:root {
  /* The brand palette (coff-designs/color-palette-coff.pdf). Every colour on
     the site comes from these, plus white for cards and --flow, the pale
     blue of the brand's background flows. No gradients anywhere. */
  --navy: #173f62;
  --charcoal: #2c3639;
  --blue: #218dbc;
  --cream: #fffaf3;
  --slate: #3f4e4f;
  --taupe: #736a5b;
  --sand: #f3e7d8;
  --white: #ffffff;
  --flow: #dde9ea;
  /* App state colours (DesignSystem.swift), only for success and error messages. */
  --success: #2e7d55;
  --error: #b3261e;
  /* The home tour's phone hardware: black like a real phone, not a palette colour. */
  --bezel: #000000;
  --bezel-rim: #2a2a2a;

  /* Roles */
  --ink: var(--charcoal);
  --ink-soft: var(--slate);
  --muted: var(--taupe);
  --paper: var(--white);
  --line: var(--sand);
  --line-strong: #cdc2b3; /* sand 70% + taupe 30% */
  --coffee: var(--navy);
  --coffee-deep: var(--charcoal);
  --caramel: var(--taupe);
  --cyan: var(--blue);
  --rose: var(--error);
  --surface-soft: var(--sand);
  --cyan-deep: var(--navy);
  --coffee-press: var(--charcoal);
  --footer-surface: var(--charcoal);
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-soft: 0 1px 2px rgba(44, 54, 57, 0.04), 0 12px 32px rgba(44, 54, 57, 0.06);
  --shadow: 0 2px 6px rgba(44, 54, 57, 0.05), 0 24px 60px rgba(44, 54, 57, 0.10);
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-x: none;
  /* Only seen when the page is pulled past its ends (rubber-band scroll):
     cream above, the charcoal footer below. Two flat halves, not a blend. */
  background: linear-gradient(var(--cream) 50%, var(--charcoal) 50%);
}

section[id] {
  scroll-margin-top: 84px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  /* Transparent: the cream ground is on html, so the flows below show. */
  background: transparent;
  overflow-x: clip;
}

/* The brand's background flows (traced from the coff. poster, without the
   wordmark) sit behind every page, fixed to the window like a backdrop. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  /* The largest viewport height, so the flows don't rescale while mobile
     toolbars show and hide. The flow colour is #dde9ea at 60% on cream. */
  height: 100vh;
  height: 100lvh;
  background: var(--cream) url("/assets/img/flow-v2.svg") center / cover no-repeat;
  pointer-events: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 999px;
  color: white;
  background: var(--coffee-deep);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #ffffff;
  background: var(--coffee-deep);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(44, 54, 57, 0.18);
}

.button.secondary {
  color: var(--coffee-deep);
  background: var(--white);
  border-color: var(--line);
  box-shadow: none;
}

.button {
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(44, 54, 57, 0.20);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px -10px;
  padding-left: 10px;
  color: var(--coffee);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 7px rgba(33, 141, 188, 0.13);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 650px;
  margin-bottom: clamp(16px, 2.2dvh, 24px);
  font-size: clamp(3.15rem, 5.9vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(22px, 3dvh, 30px);
}

.section-heading h2,
.legal-title h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 4.4vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.section-heading p,
.legal-title p {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
}

.story-media,
.story-copy,
.safety-panel,
.coming-card,
.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 20px 80px rgba(44, 54, 57, 0.08);
}

@media (max-width: 720px) {
  h1 {
    font-size: clamp(2.48rem, 11.7vw, 3.5rem);
    line-height: 0.98;
  }
}

@media (min-width: 981px) and (max-height: 820px) {
  .eyebrow {
    margin-bottom: 14px;
  }

  h1 {
    max-width: 590px;
    font-size: clamp(3rem, 5vw, 5.5rem);
  }

  .hero-actions {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══ Focus, buttons, hero motion, FAQ ═══ */

/* ── Focus visibility (keyboard users) ── */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.button:focus-visible {
  outline-offset: 4px;
}

/* ── Buttons: tactile press ── */
.button:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 10px 24px rgba(44, 54, 57, 0.16);
}

/* ── Reveal stagger ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    transition-delay: var(--reveal-delay, 0s);
  }
}

/* ═══ Site chrome: header and footer ═══
   One header and one footer on every page (tools/website/sync-chrome.mjs
   writes the markup). Flat surfaces like the app's top bar and tab bar:
   cream header, charcoal footer, no blur, glow or gradient. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.nav {
  position: relative;
  width: min(1160px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--coffee);
  background: var(--surface-soft);
}

.nav-links .nav-lang {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
}

.nav-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-cta {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--coffee);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--coffee-press);
}

.nav-cta:active {
  transform: scale(0.97);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.site-footer {
  padding-bottom: env(safe-area-inset-bottom);
  color: rgba(255, 255, 255, 0.92);
  background: var(--footer-surface);
  /* Pulled past the bottom (iOS, trackpads), the fixed cream backdrop would
     show under the footer. This shadow paints one more screen of footer
     colour below it; a shadow adds no scroll height. */
  box-shadow: 0 100vh 0 100vh var(--footer-surface);
}

.footer-inner {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0 40px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
  gap: 48px;
}

.footer-brand {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
}

.footer-brand .brand {
  color: #ffffff;
}

.footer-brand p {
  margin: 0;
  max-width: 26ch;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.96rem;
  line-height: 1.55;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-group {
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: start;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.93rem;
}

.footer-group-title {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
}

.footer-group a {
  min-height: 36px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.16s ease;
}

.footer-group a:hover,
.footer-group a:focus-visible {
  color: #ffffff;
}

.footer-base {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.85rem;
}

.footer-base .lang-switch {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.footer-base .lang-switch:hover,
.footer-base .lang-switch:focus-visible {
  color: #ffffff;
}

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

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: -18px;
    right: -18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 18px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--cream);
    box-shadow: 0 12px 24px rgba(44, 54, 57, 0.06);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  .nav-links a {
    min-height: 48px;
    padding: 0 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible,
  .nav-links a.active,
  .nav-links a[aria-current="page"] {
    background: transparent;
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-links .nav-lang {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }

  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 400px) {
  .nav {
    gap: 12px;
  }

  .nav-cta {
    display: none;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .nav-links,
  .nav-links a,
  .nav-cta,
  .nav-toggle span,
  .footer-group a {
    transition: none;
  }
}

.ph-head-title {
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
}

.ph-head-title b {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 750;
}

.ph-head-title b::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--cyan);
}

.ph-head-title small {
  padding-left: 28px;
  font-size: 12px;
  opacity: 0.78;
}
