/* Modus Centre · Season's Greetings: full-bleed winter night world
   Palette: room dark #170f0b, night #0e1a2c, ink #f8f9fa, muted #b8c2d4,
   gold #ffd45e, surface #0d1626, border #2a3a55. Solid surfaces only;
   the scene owns the color. */

:root {
  --room: #170f0b;
  --walnut: #3a2418;
  --night: #0e1a2c;
  --ink: #f8f9fa;
  --muted: #b8c2d4;
  --gold: #ffd45e;
  --gold-warm: #ffb454;
  --ink-on-gold: #0a1d37;
  --surface: #0d1626;
  --border: #2a3a55;
  --border-ghost: #3a4a66;
  --font: "Polymath", "Segoe UI", system-ui, -apple-system, sans-serif;
  --z-chips: 20;
  --z-dock: 30;
  --z-topbar: 50;
  --z-panel: 60;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--room);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--room);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }

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

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--ink-on-gold);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- top bar ---------- */

.top-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem clamp(1rem, 4vw, 2.2rem);
  background: var(--room);
  border-bottom: 1px solid rgba(58, 36, 24, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-logo { height: 1.55rem; width: auto; }
.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.top-nav { display: flex; gap: 1.4rem; }
.top-nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.top-nav a:hover { color: var(--gold); }

/* ---------- hero stage ---------- */

.hero { height: 170vh; }

.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--room);
}

.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: grab;
}
.hero-stage.is-dragging .scene-canvas { cursor: grabbing; }

/* dive-crossing vignette, opacity driven from the scene */
.stage-vignette {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, rgba(10, 8, 6, 0) 42%, rgba(10, 8, 6, 0.96) 100%);
}

/* letterbox cinema bars: slid in for the intro/replay title states only */
.letterbox {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}
.letterbox::before,
.letterbox::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 12vh;
  background: #02040a;
  transition: transform 900ms var(--ease);
}
.letterbox::before { top: 0; transform: translateY(-101%); }
.letterbox::after { bottom: 0; transform: translateY(101%); }
body[data-scene-state="intro"] .letterbox::before,
body[data-scene-state="replay"] .letterbox::before { transform: translateY(0); }
body[data-scene-state="intro"] .letterbox::after,
body[data-scene-state="replay"] .letterbox::after { transform: translateY(0); }
body.no3d .letterbox { display: none; }

/* static film grain, one baked noise tile, never animated */
.stage-grain {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.62'/%3E%3C/svg%3E");
  background-size: 18rem 18rem;
}
body.no3d .stage-grain { display: none; }

/* static fallback when WebGL is unavailable */
.scene-fallback { display: none; }
body.no3d .scene-fallback {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(60rem 34rem at 72% 38%, rgba(255, 180, 84, 0.13), transparent 62%),
    radial-gradient(48rem 30rem at 24% 70%, rgba(95, 134, 184, 0.08), transparent 60%),
    var(--room);
}
.fb-star {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
}
.fb-star-1 { top: 22%; left: 30%; box-shadow: 0 0 8px 2px rgba(255, 212, 94, 0.5); }
.fb-star-2 { top: 16%; left: 64%; }
.fb-star-3 { top: 30%; left: 82%; }
.fb-tree {
  position: absolute;
  bottom: 24%;
  right: 18%;
  width: 0; height: 0;
  border-left: 5.5rem solid transparent;
  border-right: 5.5rem solid transparent;
  border-bottom: 11rem solid #1d3a2c;
  filter: drop-shadow(0 0 1.4rem rgba(255, 212, 94, 0.25));
}
.fb-tree::after {
  content: "";
  position: absolute;
  left: -0.45rem;
  bottom: -2.4rem;
  width: 0.9rem; height: 1.4rem;
  background: var(--walnut);
}
body.no3d .scene-controls,
body.no3d .skip-intro,
body.no3d .scene-hint,
body.no3d .hotspots { display: none; }

/* ---------- hero copy ---------- */

.hero-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-ui a, .hero-ui button, .hero-ui input { pointer-events: auto; }

