/* ==========================================================================
   1% — marketing site
   One stylesheet. No preprocessor, no framework, no reset library, no webfont.
   Tokens are taken from the app (tailwind.config.js / src/lib/theme-colors.ts).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Surfaces + ink — light */
  --canvas: #F5F5F4;
  --surface: #FFFFFF;
  --surface-2: #EEEEEC;
  --ink: #111111;

  /* App token is #8A8A8E. On --canvas (#F5F5F4) that measures 3.15:1, which
     fails WCAG AA for body text. Darkened to #6E6E73 (4.65:1 on --canvas,
     5.07:1 on --surface). Same hue family, same role, readable. */
  --ink-secondary: #6E6E73;

  --ink-faint: #C6C6C8;
  --accent: #d1d1d1;
  --accent-fg: #111111;

  --hairline: rgba(17, 17, 17, 0.12);
  --hairline-strong: rgba(17, 17, 17, 0.20);

  /* Type scale — sizes are the app's, verbatim */
  --display-size: 32px;
  --display-line: 38px;
  --title-size: 22px;
  --title-line: 28px;
  --body-size: 17px;
  --body-line: 24px;
  --label-size: 13px;
  --label-line: 16px;
  --caption-size: 13px;
  --caption-line: 18px;

  /* Hero display only — scaled up for the web, 48px to 56px */
  --hero-size: clamp(48px, 4.5vw + 30px, 56px);
  --hero-line: 1.08;

  /* Radii */
  --r-chip: 10px;
  --r-card: 16px;
  --r-pill: 999px;

  /* Rhythm */
  --gap-page: 24px;
  --gap-section: 56px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0C0C0D;
    --surface: #1a1a1a;
    --surface-2: #2c2c2c;
    --ink: #F4F4F4;
    --ink-secondary: #9A9A9E; /* 6.98:1 on --canvas, 6.21:1 on --surface */
    --ink-faint: #48484A;
    --accent: #d1d1d1;
    --accent-fg: #111111;

    --hairline: rgba(244, 244, 244, 0.14);
    --hairline-strong: rgba(244, 244, 244, 0.24);
  }
}

/* --------------------------------------------------------------------------
   2. Reset — short, hand-written
   -------------------------------------------------------------------------- */

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

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
dl,
dt,
dd,
figure,
blockquote {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

svg {
  display: block;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

.wrap {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: var(--gap-page);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  transform: translateY(-200%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-chip);
  padding: 10px 14px;
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   4. Type roles
   -------------------------------------------------------------------------- */

.display {
  font-size: var(--display-size);
  line-height: var(--display-line);
  font-weight: 700;
  letter-spacing: -0.4px;
}

.hero-display {
  font-size: var(--hero-size);
  line-height: var(--hero-line);
  font-weight: 700;
  letter-spacing: -1px;
  text-wrap: balance;
}

.title {
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: 700;
  letter-spacing: -0.2px;
  text-wrap: balance;
}

.body {
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: 400;
}

.label {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.caption {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  font-weight: 400;
  color: var(--ink-secondary);
}

.eyebrow {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.measure {
  max-width: 36rem;
}

/* --------------------------------------------------------------------------
   5. Header / footer
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.wordmark {
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: 700;
  letter-spacing: -0.4px;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 2px;
}

.header-note {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

main {
  flex: 1 0 auto;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: var(--gap-section);
  padding-block: 32px 48px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin-bottom: 20px;
}

.footer-nav li {
  display: flex;
  align-items: center;
}

.footer-nav li + li::before {
  content: "·";
  color: var(--ink-secondary);
  padding-inline: 10px;
}

.footer-nav a {
  font-size: var(--body-size);
  line-height: var(--body-line);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 1px;
}

.footer-nav a:hover {
  border-bottom-color: var(--ink);
}

.footer-note {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--ink-secondary);
  max-width: 34rem;
}

.footer-note + .footer-note {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: 64px 8px;
}

.hero-grid-holder {
  margin-bottom: 40px;
}

.hero .eyebrow {
  margin-bottom: 16px;
}

.hero-sub {
  margin-top: 20px;
  color: var(--ink-secondary);
  max-width: 32rem;
}

.hero-cta {
  margin-top: 36px;
}

/* --------------------------------------------------------------------------
   7. The dot grid — 7 x 5, 35 days
   -------------------------------------------------------------------------- */

.dots {
  display: grid;
  grid-template-columns: repeat(7, 18px);
  gap: 9px;
  width: max-content;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  animation: dot-in 320ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 50ms);
}

/* Today: not done yet. Outline, holding at 0.4, breathing slowly. */
.dot--open {
  background: none;
  box-shadow: inset 0 0 0 2px var(--ink);
  opacity: 0.4;
  animation:
    dot-open-in 320ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards,
    breathe 4.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 50ms), calc(var(--i, 0) * 50ms + 320ms);
}

@keyframes dot-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dot-open-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 0.4;
    transform: scale(1);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.85;
  }
}

/* --------------------------------------------------------------------------
   8. Sections
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--gap-section);
  border-top: 1px solid var(--hairline);
}

.section:first-of-type {
  border-top: 0;
}

.section > * + * {
  margin-top: 16px;
}

.section .eyebrow + .title {
  margin-top: 12px;
}

.section p {
  color: var(--ink);
  max-width: 36rem;
}

.section p.caption {
  color: var(--ink-secondary);
}

.stack {
  display: grid;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   9. Cards, chips, pills
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 24px;
}

.card > * + * {
  margin-top: 12px;
}

.chip {
  display: inline-block;
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-chip);
  padding: 6px 10px;
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* App Store slot.
   Sized to the official Apple badge render size (156 x 52 CSS px, from the
   119.664 x 40 pt master asset) so swapping the real badge in causes no
   layout shift. See "Apple Marketing Resources and Identity Guidelines"
   -> App Store Marketing badge. Do not hotlink Apple's hosted image. */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
}

