/*
  Sawce website styles.
  Colour values mirror DesignSystem.Colors in ios/Shared/DesignSystem.swift.
  Change them there first, then here. No other colours are used on the site.
*/

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque-subset.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Cream */
  --cream: #F6E9D2;
  --paper: #FFF8EC;
  --print: #FFFFFF;
  /* Aubergine */
  --ink: #3A1020;
  --ink-muted: #6E4A5A;
  --hairline: rgb(58 16 32 / 0.12);
  --ink-fixed: #2A0A14;
  /* Chili red: identical in both themes */
  --sawce: #E8432B;
  --sawce-deep: #C2321D;
  --sawce-ink: #B3311B;
  --on-sawce: #FFF1DC;
  /* Mango: the spark */
  --mango: #FFB23F;

  --font-display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-xxl: 72px;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --measure: 64ch;
  --page: 1120px;
  --gutter: 16px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #170A0F;
    --paper: #24131A;
    --print: #F4ECDD;
    --ink: #FFF1DC;
    --ink-muted: #CDB8A4;
    --hairline: rgb(255 241 220 / 0.12);
    --sawce-ink: #FF8A70;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sawce-ink); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--mango);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--cream);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip:focus { top: var(--space-sm); }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 var(--space-md); text-wrap: pretty; }

/* ---------- Header ---------- */

.site-header {
  padding: var(--space-md) 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: inherit;
  text-decoration: none;
}
.lockup svg { width: 23px; height: 28px; flex: none; }
/* SawceMark: red on light grounds; cream pin with a mango drop on red. */
.mark-pin { fill: var(--mark-pin, var(--sawce)); }
.mark-drop { fill: var(--mark-drop, var(--sawce)); }
.on-red { --mark-pin: var(--on-sawce); --mark-drop: var(--mango); }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.045em;
  line-height: 1;
}
.nav {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
}
.nav a:hover { background: var(--hairline); }
.nav a[aria-current="page"] { box-shadow: inset 0 0 0 1.5px currentColor; }
@media (max-width: 480px) {
  .nav a { padding: var(--space-sm); font-size: 0.9rem; }
  .nav .nav-hide-sm { display: none; }
}

/* The red sheet: the brand ground. Only large text sits on it in cream; small text is ink-fixed. */
.on-red {
  background: var(--sawce);
  color: var(--on-sawce);
}
.on-red .site-header .nav a { color: var(--ink-fixed); }
.on-red .site-header .nav a:hover { background: rgb(42 10 20 / 0.1); }
.on-red .lockup { color: var(--on-sawce); }
.on-red :focus-visible { outline-color: var(--ink-fixed); }

/* ---------- Hero ---------- */

.hero {
  padding-bottom: var(--space-xxl);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
  padding-top: var(--space-lg);
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; padding-top: var(--space-xl); }
}
.hero h1 {
  font-size: clamp(2.6rem, 8.5vw, 5.4rem);
  color: var(--on-sawce);
}
.hero .lede {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--ink-fixed);
  max-width: 34ch;
  margin-top: var(--space-lg);
  font-weight: 500;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  align-items: center;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 52px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.button-primary { background: var(--ink-fixed); color: var(--on-sawce); }
.button-primary:hover { background: #000; text-decoration: none; }
.button-quiet { background: transparent; color: var(--ink-fixed); box-shadow: inset 0 0 0 1.5px var(--ink-fixed); }
.button-quiet:hover { background: rgb(42 10 20 / 0.08); }
.button-red { background: var(--sawce-deep); color: var(--on-sawce); }
.button-red:hover { background: var(--sawce-ink); }
.button svg { width: 20px; height: 20px; flex: none; }
.cta-note {
  font-size: 0.9rem;
  color: var(--ink-fixed);
  margin: var(--space-sm) 0 0;
}

/* Phone frame around Simulator screenshots */
.phone-stage {
  position: relative;
  justify-self: center;
  width: min(320px, 78vw);
}
.phone {
  position: relative;
  border-radius: 46px;
  padding: 10px;
  background: var(--ink-fixed);
  box-shadow: 0 30px 60px -20px rgb(42 10 20 / 0.55);
}
.phone img {
  border-radius: 37px;
  width: 100%;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  background: var(--paper);
}

/* The mango sticker: one per page, never a button or a state. */
.sticker {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink-fixed);
  background: var(--mango);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  transform: rotate(-8deg);
  box-shadow: 0 6px 14px -6px rgb(42 10 20 / 0.45);
  white-space: nowrap;
}
.phone-stage .sticker { top: 14%; left: -14%; z-index: 1; }
@media (max-width: 480px) { .phone-stage .sticker { left: -6%; } }
@media (prefers-reduced-motion: no-preference) {
  .sticker { animation: slap 520ms cubic-bezier(.2, 1.4, .4, 1) 500ms both; }
  @keyframes slap {
    from { transform: rotate(0deg) scale(1.6); opacity: 0; }
    to { transform: rotate(-8deg) scale(1); opacity: 1; }
  }
}

