/* Galiyaara — the page that floats over the corridor. */

:root {
  --ink: #05060b;
  --ink-2: #0a0d16;
  --paper: #ece7de;
  --muted: #9aa0b0;
  --brass: #c9a86a;
  --brass-dim: #8d7648;
  --line: rgba(236, 231, 222, 0.14);
  --pane: rgba(6, 8, 14, 0.74);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --deva: "Tiro Devanagari Hindi", var(--serif);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gut: clamp(1.25rem, 5vw, 5rem);
  /* Notched phones in landscape put the display cutout exactly where the
     page padding used to be. viewport-fit=cover means we must ask. */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pad-l: max(var(--gut), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--gut), env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--paper);
  font: 400 clamp(15px, 1.05vw, 17px)/1.75 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--brass); color: var(--ink); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

/* ── The stage ─────────────────────────────────────────────────────── */

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}

#vignette, #grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
#vignette {
  background: radial-gradient(ellipse 120% 85% at 50% 45%, transparent 32%, rgba(2, 3, 7, 0.55) 78%, rgba(2, 3, 7, 0.88) 100%);
}
/* Film grain — one tiny inline SVG turbulence, tiled. */
#grain {
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Boot ──────────────────────────────────────────────────────────── */

#boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6rem;
  background: var(--ink);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
body.ready #boot { opacity: 0; visibility: hidden; }
.boot-mark { font: 400 clamp(2.4rem, 7vw, 4.4rem)/1 var(--deva); color: var(--brass); }
.boot-bar { width: min(46vw, 260px); height: 1px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--brass); animation: sweep 1.5s var(--ease) infinite; }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.boot-note { font-size: 0.7rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }

/* ── Top bar ───────────────────────────────────────────────────────── */

#topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1.1rem + var(--safe-t)) var(--pad-r) 1.1rem var(--pad-l);
  transition: transform 0.5s var(--ease), opacity 0.4s, background 0.4s;
  background: linear-gradient(rgba(4, 5, 10, 0.72), transparent);
}
body[data-mode="immersive"] #topbar { transform: translateY(-110%); opacity: 0; pointer-events: none; }

.brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.brand span { font: 600 1.02rem/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; }
.brand em { font: 400 1rem/1 var(--deva); font-style: normal; color: var(--brass); opacity: 0.85; }

#nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 2rem); }
#nav a {
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s;
}
#nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -5px;
  height: 1px;
  background: var(--brass);
  transition: right 0.35s var(--ease);
}
#nav a:hover { color: var(--paper); }
#nav a:hover::after { right: 0; }
#nav .ig { color: var(--brass); display: grid; place-items: center; }
#nav .ig::after { display: none; }
#nav .ig:hover { color: var(--paper); }

#nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.6rem; }
#nav-toggle span { display: block; width: 22px; height: 1px; background: var(--paper); transition: transform 0.3s var(--ease); }
#nav-toggle span + span { margin-top: 6px; }

/* ── Layout ────────────────────────────────────────────────────────── */

#page { position: relative; z-index: 10; }
body[data-mode="immersive"] #page { opacity: 0; pointer-events: none; }
#page { transition: opacity 0.5s var(--ease); }

.pane {
  position: relative;
  padding: clamp(6rem, 14vh, 11rem) 0;
  background: var(--pane);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  border-top: 1px solid var(--line);
}
/* Panes that are really windows onto the corridor. */
.pane--open {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  min-height: 100svh;
  display: grid;
  align-content: center;
}

.wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: var(--pad-l) var(--pad-r); }
.centered { text-align: center; display: grid; justify-items: center; gap: 1.4rem; }

.label {
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
}

h2 {
  font: 300 clamp(1.9rem, 4.2vw, 3.2rem)/1.14 var(--serif);
  letter-spacing: -0.01em;
  margin-top: 0.7rem;
}

