:root {
  --bg: #08101f;
  --navy: #172953;
  --red: #BA2025;
  --ink: #e9edf5;
  --muted: #95a1ba;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(8, 16, 31, 0.72);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #08101f; }
}
:root[data-theme="dark"] { --bg: #08101f; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Montserrat, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; pointer-events: none; }
.water-video { position: fixed; top: 0; left: 50%; height: 100vh; width: auto; aspect-ratio: 16 / 9; transform: translateX(-50%); pointer-events: none; opacity: 0; visibility: hidden; }
.water-video.wide { -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
body.orbit #scene { pointer-events: auto; cursor: crosshair; }
#scroll { height: 900vh; }
/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 22px 32px; z-index: 3; }
.logo img { height: 30px; display: block; }
.top-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: 0.04em; border-bottom: 2px solid var(--red); padding-bottom: 2px; cursor: pointer; }

.rail { position: fixed; left: 32px; top: 50%; transform: translateY(-50%); z-index: 3; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rail li { font-size: 13px; color: #b7c1d6; cursor: pointer; padding-left: 16px; position: relative; transition: color .3s; }
.rail li::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.rail li.active { color: var(--ink); }
.rail li.active::before { background: var(--red); transform: scale(1.5); }

.panel { position: fixed; right: 32px; top: 50%; transform: translateY(-50%); width: 380px; z-index: 3;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.panel { transition: right 1.4s cubic-bezier(.65,0,.35,1), transform 1.4s cubic-bezier(.65,0,.35,1); }
/* scale, not width: the text keeps its line breaks while the card moves */
body.intro .panel { right: 50%; transform: translate(50%, -50%) scale(1.2); }
body.closing .panel { right: 50%; transform: translate(50%, -50%); }
body.closing .clients, body.intro .clients { opacity: 0; }
.stop { display: none; }
.stop.active { display: block; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-logo { display: block; width: 190px; height: auto; margin: 0 0 18px; opacity: 0; transition: opacity 1.2s ease; }
.card-logo.solid { opacity: 1; }
#intro-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 4; }
.sim { margin-left: 8px; padding: 2px 7px; border: 1px solid var(--muted); border-radius: 999px; font-size: 10px; letter-spacing: 0.1em; color: var(--muted); vertical-align: 1px; }
.stepper { display: none; }
.veil { position: fixed; inset: 0; z-index: 2; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.veil.on { opacity: 1; transition-duration: .35s; }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
h1 { margin: 0 0 14px; font-size: 30px; line-height: 1.15; font-weight: 700; }
h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.2; font-weight: 600; }
.fact { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.year { margin: 0 0 12px; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.year small { font-size: 14px; font-weight: 500; color: var(--muted); }

.wxday { margin: 0 0 12px; font-size: 26px; font-weight: 700; display: grid; gap: 4px; }
.wxday small { font-size: 13px; font-weight: 500; color: var(--muted); }
.facts { margin: 0 0 18px; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

.season { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.season li { font-size: 12px; border-top: 3px solid var(--red); padding-top: 6px; }
.season li:nth-child(2) { border-color: #3fae6a; }
.season li:nth-child(3) { border-color: #d9a441; }
.season li:nth-child(4) { border-color: #4fa3ff; }
.season span { display: block; font-weight: 600; margin-bottom: 2px; }

.spark { width: 100%; height: 60px; margin: 0 0 14px; display: block; }
.spark polyline { fill: none; stroke: #4fa3ff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark polyline.vv { stroke: #d9a441; }
.spark polyline.norm { stroke: var(--muted); stroke-dasharray: 3 3; }
.spark circle { fill: var(--red); }
.rusle div { opacity: 0.25; transition: opacity .3s; }
.rusle div.on { opacity: 1; }
.clients { position: fixed; left: 48px; bottom: 48px; z-index: 3; pointer-events: none; perspective: 900px; transition: opacity .8s ease; }
/* a glass brick with four faces; it turns about its horizontal center axis to the next client */
.lens { position: absolute; left: 0; top: 0; width: 236px; height: 66px; border-radius: 14px; opacity: 0; transition: opacity .35s ease;
  backdrop-filter: url(#glass) brightness(1.1) saturate(1.2); -webkit-backdrop-filter: brightness(1.1) saturate(1.2); }
.lens.rest { opacity: 1; }
.brick { position: relative; width: 236px; height: 66px; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.34, 1.36, .5, 1); }
.face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border-radius: 14px; backface-visibility: hidden;
  background: linear-gradient(165deg, rgba(255,255,255,.16), rgba(255,255,255,.03) 50%, rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(255,255,255,.15), inset 0 0 18px rgba(255,255,255,.05), 0 16px 36px rgba(0,0,0,.35); }
.face::after { content: ""; position: absolute; left: 8%; right: 45%; top: 0; height: 42%; border-radius: 14px 14px 50% 50%; background: linear-gradient(rgba(255,255,255,.2), transparent); pointer-events: none; }
.face img { height: 34px; width: auto; max-width: 196px; object-fit: contain; filter: brightness(0) invert(1) drop-shadow(0 1px 6px rgba(0,0,0,.5)); }
.face b { color: #fff; font-size: 17px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.face.with-name img { height: 28px; }
.spark-axis { display: flex; justify-content: space-between; margin: -10px 0 14px; font-size: 11px; color: var(--muted); }
.thanks { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.credits { margin: 6px 0 0; font-size: 10px; line-height: 1.5; color: var(--muted); opacity: 0.8; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; padding: 12px 32px 16px; text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted);
  background: linear-gradient(transparent, rgba(8,16,31,.9) 40%); opacity: 0; transform: translateY(12px); transition: opacity .9s ease, transform .9s ease; pointer-events: none; }
.foot p { margin: 0; }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--red); }
body.closing .foot a { pointer-events: auto; }
button:disabled { opacity: .6; cursor: default; }
body.closing .foot { opacity: 1; transform: none; }
.log { color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--red); }

form { display: grid; gap: 10px; margin-top: 14px; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
input, textarea { font: inherit; font-size: 14px; color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }
button { font: inherit; font-weight: 600; font-size: 14px; border-radius: 8px; padding: 10px 14px; cursor: pointer; border: 1px solid var(--red); background: var(--red); color: #fff; }
button.ghost { background: transparent; color: var(--ink); width: 100%; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: #fff; background: rgba(239,68,68,.2); border: 1px solid rgba(239,68,68,.5); }
.sent { text-align: center; padding: 8px 0 4px; }
.sent-icon { width: 64px; height: 64px; margin: 4px auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #fff; background: rgba(34,197,94,.2); border: 2px solid rgba(34,197,94,.6); }
.sent h3 { margin: 0 0 8px; font-size: 22px; }
.sent p { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
input::placeholder, textarea::placeholder { color: rgba(233,237,245,.45); }
.status { margin: 0; font-size: 12px; color: var(--muted); min-height: 1em; }

@media (max-width: 760px) {
  .top { padding: 16px; }
  .logo img { height: 24px; }
  .rail { display: none; }
  .clients { display: none; }
  .foot { padding: 10px 16px 12px; font-size: 10px; }
  body.closing .panel { right: 16px; bottom: 50%; transform: translateY(50%); max-height: none; }
  .clients b { font-size: 15px; }
  .panel { left: 16px; right: 16px; top: auto; bottom: 16px; transform: none; width: auto; padding: 18px; max-height: 48vh; overflow-y: auto; }
  /* compact strip: number, title and the first fact; tap for the rest */
  body:not(.facts-open):not(.closing) .panel { padding: 12px 16px; max-height: 22vh; overflow: hidden; }
  /* the opening card keeps its full height for the logo, headline and tagline */
  body[data-stop="0"] .panel { max-height: none !important; overflow: visible !important; }
  body[data-stop="0"] .stop .fact { display: block !important; }
  body:not(.facts-open):not(.closing) .stop .facts div:nth-child(n+2),
  body:not(.facts-open):not(.closing) .stop .spark, body:not(.facts-open):not(.closing) .stop .spark-axis,
  body:not(.facts-open):not(.closing) .stop .fact, body:not(.facts-open):not(.closing) .stop .season { display: none; }
  body:not(.facts-open):not(.closing) .stop h2 { font-size: 16px; margin-bottom: 6px; }
  body:not(.facts-open):not(.closing) .stop .kicker { margin-bottom: 4px; }
  body:not(.facts-open):not(.closing) .stop .year, body:not(.facts-open):not(.closing) .stop .wxday { font-size: 22px; margin-bottom: 4px; }
  body:not(.facts-open):not(.closing) .stop .facts { margin-bottom: 0; }
  .stop h2, .stop .kicker { padding-right: 88px; }
  .stepper { display: flex; gap: 8px; position: absolute; top: 10px; right: 12px; z-index: 2; }
  .stepper button { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--ink); }
  .stepper button:disabled { opacity: .3; }
  body.closing .stepper { display: none; }
  body.intro .panel { right: 16px; transform: translateY(-30vh); width: auto; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; margin-bottom: 10px; }
  .year { font-size: 32px; }
  form { gap: 6px; }
  input, textarea { font-size: 16px; padding: 7px 10px; }
  textarea { height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
