/* Layout and components. Values come from tokens.css only (DESIGN.md §2–§8). Desktop pass. */

html {
  background: var(--bg);
  scroll-snap-type: y proximity;
}

body {
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p,
ul {
  margin: 0;
}

h1,
h2 {
  font-weight: 300;
}

[tabindex="-1"]:focus {
  outline: none;
}

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

/* Every slide is exactly one screen tall, content centred (tim). */
.slide {
  position: relative;
  height: 100svh;
  box-sizing: border-box;
  scroll-snap-align: start;
}

/* 8.3 Button: one variant for the whole site; turns white on hover (tim) */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  box-sizing: border-box;
  border: var(--border) solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-ui);
  font-weight: var(--fw-strong);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover);
}

.btn--wide {
  width: 100%;
}

.btn:active {
  border-color: var(--text-2);
}


.btn:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 3px;
}

.btn:disabled {
  background: var(--bg);
  color: var(--text-3);
  border-color: var(--line-soft);
  cursor: wait;
}

/* Slide 1: video, menu, timed phrases, final screen */

.slide--hero {
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--t-video-out);
}

.hero__video.is-dark {
  opacity: 0;
}

.hero__video.is-dim {
  opacity: var(--hero-dim);
  transition: opacity var(--t-video-in);
}

/* Bottom of the video fades into the page (tim, v29) */
.hero__shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--hero-shade);
  background: linear-gradient(to bottom, transparent, var(--bg)); /* F5 exception: hero bottom shade, tim v29 */
  pointer-events: none;
}

.nav {
  position: absolute;
  top: var(--nav-top);
  left: var(--nav-x);
  right: var(--nav-x);
  height: var(--nav-row);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-size: var(--fs-ui);
  line-height: 1;
  color: var(--text-1);
}

/* 8.2 Language switch: the whole pill is one button, a click switches to the other language (tim) */

.lang {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  box-sizing: border-box;
  border: var(--border) solid var(--line);
  border-radius: var(--r-lang);
  background: var(--bg);
  color: var(--text-3);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-strong);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover);
}

/* Invisible hit area: at least 44px tall */
.lang::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.lang:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 3px;
}

.lang__code.is-active {
  color: var(--text-1);
  transition: color var(--t-hover);
}

.lang__sep {
  padding: 0 var(--s-1);
}

.hero__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity var(--t-video-out);
}

.hero__stage.is-dark {
  opacity: 0;
}

.hero__phrase {
  grid-area: 1 / 1;
  font-weight: var(--fw-strong);
  max-width: 90vw;
  color: var(--text-1);
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--track-h);
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-out), visibility 0s linear 200ms;
}

.hero__phrase--small {
  font-size: var(--fs-intro);
}

.hero__phrase.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-in), visibility 0s;
}

/* Phrase 1 appears and disappears without fading (tim, DESIGN.md §6) */
.hero__phrase--instant,
.hero__phrase--instant.is-on {
  transition: none;
}

.hero__final {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-video-in), visibility 0s linear 900ms;
}

.hero__final.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-video-in), visibility 0s;
}

.hero__final-text {
  position: relative;
  text-align: center;
}

.hero__title {
  color: var(--text-1);
  font-weight: var(--fw-strong);
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--track-h);
}

.hero__sub {
  margin-top: var(--hero-sub-gap);
  color: var(--text-2);
  font-size: var(--fs-sub);
  line-height: var(--lh-sub);
}

