/* ============================================================
   REIDOS World — floors.css
   The Descent: hero (the surface), six floors, footer, and the
   depth gauge. Floor backgrounds arrive via inline style from
   descent.js — this file never hard-codes a floor's bg.
   Mobile-first; desktop refinements at 821px.
   ============================================================ */

/* ---------- a floor ---------- */
.floor {
  position: relative;
  min-height: 88vh;
  padding: clamp(48px, 9vh, 96px) 16px clamp(56px, 10vh, 110px);
}
@media (min-width: 821px) {
  .floor { padding-left: 40px; padding-right: 40px; }
}
/* Keep floor content readable regardless of inner structure. */
.floor > * {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- floor head ---------- */
.floor-head { margin-bottom: 26px; }
.floor-head h2, .floor-head .floor-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5.5vw, 44px);
  line-height: 1.12;
  letter-spacing: .015em;
  color: var(--ink);
  margin-bottom: 6px;
}
.floor-head .hz {
  display: inline-block;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.floor-head .sub, .floor-head p {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 0;
}

/* ---------- floor grid (track cards) ---------- */
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 18px 0 26px;
}
@media (max-width: 380px) {
  .floor-grid { grid-template-columns: 1fr; }
}

/* ---------- floor doors row ---------- */
.floor-doors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 26px;
}
.floor-doors > * { flex: 1 1 200px; max-width: 320px; }
@media (max-width: 380px) {
  .floor-doors > * { flex-basis: 100%; max-width: none; }
}

/* ---------- the surface (hero above Gamma) ---------- */
.surface {
  position: relative;
  min-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: calc(var(--topbar-h) + 42px) 18px 72px;
}
.surface-mark {
  width: clamp(44px, 7vw, 60px);
  height: clamp(44px, 7vw, 60px);
  margin-bottom: -4px;
}
.surface h1 {
  font-size: clamp(38px, 9vw, 74px);
  letter-spacing: .05em;
  line-height: 1.05;
  margin-bottom: 0;
}
.surface h1 b, .surface h1 .gold { color: var(--gold); font-weight: inherit; }
.surface .tagline, .surface > p {
  max-width: 560px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 2.4vw, 17.5px);
  line-height: 1.65;
}
.surface .kpis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 36px;
  margin-top: 10px;
}
.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
  opacity: .8;
  text-decoration: none;
  animation: cue-float 2.6s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--gold-2); text-decoration: none; opacity: 1; }
@keyframes cue-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }
}

/* ---------- the world footer (below Epsilon) ---------- */
.world-footer, .site-footer, #mount > footer {
  position: relative;
  padding: 56px 18px calc(72px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--f-epsilon);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  text-align: center;
}
.world-footer nav, .site-footer nav, #mount > footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 14px auto;
  max-width: 720px;
}
.world-footer .fineprint, .site-footer .fineprint, #mount > footer .fineprint {
  color: var(--dim);
  font-size: 12px;
  margin-top: 16px;
}

/* ============================================================
   Depth gauge
   Mobile (default): slim fixed bottom strip of six dots.
   Desktop (821px+): fixed right rail, vertically centered,
   labels reveal on hover/focus; active dot ringed in its
   floor's color (via data-floor set by app.js).
   ============================================================ */
#depth-gauge, .depth-gauge {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(13, 11, 20, .82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
/* Reserve room so the strip never sits on the footer's last line.
   (Strip is ~56px tall: 8px padding + 40px tap-target dots + 8px.) */
@media (max-width: 820px) {
  body { padding-bottom: 60px; }
}

/* Each floor's accent, resolved from the data-floor attr app.js emits. */
#depth-gauge [data-floor="gamma"],   .depth-gauge [data-floor="gamma"]   { --gd: var(--b-gamma); }
#depth-gauge [data-floor="beta"],    .depth-gauge [data-floor="beta"]    { --gd: var(--b-beta); }
#depth-gauge [data-floor="alpha"],   .depth-gauge [data-floor="alpha"]   { --gd: var(--b-alpha); }
#depth-gauge [data-floor="theta"],   .depth-gauge [data-floor="theta"]   { --gd: var(--b-theta); }
#depth-gauge [data-floor="delta"],   .depth-gauge [data-floor="delta"]   { --gd: var(--b-delta); }
#depth-gauge [data-floor="epsilon"], .depth-gauge [data-floor="epsilon"] { --gd: var(--b-subdelta); }

.gauge-dot {
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px;
  min-width: 40px;  /* 40px tap-target floor — this is the primary */
  min-height: 40px; /* floor navigation on phones */
  border-radius: 50%;
  text-decoration: none;
}
.gauge-dot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}
.gauge-dot:hover .dot, .gauge-dot:focus-visible .dot { opacity: .95; }
.gauge-dot.active .dot {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gd, var(--gold));
}

/* Labels: visually hidden on mobile (sr-only clip pattern) so the floor
   names stay in the accessibility tree as the links' names. */
.gauge-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 821px) {
  #depth-gauge, .depth-gauge {
    left: auto;
    right: 14px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 14px;
    padding: 6px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
  }
  .gauge-dot { padding: 6px; }
  /* Un-clip the mobile sr-only pattern; desktop reveals on hover/focus. */
  .gauge-label {
    display: block;
    position: absolute;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(13, 11, 20, .88);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    transition: opacity .18s ease;
  }
  .gauge-dot:hover .gauge-label,
  .gauge-dot:focus-visible .gauge-label,
  .gauge-dot.active .gauge-label {
    opacity: 1;
  }
  .gauge-dot.active .gauge-label { color: var(--gd, var(--gold)); border-color: var(--line-2); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
  .gauge-dot .dot { transition: none; }
  .gauge-dot.active .dot { transform: none; }
}
