/* ---------- Fonts (self-hosted, woff2 only) ---------- */
@font-face {
  font-family: "Roboto Condensed";
  src: url("/fonts/RobotoCondensed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("/fonts/RobotoMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("/fonts/Switzer-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #181818; /* matches the stage image edges as WebP renders them */
  --chalk: #efefed;
  --snow: #f9f9f9;
  --green: #238850;
  --green-hover: #1d7443;

  --font-display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Switzer", ui-sans-serif, system-ui, sans-serif;
  --font-ui: var(--font-body);

  --edge: clamp(20px, 2.78vw, 40px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 4px; border-radius: 4px; }

/* ---------- Hero (one full screen) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(8px, 2svh, 24px);
  justify-items: center;
  padding: clamp(56px, min(9.44vw, 9svh), 136px) clamp(20px, 5.97vw, 86px) clamp(32px, min(4.3vw, 5svh), 62px);
  text-align: center;
  background: var(--ink);
}

/* Stage: one image (seat + lit floor), directly under the headline and as big
   as the row allows. Its edges fade to the page colour inside the image, so it
   can tilt and shift with the cursor without showing an edge. */
.stage-wrap {
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center; /* centres the stage even when it is wider than the screen */
  perspective: 1400px;
}
.stage {
  --seat-share: 0.3544;              /* seat width / image width */
  --seat-target: 40vw;               /* how wide the seat should be */
  flex: none;
  position: relative;
  /* The seat is ~66% of the image height; the rest is faded floor and air, so
     the image may reach past its row (behind the text) and the seat itself fills it. */
  height: min(calc(100% / 0.7), calc(var(--seat-target) / var(--seat-share) / (3615 / 1174)));
  aspect-ratio: 3615 / 1174;
  pointer-events: none;
}
.stage__img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 55%;
  will-change: transform;
}

/* Portrait screens: the seat fills almost the full width, like the old ads. */
@media (max-aspect-ratio: 1/1) {
  .stage { --seat-target: 94vw; }
}

/* Touch screens have no cursor: the image sways very slowly on its own. */
@media (hover: none), (pointer: coarse) {
  .stage__img { animation: sway 10s ease-in-out infinite alternate; }
}
@keyframes sway {
  from { transform: translate3d(-0.6%, 0.3%, 0) rotateY(-2.5deg) rotateX(1deg) scale(1.02); }
  to   { transform: translate3d(0.6%, -0.3%, 0) rotateY(2.5deg) rotateX(-1deg) scale(1.02); }
}

.hero__headline, .hero__bottom { position: relative; z-index: 1; }

/* AI disclosure, set like a tech mark: tiny mono, bottom right, reading upwards. */
.ai-mark {
  position: absolute;
  right: clamp(10px, 1.6vw, 24px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 1;
  margin: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(239, 239, 237, 0.45);
  white-space: nowrap;
}
.stage-wrap { position: relative; z-index: 0; }

.hero__headline {
  grid-row: 1;
  margin: 0;
  max-width: 1032px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: min(13.5vw, 16svh, 200px);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--chalk);
  text-wrap: balance;
}
.hero__headline .line { display: block; }

@media (max-aspect-ratio: 1/1) {
  .hero { padding-left: 14px; padding-right: 14px; }
  .hero__bottom { padding-inline: 18px; } /* keeps the text clear of the AI mark */
  .hero__headline { font-size: min(14.6vw, 11svh); }
}

.hero__bottom {
  grid-row: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, min(2.85vw, 3.6svh), 41px);
  width: 100%;
}
.hero__wordmark { width: min(542px, 72vw); height: auto; }
.hero__text {
  margin: 0;
  max-width: 938px;
  font-size: clamp(16px, 1.53vw, 22px);
  line-height: 1.45;
  font-weight: 400;
  text-wrap: pretty;
}
.hero__text strong { font-weight: 700; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--green);
  color: var(--chalk);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}
.button:hover { background: var(--green-hover); }
.button:active { transform: scale(0.97); }

