/*
 * Chief Aim marketing site — same design system as the app, translated to web.
 *
 * Palette is exactly the app's four colors (soft blue / sage / charcoal /
 * white); every other shade is an opacity tint of those four, never a new
 * color. Two faces, two voices: Fraunces is the site's voice (all chrome),
 * Space Grotesk is the words — the aim itself and every button label, same
 * as in the app. Chevrons are the logo's chevron geometry, never glyphs.
 */

:root {
  --blue: #4a90e2;
  --sage: #8bcf9c;
  --ink: #333333;
  --surface: #ffffff;

  --ink-dim: rgba(51, 51, 51, 0.6);
  --ink-faint: rgba(51, 51, 51, 0.4);
  --line: rgba(51, 51, 51, 0.12);
  --blue-tint: rgba(74, 144, 226, 0.08);
  --blue-track: rgba(74, 144, 226, 0.15);
  --blue-wash: rgba(74, 144, 226, 0.05);
  --sage-tint: rgba(139, 207, 156, 0.2);
  --sage-deep: #3e7a4e;
  --on-blue: #ffffff;
  --on-blue-dim: rgba(255, 255, 255, 0.86);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Chrome is the OS system font, matching the app (reverted from Fraunces). */
  --f-chrome: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-words: 'Space Grotesk', system-ui, sans-serif;

  --container: 1120px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--f-chrome);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

img,
svg {
  display: block;
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.logo svg {
  width: 24px;
  height: 27px;
}

/* The wordmark is part of the LOGO, not chrome text — never Fraunces, never
   Space Grotesk. Matched EXACTLY to the live app's Lockup (src/components/
   brand.tsx, measured from the running app): the platform system stack,
   weight 600, uppercase, 0.357em tracking (5px on the app's 14px cap). The
   OS picks the face — SF Pro on Apple, Segoe UI on Windows, Roboto on
   Android — same as the app. */
.wordmark {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.357em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav-links a {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.nav-links a:hover {
  color: var(--blue);
}

/* Buttons speak the app's box language: hairline border + tint, words font.
   No solid pills — the box whose answer is "go". */
.box-btn {
  display: inline-block;
  font-family: var(--f-words);
  font-size: 15px;
  color: var(--blue);
  background: var(--blue-tint);
  border: 1px solid var(--blue);
  border-radius: var(--r-md);
  padding: 10px 20px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.box-btn:hover {
  opacity: 0.85;
  transform: scale(0.98);
}

.nav .box-btn {
  padding: 8px 16px;
  font-size: 14px;
}

/* On blue ground the box goes white-filled, blue words — same shape. */
.box-btn.on-blue {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--blue);
}

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

.hero {
  background: var(--blue);
  color: var(--on-blue);
  overflow: visible;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 48px;
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero .sub {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--on-blue-dim);
  max-width: 52ch;
}

.badges {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* Store badges — dark like the app's drawn bezel, store name in the words
   font (a badge is a button). */
.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-sm);
  padding: 9px 18px 9px 14px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.badge:hover {
  opacity: 0.9;
  transform: scale(0.98);
}

.badge svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.badge .lines {
  line-height: 1.15;
}

.badge .tiny {
  font-family: var(--f-chrome);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
}

.badge .store {
  font-family: var(--f-words);
  font-size: 16px;
}

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

.phones {
  position: relative;
  height: 560px;
  transform: translateY(84px);
}

.phone {
  background: var(--ink);
  border-radius: 44px;
  padding: 11px;
  box-shadow: 0 24px 60px rgba(51, 51, 51, 0.28);
}

.phone .screen {
  position: relative;
  background: var(--surface);
  border-radius: 34px;
  overflow: hidden;
  height: 100%;
}

.phone .island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--ink);
}

.phone .home-bar {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--ink);
  opacity: 0.35;
}

.phone.front {
  position: absolute;
  right: 0;
  top: 0;
  width: 290px;
  height: 628px;
  z-index: 2;
}