/* ---------- Sections ---------- */

.section { padding: var(--space-xxl) 0; }
.section + .section { padding-top: 0; }
.eyebrow {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sawce-ink);
  margin-bottom: var(--space-sm);
}
.section h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: var(--space-md); }
.section-intro { color: var(--ink-muted); max-width: 52ch; font-size: 1.1rem; }

.steps {
  list-style: none;
  padding: 0;
  margin: var(--space-xl) 0 0;
  display: grid;
  gap: var(--space-md);
  counter-reset: step;
}
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: inset 0 0 0 1px var(--hairline);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sawce-deep);
  color: var(--on-sawce);
  font-family: var(--font-display);
  font-weight: 800;
  margin-bottom: var(--space-md);
}
.step h3 { font-size: 1.45rem; margin-bottom: var(--space-sm); }
.step p { color: var(--ink-muted); margin: 0; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
}
.platforms li {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--hairline);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--paper);
}

.shots {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--space-xl);
}
.shot { margin: 0; }
.shot .phone { padding: 8px; border-radius: 40px; box-shadow: 0 18px 40px -22px rgb(42 10 20 / 0.5); }
.shot .phone img { border-radius: 32px; }
.shot figcaption { margin-top: var(--space-md); color: var(--ink-muted); font-size: 0.97rem; }
.shot figcaption strong { color: var(--ink); display: block; font-size: 1.05rem; }

.features {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.feature h3 { font-size: 1.3rem; margin-bottom: var(--space-sm); }
.feature p { margin: 0; color: var(--ink-muted); }

.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}
@media (min-width: 820px) { .callout { grid-template-columns: 1fr auto; padding: var(--space-xl); } }
.callout h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin-bottom: var(--space-sm); color: var(--on-sawce); }
.callout p { color: var(--ink-fixed); margin: 0; max-width: 46ch; font-weight: 500; }

/* ---------- Document pages (privacy, support) ---------- */

.doc-hero { padding-top: var(--space-xl); padding-bottom: var(--space-xxl); }
.doc-hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); color: var(--on-sawce); }
.doc-hero p { color: var(--ink-fixed); font-size: 1.15rem; max-width: 46ch; margin-top: var(--space-md); font-weight: 500; }

.doc {
  max-width: var(--measure);
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xxl);
}
.doc h2 { font-size: 1.8rem; margin: var(--space-xl) 0 var(--space-md); }
.doc h3 { font-size: 1.25rem; margin: var(--space-lg) 0 var(--space-sm); }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 var(--space-md); }
.doc li { margin-bottom: var(--space-sm); }
.doc .meta { color: var(--ink-muted); font-size: 0.95rem; }

.summary {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: inset 0 0 0 1px var(--hairline);
  margin-bottom: var(--space-lg);
}
.summary ul { margin: 0; }

.table-scroll { overflow-x: auto; margin: 0 0 var(--space-md); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; border-bottom: 1px solid var(--hairline); }
th { font-weight: 700; }
/* On phones each row becomes a small card, so the "How long" column is never scrolled out of view. */
@media (max-width: 600px) {
  table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, td { display: block; }
  tr { padding: var(--space-sm) 0; border-bottom: 1px solid var(--hairline); }
  td { border: 0; padding: var(--space-xs) 0; }
  td::before { content: attr(data-label); display: block; font-weight: 700; font-size: 0.85rem; color: var(--ink-muted); }
}

/* Owner to-dos: visible on purpose until they are resolved. Search the source for "TODO(owner)". */
.todo {
  background: var(--hairline);
  border-left: 4px solid var(--mango);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  font-size: 0.95em;
}

details.faq {
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-md) 0;
}
details.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--font-display); font-weight: 800; color: var(--sawce-ink); }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding-top: var(--space-sm); color: var(--ink-muted); }
details.faq > div p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-xl) 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.site-footer a { color: inherit; }
.site-footer .lockup svg { width: 18px; height: 22px; }
.site-footer .wordmark { font-size: 1.25rem; color: var(--ink); }

/* Prelaunch page: uses the same brand tokens and wordmark as the full site. */
.coming-soon { min-height: 100svh; display: flex; flex-direction: column; }
.coming-soon-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-xxl); }
.coming-soon-main h1 { font-size: clamp(2.6rem, 7.5vw, 5.4rem); max-width: 17ch; }
.coming-soon-description { color: var(--ink-fixed); max-width: 41ch; font-size: clamp(1.1rem, 2vw, 1.3rem); margin-top: var(--space-lg); }
.coming-soon-status { color: var(--ink-fixed); font-weight: 700; margin-top: var(--space-lg); }
.coming-soon-footer { color: var(--ink-fixed); font-size: 0.9rem; padding-bottom: var(--space-lg); }
