/* ==========================================================================
   BASE: reset, typography, layout helpers, buttons, header, footer.
   All values come from tokens.css.
   ========================================================================== */

/* ---- RESET --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

/* Lenis smooth scroll housekeeping (only active when JS turns it on) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---- TYPOGRAPHY ---------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-hero);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
}
.display--lg { font-size: var(--text-display-lg); }
.display--md { font-size: var(--text-display-md); }

.lead { font-size: var(--text-lead); line-height: 1.5; max-width: 34em; }

/* ---- LAYOUT HELPERS ------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.scene { position: relative; }
.scene--light { background: var(--bone); color: var(--ink); }
.scene--pad { padding-block: var(--section-pad); }

/* Hidden visually, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--bone);
  color: var(--ink);
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--bone); outline-offset: 3px; }
.scene--light :focus-visible { outline-color: var(--ink); }

/* ---- BUTTONS ------------------------------------------------------------- */
/* The button borrows the shape of the door window: square at the back, raked
   at the front. The shape is drawn on ::before so the button itself is never
   clipped and its keyboard focus ring stays whole. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.7rem 2.3rem 0.7rem 1.5rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 5px 0 0 5px;
  background: var(--ember);
  clip-path: polygon(0 0, calc(100% - 0.95rem) 0, 100% 100%, 0 100%);
  transition: background-color var(--speed-fast) var(--ease-smooth);
}
.btn:hover::before { background: var(--ember-hover); }

/* Second-choice action: a plain underlined link, no shape */
.btn--ghost { padding-inline: 0.15rem; color: var(--bone); }
.btn--ghost::before {
  inset: auto 0 0.6rem 0;
  height: 2px;
  border-radius: 0;
  background: var(--sand);
  clip-path: none;
}
.btn--ghost:hover::before { background: var(--bone); }
.btn--small { min-height: 2.6rem; padding: 0.45rem 1.7rem 0.45rem 1rem; font-size: 1.05rem; white-space: nowrap; }
.btn--small::before { clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 100%, 0 100%); }

/* ---- SVG PAINT HELPERS ---------------------------------------------------
   The SVG layers use these classes so their colors come from tokens.css. */
.f-ink { fill: var(--ink); }
.f-ink-deep { fill: var(--ink-deep); }
.f-charcoal { fill: var(--charcoal); }
.f-sand { fill: var(--sand); }
.f-bone { fill: var(--bone); }
.f-ember { fill: var(--ember); }
.f-dusk { fill: var(--dusk); }
.f-pine { fill: var(--pine); }
.f-pine-near { fill: color-mix(in srgb, var(--pine) 55%, var(--ink-deep)); }   /* roadside trees: darker, so they stand out from the forest behind */
.f-haze { fill: color-mix(in srgb, var(--haze) 80%, var(--dusk)); }   /* solid, so nothing behind shows through */
.f-dirt { fill: var(--dirt); }
.f-rut { fill: var(--ink); opacity: 0.32; }
.f-ridge { fill: var(--sand); opacity: 0.16; }
.f-current { fill: currentColor; }
.f-wing { fill: currentColor; opacity: 0.55; }
.s-current { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.s-mesh { fill: none; stroke: var(--sand); stroke-width: 0.7; opacity: 0.42; }
.f-mesh-tint { fill: var(--ink); opacity: 0.08; }
.s-mesh-ink { fill: none; stroke: var(--ink); stroke-width: 0.7; opacity: 0.4; }
.sky-stop-top { stop-color: var(--sky-top); }
.sky-stop-mid { stop-color: var(--sky-mid); }
.sky-stop-horizon { stop-color: var(--sky-horizon); }
.sun-stop-core { stop-color: var(--bone); stop-opacity: 0.85; }
.sun-stop-glow { stop-color: var(--sky-horizon); stop-opacity: 0.5; }
.sun-stop-edge { stop-color: var(--sky-horizon); stop-opacity: 0; }
.f-sun { fill: var(--bone); opacity: 0.9; }

/* ---- HEADER / NAV --------------------------------------------------------
   Clear over the hero. After the hero it turns into a solid bar that slides
   away while you scroll down and returns when you scroll up (js/ui.js adds
   the is-solid and is-hidden classes). */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-block: 1.1rem;
  border-bottom: 1px solid transparent;
  transition: transform var(--speed-fast) var(--ease-smooth), background-color var(--speed-fast) var(--ease-smooth), padding var(--speed-fast) var(--ease-smooth);
}
.site-header.is-solid {
  padding-block: 0.6rem;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  border-bottom-color: color-mix(in srgb, var(--sand) 18%, transparent);
}
.site-header.is-hidden { transform: translateY(-101%); }

