/* The landing page (app/landing.js): Landing Page v2 from the design handoff, with the
   corrections in Note_to_ClaudeCode_LandingPage.md. Every size is a variable that
   landing.js sets from the design's presets (desk, phone, land, quest), scaled to the
   viewport. Gradients and glow are kept here, as an exception to the room's rule. */

@font-face { font-family: LandingGeist; src: url('/assets/fonts/Geist-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: LandingGeist; src: url('/assets/fonts/Geist-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: LandingGeist; src: url('/assets/fonts/Geist-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: LandingGeistMono; src: url('/assets/fonts/GeistMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: LandingGeistMono; src: url('/assets/fonts/GeistMono-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* Painted before the script runs, so the first frame is the page's own background. */
body.landing { background: #021a2e; }
body.landing #rotate-hint { display: none !important; }

#landing {
  position: fixed; inset: 0; z-index: 20000;
  display: flex; flex-direction: column; overflow: hidden;
  box-sizing: border-box;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(ellipse at 15% 85%, rgba(71,229,255,.12), transparent 55%),
              linear-gradient(160deg, #042846, #053050 40%, #010b16 100%);
  color: #EDF2F4; font-family: LandingGeist, sans-serif; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: opacity .35s ease;
}
#landing.leaving { opacity: 0; pointer-events: none; }
#landing *, #landing *::before, #landing *::after { box-sizing: border-box; }
#landing [hidden] { display: none !important; }
#landing .grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(71,229,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(71,229,255,.045) 1px, transparent 1px);
  background-size: 40px 40px;
}
#landing .mono { font-family: LandingGeistMono, monospace; }

/* Header */
#landing header {
  position: relative; flex: none; height: var(--hdrH); padding: 0 var(--pad);
  border-bottom: 1px solid #175070; display: flex; align-items: center; gap: 12px;
}
#landing .sq { flex: none; width: var(--sq); height: var(--sq); border: 2px solid #47E5FF; }
#landing .eyebrow { font-size: var(--hdrF); letter-spacing: .14em; font-weight: 500; white-space: nowrap; }
#landing .eyebrow-right { margin-left: auto; font-size: var(--hdrR); letter-spacing: .14em; color: #B4C2CC; white-space: nowrap; }

/* Main: text column and schematic side by side, or stacked on a phone */
#landing main { position: relative; flex: 1; min-height: 0; display: flex; }
#landing .col {
  flex: 1.25; min-width: 0; padding: var(--colPadY) var(--pad);
  display: flex; flex-direction: column; justify-content: center;
}
#landing h1 { margin: 0; font-size: var(--title); line-height: 1.05; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
#landing h1 .accent { color: #47E5FF; }
#landing .line { margin: var(--g) 0 0; font-size: var(--line); line-height: 1.35; text-wrap: pretty; }
#landing .sub { margin: calc(var(--g) * .5) 0 0; font-size: var(--sub); line-height: 1.4; color: #B4C2CC; text-wrap: pretty; }

/* Buttons */
#landing .btn-row { margin-top: calc(var(--g) * 2); display: flex; gap: var(--g); align-items: center; }
#landing .btn {
  position: relative; overflow: hidden; flex: 1; max-width: var(--btnMax); height: var(--btnH);
  padding: 0 var(--btnPad); border: 2px solid #06B7E6; border-radius: 4px; background: rgba(8,60,93,.7);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 500 var(--btnF)/1.3 LandingGeist, sans-serif; color: #EDF2F4; text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#landing .btn > span { position: relative; overflow: hidden; text-overflow: ellipsis; }
#landing .btn > span:empty { display: none; }
#landing .btn .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(71,229,255,.26); transition: width .25s linear; }
#landing .btn:disabled { cursor: progress; }
#landing .btn-2 {
  flex: none; height: var(--btnH); padding: 0 var(--btn2Pad); border: 2px solid #06B7E6; border-radius: 4px;
  background: transparent; display: flex; align-items: center; justify-content: center;
  font: 500 var(--btnF)/1 LandingGeist, sans-serif; color: #EDF2F4; white-space: nowrap; cursor: pointer;
}
#landing .btn-2:disabled { border-color: #175070; color: #B4C2CC; cursor: not-allowed; }
#landing .btn:not(:disabled):hover, #landing .btn-2:not(:disabled):hover {
  background: #0B5F8C; border-color: #47E5FF; box-shadow: 0 0 18px rgba(71,229,255,.35);
}
#landing button:focus-visible, #landing a:focus-visible { outline: 2px solid #EDF2F4; outline-offset: 4px; }
/* Ready: Enter pulses. The focus the page gives it on ready shows no ring (the pulse
   says it's ready); focus reached with Tab still does. */