.phone.back {
  position: absolute;
  right: 218px;
  top: 44px;
  width: 252px;
  height: 545px;
  transform: rotate(-6deg);
  z-index: 1;
}

/* Screen mock — the home screen, in the app's real tokens. */

.mock {
  padding: 40px 16px 18px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* The home mock fills the screen like the real one — button rides low. */
.phone.front .mock .mock-btn {
  margin-top: auto;
}

.mock .time {
  position: absolute;
  top: 10px;
  left: 22px;
  font-weight: 600;
  font-size: 12px;
}

.mock h3 {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.mock .date {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.mock .card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px;
  margin-top: 12px;
}

.mock .card-label {
  font-weight: 600;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.mock .aim {
  font-family: var(--f-words);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 6px;
}

.mock .ritual-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-top: 8px;
}

.mock .ritual-row b {
  font-weight: 600;
  font-size: 12px;
  display: block;
}

.mock .ritual-row span {
  font-size: 9.5px;
  color: var(--ink-dim);
}

.chip {
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  white-space: nowrap;
}

.chip.done {
  background: var(--sage-tint);
  color: var(--sage-deep);
}

.chip.next {
  background: var(--blue-tint);
  color: var(--blue);
}

.mock .stats {
  display: flex;
  margin-top: 14px;
}

.mock .stat {
  flex: 1;
  text-align: center;
}

.mock .stat b {
  display: block;
  font-weight: 600;
  font-size: 17px;
}

.mock .stat span {
  font-size: 8.5px;
  color: var(--ink-dim);
}

.mock .mock-btn {
  font-family: var(--f-words);
  font-size: 11.5px;
  color: var(--blue);
  background: var(--blue-tint);
  border: 1px solid var(--blue);
  border-radius: 14px;
  text-align: center;
  padding: 10px;
  margin-top: 14px;
}

.mock .week-label {
  font-weight: 600;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-top: 16px;
}

.mock .week {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}

.mock .week i {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 8.5px;
  color: var(--ink-faint);
}

.mock .week i.done {
  background: var(--sage-tint);
  border-color: transparent;
  color: var(--sage-deep);
  font-weight: 600;
}

.mock .week i.today {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

/* Back phone — the welcome screen. */

.mock.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 64px;
}

.mock.welcome svg {
  width: 30px;
  height: 33px;
}

.mock.welcome .wordmark {
  font-size: 8.5px;
  letter-spacing: 0.357em;
  margin-top: 8px;
}

.mock.welcome h3 {
  font-size: 16.5px;
  line-height: 1.25;
  margin-top: 18px;
  max-width: 12ch;
}

.mock.welcome .bar {
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  margin-top: 10px;
}

.mock.welcome p {
  font-size: 9.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-top: 10px;
  max-width: 24ch;
}

.mock.welcome .mock-btn {
  width: 82%;
  margin-top: 18px;
}

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

section {
  padding: 88px 0;
}

.section-head {
  max-width: 60ch;
  margin: 0 auto 48px;
  text-align: center;
}

.eyebrow {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

h2 {
  font-weight: 700;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.2;
  margin-top: 10px;
  text-wrap: balance;
}

.section-head p {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--ink-dim);
}

/* Features — the 4-up row under the hero. */

.features {
  padding-top: 176px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.feature {
  text-align: center;
}

.feature .icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
}

.feature h3 {
  font-weight: 600;
  font-size: 17px;
}

.feature p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
}

/* How it works — tinted band, numbered steps. */

.how {
  background: var(--blue-wash);
}

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

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
}

.step .num {
  font-weight: 700;
  font-size: 34px;
  color: var(--blue-track);
  line-height: 1;
}

.step h3 {
  font-weight: 600;
  font-size: 17.5px;
  margin-top: 12px;
}

