/* HYLTH marketing site — hand-written CSS for the static pages served at `/`.
 *
 * Every colour here is a custom property from tokens.css, which is generated
 * from src/theme/colors.ts (CLAUDE.md non-negotiable #2 — the palette is
 * locked and §9.1 is its source of truth). There are no hexes in this file,
 * deliberately. If you need a colour that isn't a token, amend §9.1 first.
 *
 * Two brand rules this file has to honour and which are easy to break in CSS:
 *   1. Never white-on-teal. The accent's foreground is always --on-accent.
 *   2. Teal is rare — one primary action per screen. This page has three
 *      audiences and therefore three calls to action, so exactly one of them
 *      (the AI coach CTA, and its repeat at the foot of the page — the same
 *      action, not a second one) is teal. The coach CTA is an outline button
 *      and the invite-code path is a text link. That hierarchy is the rule
 *      being obeyed, not a styling preference.
 */

/* Self-hosted rather than Google Fonts: the app's privacy policy enumerates
   its sub-processors, and pulling fonts from fonts.gstatic.com would send
   every visitor's IP to Google before they've consented to anything. Three
   weights only (~174 KB) — the wordmark is a PNG, so Archivo isn't needed. */
@font-face {
  font-family: 'Sora';
  src: url('fonts/Sora_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('fonts/Sora_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('fonts/Sora_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: var(--type-body-line);
  color: var(--text);
  /* The app's own page ground is a shallow vertical fade (see
     backgroundGradientEnd's comment in colors.ts) — same treatment here so
     the site and the app read as one surface. */
  background: linear-gradient(var(--background), var(--background-gradient-end)) no-repeat;
  background-attachment: fixed;
}

/* Matches src/app/+html.tsx exactly — a keyboard visitor gets the same focus
   ring on the marketing site as inside the app. :focus-visible, not :focus,
   so it doesn't fire on every mouse click. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
}

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

p {
  margin: 0;
}

a {
  color: inherit;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.band {
  padding: calc(var(--space-xxl) * 2) 0;
}

.band--dark {
  /* --bar is theme-invariant by design (colors.ts), so this band is the same
     graphite in light and dark mode, exactly like the app's chrome. */
  background: var(--bar);
  color: var(--bar-foreground);
}

.band--card {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-md) var(--space-lg);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip:focus {
  left: 0;
}

/* ---------- nav ---------- */

.nav {
  background: var(--bar);
  color: var(--bar-foreground);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-right: auto;
  text-decoration: none;
}

.nav__wordmark {
  height: 26px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--bar-foreground);
  text-decoration: none;
  font-size: var(--type-label);
  font-weight: 600;
  /* 44px min target (Apple HIG) achieved with padding rather than height, so
     the row still collapses gracefully when it wraps on a phone. */
  display: inline-block;
  padding: var(--space-md) 0;
}

.nav__links a:hover {
  text-decoration: underline;
}

/* ---------- brand mark ---------- */

.mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mark svg {
  width: 22px;
  height: 22px;
  display: block;
}

.mark--lg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
}
.mark--lg svg {
  width: 36px;
  height: 36px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--type-heading);
  line-height: var(--type-heading-line);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: translateY(1px);
}

/* The one teal action on the page. --on-accent, never white (§9.1). */
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

/* Coach CTA. Outline, not filled — deliberately the second-priority action. */
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--outline-light {
  background: transparent;
  color: var(--bar-foreground);
  border-color: var(--bar-muted);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  gap: var(--space-xxl);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--type-label);
  line-height: var(--type-label-line);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-size: 40px;
  line-height: 46px;
  margin-bottom: var(--space-lg);
}

.hero__sub {
  font-size: 18px;
  line-height: 28px;
  color: var(--bar-muted);
  max-width: 46ch;
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.hero__reassure {
  margin-top: var(--space-lg);
  font-size: var(--type-caption);
  line-height: var(--type-caption-line);
  color: var(--bar-muted);
}

/* ---------- device mock ---------- */

/* No fixed aspect-ratio, deliberately (2026-09-14). These are real captures
   from a browser at phone width, not phone-shaped renders — app-home.png is
   0.76:1 against the 9/19 this used to force, so `object-fit: cover` was
   cropping 38% of the screen away. The image sets its own height and nothing
   is lost.

   The rounding lives here rather than being baked into the PNG, for two
   reasons: the radius then matches every other card on the page at whatever
   size it renders, and it can't be silently cropped off by object-fit. */
.device {
  justify-self: center;
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--bar-glass-border);
  background: var(--background);
  overflow: hidden;
  box-shadow: 0 24px 60px rgb(0 0 0 / 35%);
}

.device img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- proof strip ---------- */

.proof {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.proof li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  font-size: var(--type-body);
  line-height: var(--type-body-line);
}

.proof svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}

/* ---------- section headings ---------- */

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-xxl);
}

.section-head h2 {
  font-size: 30px;
  line-height: 38px;
  margin-bottom: var(--space-md);
}

.section-head p {
  font-size: 17px;
  line-height: 26px;
  color: var(--text-muted);
}

