/*
 * Shared by all five pages.
 *
 * Colours are the app's own tokens (apps/mobile/src/theme/tokens.ts), so the
 * site and the app cannot drift apart: accent is water and only water
 * (DESIGN-BRIEF §3.1), and both schemes are defined rather than one being
 * derived from the other.
 *
 * ## The font is self-hosted, deliberately
 *
 * `design/Find My Tide Website.dc.html` pulls Schibsted Grotesk from Google
 * Fonts. That cannot ship as-is: it would send every visitor's IP to a third
 * party from the page that tells them we do not do that, and /privacy makes
 * that promise in writing.
 *
 * The objection is to the CDN rather than to web fonts, so the four faces are
 * served from this origin instead — converted to woff2 from the same TTFs
 * `@expo-google-fonts` ships to the app, which is what keeps the two sides
 * rasterising the same outlines. 158 KB for all four, and no third party.
 *
 * The system stack stays as the fallback, so a blocked or failed font request
 * degrades to the site as it read before rather than to nothing.
 */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-700.woff2') format('woff2');
  /* 600 maps to the 700 face, as it does in the app (DESIGN-BRIEF §4). */
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk-900.woff2') format('woff2');
  font-weight: 800 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --surface: #ffffff;
  --surface-sunken: #f1f3f6;
  --surface-raised: #f6f8fb;
  --ink: #0b0f14;
  --ink-secondary: #3c4650;
  --muted: #8a9199;
  --muted-soft: #96a0ab;
  --border: #e4e8ee;
  --border-soft: #eef1f5;
  --accent: #1b4fc4;
  --accent-hover: #153e9c;
  --accent-soft: #eef2fa;
  --on-accent: #ffffff;
  --warning: #c2472f;

  /* Type on the accent field, where the surface is always blue. */
  --on-accent-dim: rgba(255, 255, 255, 0.82);
  --on-accent-faint: rgba(255, 255, 255, 0.62);
  --on-accent-line: rgba(255, 255, 255, 0.5);

  --gutter: 32px;
  --column: 1080px;
  --radius-card: 16px;
  --radius-tile: 13px;
  --radius-button: 11px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f151c;
    --surface-sunken: #1a222c;
    --surface-raised: #151c25;
    --ink: #e9eff5;
    --ink-secondary: #b4bfca;
    --muted: #8794a1;
    --muted-soft: #78848f;
    --border: #232d39;
    --border-soft: #1e2731;
    --accent: #78a6ff;
    --accent-hover: #9dbeff;
    --accent-soft: #182438;
    --on-accent: #0a1120;
    --warning: #f0785c;
  }

  /*
   * The hero and CTA keep their brand blue in both schemes — it is the one
   * field where the accent is a surface rather than a text colour, and the
   * dark accent (#78A6FF) is far too light to carry white type. So the
   * on-accent tokens are pinned to the light values inside those blocks.
   */
  .field {
    --accent: #1b4fc4;
    --on-accent: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.site-header > div {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.72px;
  color: var(--ink);
  /* Two words, and the header is a flex row that will happily break them
     apart at 390px. The name is a name — it does not wrap. */
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark svg {
  flex: none;
  display: block;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  color: var(--ink);
}

.site-header nav a.contact {
  font-weight: 700;
  color: var(--accent);
}

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

/*
 * `.field` marks a block where the accent is the *background*. It pins the
 * on-accent tokens in dark mode (see above) and owns the white type inside.
 */
.field {
  background: var(--accent);
  color: var(--on-accent);
  overflow: hidden;
}

.hero {
  max-width: var(--column);
  margin: 0 auto;
  padding: 88px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.43px;
  text-transform: uppercase;
  color: var(--muted);
}

.field .eyebrow {
  color: var(--on-accent-faint);
}

.hero h1 {
  margin: 16px 0 0;
  font-size: 68px;
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: -2.58px;
  max-width: 15ch;
  text-wrap: balance;
}

.hero .lede {
  margin: 20px 0 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--on-accent-dim);
  max-width: 52ch;
  text-wrap: pretty;
}

.store-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-button);
  padding: 15px 22px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.store-button svg {
  flex: none;
  display: block;
}

.store-button.primary {
  background: var(--on-accent);
  color: var(--accent);
}

.store-button.primary:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.store-button.secondary {
  background: transparent;
  color: var(--on-accent);
  border-color: var(--on-accent-line);
}

.store-button.secondary:hover {
  border-color: var(--on-accent);
  color: var(--on-accent);
}

.badge {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 8px 17px;
  font-size: 13px;
  font-weight: 700;
}

.hero img {
  display: block;
  width: 392px;
  height: auto;
  margin: 52px 0 0;
}

/* ---------------------------------------------------------------- sections */

.section {
  max-width: var(--column);
  margin: 0 auto;
  padding: 96px var(--gutter) 0;
}