.step p {
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* Why it works — split with a calendar motif. */

.why-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.why-grid h2 {
  margin-top: 0;
}

.why-grid .lead {
  margin-top: 18px;
  font-size: 16.5px;
  line-height: 1.7;
}

.why-grid .lead + .lead {
  margin-top: 14px;
  color: var(--ink-dim);
}

.cue {
  margin-top: 22px;
  font-style: italic;
  font-size: 15.5px;
  color: var(--ink-dim);
  border-left: 2px solid var(--sage);
  padding-left: 16px;
}

.cal-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}

.cal-card .cal-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 14px;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal i {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-style: normal;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
}

.cal i.done {
  background: var(--sage-tint);
  border-color: transparent;
  color: var(--sage-deep);
  font-weight: 600;
}

.cal i.today {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.cal-card .cal-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-dim);
  text-align: center;
}

/* The idea — why "Chief Aim". */

.idea .section-head {
  margin-bottom: 0;
}

.idea p.origin {
  margin-top: 18px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-dim);
  text-align: center;
}

/* Pricing */

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, 340px);
  gap: 24px;
  justify-content: center;
}

.price-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
  position: relative;
}

.price-card.featured {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.price-card .plan {
  font-weight: 600;
  font-size: 15px;
}

.price-card .price {
  font-weight: 700;
  font-size: 38px;
  margin-top: 10px;
  line-height: 1;
}

.price-card .per {
  font-size: 14px;
  color: var(--ink-dim);
}

.price-card .note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-dim);
}

.save-chip {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sage-tint);
  color: var(--sage-deep);
  border: 1px solid var(--sage);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  white-space: nowrap;
}

.trial-note {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-dim);
}

/* CTA band */

.cta {
  background: var(--blue);
  color: var(--on-blue);
  text-align: center;
}

.cta h2 {
  margin-top: 0;
}

.cta p {
  margin-top: 12px;
  font-size: 16.5px;
  color: var(--on-blue-dim);
}

.cta .badges {
  justify-content: center;
}

/* Footer */

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}

.foot-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.foot-inner .logo svg {
  width: 18px;
  height: 20px;
}

.foot-inner .wordmark {
  font-size: 11px;
}

.foot-links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 13.5px;
}

.foot-links a {
  color: var(--ink-dim);
}

.foot-links a:hover {
  color: var(--blue);
}

.copyright {
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Privacy page ---------- */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.legal h1 {
  font-weight: 700;
  font-size: 36px;
}

.legal .updated {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.legal h2 {
  font-size: 20px;
  margin-top: 40px;
}

.legal p {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-dim);
}

.legal ul {
  margin-top: 12px;
  list-style: none;
}

.legal li {
  position: relative;
  padding-left: 26px;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-dim);
}

/* List marker: the logo's chevron, pointing right — never a glyph. */
.legal li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 138'%3E%3Cpolyline points='5,5 53,69 5,133' fill='none' stroke='%234A90E2' stroke-width='14' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
}

.back-link svg {
  width: 7px;
  height: 11px;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 64px;
  }
  .hero .sub {
    margin-left: auto;
    margin-right: auto;
  }
  .badges {
    justify-content: center;
  }
  .phones {
    height: 480px;
    width: 420px;
    margin: 24px auto 0;
    transform: translateY(64px);
  }
  .phone.front {
    width: 250px;
    height: 541px;
    right: 20px;
  }
  .phone.back {
    width: 218px;
    height: 472px;
    right: 200px;
  }
  .features {
    padding-top: 150px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .price-grid {
    grid-template-columns: minmax(0, 340px);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .nav-inner {
    justify-content: space-between;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .phones {
    width: 300px;
    height: 470px;
  }
  /* Keep the phone's true 290x628 layout and scale it as one piece, so the
     mock's content never clips against a smaller screen. */
  .phone.front {
    width: 290px;
    height: 628px;
    right: 50%;
    transform: translateX(50%) scale(0.76);
    transform-origin: top center;
  }
  .phone.back {
    display: none;
  }
  section {
    padding: 64px 0;
  }
  .features {
    padding-top: 140px;
  }
}