a.pill:hover {
  background: var(--ink);
  color: var(--canvas);
}

.cta-note {
  margin-top: 14px;
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--ink-secondary);
}

/* --------------------------------------------------------------------------
   10. FAQ — <details>, no JavaScript
   -------------------------------------------------------------------------- */

.faq {
  border-bottom: 1px solid var(--hairline);
  margin-top: 24px;
}

.faq details {
  border-top: 1px solid var(--hairline);
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-block: 18px;
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--ink-secondary);
  font-weight: 400;
  flex: none;
}

.faq details[open] summary::after {
  content: "\2212"; /* minus sign */
}

.faq summary:focus-visible {
  outline-offset: -2px;
}

.faq details > p {
  padding-bottom: 20px;
  color: var(--ink-secondary);
  max-width: 36rem;
}

.faq details > p + p {
  padding-bottom: 20px;
  margin-top: -8px;
}

/* --------------------------------------------------------------------------
   11. Legal / prose pages
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: 56px 8px;
}

.page-head .eyebrow {
  margin-bottom: 14px;
}

.page-head .updated {
  margin-top: 16px;
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--ink-secondary);
}

.prose {
  padding-block: 40px 0;
}

.prose section + section {
  margin-top: 44px;
}

.prose h2 {
  font-size: var(--title-size);
  line-height: var(--title-line);
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 14px;
}

.prose h3 {
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: 600;
  margin-top: 22px;
  margin-bottom: 8px;
}

.prose p,
.prose li {
  max-width: 38rem;
}

.prose p + p {
  margin-top: 14px;
}

.prose ul {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.prose ul li {
  position: relative;
  padding-left: 20px;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ink-secondary);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose .card {
  margin-top: 20px;
}

.prose dl {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.prose dt {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.prose dd {
  margin: 4px 0 0;
}

.prose .lede {
  color: var(--ink-secondary);
  max-width: 36rem;
}

address {
  font-style: normal;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 6px;
  padding: 2px 6px;
}

.card code {
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   12. Reduced motion — final state, immediately, nothing moves
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .dot,
  .dot--open {
    animation: none;
  }

  .dot {
    opacity: 1;
    transform: none;
  }

  .dot--open {
    opacity: 0.4;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   13. Small screens — 375px is the target
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {
  :root {
    --gap-page: 20px;
    --gap-section: 44px;
  }

  .hero {
    padding-block: 44px 8px;
  }

  .page-head {
    padding-block: 40px 8px;
  }

  .card {
    padding: 20px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip,
  .hero-grid-holder {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