.display {
  /* Sized on height as well as width — a phone in landscape is 390px tall. */
  font: 300 min(clamp(3.4rem, 13vw, 10rem), 26vh)/0.9 var(--serif);
  letter-spacing: -0.03em;
  text-transform: none;
}
.display--sm { font-size: min(clamp(2.2rem, 5.5vw, 4.2rem), 13vh); line-height: 1.05; }
.display--xs { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; }

.lede { font-size: clamp(1rem, 1.5vw, 1.2rem); color: #cfd3dd; max-width: 46ch; }
.lede--tight { max-width: 40ch; }

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.sec-note { color: var(--muted); font-size: 0.86rem; max-width: 40ch; }
.count { color: var(--brass); font-size: 0.5em; vertical-align: super; letter-spacing: 0.1em; }

/* ── Hero ──────────────────────────────────────────────────────────── */

.hero { padding-inline: var(--pad-l) var(--pad-r); display: grid; gap: 0.5rem; justify-items: start; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.38em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: var(--brass); text-decoration: none; border-bottom: 1px solid transparent; }
.eyebrow a:hover { border-color: currentColor; }
.hero .display { margin: 0.4rem 0 0; }
.devanagari { font: 400 min(clamp(1.4rem, 3.4vw, 2.4rem), 6vh)/1 var(--deva); color: var(--brass); opacity: 0.7; margin-bottom: 1.1rem; }
.hero .lede { min-height: 2.6em; }
.caret { display: inline-block; width: 1px; height: 1em; background: var(--brass); vertical-align: -0.14em; margin-left: 3px; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 2.4rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint i { width: 1px; height: 46px; background: linear-gradient(var(--brass), transparent); animation: drop 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes drop { 0%, 100% { transform: scaleY(0.3); opacity: 0.3; } 45% { transform: scaleY(1); opacity: 1; } }

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  font: 500 0.76rem/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.btn:hover { border-color: var(--brass); background: rgba(201, 168, 106, 0.1); transform: translateY(-2px); }
.btn--primary { border-color: var(--brass-dim); color: var(--brass); }
.btn--primary:hover { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.btn--lg { padding: 1.05rem 2.1rem; letter-spacing: 0.24em; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font: 400 0.7rem/1 var(--sans);
  letter-spacing: 0.12em;
  color: var(--paper);
  background: rgba(6, 8, 14, 0.62);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.chip:hover { border-color: var(--brass); color: var(--brass); }
.chip--quiet { color: var(--muted); cursor: default; }
.chip--quiet:hover { border-color: var(--line); color: var(--muted); }

kbd {
  font: 500 0.68rem/1 var(--sans);
  letter-spacing: 0.08em;
  padding: 0.28em 0.45em;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--brass);
  background: rgba(255, 255, 255, 0.04);
}

.keycaps { list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: center; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.1em; margin-top: 0.8rem; }
.keycaps li { display: flex; align-items: center; gap: 0.35rem; }

/* ── About ─────────────────────────────────────────────────────────── */

.about { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about-fig { padding: 14px; }
/* The offset brass frame is an outline on the image itself, so it can never
   drift across the caption the way an absolutely-positioned one does. */
.about-fig img { width: 100%; filter: grayscale(0.25) contrast(1.05); outline: 1px solid var(--brass-dim); outline-offset: 13px; }
.about-fig figcaption { margin-top: 1.9rem; font-size: 0.68rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.about-txt { display: grid; gap: 1.25rem; justify-items: start; }
.about-txt p { color: #c4c9d4; max-width: 52ch; }
blockquote {
  font: italic 300 clamp(1.05rem, 1.9vw, 1.35rem)/1.7 var(--serif);
  color: var(--paper);
  padding-left: 1.4rem;
  border-left: 1px solid var(--brass-dim);
}
.mono { font-size: 1.3rem; }

/* ── Grids ─────────────────────────────────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 15vw, 210px), 1fr)); gap: clamp(0.5rem, 1vw, 0.9rem); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

.tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #0d0f16;
  cursor: pointer;
  display: block;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.6) brightness(0.78);
  transition: transform 0.7s var(--ease), filter 0.5s;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); filter: grayscale(0) brightness(1); }
.tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.2rem 0.7rem 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-align: left;
  color: var(--paper);
  background: linear-gradient(transparent, rgba(3, 4, 9, 0.92));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.tile:hover figcaption, .tile:focus-visible figcaption { opacity: 1; transform: none; }

.cta { display: grid; justify-items: center; gap: 1rem; text-align: center; margin-top: clamp(2rem, 5vw, 3.5rem); }

/* ── Footer ────────────────────────────────────────────────────────── */

#footer { padding-block: clamp(3rem, 7vw, 5rem); }
.foot { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.foot-links a { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); text-decoration: none; transition: color 0.25s; }
.foot-links a:hover { color: var(--brass); }

/* ── Immersive HUD ─────────────────────────────────────────────────── */

#hud {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
body[data-mode="immersive"] #hud { opacity: 1; }
#hud > * { pointer-events: auto; }

#hud-exit { position: absolute; top: calc(1.2rem + var(--safe-t)); right: var(--pad-r); }
#hud-keys { position: absolute; bottom: calc(1.4rem + var(--safe-b)); left: 50%; transform: translateX(-50%); white-space: nowrap; }
#hud-now {
  position: absolute;
  top: calc(1.2rem + var(--safe-t)); left: var(--pad-l);
  display: grid;
  gap: 0.3rem;
  pointer-events: none;
}
#hud-now strong { font: 300 clamp(1.1rem, 2.2vw, 1.7rem)/1.1 var(--serif); }

/* Touch stick, only where there is no keyboard. */
#joy { display: none; }
@media (pointer: coarse) {
  #joy {
    display: grid;
    place-items: center;
    position: absolute;
    left: 1.4rem; bottom: 5.5rem;
    width: 108px; height: 108px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(6, 8, 14, 0.4);
    backdrop-filter: blur(8px);
    touch-action: none;
  }
  #joy i { width: 42px; height: 42px; border-radius: 50%; background: rgba(201, 168, 106, 0.5); transition: transform 0.12s linear; }
  #hud-keys { display: none; }
}

/* ── Focus plate ───────────────────────────────────────────────────── */

#plate {
  position: fixed;
  z-index: 35;
  right: var(--gut);
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  width: min(360px, calc(100vw - var(--gut) * 2));
  padding: 1.6rem 1.6rem 1.4rem;
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--line);
  border-top: 1px solid var(--brass-dim);
  display: grid;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(18px);
  visibility: hidden;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0.45s;
}
body.plated #plate { opacity: 1; transform: none; visibility: visible; }
#plate h3 { font: 300 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--serif); }
#plate p { color: var(--muted); font-size: 0.88rem; }
#plate-close { position: absolute; top: 0.5rem; right: 0.7rem; background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; transition: color 0.25s; }
#plate-close:hover { color: var(--brass); }
.plate-nav { display: flex; gap: 0.5rem; margin-top: 0.3rem; }
.plate-nav .chip { flex: 1; justify-content: center; }
.plate-ig { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); text-decoration: none; margin-top: 0.2rem; }
.plate-ig:hover { color: var(--paper); }

/* ── Reveal on scroll ──────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .boot-bar i, .scroll-hint i { animation: none; }
}

/* ── Small screens ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-fig { max-width: 320px; }
  #nav-toggle { display: block; }
  #nav {
    position: fixed;
    inset: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    padding: 5.5rem var(--gut) 2.5rem;
    background: rgba(4, 5, 10, 0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-102%);
    transition: transform 0.5s var(--ease);
  }
  body.menu #nav { transform: none; }
  #nav a { font-size: 1rem; letter-spacing: 0.2em; }
  #plate { left: var(--gut); right: var(--gut); width: auto; }
  #hud-exit { right: 1rem; top: 1rem; }
  #hud-now { left: 1rem; top: 1rem; }
}

/* ── Curated walks ─────────────────────────────────────────────────── */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.label--mid { margin-top: 1.6rem; }

/* Full width inside the centred column, or auto-fit only ever sees content width. */
#walks-wrap { width: 100%; display: grid; justify-items: center; }

.walks {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
  width: min(1000px, 100%);
  justify-content: center;
}
.walk {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 1.05rem 1.15rem;
  text-align: left;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}
.walk:hover, .walk:focus-visible { border-color: var(--brass); background: rgba(201, 168, 106, 0.08); transform: translateY(-2px); }
.walk strong { font: 400 1.12rem/1.2 var(--serif); }
.walk span { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.walk em { font-style: normal; font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass-dim); }

/* The read-out while a walk is playing. */
#tour {
  position: absolute;
  left: 50%; bottom: 4.6rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem 0.6rem 1.1rem;
  white-space: nowrap;
  background: rgba(6, 8, 14, 0.78);
  border: 1px solid var(--line);
  border-top-color: var(--brass-dim);
  backdrop-filter: blur(12px);
}
#tour[hidden] { display: none; }
#tour-pos { font-size: 0.74rem; color: var(--muted); letter-spacing: 0.1em; }

/* ── Search ────────────────────────────────────────────────────────── */

.sec-tools { display: grid; gap: 0.9rem; justify-items: flex-start; }
.find { display: flex; align-items: center; gap: 0.8rem; width: min(420px, 100%); }
.find[hidden] { display: none; }
#q {
  flex: 1;
  padding: 0.7rem 0.9rem;
  font: 400 0.88rem/1 var(--sans);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.25s;
}
#q::placeholder { color: #6d7382; }
#q:focus { border-color: var(--brass); outline: none; }
#q-count { font-size: 0.72rem; letter-spacing: 0.14em; color: var(--brass); }