.hero-copy {
  position: absolute;
  left: clamp(1.25rem, 6vw, 5.5rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: 34rem;
  will-change: transform, opacity;
}

.season-line {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-warm);
  margin-bottom: 1.1rem;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(10, 8, 6, 0.65);
}
.hero-title-sub {
  display: block;
  font-weight: 400;
  font-size: 0.52em;
  color: var(--muted);
  margin-top: 0.5rem;
}

.hero-sub {
  margin-top: 1.2rem;
  max-width: 30rem;
  color: var(--muted);
  font-size: 1.02rem;
  text-shadow: 0 1px 12px rgba(10, 8, 6, 0.6);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.btn-primary {
  background: var(--gold);
  color: var(--ink-on-gold);
}
.btn-primary:hover { background: var(--gold-warm); }
.btn-ghost {
  border-color: var(--border-ghost);
  color: var(--ink);
  background: rgba(13, 22, 38, 0.55);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- scene controls ---------- */

.scene-controls {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  display: flex;
  gap: 0.45rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ctl {
  padding: 0.42rem 0.95rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.ctl:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.ctl[aria-pressed="true"] { background: var(--gold); color: var(--ink-on-gold); }

.skip-intro {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: var(--z-dock);
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-ghost);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.skip-intro:hover { color: var(--gold); border-color: var(--gold); }

.scene-hint {
  position: absolute;
  left: 50%;
  bottom: 4.4rem;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(10, 8, 6, 0.7);
  white-space: nowrap;
}

/* static and reduced modes keep the page content only */
body.static-mode .scene-controls,
body.static-mode .scene-hint,
body.static-mode .skip-intro { display: none; }

/* ---------- hotspot chips ---------- */

.hotspots {
  position: absolute;
  inset: 0;
  z-index: var(--z-chips);
  overflow: hidden;
}

.hotspot {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.8rem 0.34rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
  transition: opacity 220ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}
.hotspot[data-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}
.hotspot:hover { border-color: var(--gold); }
.hotspot[aria-expanded="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-on-gold);
}
.hs-dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}
.hotspot[aria-expanded="true"] .hs-dot { box-shadow: none; }

/* ---------- focus panel ---------- */

.focus-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-panel);
  width: min(24rem, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.3rem 1.3rem 1.5rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}
.focus-panel[data-open] {
  transform: translateX(1.5rem);
  opacity: 0;
}
.focus-panel[hidden] { display: none; }

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.panel-dot {
  flex: none;
  width: 0.8rem; height: 0.8rem;
  margin-top: 0.42rem;
  border-radius: 50%;
}
.panel-head-text { flex: 1; min-width: 0; }
.panel-head-text h3 { font-size: 1.15rem; font-weight: 700; }
.panel-head-text p {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.panel-close {
  flex: none;
  width: 2rem; height: 2rem;
  border: 1px solid var(--border-ghost);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover { color: var(--ink); border-color: var(--gold); }

.panel-search {
  display: block;
}
.panel-search span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.panel-search input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--night);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
}
.panel-search input:focus-visible { outline-offset: 0; }

.panel-status {
  min-height: 1.1em;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* the link list is the sheet's scroll container: long sections (F carries
   22 rows) must scroll inside the sheet, never clip past its bottom edge */
.panel-groups {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.panel-group { margin-top: 0.7rem; }
.panel-group h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.panel-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "t o" "d o";
  column-gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--night);
  text-decoration: none;
  transition: border-color 160ms var(--ease);
}
.panel-link:hover { border-color: var(--gold); }
.panel-link strong {
  grid-area: t;
  font-size: 0.88rem;
  font-weight: 600;
}
.panel-link span {
  grid-area: d;
  font-size: 0.78rem;
  color: var(--muted);
}
/* double class: must out-rank `.panel-link span` (same-element specificity
   would otherwise drag the label back into the description cell) */
.panel-link .link-open {
  grid-area: o;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
}
[data-filtered="on"] { display: none !important; }

/* ---------- countdown ---------- */

.countdown {
  padding: clamp(4rem, 9vw, 7rem) 1.25rem;
  background: linear-gradient(180deg, var(--room), #120c08 55%, var(--room));
}
.countdown-inner {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
}
.countdown h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
}
.count-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  max-width: 30rem;
  margin: 2rem auto 0;
}
.chip {
  padding: 1rem 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.chip-num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.chip-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.count-note {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.countdown .btn { margin-top: 1.6rem; }

/* ---------- access index ---------- */

.access-index {
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--room);
  border-top: 1px solid rgba(58, 36, 24, 0.7);
}
.access-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "title search clear" "status status status";
  align-items: end;
  column-gap: 1.2rem;
  row-gap: 0.8rem;
  max-width: 72rem;
  margin: 0 auto 2.2rem;
}
.access-head h2 {
  grid-area: title;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
}
.access-search { grid-area: search; }
.access-search span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.access-search input {
  width: min(18rem, 60vw);
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
}
.access-clear {
  grid-area: clear;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-ghost);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.access-clear:hover { color: var(--gold); border-color: var(--gold); }