#landing .btn.ready { animation: landing-pulse 2.4s ease-in-out infinite; }
#landing .btn.ready:hover { animation: none; }
#landing .btn.auto-focus:focus-visible { outline: none; }
@keyframes landing-pulse {
  0%, 100% { border-color: #06B7E6; box-shadow: 0 0 0 rgba(71,229,255,0); }
  50% { border-color: #47E5FF; box-shadow: 0 0 24px rgba(71,229,255,.55); }
}

#landing .vr-tip { margin: calc(var(--g) * .5) 0 0; font-size: var(--hint); color: #B4C2CC; }
#landing .vr-tip strong { font-weight: 600; color: #EDF2F4; }
#landing .hints { margin-top: var(--g); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#landing .hints span { font-size: var(--hint); color: #B4C2CC; }
#landing .hints kbd {
  font: 400 var(--hint) LandingGeistMono, monospace; padding: 2px 8px; border: 1px solid #06B7E6;
  border-radius: 3px; color: #47E5FF; background: rgba(6,183,230,.08);
}

/* Sound switch */
#landing .toggle {
  margin-top: calc(var(--g) * 1.4); align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center;
  gap: calc(var(--g) * .7) 12px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: left;
}
#landing .track {
  position: relative; flex: none; width: calc(var(--tog) * 2.6); height: calc(var(--tog) * 1.5);
  border-radius: var(--tog); border: 2px solid #06B7E6; background: rgba(71,229,255,.08); transition: background .2s;
}
#landing .knob {
  position: absolute; left: 3px; top: 50%; width: var(--tog); height: var(--tog); margin-top: calc(var(--tog) * -.5);
  border-radius: 50%; background: #47E5FF; box-shadow: 0 0 8px rgba(71,229,255,.6); transition: left .2s;
}
#landing .toggle[aria-checked=true] .track { background: rgba(71,229,255,.3); }
#landing .toggle[aria-checked=true] .knob { left: calc(var(--tog) * 1.6 - 7px); }
#landing .tog-label { font-size: var(--tog); font-weight: 500; }
#landing .tog-hint { font-size: var(--togH); color: #B4C2CC; }
#landing .toggle[aria-checked=true] .tog-hint { display: none; }

#landing .book { margin-top: calc(var(--g) * 1.6); align-self: flex-start; font-size: var(--link); color: #47E5FF; text-decoration: none; }
#landing .book:hover { color: #EDF2F4; }

/* No 3D on this device */
#landing .fb-msg { margin-top: calc(var(--g) * 2); font-size: var(--line); }

/* Schematic */
#landing .sch { position: relative; flex: 1; min-width: 0; padding: var(--schPadY) var(--pad); display: flex; flex-direction: column; }
#landing .sch-top, #landing .sch-bot { font-size: var(--labF); letter-spacing: .1em; color: #B4C2CC; }
#landing .sch-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#landing .sch-art svg { display: block; width: 100%; height: 100%; max-width: 440px; filter: drop-shadow(0 0 10px rgba(71,229,255,.45)); }
#landing .sch-bot { padding-top: var(--labPad); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
#landing .sch-bot .ready { font-weight: 500; color: #47E5FF; text-shadow: 0 0 14px rgba(71,229,255,.5); }
#landing .pct { font: 400 var(--pctF) LandingGeist, sans-serif; color: #47E5FF; letter-spacing: 0; text-shadow: 0 0 14px rgba(71,229,255,.5); }

#landing footer { position: relative; flex: none; height: var(--ftrH); padding: 0 var(--pad); display: flex; align-items: center; font-size: var(--small); color: #B4C2CC; }

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

/* Phone portrait: schematic on top, growing into the space the text leaves. */
#landing.stacked main { flex-direction: column; }
#landing.stacked .col { flex: none; order: 2; padding: var(--pad); justify-content: flex-start; }
#landing.stacked .sch { flex: 1 1 var(--sh); min-height: 120px; order: 1; }
#landing.stacked .sch-top { display: none; }
#landing.stacked .btn { max-width: none; }

#landing svg.no-labels .sch-label { display: none; }
@media (max-width: 599px) {
  #landing .eyebrow-right, #landing .sch-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #landing { transition: none; }
  #landing .btn .fill, #landing .track, #landing .knob { transition: none; }
  #landing .btn.ready { animation: none; border-color: #47E5FF; box-shadow: 0 0 18px rgba(71,229,255,.35); }
}