.tile[hidden] { display: none; }

@media (max-width: 860px) {
  #tour { bottom: 4rem; left: 1rem; right: 1rem; transform: none; flex-wrap: wrap; white-space: normal; justify-content: center; }
}

/* ── Touch devices ─────────────────────────────────────────────────── */

/* Fingers are not cursors. Everything tappable gets a 44px hit area on a
   coarse pointer, achieved with padding so the visual layout is unchanged.
   Desktop keeps the tighter, quieter spacing. */
@media (pointer: coarse) {
  #nav a { display: flex; align-items: center; min-height: 44px; }
  #nav a::after { bottom: 8px; }
  #nav .ig { min-width: 44px; }
  .brand { min-height: 44px; align-items: center; }
  #nav-toggle { min-width: 44px; min-height: 44px; display: grid; align-content: center; justify-items: center; }
  .foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .eyebrow a { display: inline-block; padding-block: 0.5rem; }
  .plate-ig { display: inline-flex; align-items: center; min-height: 44px; }
  .chip { min-height: 44px; }
  #plate-close { width: 44px; height: 44px; top: 0.2rem; right: 0.3rem; }
  #q { min-height: 44px; }
  /* The corridor is driven by drag, so the page must not pan with it. */
  #stage { touch-action: none; }
}