/* Text stays centred; the button hangs below it */
.hero__cta {
  position: absolute;
  top: calc(100% + var(--hero-cta-gap));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

.no-fade .hero__video,
.no-fade .hero__stage,
.no-fade .hero__phrase,
.no-fade .hero__phrase.is-on,
.no-fade .hero__final,
.no-fade .hero__final.is-on {
  transition: none;
}

/*
 * Slide 1 stays pinned for one extra screen of scroll while a black block rises from the bottom
 * and covers it completely; slide 2 starts only after that (tim, v6).
 */
.hero-track {
  height: calc(100svh * (1 + var(--cover-share)));
}

.hero-track > .slide--hero {
  position: sticky; /* F14 exception: pinned slide 1, tim v6 */
  top: 0;
}

/* While the block rises, the still visible part of slide 1 dims too (tim, v7) */
.hero__dim {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: calc(var(--cover, 0) * var(--hero-scroll-dim));
  pointer-events: none;
}

.hero__cover {
  position: absolute;
  inset: 0;
  background: var(--bg);
  clip-path: inset(calc((1 - var(--cover, 0)) * 100%) 0 0 0);
  pointer-events: none;
}

/* Slide 2: no card frame (tim, v3, restored v15); text sits on the common content line */

.slide--info,
.slide--form {
  display: grid;
  place-items: center;
  padding: var(--s-7) var(--content-x);
}

/* Slide 3 sits 1.5× closer to slide 2: the form is pinned to the top of its slide (tim, v30) */
.slide--form {
  place-items: start center;
  padding-top: var(--slide3-top);
}

/*
 * Slide 2 (tim, v28): everything centred; the card holds the list and, below a thin line,
 * the price, terms and button.
 */
.slide--info {
  place-items: center;
  padding-block: var(--s-8);
}

.info {
  display: grid;
  justify-items: center;
  row-gap: calc(var(--s-6) / var(--tight));
  text-align: center;
}

.poster__mid {
  display: grid;
  justify-items: center;
}

.poster__mid .card__list {
  grid-template-columns: repeat(2, max-content);
  column-gap: var(--s-8);
}

.card__title {
  margin-bottom: calc(var(--s-5) / var(--tight));
  color: var(--text-1);
  font-size: var(--fs-h);
  font-weight: var(--fw-strong);
  line-height: var(--lh-h);
  letter-spacing: var(--track-h);
  text-wrap: balance;
}

.card__desc {
  color: var(--text-2);
}



/* The list sits in a frame like the form card, mirroring it (tim, v22) */
.inside-card {
  padding: var(--list-pad);
  border: var(--border) solid var(--line-soft);
  border-radius: var(--r-card);
  transition: border-color var(--t-hover);
}

.card__list {
  display: grid;
  gap: calc(var(--s-4) / var(--tight));
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-1);
  text-align: left; /* dots read better left-aligned; the columns sit centred in the card */
}

/* Price, terms and button inside the card, under a thin line, centred */
.card__buy {
  display: grid;
  justify-items: center;
  margin-top: calc(var(--s-6) / var(--tight));
  padding-top: calc(var(--s-6) / var(--tight));
  border-top: var(--border) solid var(--line-soft);
}

.card__list li {
  position: relative;
  padding-left: calc(var(--s-5) - var(--s-1));
}

/* Round dot, centred on the first line of each item */
.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--fs-body) * var(--lh-body) / 2 - var(--dot) / 2);
  width: var(--dot);
  height: var(--dot);
  border-radius: var(--r-pill);
  background: var(--text-3);
}

/* 8.7 Price: $9 / forever */

.price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: var(--s-2);
}

.price__value {
  color: var(--accent);
  font-size: var(--fs-h);
  line-height: var(--lh-h);
  letter-spacing: var(--track-h);
}

.price__unit {
  color: var(--text-3);
  font-size: var(--fs-body);
}