/* ---------- Footer ---------- */
.footer {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "copy links"
    "logo logo";
  align-items: center;
  gap: 16px 40px;
  background: var(--green);
  color: var(--snow);
  padding: 48px var(--edge) var(--edge);
}
.footer__copy {
  grid-area: copy;
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
.footer__links {
  grid-area: links;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.footer__links a { text-decoration: none; }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__logo { grid-area: logo; width: 100%; height: auto; margin-top: clamp(96px, 14.2vw, 205px); }

@media (max-width: 640px) {
  .footer {
    grid-template-columns: 1fr;
    grid-template-areas: "links" "logo" "copy";
    padding-top: 40px;
  }
  .footer__links { justify-self: start; font-size: 16px; gap: 12px 24px; }
  .footer__logo { margin-top: 120px; }
  .footer__copy { font-size: 11px; opacity: 0.8; margin-top: 8px; }
}

/* ---------- Intro ---------- */
.curtain { display: none; }

html.intro body { overflow: hidden; }
html.intro .curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  padding: var(--edge);
  background: var(--green);
  cursor: pointer;
  animation: curtain-out 0.9s var(--ease-inout) 1.05s both;
  will-change: transform;
}
html.intro .curtain__logo {
  width: 100%;
  height: auto;
  animation: logo-in 0.7s var(--ease-out) 0.1s both;
}

html.intro .stage        { animation: bg-in 1.6s var(--ease-out) 1.2s both; }
html.intro .hero__headline .line { animation: rise 0.9s var(--ease-out) both; }
html.intro .hero__headline .line:nth-child(1) { animation-delay: 1.45s; }
html.intro .hero__headline .line:nth-child(2) { animation-delay: 1.55s; }
html.intro .hero__bottom { animation: fade-up 0.8s var(--ease-out) 1.75s both; }
html.intro .ai-mark      { animation: fade 0.8s ease 2s both; }

/* Skipped (click, scroll, key): everything finishes quickly. */
html.intro.skip .curtain { animation-duration: 0.45s; animation-delay: 0s; }
html.intro.skip .curtain__logo { animation-duration: 0.01s; animation-delay: 0s; }
html.intro.skip .stage,
html.intro.skip .hero__headline .line,
html.intro.skip .hero__bottom,
html.intro.skip .ai-mark { animation-duration: 0.5s; animation-delay: 0.1s; }

@keyframes logo-in {
  from { clip-path: inset(100% 0 0 0); transform: translateY(12%); }
  to   { clip-path: inset(0 0 0 0);    transform: none; }
}
@keyframes curtain-out {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bg-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.25em); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

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

/* ---------- Legal panel ----------
   The intro in reverse: the green block rises from the bottom to show the legal
   pages, and slides back down when closed. Opened directly, the same layout is
   just the page (.panel--page). */
.panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--green);
  color: var(--snow);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.85s var(--ease-inout), visibility 0s linear 0.85s;
}
.panel[hidden] { display: none; }
.panel.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.85s var(--ease-inout), visibility 0s;
}
.panel--page {
  position: static;
  min-height: 100vh;
  min-height: 100svh;
  transform: none;
  visibility: visible;
  overflow: visible;
  transition: none;
}
html.panel-open body { overflow: hidden; }

.panel__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--edge);
}
.panel--page .panel__inner { min-height: 100vh; min-height: 100svh; }

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding-top: 8px;
}
.panel__close {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  padding: 8px 0;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.panel__close:hover { text-decoration: underline; text-underline-offset: 4px; }

.panel__content {
  flex: 1;
  transition: opacity 0.4s ease 0.45s, transform 0.6s var(--ease-out) 0.4s;
}
.panel:not(.is-open):not(.panel--page) .panel__content { opacity: 0; transform: translateY(24px); transition-delay: 0s; }

.panel__logo { width: 100%; height: auto; margin-top: clamp(64px, 10vw, 160px); }

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 104px) 0 0;
  font-size: 17px;
  line-height: 1.6;
}
.legal h1 {
  margin: 0 0 40px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.85;
  letter-spacing: -0.04em;
}
.legal h2 { margin: 40px 0 8px; font-size: 19px; line-height: 1.35; }
.legal p, .legal ul { margin: 0 0 16px; }
.legal ul { padding-left: 1.2em; }
.legal address { font-style: normal; }
.legal a { text-underline-offset: 3px; }

/* 404 */
.legal__back {
  display: inline-block;
  margin-bottom: 48px;
  font-family: var(--font-ui);
  font-weight: 500;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .panel, .panel.is-open, .panel__content { transition: none !important; }
}