/* ---- SCROLL PROGRESS: thin ember line across the top --------------------- */
.progress { position: fixed; inset: 0 0 auto 0; z-index: 60; height: 3px; pointer-events: none; }
.progress__bar { display: block; height: 100%; background: var(--ember); transform: scaleX(0); transform-origin: 0 50%; }

/* ---- AUTO PLAY BUTTON: sits in the bottom right corner --------------------
   Full size with its words at the top of the page. Once you scroll, js/ui.js
   adds is-compact and it shrinks to a small icon button. The words are only
   hidden from view: screen readers still read them. */
.tour {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 55;
  color: var(--bone);
  transition: gap var(--speed-base) var(--ease-smooth), padding var(--speed-base) var(--ease-smooth);
}
.tour__label {
  display: inline-block;
  max-width: 10em;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width var(--speed-base) var(--ease-smooth), opacity var(--speed-fast) var(--ease-smooth);
}
.tour.is-compact { gap: 0; padding-inline: 0.85rem 1.15rem; }
.tour.is-compact .tour__label { max-width: 0; opacity: 0; }
/* With a mouse or keyboard, pointing at the small button opens it back up */
@media (hover: hover) {
  .tour.is-compact:hover { gap: 0.6rem; padding-inline: 1rem 1.7rem; }
  .tour.is-compact:hover .tour__label { max-width: 10em; opacity: 1; }
}
.tour.is-compact:focus-visible { gap: 0.6rem; padding-inline: 1rem 1.7rem; }
.tour.is-compact:focus-visible .tour__label { max-width: 10em; opacity: 1; }
.tour[hidden] { display: none; }
.tour::before { background: color-mix(in srgb, var(--ink-deep) 92%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sand) 35%, transparent); }
.tour:hover::before { background: var(--ink-deep); }
.tour__icon { width: 0.9rem; height: 0.9rem; fill: var(--ember); }
.tour__icon-pause, .tour.is-playing .tour__icon-play { display: none; }
.tour.is-playing .tour__icon-pause { display: inline; }

@media (prefers-reduced-motion: reduce) {
  .site-header, .tour, .tour__label { transition: none; }
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.wordmark {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}
.nav__links { display: none; gap: 2rem; }
.nav__links a {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: border-color var(--speed-fast) var(--ease-smooth);
}
.nav__links a:hover { border-color: var(--ember); }
@media (min-width: 900px) { .nav__links { display: flex; } }

/* ---- PHONE MENU -----------------------------------------------------------
   Below 900px wide the links hide behind the menu button. js/menu.js adds
   is-open to the header when the button is pressed. */
.nav__links { list-style: none; margin: 0; padding: 0; }
.nav__toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem; height: 2.75rem;
  margin-right: -0.6rem;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav__toggle svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav__toggle-x, .site-header.is-open .nav__toggle-bars { display: none; }
.site-header.is-open .nav__toggle-x { display: inline; }
@media (min-width: 900px) { .nav__toggle { display: none; } }
@media (max-width: 899px) {
  .nav > .btn { margin-left: auto; }
  .site-header.is-open { background: var(--ink); }
  .nav__links {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem var(--gutter) 1rem;
    background: var(--ink);
    color: var(--bone);
    border-bottom: 1px solid var(--line-on-dark);
  }
  .site-header.is-open .nav__links { display: flex; }
  .nav__links a {
    display: block;
    padding-block: 0.95rem;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--line-on-dark);
  }
  .nav__links li:last-child a { border-bottom-color: transparent; }
}
/* Small phones: the orange button will not fit beside the name and the menu
   button, so it moves into the menu as the last link */
.nav__links-cta { display: none; }
@media (max-width: 520px) {
  .nav > .btn { display: none; }
  .nav__toggle { margin-left: auto; }
  .nav__links-cta { display: block; }
  .nav__links .nav__links-cta a { color: var(--ember); font-weight: 600; }
}

/* ---- FOOTER -------------------------------------------------------------- */
.site-footer {
  background: var(--ink-deep);
  color: var(--sand);
  padding-block: 3rem 5.5rem;              /* extra room at the bottom so the auto play button never covers the small print */
  font-size: var(--text-small);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer .wordmark { color: var(--bone); }
.site-footer a { color: inherit; text-underline-offset: 0.25em; }
.site-footer a:hover { color: var(--bone); }
.site-footer__disclaimer { margin-top: 1.5rem; max-width: 48em; }

/* Narrow phones: keep the wordmark and the waitlist button on one row */
@media (max-width: 480px) {
  .wordmark { font-size: 1.3rem; }
  .nav { gap: 0.75rem; }
  .btn--small { padding: 0.45rem 1.35rem 0.45rem 0.8rem; font-size: 0.95rem; }
}

@media (max-width: 767px) {
  .tour { right: 0.75rem; bottom: 0.75rem; }
}
