/* subtrack website · Mood A tokens mirrored from app/src/theme/tokens.ts */

:root {
  --paper: #FFF4E0;
  --paper-2: #FBE7C6;
  --surface: #FFFFFF;
  --ink: #1E1712;
  --ink-soft: #6B5E52;
  --line: #1E1712;
  --shadow: #1E1712;
  --solid: #1E1712;
  --sun: #FFD23F;
  --tomato: #FF5A36;
  --tomato-soft: #FFE1D9;
  --mint: #3DDC97;
  --sky: #5BC0EB;
  --bubble: #FF9EC7;
  --on-accent: #1E1712;
  --cream: #FFF4E0;

  --font-display: "Nunito", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --bw: 2px;
  --offset: 4px;
  --gutter: 20px;
  color-scheme: light dark;

  /* Motion, from app/src/theme/tokens.ts */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-press: 120ms;
  --t-base: 200ms;
  --t-surface: 360ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121214;
    --paper-2: #26262B;
    --surface: #1C1C1F;
    --ink: #F5F5F2;
    --ink-soft: #C2C2CA;
    --line: #3A3A40;
    --shadow: #000000;
    --solid: #0B0B0D;
    --tomato-soft: #3A1F1F;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 900; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip {
  position: absolute; left: var(--gutter); top: -48px;
  padding: 8px 14px; background: var(--sun); color: var(--on-accent);
  border: var(--bw) solid var(--line); border-radius: 999px; font-weight: 800;
}
.skip:focus { top: 12px; z-index: 10; }

/* Containers */
.nav, .hero, .section, .footer { padding-left: var(--gutter); padding-right: var(--gutter); }
.nav, .hero, .section { max-width: 1440px; margin-left: auto; margin-right: auto; }

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.logo img { width: 32px; height: 32px; }
.nav-right { display: flex; align-items: center; gap: 28px; font-weight: 800; font-size: 15px; }
.nav-right a { display: none; }
.nav-right a:hover { text-decoration: underline; text-underline-offset: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-weight: 800; font-size: 13px;
}
.chip-android { background: var(--paper-2); }
.chip-android svg { font-size: 15px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-display); font-weight: 900; font-size: 19px;
  padding: 18px 28px; border-radius: 999px;
  border: var(--bw) solid var(--line);
  box-shadow: 0 var(--offset) 0 var(--shadow);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { font-size: 22px; flex: none; }