/* Where the browser reports no hover, the tile caption can't wait for one. */
@media (hover: none) {
  .tile figcaption { opacity: 1; transform: none; }
  .tile img { filter: grayscale(0.15) brightness(0.9); }
}

/* Safe areas on the elements that sit at the very edge of the corridor view. */
#tour { bottom: calc(4.6rem + var(--safe-b)); }
#joy { bottom: calc(5.5rem + var(--safe-b)); left: calc(1.4rem + env(safe-area-inset-left, 0px)); }
#plate { bottom: calc(clamp(1.5rem, 5vh, 3.5rem) + var(--safe-b)); right: var(--pad-r); }
#footer { padding-bottom: calc(clamp(3rem, 7vw, 5rem) + var(--safe-b)); }

/* Short and wide — a phone held sideways. Give the corridor the room. */
@media (max-height: 460px) and (orientation: landscape) {
  .pane--open { min-height: 100svh; padding-block: 4rem; }
  .hero-actions { margin-top: 0.9rem; }
  .scroll-hint { display: none; }
  .keycaps { display: none; }
  #walks-wrap { display: none; }
  .pane { padding-block: 3.5rem; }
}

/* Very small phones: the nav panel has to fit five links plus the icon. */
@media (max-width: 380px) {
  .hero-actions .btn { padding-inline: 1.1rem; }
  .keycaps { gap: 0.8rem; font-size: 0.68rem; }
  #tour { gap: 0.5rem; padding: 0.5rem; }
}

