/* The landing (#153, #155): the app's two colors and its font. Cream on teal and teal on
   cream, every other tone a mix of the two (frontend/src/theme/variables.css). */
@font-face {
  font-family: "News Cycle";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/news-cycle-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "News Cycle";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/news-cycle-latin-700.woff2") format("woff2");
}

:root {
  --cream: #fae3b4;
  --teal: #1e4147;
  --bg: var(--cream);
  --fg: var(--teal);
  --danger: #ba1a1a;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(48px, 7vw, 88px);
  --wide: 1120px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

/* a teal block: the same tokens, the other way round */
.flip {
  --bg: var(--teal);
  --fg: var(--cream);
  --danger: #ffb4ab;
  color-scheme: dark;
}

/* the mixes: declared again wherever the two colors swap, or they keep the page's values */
:root,
.flip {
  --soft: color-mix(in srgb, var(--fg) 7%, var(--bg));
  --muted: color-mix(in srgb, var(--fg) 76%, var(--bg));
  --line: color-mix(in srgb, var(--fg) 22%, var(--bg));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--teal);
  font-family: "News Cycle", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

section,
.foot,
.flip {
  background: var(--bg);
  color: var(--fg);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
}

h2 {
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
}

h3 {
  font-size: 1.3125rem;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* ---- top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.top__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 1rem;
}

.top__nav a {
  text-decoration: none;
}

.top__nav a:not(.top__signin):hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.top__signin {
  padding: 6px 16px;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.top__signin:hover {
  background: var(--teal);
  color: var(--cream);
}

@media (max-width: 640px) {
  .top__nav a:not(.top__signin) {
    display: none;
  }
}

/* ---- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--gutter) var(--section);
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero__text .eyebrow {
  margin-bottom: -6px;
}

.hero__phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* ---- a phone a video plays in: the video keeps its own shape, nothing is cut off */
.phone {
  width: 100%;
  padding: 8px;
  border-radius: 34px;
  background: var(--teal);
}

.flip .phone {
  background: color-mix(in srgb, var(--cream) 16%, var(--teal));
}

.phone video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  background: var(--soft);
}

.phone_promo {
  max-width: 280px;
}

.phone_promo video {
  aspect-ratio: 9 / 16;
}

.phone_card {
  max-width: 220px;
  padding: 6px;
  border-radius: 28px;
}

.phone_card video {
  aspect-ratio: 560 / 1212;
  border-radius: 22px;
}

.sound {
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.sound[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
}

/* ---- the best of: one tight band */
.best {
  padding: clamp(40px, 5vw, 64px) var(--gutter);
}

.best__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.best__list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1.5px solid var(--line);
}

.best__list p {
  font-size: 1rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .best__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .best__list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ---- for yourself / for coaches */
.uses {
  padding: var(--section) var(--gutter);
}

.uses__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: var(--wide);
  margin: 0 auto 32px;
}

/* the segmented switch: the tabs here and the form's radios share it */
.tabs,
.toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.tabs button,
.toggle span {
  display: block;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.tabs button[aria-selected="true"],
.toggle input:checked + span {
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

.tabs button:hover:not([aria-selected="true"]),
.toggle label:hover input:not(:checked) + span {
  color: var(--fg);
}

/* a column as wide as its phone: the text lines up under it */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 220px));
  justify-content: space-between;
  gap: 24px;
  max-width: var(--wide);
  margin: 0 auto;
}

.cards[hidden] {
  display: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card .phone {
  margin-bottom: 8px;
}

.card p {
  font-size: 1rem;
  color: var(--muted);
}

/* a row to swipe on a phone, the next card peeking in */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(64vw, 240px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .cards::-webkit-scrollbar {
    display: none;
  }
  .card {
    scroll-snap-align: start;
  }
}

/* ---- the invite */
.cta {
  padding: 0 var(--gutter) var(--section);
}

.cta__card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 32px;
}

.cta__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 760px) {
  .cta__card {
    grid-template-columns: 1fr;
  }
}

/* ---- the waitlist form: the address and the button in one pill */
.waitlist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  max-width: 520px;
}

.pill {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 5px 5px 5px 20px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow 0.2s var(--ease);
}

.pill:focus-within {
  box-shadow: inset 0 0 0 2px var(--fg);
}

.pill input {
  flex: 1;
  min-width: 0;
  padding: 10px 8px 10px 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  outline: none;
}

.pill input::placeholder,
.waitlist textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.pill button {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.pill button:hover {
  transform: translateY(-1px);
}

.pill button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

@media (max-width: 400px) {
  .pill button {
    padding-inline: 16px;
  }
}

/* the radios as a segmented switch: the circle hidden, the label is the button */
.toggle {
  margin: 0;
  border: 0;
}

.toggle label {
  position: relative;
}

.toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.toggle input:focus-visible + span {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.toggle span {
  padding: 6px 14px;
  font-size: 0.9375rem;
}

.waitlist__more {
  width: 100%;
}

.waitlist textarea {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: 20px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
}

.waitlist textarea:focus {
  box-shadow: inset 0 0 0 2px var(--fg);
}

.waitlist__note {
  font-size: 0.9375rem;
  color: var(--muted);
}

.waitlist__status:empty {
  display: none;
}

.waitlist__status {
  font-weight: 700;
}

.waitlist__status_error {
  color: var(--danger);
}

/* sent: the form gives way to its answer */
.waitlist_done > :not(.waitlist__status) {
  display: none;
}

/* ---- footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  font-size: 1rem;
  color: var(--muted);
}

.foot .brand {
  font-size: 1rem;
  color: var(--fg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