.btn:active { transform: translateY(var(--offset)); box-shadow: 0 0 0 var(--shadow); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.btn-sun { background: var(--sun); color: var(--on-accent); border-color: #1E1712; }
.btn-ink { background: var(--solid); color: var(--cream); border-color: var(--line); }

.small { font-size: 14px; color: var(--ink-soft); }

/* Hero */
.hero {
  display: grid; gap: 40px;
  padding-top: 24px; padding-bottom: 56px;
}
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: clamp(42px, 9vw, 76px); line-height: 0.98; letter-spacing: -0.02em; }
.lede { font-size: 17px; color: var(--ink-soft); max-width: 600px; }
.cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cta .btn { width: 100%; }
.cta .small { text-align: center; }

.hero-phone { position: relative; display: flex; justify-content: center; padding-top: 8px; }
.hero-phone .shot {
  width: 280px; height: 420px; object-fit: cover; object-position: top;
  border-radius: 36px 36px 0 0; border: 3px solid var(--line); border-bottom: 0;
}
.sticker {
  display: none; position: absolute; left: 0; top: 74%;
  align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 var(--offset) 0 var(--shadow); transform: rotate(-4deg);
}
.sticker img { width: 40px; height: 40px; border-radius: var(--r-sm); border: var(--bw) solid var(--line); }
.sticker div { display: flex; flex-direction: column; gap: 2px; font-weight: 800; }
.sticker strong { font-size: 16px; }
.sticker span { font-size: 13px; color: var(--tomato); }

/* Sections */
.section { padding-bottom: 56px; }
.section h2 { font-size: clamp(30px, 5vw, 48px); line-height: 1.05; margin-bottom: 20px; }
.section .h3 { font-size: clamp(24px, 3vw, 32px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.section-head h2 { margin-bottom: 0; }
.section-head p { color: var(--ink-soft); font-size: 17px; }

.features { display: grid; gap: 14px; }
.card {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start;
  padding: 18px; background: var(--surface);
  border: var(--bw) solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 var(--offset) 0 var(--shadow);
}
.card h3 { font-size: 19px; }
.card p { grid-column: 2; font-size: 14px; color: var(--ink-soft); }
.icon-chip {
  grid-row: 1 / span 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--chip); color: #1E1712; border: var(--bw) solid #1E1712;
}
.icon-chip svg { font-size: 22px; }

/* Privacy poster: fixed ink in both modes */
.poster {
  display: grid; gap: 24px;
  padding: 28px; background: #1E1712; color: #FFF4E0;
  border: var(--bw) solid var(--line); border-radius: var(--r-lg);
}
.poster h2 { color: #FFF4E0; font-size: clamp(34px, 5vw, 56px); margin-bottom: 8px; }
.poster-copy p { color: #FFF4E0B3; font-size: 17px; }
.poster-list { display: flex; flex-direction: column; gap: 20px; }
.poster-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; }
.poster-list svg { flex: none; font-size: 24px; color: var(--sun); margin-top: 1px; }

/* Screens */
.screens-section { padding-left: 0; padding-right: 0; }
.screens-section .section-head { padding: 0 var(--gutter); }
.screens {
  display: flex; gap: 16px; padding: 4px var(--gutter) 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screens figure { margin: 0; flex: none; scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
.screens .shot {
  width: 220px; height: 452px; object-fit: cover; object-position: top;
  border: 2.5px solid var(--line); border-radius: 30px;
  box-shadow: 0 var(--offset) 0 var(--shadow);
}
.screens figcaption { display: flex; flex-direction: column; gap: 2px; }
.screens figcaption strong { font-family: var(--font-display); font-weight: 900; font-size: 17px; }
.screens figcaption span { font-size: 13px; color: var(--ink-soft); }

/* Senders */
.senders h2 { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips .chip {
  padding: 7px 12px 7px 7px; gap: 8px;
  background: var(--surface); border: var(--bw) solid var(--line);
}
.chips img, .dot { width: 24px; height: 24px; border-radius: 999px; border: 1.5px solid var(--line); object-fit: cover; }
.dot { display: inline-flex; align-items: center; justify-content: center; background: var(--paper-2); color: var(--ink); }
.dot svg { font-size: 13px; }
.dot-mail { background: var(--tomato-soft); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-md);
  padding: 0 18px;
}
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; font-family: var(--font-display); font-weight: 900; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg); transition: transform 160ms var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); max-width: 880px; }
.faq summary:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }

/* Footer */
.footer {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding-top: 40px; padding-bottom: 40px; background: var(--paper-2); text-align: center;
}
.footer .mascot { width: 120px; height: 120px; }
.footer h2 { font-size: clamp(40px, 6vw, 56px); }
.footer .btn { width: 100%; max-width: 420px; }
.footer .small { font-size: 13px; }
.footer .sha { font-size: 12px; word-break: break-all; max-width: 560px; opacity: .8; }
.footer .sha code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Desktop */
@media (min-width: 760px) {
  :root { --gutter: 40px; }
  .nav { padding-top: 24px; padding-bottom: 24px; }
  .logo { font-size: 26px; }
  .logo img { width: 40px; height: 40px; }
  .nav-right a { display: inline; }
  .btn { font-size: 22px; padding: 20px 34px; }
  .btn svg { font-size: 26px; }
  .btn-sun { box-shadow: 0 6px 0 var(--shadow); }
  .btn-sun:active { box-shadow: 0 0 0 var(--shadow); transform: translateY(6px); }

  .hero { grid-template-columns: 1fr auto; align-items: center; gap: 72px; padding-top: 56px; padding-bottom: 104px; }
  .lede { font-size: 22px; line-height: 1.4; }
  .cta { align-items: flex-start; gap: 14px; }
  .cta .btn { width: auto; }
  .cta .small { text-align: left; font-size: 15px; }
  .hero-phone { width: 420px; height: 760px; justify-content: flex-end; padding: 0; }
  .hero-phone .shot {
    width: 360px; height: 740px; border-radius: 44px; border: 3px solid var(--line);
    box-shadow: 0 8px 0 var(--shadow);
  }
  .sticker { display: flex; }

  .section { padding-bottom: 112px; }
  .section h2 { margin-bottom: 40px; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .card { grid-template-columns: 1fr; gap: 18px; padding: 28px; border-radius: var(--r-lg); }
  .card h3 { font-size: 24px; }
  .card p { grid-column: 1; font-size: 16px; }
  .icon-chip { grid-row: auto; width: 52px; height: 52px; }
  .icon-chip svg { font-size: 26px; }

  .poster { grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; padding: 64px; }
  .poster-list { gap: 24px; }
  .poster-list li { font-size: 18px; gap: 18px; }
  .poster-list svg { font-size: 28px; }

  .screens-section { padding-left: var(--gutter); padding-right: var(--gutter); }
  .screens-section .section-head { padding: 0; margin-bottom: 40px; }
  .screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 0; overflow: visible; }
  .screens figure { align-items: center; gap: 20px; }
  .screens .shot { width: 320px; height: 660px; border-radius: 40px; border-width: 3px; box-shadow: 0 6px 0 var(--shadow); }
  .screens figcaption { align-items: center; gap: 4px; }
  .screens figcaption strong { font-size: 22px; }
  .screens figcaption span { font-size: 15px; }

  .chips { gap: 14px; }
  .chips .chip { padding: 10px 18px 10px 10px; gap: 12px; font-size: 15px; }
  .chips img, .dot { width: 30px; height: 30px; }
  .dot svg { font-size: 16px; }

  .faq { gap: 14px; }
  .faq details { padding: 0 28px; }
  .faq summary { padding: 24px 0; font-size: 22px; }
  .faq details p { font-size: 17px; padding-bottom: 24px; }

  .footer { padding-top: 64px; padding-bottom: 56px; gap: 24px; }
  .footer .mascot { width: 150px; height: 150px; }
  .footer .btn { width: auto; font-size: 20px; padding: 18px 30px; }
  .footer .small { font-size: 14px; }
}

@media (min-width: 1100px) {
  :root { --gutter: 80px; }
  .features { grid-template-columns: repeat(4, 1fr); }
}

/* Motion
   Hero: enters once on load, 60ms stagger, the sticker pops in last.
   Sections: reveal once when scrolled into view (IntersectionObserver adds .is-in).
   FAQ: the answer fades up when a row opens.
   Reduced motion: opacity only, no travel. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: rotate(-4deg) scale(0.6); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
@keyframes answer { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hero h1, .hero .lede, .hero .cta, .hero-phone picture {
  animation: rise var(--t-surface) var(--ease-out) both;
}
.hero .lede { animation-delay: 60ms; }
.hero .cta { animation-delay: 120ms; }
.hero-phone picture { animation-delay: 160ms; animation-duration: 480ms; }
.sticker { animation: pop 420ms var(--ease-pop) 520ms both; }

[data-reveal] { opacity: 0; transform: translateY(16px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity var(--t-surface) var(--ease-out), transform var(--t-surface) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.no-observer [data-reveal] { opacity: 1; transform: none; }

.faq details[open] > p { animation: answer var(--t-base) var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after { transition: none; }
  .hero h1, .hero .lede, .hero .cta, .hero-phone picture, .sticker, .faq details[open] > p {
    animation-name: fade; animation-duration: 160ms; animation-delay: 0ms;
  }
  .sticker { transform: rotate(-4deg); }
  [data-reveal] { transform: none; }
  [data-reveal].is-in { transition: opacity 160ms ease-out; transition-delay: 0ms; }
}