.terms {
  margin: calc(var(--s-2) / var(--tight)) 0 calc(var(--s-6) / var(--tight));
  color: var(--text-3);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

/* Right column of slide 2: title and lead centred above the card, the card holds only the form (tim, v15–v16) */

.waitlist__head {
  margin-bottom: var(--s-4); /* closer to the card (tim, v21) */
  text-align: center;
}

.waitlist__title {
  color: var(--text-1);
  font-size: var(--fs-h);
  font-weight: var(--fw-strong);
  line-height: var(--lh-h);
  letter-spacing: var(--track-h);
  text-wrap: balance;
}

.form-card {
  padding: var(--form-pad);
  box-sizing: border-box;
  border: var(--border) solid var(--line-soft);
  border-radius: var(--r-card);
  background: var(--bg);
  transition: border-color var(--t-hover);
}

/* Labels, fields, errors and notes stay left (tim, v4, confirmed v7) */
.form-card__form {
  display: grid;
  gap: calc(var(--s-5) / var(--tight));
}

/* Light (inverted) button: the form "join" and slide 2 "join the waitlist" (tim, v10–v11, v30) */
.btn--light {
  width: 100%;
  height: 52px;
  border-color: var(--accent);
  border-radius: var(--r-btn-lg);
  background: var(--accent);
  color: var(--bg);
}

.field {
  display: grid;
  gap: calc(var(--s-2) / var(--tight));
}

.field__label {
  color: var(--text-3);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.field__input {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  box-sizing: border-box;
  border: var(--border) solid var(--line);
  border-radius: var(--r-btn-lg);
  background: var(--bg);
  color: var(--text-1);
  caret-color: var(--text-1);
  font: inherit;
  font-size: var(--fs-ui);
  transition: border-color var(--t-hover);
}

.field__input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.field__input:focus {
  border-color: var(--text-1);
}

.field__input:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 3px;
}

.field__input[aria-invalid="true"] {
  border-color: var(--accent);
}

/* Keep browser autofill from painting the field */
.field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1);
  transition: background-color 100000s 0s;
}

.field__error,
.form-status {
  color: var(--accent);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.form-card__success {
  color: var(--text-1);
  font-size: var(--fs-sub);
  line-height: var(--lh-sub);
}

.form-card__consent {
  margin-top: calc(var(--s-4) / var(--tight));
  color: var(--text-3);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* §6 item 2: reveal on scroll, opacity only, once. Hidden only when JS is running. */

.reveal {
  transition: opacity var(--t-reveal);
}

.js .reveal:not(.is-in) {
  opacity: 0;
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
  }

  /* Only the form button is inverted: hover turns it black with a grey edge (tim, v10–v11) */
  .btn--light:not(:disabled):hover {
    background: var(--bg);
    border-color: var(--line);
    color: var(--accent);
  }

  .lang:hover {
    background: var(--accent);
    border-color: var(--accent);
  }

  .lang:hover .lang__code.is-active {
    color: var(--bg);
  }

  .form-card:hover,
  .inside-card:hover {
    border-color: var(--text-1);
  }
}

/* Tablet and phone: one column; slides 2 and 3 grow with their content (v15) */
@media (max-width: 1023px) {
  .slide--info,
  .slide--form {
    height: auto;
    min-height: 100svh;
    padding-block: var(--s-10) var(--s-8);
  }

  .hero__title {
    max-width: 90vw;
    text-wrap: balance;
  }

  .slide--form {
    padding-top: var(--s-7);
  }

  /* Tablet and phone: the list goes to one column */
  .poster__mid .card__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .slide--info,
  .slide--form {
    padding-block: var(--s-9) var(--s-7);
  }

  /* Slide 3 follows slide 2 closely on phones too (tim, v30) */
  .slide--form {
    padding-top: var(--s-5);
  }
}

/* Phones and tablets: the same colour change happens on press instead of hover (tim, v29) */
@media (hover: none) {
  .btn:not(:disabled):active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
  }

  .btn--light:not(:disabled):active {
    background: var(--bg);
    border-color: var(--line);
    color: var(--accent);
  }

  .lang:active {
    background: var(--accent);
    border-color: var(--accent);
  }

  .lang:active .lang__code.is-active {
    color: var(--bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-track {
    height: auto;
  }

  .hero__cover,
  .hero__dim {
    display: none;
  }

  .js .reveal:not(.is-in) {
    opacity: 1;
  }

  .reveal {
    transition: none;
  }
}