/* WCAG 2.2 AA asks for 24x24 CSS px on every target, mouse or not. Padding
   only — #topbar and #nav centre their children, so nothing moves. */
#nav a { padding-block: 5px; }
#nav .ig { padding: 5px; }
.brand { padding-block: 5px; }
.foot-links a { padding-block: 5px; }
.eyebrow a { display: inline-flex; align-items: center; min-height: 24px; }
@media (pointer: coarse) { .eyebrow a { min-height: 44px; } }
#plate-close { display: grid; place-items: center; width: 32px; height: 32px; top: 0.35rem; right: 0.5rem; }
.plate-ig { display: inline-flex; align-items: center; min-height: 28px; align-self: start; }

/* ── No WebGL ──────────────────────────────────────────────────────── */

/* The flat index is a complete gallery. When the corridor cannot render, the
   page has to stand on its own rather than sit over an empty black canvas. */
body.flat #stage,
body.flat [data-enter],
body.flat .keycaps,
body.flat #walks-wrap,
body.flat .scroll-hint { display: none; }

body.flat { background: linear-gradient(180deg, #05060b, #0c1120 55%, #05060b); }
body.flat .pane--open {
  background: var(--pane);
  border-top: 1px solid var(--line);
  min-height: auto;
  padding-block: clamp(5rem, 12vh, 9rem);
}
body.flat #home { padding-top: clamp(7rem, 18vh, 12rem); }
body.flat #work .centered::after {
  content: "The walk-through corridor needs WebGL, which this browser cannot provide. Every photograph is in the index below.";
  display: block;
  max-width: 44ch;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ── Headsets ──────────────────────────────────────────────────────── */

/* Inside a session the page chrome is either invisible (VR) or floating over
   the room (AR). Either way it has to get out of the way. */
body[data-xr="vr"] #topbar,
body[data-xr="vr"] #page,
body[data-xr="vr"] #hud,
body[data-xr="vr"] #plate,
body[data-xr="vr"] #grain,
body[data-xr="vr"] #vignette { display: none; }

body[data-xr="ar"] #topbar,
body[data-xr="ar"] #page,
body[data-xr="ar"] #hud,
body[data-xr="ar"] #plate,
body[data-xr="ar"] #grain,
body[data-xr="ar"] #vignette { display: none; }
body[data-xr="ar"] { background: transparent; }

/* Deliberately not inside #hud: the HUD is display:none inside a session, and
   this is the one caption that has to survive there. pointer-events:none keeps
   the DOM overlay from swallowing the tap that hangs the print. */
#ar-hint {
  position: fixed;
  pointer-events: none;
  left: 50%;
  bottom: calc(2.4rem + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.8rem 1.2rem;
  max-width: min(30ch, calc(100vw - 2rem));
  text-align: center;
  font-size: 0.82rem;
  color: var(--paper);
  background: rgba(6, 8, 14, 0.82);
  border: 1px solid var(--brass-dim);
  backdrop-filter: blur(10px);
}
#ar-hint[hidden] { display: none; }

#enter-ar { justify-self: start; }

/* Only ever visible when a headset mode is missing or a session failed. */
.xr-note { max-width: 46ch; margin-top: 0.9rem; color: var(--muted); }
