/* Notchbook website. Colours, spacing and type come from the app's
   design tokens (design/source/design-system/tokens.css). */

/* Noto Sans, self-hosted (SIL Open Font License, see fonts/OFL.txt). */
@font-face { font-family: "Noto Sans"; src: url("../fonts/NotoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/NotoSans-SemiBold.ttf") format("truetype"); font-weight: 500 700; font-display: swap; }

:root {
  --background: #faf8f3; --surface: #ffffff; --surfaceRaised: #f2efe8;
  --outline: #e3ded4; --outlineStrong: #8a857c;
  --textPrimary: #1c1b19; --textSecondary: #5f5b54;
  --primary: #0f5c55; --onPrimary: #ffffff; --primaryTint: #0f5c551f;
  --present: #2e7d32; --absent: #c62828; --halfDay: #9a5b00;
  --presentTint: #2e7d321f; --absentTint: #c628281f; --halfDayTint: #9a5b001f;
  --shadow-card: 0 1px 3px #00000014;
  /* Raised surfaces on the page (cards, the phone): a softer, larger shadow. */
  --shadow-raised: 0 4px 16px #00000029;
  --frame: #1c1b19;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-chip: 12px; --radius-card: 16px; --radius-sheet: 24px; --radius-full: 999px;
  --tap-min: 48px;
  --font-sans: "Noto Sans", system-ui, sans-serif;
  /* Language names in their own scripts: every phone and laptop has fonts
     for these, so the site ships none. */
  --font-system: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #151412; --surface: #1f1d1a; --surfaceRaised: #2a2723;
    --outline: #3a3631; --outlineStrong: #7a746c;
    --textPrimary: #ece8e1; --textSecondary: #a8a39a;
    --primary: #6fc9bd; --onPrimary: #00332e; --primaryTint: #6fc9bd1f;
    --present: #81c784; --absent: #ef9a9a; --halfDay: #ffca6b;
    --presentTint: #81c7841f; --absentTint: #ef9a9a1f; --halfDayTint: #ffca6b1f;
    --shadow-card: none;
    --shadow-raised: 0 4px 16px #00000066;
    --frame: #2a2723;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--background); color: var(--textPrimary);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 7vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 var(--space-4); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--space-4); top: -100px; z-index: 10; padding: var(--space-3) var(--space-4); background: var(--primary); color: var(--onPrimary); border-radius: var(--radius-chip); }
.skip:focus { top: var(--space-4); }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 600px) { .wrap { padding: 0 var(--space-8); } }
.narrow { max-width: 760px; }
section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 88px 0; } }
.band { background: var(--surfaceRaised); }
.section-lead { color: var(--textSecondary); font-size: 1.0625rem; max-width: 60ch; }
.small, .caption { color: var(--textSecondary); font-size: 0.875rem; }
.caption { margin-top: var(--space-3); }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--outline); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 64px; }
.brand { display: inline-flex; border-radius: 8px; }
.brand img { width: 132px; height: auto; }
.nav { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); padding: 0 var(--space-3); color: var(--textPrimary); text-decoration: none; font-size: 0.9375rem; font-weight: 500; border-radius: var(--radius-full); }
.nav a:hover { background: var(--primaryTint); }
@media (max-width: 520px) { .nav li:not(:last-child) { display: none; } }

/* Hero */
.hero { padding-top: 40px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-grid > *, .lang-grid > * { min-width: 0; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 64px; } .hero { padding: 72px 0 88px; } }
.lead { font-size: clamp(1.125rem, 2.6vw, 1.375rem); color: var(--textSecondary); max-width: 34ch; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin: var(--space-6) 0 var(--space-3); }
.play { display: inline-flex; border-radius: 10px; }
/* The official badge carries its own clear space: shown at 60 px tall. */
.play img { height: 60px; width: auto; max-width: 100%; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--outlineStrong); color: var(--textSecondary); font-size: 0.9375rem; font-weight: 500; }

/* Phone frame */
.phone { width: min(300px, 78vw); margin: 0 auto; padding: 10px; border-radius: 44px; background: var(--frame); box-shadow: var(--shadow-raised), 0 24px 48px -24px #0000004d; }
.phone.small { width: min(240px, 70vw); border-radius: 36px; padding: 8px; }
.screen { position: relative; aspect-ratio: 720 / 1600; border-radius: 34px; overflow: hidden; background: var(--background); }
.phone.small .screen { border-radius: 28px; }
.screen img { width: 100%; height: 100%; object-fit: cover; }

/* Hero carousel: with JavaScript off only the first screen shows. */
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 600ms ease, visibility 0s linear 600ms; }
.slide.is-on { opacity: 1; visibility: visible; transition: opacity 600ms ease; }
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-on { transition: none; } }
.dots { display: none; justify-content: center; gap: var(--space-1); margin-top: var(--space-4); }
.js .dots { display: flex; }
.dot { width: var(--tap-min); height: var(--tap-min); border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--outlineStrong); transition: width 200ms ease, background-color 200ms ease; }
.dot[aria-pressed="true"]::before { width: 24px; background: var(--primary); }