.section.tight {
  padding-top: 56px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split .copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -1.33px;
  text-wrap: balance;
}

.split p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

.shot {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 34px 0 0;
}

.shot img {
  display: block;
  width: 296px;
  height: auto;
  margin-bottom: -6px;
}

/* ------------------------------------------------------------------- tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tile {
  background: var(--surface-raised);
  border-radius: var(--radius-tile);
  padding: 24px;
}

.tile-key {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.26px;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.tile h3 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.tile p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

/* ------------------------------------------------------------------ notice */

/* The one place the warning colour appears, for the one thing it means here:
   this app is not for navigation. Reserved elsewhere (DESIGN-BRIEF §3.1). */
.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice .eyebrow {
  color: var(--warning);
  letter-spacing: 1.21px;
}

.notice .headline {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.38px;
}

.notice p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
  max-width: 74ch;
  text-wrap: pretty;
}

.notice a {
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 2px;
}

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

.cta {
  border-radius: 18px;
  padding: 52px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cta h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -1.19px;
}

.cta p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--on-accent-dim);
}

.cta .copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ----------------------------------------------------------------- contact */

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.contact-block h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.78px;
}

.contact-block p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-secondary);
  max-width: 56ch;
}

.contact-block .email {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}

/* ---------------------------------------------------------- document pages */

/*
 * /legal, /privacy and /support are documents rather than marketing: a single
 * narrower column, and prose set larger than the home page's body copy because
 * these are read start to finish rather than scanned.
 */
.doc {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 72px var(--gutter) 0;
  width: 100%;
}

.doc h1 {
  margin: 14px 0 0;
  font-size: 46px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1.75px;
  text-wrap: balance;
}

.doc .updated {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.doc-sections {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 38px;
}

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

.doc-section .eyebrow {
  letter-spacing: 1.21px;
}

.doc-section h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.72px;
}

.doc-section h3 {
  margin: 10px 0 0;
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.37px;
}

.doc p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

.doc p.strong {
  color: var(--ink);
  font-weight: 600;
}

.doc p.dim {
  color: var(--muted);
}

.doc ul {
  margin: 0;
  padding-left: 22px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.doc li {
  margin-bottom: 8px;
}

.doc strong {
  color: var(--ink);
  font-weight: 700;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--surface-sunken);
  border-radius: 5px;
  padding: 1px 5px;
}

.doc .links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  align-items: flex-start;
}

.doc .links a,
.doc .email a,
.doc a.standalone {
  font-size: 16px;
  font-weight: 700;
}

.doc .email {
  font-size: 16.5px;
  font-weight: 700;
}

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

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border-soft);
}

.site-footer > div {
  max-width: var(--column);
  margin: 0 auto;
  padding: 36px var(--gutter) 56px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-footer .brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer .brand .wordmark {
  font-size: 15px;
  letter-spacing: -0.6px;
}

.site-footer .tagline {
  font-size: 12.5px;
  color: var(--muted);
}

.footer-columns {
  display: flex;
  gap: 44px;
  flex-wrap: wrap;
}

.footer-columns > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-columns .tile-key {
  color: var(--muted-soft);
}

.footer-columns a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.footer-columns a:hover {
  color: var(--accent);
}

.copyright {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------- narrow view */

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  /* The screenshot leads on a phone; source order puts it second in the
     second band, which would otherwise read as a caption under its own copy. */
  .split.reversed .shot {
    order: -1;
  }

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

  .hero h1 {
    font-size: 46px;
    letter-spacing: -1.75px;
  }

  .doc h1 {
    font-size: 36px;
    letter-spacing: -1.37px;
  }

  .section {
    padding-top: 72px;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 22px;
  }

  body {
    font-size: 16px;
  }

  /* The wordmark holds its size; the nav gives up the room instead. Support
     drops out — it is one tap away in the footer of every page. */
  .site-header nav {
    gap: 16px;
  }

  .site-header nav a[href='/support'] {
    display: none;
  }

  .site-header nav a {
    font-size: 13.5px;
  }

  .hero {
    padding-top: 60px;
  }

  .hero h1 {
    font-size: 37px;
    letter-spacing: -1.4px;
  }

  .hero .lede {
    font-size: 17px;
  }

  .hero img {
    width: 300px;
    margin-top: 40px;
  }

  .split h2 {
    font-size: 30px;
    letter-spacing: -1.05px;
  }

  .cta {
    padding: 34px 26px;
  }

  .cta h2 {
    font-size: 27px;
    letter-spacing: -0.95px;
  }

  .doc {
    padding-top: 52px;
  }

  .doc h1 {
    font-size: 30px;
    letter-spacing: -1.14px;
  }

  .doc p,
  .doc ul {
    font-size: 16px;
  }

  .store-button {
    flex: 1;
    justify-content: center;
  }
}