.access-status {
  grid-area: status;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.access-lists {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.6rem 3.5rem;
}
@media (min-width: 900px) {
  .access-lists { grid-template-columns: 1fr 1fr; align-items: start; }
}

.access-section h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.sec-dot { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.sec-code {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}
.access-summary {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 44rem;
}
.access-groups { margin-top: 1.2rem; display: grid; gap: 1.4rem; }
.access-group h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.access-group ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 0.3rem;
}
.access-link {
  display: grid;
  grid-template-columns: 2rem 1fr;
  grid-template-areas: "num t" "num d" "num r";
  column-gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.access-link:hover { border-color: var(--gold); background: #101b30; }
.li-num {
  grid-area: num;
  align-self: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.access-link strong { grid-area: t; font-size: 0.9rem; font-weight: 600; }
.li-desc { grid-area: d; font-size: 0.78rem; color: var(--muted); }
.li-remark {
  grid-area: r;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--gold-warm);
}

/* ---------- greeting footer ---------- */

.greeting {
  padding: clamp(3rem, 7vw, 5rem) 1.25rem 3rem;
  background: #120c08;
  border-top: 1px solid rgba(58, 36, 24, 0.7);
  text-align: center;
}
.greeting-logo { height: 2rem; width: auto; opacity: 0.92; }
.greeting-line {
  margin: 1.1rem auto 0;
  max-width: 34rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.greeting-social {
  list-style: none;
  margin: 1.3rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
}
.greeting-social a {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-ghost);
  padding-bottom: 0.1rem;
}
.greeting-social a:hover { color: var(--gold); border-color: var(--gold); }
.greeting-fine {
  margin: 1.8rem auto 0;
  max-width: 40rem;
  font-size: 0.78rem;
  color: #8d94a5;
}

/* ---------- responsive ---------- */

@media (max-width: 759px) {
  .hero-copy {
    left: 1.25rem;
    right: 1.25rem;
    top: clamp(4.2rem, 12vh, 6.5rem);
    transform: none;
    max-width: none;
  }
  .hero-title { font-size: clamp(2.2rem, 9vw, 2.8rem); }
  .hero-sub { font-size: 0.95rem; }
  .focus-panel {
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    max-height: 62vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
  }
  .focus-panel[data-open] { transform: translateY(1.5rem); }
  .count-chips { grid-template-columns: repeat(2, 1fr); max-width: 17rem; gap: 0.6rem; }
  .access-head {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "search" "clear" "status";
  }
  .access-lists { gap: 2.2rem; }
  .scene-controls { bottom: max(1rem, env(safe-area-inset-bottom)); }
  .skip-intro { bottom: 4.6rem; }
  .scene-hint { bottom: 7.2rem; }
  /* six chips cannot fit one row on phones: collapse to dot pills;
     the aria-label and the panel carry the section name */
  .hs-label { display: none; }
  .hotspot { padding: 0.3rem; gap: 0; }
}

@media (max-width: 400px) {
  .brand-name { display: none; }
  .top-nav { gap: 0.9rem; }
  .hero-title { font-size: 2rem; }
  .btn { padding: 0.65rem 1.05rem; font-size: 0.9rem; }
  .chip-num { font-size: 1.5rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