/* Try it: the app's provider card */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); border: 1px solid var(--outline); }
.provider { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); margin-top: var(--space-6); max-width: 520px; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--primaryTint); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.125rem; }
.provider-text { flex: 1; min-width: 0; }
.provider-text p { margin: 0; }
.name { font-weight: 600; font-size: 1.0625rem; }
.meta, .note { color: var(--textSecondary); font-size: 0.875rem; }
.earned { margin-top: var(--space-1) !important; font-size: 0.9375rem; }
.earned strong { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.125rem; }
.note { margin-top: var(--space-1) !important; }
.chip-col { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.chip-note { margin: 0; color: var(--textSecondary); font-size: 0.8125rem; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 0 var(--space-4) 0 var(--space-3); border: 0; border-radius: var(--radius-full); font: 500 0.9375rem var(--font-sans); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.chip-icon { fill: currentColor; }
.chip.present { background: var(--presentTint); color: var(--present); }
.chip.absent { background: var(--absentTint); color: var(--absent); }
.chip.half { background: var(--halfDayTint); color: var(--halfDay); }
.chip span { color: var(--textPrimary); }
/* Narrow phones: the chip moves under the text, lined up with it. */
@media (max-width: 420px) { .provider { flex-wrap: wrap; } .provider-text { flex-basis: calc(100% - 60px); } .chip-col { margin-left: 60px; align-items: flex-start; } }

/* Steps */
.steps { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: 48px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); } }
.step { text-align: center; }
.step h3 { margin-top: var(--space-6); display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.step p { color: var(--textSecondary); max-width: 32ch; margin: 0 auto; }
.num { display: inline-flex; width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--primary); color: var(--onPrimary); align-items: center; justify-content: center; font-size: 0.875rem; }

/* Languages */
.lang-grid { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 900px) { .lang-grid { grid-template-columns: 1fr 1fr; gap: 64px; } }
.langs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.lang { min-height: var(--tap-min); padding: 0 var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--outlineStrong); background: transparent; color: var(--textPrimary); font: 500 1rem var(--font-sans); cursor: pointer; }
.lang:hover { background: var(--primaryTint); }
.lang:not([lang="en"]) { font-family: var(--font-system); }
.lang[aria-pressed="true"] { background: var(--primaryTint); border: 2px solid var(--primary); color: var(--primary); font-weight: 600; }
.statement { margin: 0; justify-self: center; width: min(420px, 100%); }
.statement img { border-radius: var(--radius-sheet); box-shadow: var(--shadow-raised); border: 1px solid var(--outline); }

/* Feature cards */
.cards { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: var(--space-4); }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: var(--space-6); }
.feature p { color: var(--textSecondary); margin: 0; }

/* Story */
.story { text-align: center; }
.story img { margin: 0 auto var(--space-6); width: 110px; }
.story p { color: var(--textSecondary); font-size: 1.0625rem; max-width: 60ch; margin: 0 auto; }

/* FAQ */
.faq { margin-top: var(--space-6); display: grid; gap: var(--space-3); }
.faq details { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.faq summary { list-style: none; cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-6); font-weight: 600; border-radius: var(--radius-card); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--textSecondary); border-bottom: 2px solid var(--textSecondary); transform: rotate(45deg) translateY(-3px); transition: transform 200ms ease; }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { padding: 0 var(--space-6) var(--space-5); margin: 0; color: var(--textSecondary); }

/* Footer */
.foot { border-top: 1px solid var(--outline); padding: var(--space-8) 0; color: var(--textSecondary); font-size: 0.9375rem; }
.foot p { margin: 0; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); align-items: center; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; padding: 0; }
.foot a { display: inline-flex; align-items: center; min-height: var(--tap-min); }

/* Scroll reveal: only with JavaScript and motion allowed. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms ease, transform 700ms ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* Text pages (privacy, 404) */
.doc { padding: 48px 0 72px; }
.doc h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
.doc h2 { font-size: 1.375rem; margin-top: var(--space-8); }
.doc p, .doc li { color: var(--textPrimary); max-width: 68ch; }
.doc .effective { color: var(--textSecondary); }
.doc ul { padding-left: 1.25em; }
.doc li { margin-bottom: var(--space-2); }
.center { text-align: center; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap-min); padding: 0 var(--space-6); border-radius: var(--radius-full); background: var(--primary); color: var(--onPrimary); text-decoration: none; font-weight: 600; }