.band--dark .section-head p {
  color: var(--bar-muted);
}

/* ---------- steps ---------- */

.steps {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.step__n {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--bar);
  color: var(--bar-foreground);
  font-size: var(--type-label);
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.step h3 {
  font-size: var(--type-title);
  line-height: var(--type-title-line);
  margin-bottom: var(--space-sm);
}

.step p {
  color: var(--text-muted);
}

/* ---------- feature rows ---------- */

.feature {
  display: grid;
  gap: var(--space-xxl);
  align-items: center;
  padding: var(--space-xxl) 0;
}

.feature + .feature {
  border-top: 1px solid var(--border);
}

.feature h3 {
  font-size: 26px;
  line-height: 34px;
  margin-bottom: var(--space-md);
}

.feature p {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 26px;
  max-width: 48ch;
}

.feature ul {
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.feature li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  color: var(--text);
}

.feature li svg {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--accent);
}

/* Same reasoning as .device — the capture sets its own height rather than
   being cropped to a frame it doesn't match. */
.shot {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- pricing ---------- */

.plan-group + .plan-group {
  margin-top: var(--space-xxl);
}

.plan-group > h3 {
  font-size: var(--type-title);
  line-height: var(--type-title-line);
  margin-bottom: var(--space-lg);
}

.plans {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.plan--featured {
  border-color: var(--accent);
  border-width: 2px;
}

.plan__name {
  font-size: var(--type-label);
  line-height: var(--type-label-line);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.plan__price {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
}

.plan__price span {
  font-size: var(--type-body);
  line-height: var(--type-body-line);
  font-weight: 400;
  color: var(--text-muted);
}

.plan__note {
  color: var(--text-muted);
  font-size: var(--type-body);
}

/* ---------- coach band ---------- */

.coach-grid {
  display: grid;
  gap: var(--space-xxl);
  align-items: start;
}

/* ---------- founder ---------- */

.founder {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

.founder blockquote {
  margin: 0;
  font-size: 19px;
  line-height: 30px;
}

.founder cite {
  display: block;
  margin-top: var(--space-lg);
  font-style: normal;
  font-size: var(--type-label);
  color: var(--text-muted);
}

/* ---------- final CTA ---------- */

.final {
  text-align: center;
}

.final h2 {
  font-size: 32px;
  line-height: 40px;
  margin-bottom: var(--space-md);
}

.final p {
  color: var(--bar-muted);
  font-size: 17px;
  line-height: 26px;
  margin: 0 auto var(--space-xl);
  max-width: 48ch;
}

.final .hero__actions {
  justify-content: center;
}

/* ---------- footer ---------- */

.footer {
  background: var(--bar);
  color: var(--bar-foreground);
  padding: var(--space-xxl) 0;
  border-top: 1px solid var(--bar-glass-border);
}

.footer__cols {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--space-xxl);
}

.footer h2 {
  font-size: var(--type-label);
  line-height: var(--type-label-line);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bar-muted);
  margin-bottom: var(--space-md);
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.footer a {
  color: var(--bar-foreground);
  text-decoration: none;
  font-size: var(--type-body);
  display: inline-block;
  padding: var(--space-xs) 0;
}

.footer a:hover {
  text-decoration: underline;
}

.footer__legal {
  border-top: 1px solid var(--bar-glass-border);
  padding-top: var(--space-lg);
  font-size: var(--type-caption);
  line-height: var(--type-caption-line);
  color: var(--bar-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
}

/* ---------- forms (join page) ---------- */

.form {
  display: grid;
  gap: var(--space-lg);
  max-width: 420px;
}

.field {
  display: grid;
  gap: var(--space-sm);
}

.field label {
  font-size: var(--type-label);
  line-height: var(--type-label-line);
  font-weight: 600;
}

.field input {
  font-family: inherit;
  font-size: var(--type-body);
  min-height: 48px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
}

.field__hint {
  font-size: var(--type-caption);
  line-height: var(--type-caption-line);
  color: var(--text-muted);
}

/* ---------- wide layout ----------
   768px is the app's own wide-screen breakpoint (src/theme/responsive.ts),
   reused here so the site and the app change shape at the same width. */

@media (min-width: 768px) {
  .hero {
    /* 1.25fr, not 1.15 — the text column has to be wide enough to hold
       "Start with an AI coach." on one line at the size below, or the
       headline breaks mid-phrase ("an AI / coach."), which reads badly. */
    grid-template-columns: 1.25fr 0.75fr;
  }

  .hero h1 {
    font-size: 46px;
    line-height: 54px;
  }

  .feature {
    grid-template-columns: 1fr 1fr;
  }

  .feature--flip .feature__text {
    order: 2;
  }

  .coach-grid {
    grid-template-columns: 1fr 1fr;
  }

  .founder {
    grid-template-columns: auto 1fr;
  }
}

/* Non-negotiable #6 — any entrance animation goes through a reduced-motion
   guard. The only motion on this page is the button press transform, but the
   rule holds regardless of how small the motion is. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
