/* Sahife — marketing site.
   Values come from .ai/18-BRAND-IDENTITY.md (P-13, P-26). Motion: "a page settling into place":
   ease-out only, no bounce, no springs. Everything honours prefers-reduced-motion. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens (18 §12, §13, §18–§20, §26) ---------- */
:root {
  color-scheme: light;
  --ds-bg-app: #FAF8F4;
  --ds-bg-surface: #FFFEFC;
  --ds-bg-subtle: #F5F1E9;
  --ds-bg-elevated: #FFFFFF;
  --ds-text-primary: #211C19;
  --ds-text-secondary: #625247;
  --ds-text-tertiary: #7A6C62;
  --ds-text-disabled: #B8AEA5;
  --ds-text-inverse: #FAF8F4;
  --ds-text-on-accent: #FFFFFF;
  --ds-border-soft: #ECE5DA;
  --ds-border-default: #DDD1C2;
  --ds-border-strong: #B9AA9A;
  --ds-accent-primary: #7F8B78;
  --ds-accent-hover: #65705F;
  --ds-accent-strong: #65705F;
  --ds-accent-soft: #EEF1EC;
  --ds-selection-background: #E7ECE4;
  --ds-state-hover: #F5F1E9;
  --ds-state-pressed: #ECE5DA;
  --ds-focus-ring: #65705F;
  --ds-danger: #A75F55;
  --ds-warning: #B18A55;
  --ds-success: #6F8068;
  --ds-shadow-low: 0 1px 2px rgba(33, 28, 25, 0.05);
  --ds-shadow-medium: 0 4px 16px rgba(33, 28, 25, 0.08);
  --ds-shadow-high: 0 12px 32px rgba(33, 28, 25, 0.12);

  /* The "night page" used by the privacy chapter: ink and dark paper in both themes. */
  --night-bg: #1A1715;
  --night-surface: #221E1B;
  --night-border: #403832;
  --night-text: #F6F2EB;
  --night-text-2: #D6CDC2;
  --night-text-3: #A99E93;
  --night-accent: #9FAB97;

  --ds-radius-xs: 6px;
  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 16px;
  --ds-radius-xl: 24px;

  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-page: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-fast: 140ms;
  --motion-standard: 200ms;
  --motion-panel: 260ms;
  --motion-page: 900ms;

  --gutter: 24px;
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ds-bg-app: #1A1715;
    --ds-bg-surface: #221E1B;
    --ds-bg-subtle: #2A2521;
    --ds-bg-elevated: #302A26;
    --ds-text-primary: #F6F2EB;
    --ds-text-secondary: #D6CDC2;
    --ds-text-tertiary: #A99E93;
    --ds-text-disabled: #756C65;
    --ds-text-inverse: #211C19;
    --ds-text-on-accent: #211C19;
    --ds-border-soft: #302A26;
    --ds-border-default: #403832;
    --ds-border-strong: #5A5048;
    --ds-accent-primary: #9FAB97;
    --ds-accent-hover: #B8C3B2;
    --ds-accent-strong: #9FAB97;
    --ds-accent-soft: #30382E;
    --ds-selection-background: #30382E;
    --ds-state-hover: #2A2521;
    --ds-state-pressed: #302A26;
    --ds-focus-ring: #9FAB97;
    --ds-danger: #D39487;
    --ds-warning: #CDA873;
    --ds-success: #A3B39B;
    --ds-shadow-low: 0 1px 2px rgba(0, 0, 0, 0.30);
    --ds-shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.36);
    --ds-shadow-high: 0 12px 32px rgba(0, 0, 0, 0.44);
    --night-bg: #120F0E;
    --night-surface: #1A1715;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ds-bg-app: #1A1715;
  --ds-bg-surface: #221E1B;
  --ds-bg-subtle: #2A2521;
  --ds-bg-elevated: #302A26;
  --ds-text-primary: #F6F2EB;
  --ds-text-secondary: #D6CDC2;
  --ds-text-tertiary: #A99E93;
  --ds-text-disabled: #756C65;
  --ds-text-inverse: #211C19;
  --ds-text-on-accent: #211C19;
  --ds-border-soft: #302A26;
  --ds-border-default: #403832;
  --ds-border-strong: #5A5048;
  --ds-accent-primary: #9FAB97;
  --ds-accent-hover: #B8C3B2;
  --ds-accent-strong: #9FAB97;
  --ds-accent-soft: #30382E;
  --ds-selection-background: #30382E;
  --ds-state-hover: #2A2521;
  --ds-state-pressed: #302A26;
  --ds-focus-ring: #9FAB97;
  --ds-danger: #D39487;
  --ds-warning: #CDA873;
  --ds-success: #A3B39B;
  --ds-shadow-low: 0 1px 2px rgba(0, 0, 0, 0.30);
  --ds-shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.36);
  --ds-shadow-high: 0 12px 32px rgba(0, 0, 0, 0.44);
  --night-bg: #120F0E;
  --night-surface: #1A1715;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--ds-bg-app);
  color: var(--ds-text-primary);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--motion-panel) var(--ease), color var(--motion-panel) var(--ease);
}

img, svg { display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--ds-selection-background); color: var(--ds-text-primary); }

:focus-visible {
  outline: 2px solid var(--ds-focus-ring);
  outline-offset: 3px;
  border-radius: var(--ds-radius-xs);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-text-primary);
  color: var(--ds-text-inverse);
  text-decoration: none;
  transition: top var(--motion-standard) var(--ease);
}
.skip:focus { top: 16px; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.sm { width: 16px; height: 16px; }

/* Paper grain: an almost invisible fibre texture, not a gradient effect. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .17 0 0 0 0 .15 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] .grain { opacity: 0.05; mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .grain { opacity: 0.05; mix-blend-mode: screen; } }

/* Reading progress: a thin ink line that fills as the page is read. */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(var(--read, 0));
  background: var(--ds-accent-primary);
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-md);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.btn-primary {
  background: var(--ds-text-primary);
  color: var(--ds-text-inverse);
}
.btn-primary:hover { background: var(--ds-text-secondary); }
.btn-primary:active { background: #463C36; }
.btn-primary .icon { transition: transform var(--motion-standard) var(--ease); }
.btn-primary:hover .icon { transform: translateX(3px); }
.btn-quiet {
  min-height: 36px;
  padding: 0 14px;
  border-color: var(--ds-border-default);
  background: transparent;
  color: var(--ds-text-primary);
  font-size: 14px;
  border-radius: var(--ds-radius-sm);
}
.btn-quiet:hover { background: var(--ds-state-hover); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color var(--motion-panel) var(--ease), border-color var(--motion-panel) var(--ease), transform var(--motion-panel) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--ds-bg-app) 94%, transparent);
  border-bottom-color: var(--ds-border-soft);
}
.nav.tucked { transform: translateY(-100%); }
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand svg { width: 20px; height: 25px; }

.nav-links {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-secondary);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease), background-color var(--motion-fast) var(--ease);
}
.nav-links a:hover { color: var(--ds-text-primary); background: var(--ds-state-hover); }
.nav-links a[aria-current='true'] { color: var(--ds-text-primary); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(120px, 18vh, 180px);
  text-align: center;
}
.hero-mark {
  width: 64px;
  margin: 0 auto 36px;
}
.hero-mark svg { width: 100%; height: auto; aspect-ratio: 1036 / 1296; overflow: visible; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-secondary);
  font-size: 13px;
  line-height: 1.2;
  background: var(--ds-bg-surface);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--ds-accent-primary);
  animation: breathe 2.8s var(--ease) infinite;
}
@keyframes breathe { 50% { opacity: 0.35; } }

.display {
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.display em { font-style: normal; font-weight: 500; color: var(--ds-text-tertiary); }
.hero-lede {
  max-width: 34ch;
  margin: 28px auto 0;
  color: var(--ds-text-secondary);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  text-wrap: balance;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}
.fineprint { color: var(--ds-text-tertiary); font-size: 13px; }

/* Ink: words settle out of a soft blur, like ink drying on the page. */
.ink-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.18em);
  transition: opacity 1100ms var(--ease-page), filter 1100ms var(--ease-page), transform 1100ms var(--ease-page);
  transition-delay: calc(var(--i) * 90ms + 250ms);
}
.is-ready .ink-word { opacity: 1; filter: blur(0); transform: none; }

.rise {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms var(--ease-page), transform 900ms var(--ease-page);
  transition-delay: var(--d, 0ms);
}
.is-ready .rise, .rise.in { opacity: 1; transform: none; }

/* Folio mark assembly: back pages slide in, bands rise, the front page settles last. */
.mark-part {
  transform-box: fill-box;
  transition: transform 1100ms var(--ease-page), opacity 700ms var(--ease);
}
.mark-anim .mark-part { opacity: 0; }
.mark-anim .mp-s1 { transform: translateX(60%); }
.mark-anim .mp-s2 { transform: translateX(45%); }
.mark-anim .mp-s3 { transform: translateX(30%); }
.mark-anim .mp-b1, .mark-anim .mp-b2, .mark-anim .mp-b3 { transform: translateY(-40%); }
.mark-anim .mp-front { transform: translateY(6%); }
.is-ready .mark-anim .mark-part { opacity: 1; transform: none; }
.mp-front { transition-delay: 0ms; }
.mp-s3 { transition-delay: 120ms; }
.mp-s2 { transition-delay: 200ms; }
.mp-s1 { transition-delay: 280ms; }
.mp-b1 { transition-delay: 160ms; }
.mp-b2 { transition-delay: 240ms; }
.mp-b3 { transition-delay: 320ms; }
.mark-gap { stroke: var(--ds-bg-app); transition: stroke var(--motion-panel) var(--ease); }

/* Hero stage: the product lifts off the table and settles flat as you scroll. */
.stage {
  position: relative;
  margin-top: clamp(56px, 9vh, 96px);
  perspective: 1800px;
  padding-bottom: 40px;
}
.stage-inner {
  --p: 0;
  transform-origin: 50% 0;
  transform: rotateX(calc((1 - var(--p)) * 24deg)) scale(calc(0.9 + var(--p) * 0.1)) translateY(calc((1 - var(--p)) * -20px));
  will-change: transform;
}
.stage-shadow {
  position: absolute;
  left: 8%; right: 8%;
  bottom: 10px;
  height: 60px;
  border-radius: 50%;
  background: rgba(33, 28, 25, 0.18);
  filter: blur(40px);
  opacity: calc(0.4 + var(--p, 0) * 0.6);
  z-index: -1;
}
/* Pages fanned behind the hero window — the folio mark, made physical. */
.stage-sheet {
  position: absolute;
  inset: 0;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-bg-subtle);
  border: 1px solid var(--ds-border-soft);
  transform-origin: 50% 100%;
}
.stage-sheet.s1 { transform: translateY(calc(-14px - (1 - var(--p)) * 30px)) scale(0.96); opacity: 0.8; }
.stage-sheet.s2 { transform: translateY(calc(-28px - (1 - var(--p)) * 60px)) scale(0.92); opacity: 0.55; }

/* ---------- Browser + app replica ---------- */
.window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-bg-surface);
  box-shadow: var(--ds-shadow-high);
  text-align: start;
}
.window-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ds-border-soft);
  background: var(--ds-bg-app);
}
.window-dots { display: flex; gap: 7px; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-border-default); }
.window-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: min(280px, 40vw);
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-subtle);
  color: var(--ds-text-tertiary);
  font-size: 12px;
}
.window-url .icon { width: 12px; height: 12px; }

.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: var(--app-h, 560px);
  font-size: 15px;
  line-height: 1.53;
}
.app-side {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  background: var(--ds-bg-app);
  overflow: hidden;
}
.app-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 18px;
  padding-inline-start: 8px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.app-side-head .ghost { color: var(--ds-text-tertiary); }
.side-group { display: grid; gap: 2px; margin-bottom: 16px; position: relative; }
.side-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-secondary);
  white-space: nowrap;
  transition: color var(--motion-standard) var(--ease), font-weight var(--motion-standard) var(--ease);
}
.side-item .icon { color: var(--ds-text-tertiary); transition: color var(--motion-standard) var(--ease); }
.side-item > span:not(.count) { overflow: hidden; text-overflow: ellipsis; }
.side-item .count { margin-inline-start: auto; font-size: 13px; color: var(--ds-text-secondary); }
.side-item.active { color: var(--ds-text-primary); font-weight: 500; }
.side-item.active .icon { color: var(--ds-accent-hover); }
.side-item.sub { padding-inline-start: 22px; }
.side-label {
  padding: 0 8px;
  margin: 4px 0 4px;
  color: var(--ds-text-tertiary);
  font-size: 12px;
  font-weight: 500;
}
.side-select {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 32px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-accent-soft);
  transform: translateY(var(--y, 0px));
  transition: transform 420ms var(--ease-page), opacity var(--motion-standard) var(--ease);
}
.glyph-progress { width: 16px; height: 16px; margin: 0 2px; }
.app-side-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 0 0 8px;
  border-top: 1px solid var(--ds-border-soft);
  color: var(--ds-text-tertiary);
  font-size: 13px;
  white-space: nowrap;
}
.app-main {
  position: relative;
  padding: 36px clamp(20px, 5%, 56px) 24px;
  border-inline-start: 1px solid var(--ds-border-soft);
  background: var(--ds-bg-surface);
  overflow: hidden;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.list-head .icon { width: 24px; height: 24px; color: var(--ds-accent-hover); }
.list-title {
  font-size: 26px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.list-sub { margin-inline-start: auto; color: var(--ds-text-tertiary); font-size: 13px; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 0 8px 6px;
  border-bottom: 1px solid var(--ds-border-soft);
  color: var(--ds-text-primary);
  font-size: 13px;
  font-weight: 600;
}
.group-title small { color: var(--ds-text-tertiary); font-weight: 400; font-size: 13px; }

/* Task row — mirrors apps/web/src/ui/ds/TaskRow. */
.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: var(--ds-radius-sm);
  transition: background-color var(--motion-fast) var(--ease);
}
.task:hover { background: var(--ds-state-hover); }
.task.selected { background: var(--ds-selection-background); }
.check {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  margin-top: 2px;
}
.check .box {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.75px solid var(--ds-text-tertiary);
  border-radius: var(--ds-radius-xs);
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.check svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ds-text-on-accent);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14;
  stroke-dashoffset: 14;
  transition: stroke-dashoffset var(--motion-standard) var(--ease);
}
.check:hover .box { border-color: var(--ds-accent-primary); }
.task.done .check .box { border-color: var(--ds-accent-strong); background: var(--ds-accent-strong); }
.task.done .check svg { stroke-dashoffset: 0; transition-delay: 60ms; }
.task-body { flex: 1; min-width: 0; padding-block: 2px; }
.task-title {
  position: relative;
  display: inline;
  color: var(--ds-text-primary);
  transition: color var(--motion-standard) var(--ease);
  background-image: linear-gradient(var(--ds-border-strong), var(--ds-border-strong));
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 1px;
  transition: color 260ms var(--ease), background-size 320ms var(--ease-page);
}
.task.done .task-title { color: var(--ds-text-secondary); background-size: 100% 1px; }
.task-context { display: block; color: var(--ds-text-tertiary); font-size: 13px; line-height: 20px; }
.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin-top: 2px;
  color: var(--ds-text-secondary);
  font-size: 13px;
  white-space: nowrap;
}
.task-meta .icon { width: 15px; height: 15px; color: var(--ds-text-tertiary); }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.meta.deadline { color: var(--ds-danger); }
.meta.deadline .icon { color: var(--ds-danger); }
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-xs);
  color: var(--ds-text-secondary);
  font-size: 12px;
}
.dirty {
  width: 6px; height: 6px;
  margin-top: 13px;
  border-radius: 2px;
  background: var(--ds-text-tertiary);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.dirty.gone { opacity: 0; transform: scale(0.2); }
.task-note { padding-inline-start: 32px; color: var(--ds-text-secondary); font-size: 13px; line-height: 20px; }

.row-in { animation: row-in 560ms var(--ease-page) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }
.page-in { animation: page-in 620ms var(--ease-page) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

.empty-note {
  display: grid;
  place-items: center;
  gap: 6px;
  height: 60%;
  color: var(--ds-text-tertiary);
  text-align: center;
  font-size: 14px;
}

/* Toast inside the replica */
.app-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--ds-radius-md);
  background: var(--ds-text-primary);
  color: var(--ds-text-inverse);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--ds-shadow-medium);
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: transform 280ms var(--ease-page), opacity 200ms var(--ease);
  pointer-events: none;
}
.app-toast.show { transform: translate(-50%, 0); opacity: 1; }
.app-toast b { font-weight: 500; color: var(--ds-accent-soft); }
:root[data-theme='dark'] .app-toast b { color: #30382E; }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(80px, 10vw, 136px); }
.section.tight { padding-block: clamp(72px, 10vw, 120px); }

.folio {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--ds-text-tertiary);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.folio-n {
  font-weight: 500;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ds-accent-hover);
  min-width: 1.4em;
}
.folio-rule {
  width: 48px;
  height: 1px;
  background: var(--ds-border-strong);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-page) 150ms;
}
.in .folio-rule, .folio.in .folio-rule { transform: scaleX(1); }

.h2 {
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h2 em { font-style: normal; font-weight: 500; color: var(--ds-text-tertiary); }
.lede {
  max-width: 46ch;
  margin-top: 24px;
  color: var(--ds-text-secondary);
  font-size: 18px;
  line-height: 1.6;
}
.h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.4; }
.p { color: var(--ds-text-secondary); font-size: 16px; line-height: 1.6; }

/* Marginalia — the literary aside. */
.margin-note {
  position: relative;
  max-width: 30ch;
  padding-inline-start: 16px;
  border-inline-start: 1px solid var(--ds-border-default);
  color: var(--ds-text-secondary);
  font-size: 15px;
  line-height: 1.5;
}
.margin-note small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ds-text-tertiary);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 900ms var(--ease-page), transform 900ms var(--ease-page);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Manifesto (scroll ink) ---------- */
.manifesto { padding-block: clamp(96px, 14vw, 180px) clamp(40px, 6vw, 72px); }
.manifesto-text {
  max-width: 24ch;
  font-weight: 500;
  font-size: clamp(1.9rem, 4.2vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.manifesto-text .w {
  color: var(--ds-text-primary);
  opacity: calc(0.16 + var(--lit, 0) * 0.84);
  transition: opacity 240ms linear;
}
.manifesto-text em, .manifesto-text em .w { font-style: normal; color: var(--ds-text-tertiary); }
.manifesto-sign {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  color: var(--ds-text-tertiary);
  font-size: 14px;
}
.manifesto-sign svg { width: 18px; height: 23px; }

/* ---------- Split layout ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split-copy .margin-note { margin-top: 40px; }

/* ---------- Quick Add ---------- */
.qa-card {
  position: relative;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-bg-elevated);
  box-shadow: var(--ds-shadow-high);
  overflow: hidden;
}
.qa-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
  color: var(--ds-text-tertiary);
  font-size: 13px;
}
.qa-top kbd { margin-inline-start: auto; }
.qa-field {
  position: relative;
  margin: 10px 20px 0;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.qa-mirror, .qa-input {
  display: block;
  width: 100%;
  min-height: 1.5em;
  padding: 6px 0 10px;
  font: inherit;
  letter-spacing: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}
.qa-mirror {
  position: absolute;
  inset: 0;
  color: transparent;
  pointer-events: none;
}
.qa-mirror mark {
  color: transparent;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ds-accent-primary) 24%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-accent-primary) 24%, transparent);
  animation: mark-in 320ms var(--ease) both;
}
.qa-mirror mark.k-deadline { background: color-mix(in srgb, var(--ds-danger) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-danger) 20%, transparent); }
.qa-mirror mark.k-tag { background: color-mix(in srgb, var(--ds-text-tertiary) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-text-tertiary) 20%, transparent); }
.qa-mirror mark.k-duration, .qa-mirror mark.k-time { background: color-mix(in srgb, var(--ds-warning) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-warning) 20%, transparent); }
@keyframes mark-in { from { background-color: transparent; box-shadow: 0 0 0 2px transparent; } }
.qa-input {
  position: relative;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: var(--ds-text-primary);
  caret-color: var(--ds-accent-hover);
}
.qa-input::placeholder { color: var(--ds-text-disabled); }
.qa-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-start: 1px;
  vertical-align: -0.15em;
  background: var(--ds-accent-hover);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.qa-result {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--ds-border-soft);
  background: var(--ds-bg-app);
}
.qa-title-row { display: flex; align-items: baseline; gap: 10px; min-height: 26px; }
.qa-title-row .lbl { color: var(--ds-text-tertiary); font-size: 12px; width: 64px; flex: none; }
.qa-title-row .val { font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-surface);
  color: var(--ds-text-secondary);
  font-size: 13px;
  animation: chip-in 380ms var(--ease-page) both;
}
.chip .icon { width: 15px; height: 15px; color: var(--ds-text-tertiary); }
.chip.k-deadline { color: var(--ds-danger); }
.chip.k-deadline .icon { color: var(--ds-danger); }
.chip.k-when .icon { color: var(--ds-accent-hover); }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.qa-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--ds-border-soft);
  color: var(--ds-text-tertiary);
  font-size: 12px;
}
.qa-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.qa-examples button {
  padding: 6px 10px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.qa-examples button:hover { background: var(--ds-state-hover); color: var(--ds-text-primary); }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--ds-border-default);
  border-bottom-width: 2px;
  border-radius: var(--ds-radius-xs);
  background: var(--ds-bg-surface);
  color: var(--ds-text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

/* ---------- Lists (scrollytelling) ---------- */
.lists { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); }
.lists-steps { padding-block: 10vh 30vh; }
.step {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.28;
  transition: opacity 500ms var(--ease);
}
.step.active { opacity: 1; }
.step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--ds-accent-hover);
  font-size: 14px;
  font-weight: 500;
}
.step-kicker .icon { width: 18px; height: 18px; }
.step h3 {
  font-weight: 600;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  text-wrap: balance;
}
.step p { max-width: 38ch; color: var(--ds-text-secondary); }
.step .keys { display: flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--ds-text-tertiary); font-size: 13px; }
.lists-stage { position: relative; }
.lists-sticky { position: sticky; top: calc(50vh - 290px); }
.lists-sticky .app { --app-h: 580px; }

/* ---------- Structure: fanned pages ---------- */
.fan {
  --p: 0;
  position: relative;
  height: 620px;
}
.sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: min(440px, 78%);
  padding: 18px 20px 20px;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-bg-surface);
  box-shadow: var(--ds-shadow-medium);
  transform: translate(calc(var(--k) * var(--p) * var(--dx)), calc(var(--p) * var(--ty) * var(--s) + (1 - var(--p)) * var(--k) * 10px)) rotate(calc((1 - var(--p)) * (var(--k) * -1.4deg)));
  will-change: transform;
}
.sheet:nth-child(1) { --k: 0; --ty: 0px; z-index: 1; }
.sheet:nth-child(2) { --k: 1; --ty: 96px; z-index: 2; }
.sheet:nth-child(3) { --k: 2; --ty: 192px; z-index: 3; }
.sheet:nth-child(4) { --k: 3; --ty: 288px; z-index: 4; }
.sheet:nth-child(5) { --k: 4; --ty: 430px; z-index: 5; }
.fan { --dx: 52px; --s: 1; }
.sheet-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ds-text-tertiary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sheet-kind .n { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; color: var(--ds-accent-hover); }
.sheet-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-title .icon { color: var(--ds-text-tertiary); }
.sheet .task { padding-inline: 0; }
.sheet .check { margin-top: 0; }
.sheet-heading { padding-bottom: 6px; border-bottom: 1px solid var(--ds-border-soft); font-size: 14px; font-weight: 600; color: var(--ds-accent-hover); }
.checklist { display: grid; gap: 2px; }
.cl-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ds-text-primary); min-height: 28px; }
.cl-item .cb { width: 14px; height: 14px; border: 1.5px solid var(--ds-text-tertiary); border-radius: 4px; display: grid; place-items: center; flex: none; }
.cl-item.done { color: var(--ds-text-secondary); text-decoration: line-through; text-decoration-color: var(--ds-border-strong); }
.cl-item.done .cb { background: var(--ds-accent-strong); border-color: var(--ds-accent-strong); }
.cl-item.done .cb svg { width: 12px; stroke: var(--ds-text-on-accent); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hier-list { display: grid; gap: 18px; margin-top: 40px; }
.hier-list li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.hier-list .n { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ds-accent-hover); line-height: 1.3; }
.hier-list b { font-weight: 600; }
.hier-list p { color: var(--ds-text-secondary); font-size: 15px; }

/* ---------- Time ---------- */
.time-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-top: 64px;
}
.card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-bg-surface);
  overflow: hidden;
}
.card .h3 { margin-bottom: 8px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.week {
  --p: 0;
  position: relative;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--ds-border-soft);
}
.day {
  padding: 10px 0 0;
  color: var(--ds-text-tertiary);
  font-size: 12px;
  text-align: center;
  border-inline-start: 1px dashed var(--ds-border-soft);
  height: 150px;
}
.day:first-child { border-inline-start: 0; }
.day b { display: block; color: var(--ds-text-primary); font-size: 17px; font-weight: 500; margin-top: 2px; }
.day.today b { color: var(--ds-accent-hover); }
.span-bar {
  position: absolute;
  top: 96px;
  left: calc(100% / 7 * 2 + 8px);
  width: calc((100% / 7 * 3 - 16px) * var(--p));
  height: 34px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-accent-soft);
  border: 1px solid var(--ds-border-default);
  overflow: hidden;
}
.span-label {
  position: absolute;
  top: 102px;
  left: calc(100% / 7 * 2 + 18px);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: calc(var(--p) * 2 - 0.6);
}
.pin {
  position: absolute;
  top: 66px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
  transform: translateX(-50%) translateY(calc((1 - min(1, var(--p) * 1.6)) * 8px));
  opacity: min(1, calc(var(--p) * 3));
}
.pin .icon { width: 14px; height: 14px; }
.pin.start { left: calc(100% / 7 * 2.5); color: var(--ds-accent-hover); }
.pin.due { left: calc(100% / 7 * 4.5); color: var(--ds-danger); opacity: min(1, calc(var(--p) * 3 - 1.8)); }
.week-legend { display: flex; gap: 20px; margin-top: 16px; font-size: 13px; color: var(--ds-text-secondary); flex-wrap: wrap; }
.week-legend span { display: inline-flex; align-items: center; gap: 6px; }
.week-legend .icon { width: 15px; height: 15px; }

.repeat-demo { margin-top: 24px; display: grid; gap: 14px; }
.repeat-open { border: 1px solid var(--ds-border-default); border-radius: var(--ds-radius-md); padding: 6px 8px; background: var(--ds-bg-app); }
.repeat-log-title { display: flex; align-items: center; gap: 8px; color: var(--ds-text-tertiary); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.repeat-log { display: grid; gap: 0; height: 132px; overflow: hidden; mask-image: linear-gradient(#000 60%, transparent); -webkit-mask-image: linear-gradient(#000 60%, transparent); }
.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 33px;
  padding: 0 8px;
  color: var(--ds-text-secondary);
  font-size: 14px;
  border-bottom: 1px solid var(--ds-border-soft);
}
.log-row .date { margin-inline-start: auto; color: var(--ds-text-tertiary); font-size: 12px; }
.log-row .icon { width: 15px; height: 15px; color: var(--ds-text-tertiary); }
.log-row .mini { width: 14px; height: 14px; border-radius: 4px; background: var(--ds-accent-strong); display: grid; place-items: center; flex: none; }
.log-row .mini svg { width: 12px; stroke: var(--ds-text-on-accent); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.log-row.enter { animation: log-in 620ms var(--ease-page) both; }
@keyframes log-in { from { opacity: 0; transform: translateY(-100%); } }

.stat-num {
  font-weight: 600;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 18px 0 10px;
  font-variant-numeric: lining-nums tabular-nums;
}
.sum-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-app);
  font-size: 14px;
  color: var(--ds-text-secondary);
}
.sum-line b { font-weight: 500; color: var(--ds-text-primary); font-variant-numeric: tabular-nums; }
.reminder-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-md);
  background: var(--ds-bg-elevated);
  box-shadow: var(--ds-shadow-medium);
  font-size: 14px;
}
.reminder-toast .icon { color: var(--ds-accent-hover); margin-top: 2px; }
.reminder-toast small { display: block; color: var(--ds-text-tertiary); font-size: 12px; }
.reminder-toast.ring .icon { animation: ring 1.6s var(--ease) infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(12deg); } 84% { transform: rotate(-10deg); } 92% { transform: rotate(5deg); } }

/* ---------- Privacy (night page) ---------- */
.night {
  --ds-text-primary: var(--night-text);
  --ds-text-secondary: var(--night-text-2);
  --ds-text-tertiary: var(--night-text-3);
  --ds-border-soft: #302A26;
  --ds-border-default: var(--night-border);
  --ds-border-strong: #5A5048;
  --ds-accent-hover: #B8C3B2;
  --ds-accent-primary: #9FAB97;
  --ds-accent-soft: #30382E;
  --ds-bg-surface: var(--night-surface);
  --ds-bg-app: var(--night-bg);
  --ds-bg-subtle: #2A2521;
  --ds-bg-elevated: #302A26;
  --ds-selection-background: #30382E;
  color: var(--night-text);
  background: var(--night-bg);
  border-radius: clamp(20px, 3vw, 36px);
  margin-inline: clamp(8px, 1.5vw, 20px);
}
.cipher {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 0.7fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin-top: 72px;
}
.cipher-node {
  position: relative;
  padding: 22px;
  border: 1px solid var(--night-border);
  border-radius: var(--ds-radius-lg);
  background: var(--night-surface);
}
.cipher-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--night-text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cipher-label .icon { width: 16px; height: 16px; }
.cipher-text {
  font-size: 16px;
  font-weight: 500;
  min-height: 3em;
  overflow-wrap: anywhere;
}
.cipher-text .meta-line { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; color: var(--night-text-3); }
.cipher-code {
  font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--night-text-2);
  min-height: 6.2em;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.cipher-code .hot { color: var(--night-accent); }
.cipher-wire { position: relative; align-self: center; height: 2px; margin: 0 -1px; background: repeating-linear-gradient(90deg, var(--night-border) 0 6px, transparent 6px 12px); }
.cipher-packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 44px;
  height: 22px;
  margin-top: -11px;
  border-radius: 6px;
  background: var(--night-accent);
  display: grid;
  place-items: center;
  color: #211C19;
  opacity: 0;
}
.cipher-packet .icon { width: 13px; height: 13px; stroke-width: 2; }
.cipher-packet.go { animation: packet 1800ms var(--ease) both; }
@keyframes packet {
  0% { left: -22px; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: calc(100% - 22px); opacity: 0; }
}
.privacy-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 48px;
  margin-top: 96px;
}
.fact .icon { width: 22px; height: 22px; color: var(--night-accent); margin-bottom: 16px; }
.fact h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.fact p { color: var(--night-text-2); font-size: 15px; line-height: 1.6; }
.night .margin-note { border-color: var(--night-border); color: var(--night-text-2); }
.night .margin-note small { color: var(--night-text-3); }
.night .h2 em { color: var(--night-text-2); }
.night .lede { color: var(--night-text-2); }
.night .folio { color: var(--night-text-3); }
.night .folio-n { color: var(--night-accent); }
.night .folio-rule { background: var(--night-border); }

/* ---------- Offline ---------- */
.offline-demo .app { --app-h: 440px; grid-template-columns: 200px 1fr; }
.switch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding: 14px 16px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-md);
  background: var(--ds-bg-surface);
  max-width: 380px;
}
.switch-row .lbl { font-size: 15px; font-weight: 500; }
.switch-row .sub { display: block; font-size: 13px; color: var(--ds-text-tertiary); font-weight: 400; }
.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--ds-accent-strong);
  cursor: pointer;
  transition: background-color var(--motion-standard) var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: var(--ds-shadow-low);
  transform: translateX(18px);
  transition: transform var(--motion-standard) var(--ease);
}
.switch[aria-checked='false'] { background: var(--ds-border-strong); }
.switch[aria-checked='false']::after { transform: none; }
.sync-status { display: inline-flex; align-items: center; gap: 8px; transition: color var(--motion-standard) var(--ease); }
.sync-status.offline { color: var(--ds-warning); }
.sync-status .spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 72px;
  border-top: 1px solid var(--ds-border-soft);
}
.number { padding-top: 28px; }
.number p.stat-num { margin-top: 0; color: var(--ds-text-primary); font-size: clamp(2.6rem, 4vw, 3.6rem); max-width: none; }
.number p { color: var(--ds-text-secondary); font-size: 15px; max-width: 30ch; }

/* ---------- Keyboard ---------- */
.kb {
  display: grid;
  gap: 8px;
  margin-top: 56px;
  padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-xl);
  background: var(--ds-bg-surface);
}
.kb-row { display: flex; gap: 8px; justify-content: center; }
.key {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(28px, 5.2vw, 58px);
  height: clamp(36px, 5.2vw, 58px);
  padding: 0;
  border: 1px solid var(--ds-border-default);
  border-bottom-width: 3px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-app);
  color: var(--ds-text-tertiary);
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 500;
  cursor: default;
  transition: transform 120ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.key.wide { width: clamp(44px, 8vw, 92px); }
.key.space { width: clamp(140px, 30vw, 340px); }
.key.live { color: var(--ds-text-primary); border-color: var(--ds-border-strong); cursor: pointer; }
.key.live::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px; height: 4px; border-radius: 1px;
  background: var(--ds-accent-primary);
}
.key.on {
  background: var(--ds-accent-soft);
  border-color: var(--ds-accent-primary);
  color: var(--ds-accent-hover);
  transform: translateY(2px);
  border-bottom-width: 1px;
  margin-bottom: 2px;
}
.kb-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 16px;
  font-size: 17px;
  text-align: center;
}
.kb-caption .act { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.kb-caption.flash .act { animation: page-in 420ms var(--ease-page) both; }
.kb-hint { text-align: center; color: var(--ds-text-tertiary); font-size: 13px; margin-top: 4px; }

/* ---------- Left out ---------- */
.leftout-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.strike-list { display: grid; }
.strike-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ds-border-soft);
}
.strike-list li:first-child { border-top: 1px solid var(--ds-border-soft); }
.strike-list .what {
  position: relative;
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  transition: color 600ms var(--ease);
}
.strike-list .what::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  top: 55%;
  height: 1.5px;
  background: var(--ds-text-secondary);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 700ms var(--ease-page);
  transition-delay: calc(var(--i, 0) * 110ms + 200ms);
}
.strike-list.in .what { color: var(--ds-text-tertiary); transition-delay: calc(var(--i, 0) * 110ms + 400ms); }
.strike-list.in .what::after { transform: scaleX(1); }
.strike-list .why { color: var(--ds-text-tertiary); font-size: 14px; text-align: end; max-width: 26ch; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 64px; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 44px);
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-xl);
  background: var(--ds-bg-surface);
}
.plan.later { background: transparent; border-style: dashed; }
.plan-name { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--ds-radius-xs);
  background: var(--ds-accent-soft);
  color: var(--ds-accent-hover);
  font-size: 12px;
  font-weight: 500;
}
.badge.muted { background: var(--ds-bg-subtle); color: var(--ds-text-secondary); }
.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 6px;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.price small { font-family: var(--font-ui); font-size: 15px; font-weight: 400; color: var(--ds-text-tertiary); letter-spacing: 0; }
.plan > .p { margin-bottom: 26px; }
.ticks { display: grid; gap: 12px; margin-bottom: 32px; }
.ticks li { display: flex; gap: 12px; font-size: 15px; line-height: 1.5; }
.ticks .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--ds-accent-hover); }
.plan.later .ticks .icon { color: var(--ds-text-tertiary); }
.plan .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Roadmap ---------- */
.road {
  --p: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 72px;
}
.road-line {
  position: absolute;
  left: 0; right: 0;
  top: 9px;
  height: 1px;
  background: var(--ds-border-default);
}
.road-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ds-accent-primary);
  transform-origin: 0 50%;
  transform: scaleX(var(--p));
}
.stop { position: relative; padding-top: 36px; }
.stop::before {
  content: '';
  position: absolute;
  left: 0; top: 3px;
  width: 13px; height: 13px;
  border-radius: 4px;
  border: 1.75px solid var(--ds-border-strong);
  background: var(--ds-bg-app);
  transition: border-color 400ms var(--ease), background-color 400ms var(--ease);
}
.stop.lit::before { border-color: var(--ds-accent-primary); }
.stop.current::before { border-color: var(--ds-accent-primary); background: var(--ds-accent-primary); box-shadow: 0 0 0 5px var(--ds-accent-soft); }
.stop.lit h3 { color: var(--ds-text-primary); }
.stop h3 { color: var(--ds-text-secondary); transition: color 400ms var(--ease); }
.stop.current h3 { color: var(--ds-text-primary); }
.stop .stage-n { font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ds-text-tertiary); }
.stop h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 4px 0 6px; }
.stop .stack { color: var(--ds-text-tertiary); font-size: 13px; }
.stop .now { margin-top: 12px; }
.horizon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 88px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-border-soft);
  overflow: hidden;
}
.horizon li { padding: 24px; background: var(--ds-bg-app); transition: background-color var(--motion-standard) var(--ease); }
.horizon li:hover { background: var(--ds-bg-surface); }
.horizon .icon { width: 22px; height: 22px; color: var(--ds-text-tertiary); margin-bottom: 16px; }
.horizon h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.horizon p { color: var(--ds-text-secondary); font-size: 14px; line-height: 1.55; }
.horizon .badge { margin-top: 14px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-top: 56px; }
.faq details { border-bottom: 1px solid var(--ds-border-soft); }
.faq details:first-child { border-top: 1px solid var(--ds-border-soft); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--ds-text-tertiary); transition: transform var(--motion-panel) var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq .ans { overflow: hidden; }
.faq .ans p { padding: 0 0 24px; max-width: 64ch; color: var(--ds-text-secondary); }

/* ---------- Closing ---------- */
.closing { text-align: center; padding-block: clamp(120px, 16vw, 200px) clamp(96px, 12vw, 140px); }
.closing .hero-mark { width: 72px; }
.closing .display { font-size: clamp(2.8rem, 7vw, 6.2rem); }
.closing .hero-cta { margin-top: 44px; }

.footer { padding-block: 40px 56px; border-top: 1px solid var(--ds-border-soft); color: var(--ds-text-tertiary); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { text-decoration: none; color: var(--ds-text-secondary); }
.footer a:hover { color: var(--ds-text-primary); }
.theme-switch {
  display: inline-flex;
  margin-inline-start: auto;
  padding: 3px;
  border: 1px solid var(--ds-border-soft);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-subtle);
}
.theme-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.theme-switch button .icon { width: 15px; height: 15px; }
.theme-switch button[aria-pressed='true'] { background: var(--ds-bg-elevated); color: var(--ds-text-primary); box-shadow: var(--ds-shadow-low); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .horizon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app { grid-template-columns: 200px 1fr; }
}

@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .nav-links { display: none; }
  .nav-inner .btn { margin-inline-start: auto; }
  .split, .split.flip, .leftout-grid { grid-template-columns: 1fr; }
  .split.flip .split-visual { order: 2; }
  .lists { grid-template-columns: 1fr; }
  .lists-stage { order: -1; position: sticky; top: 76px; z-index: 2; height: 0; }
  .lists-sticky { position: relative; top: 0; }
  .lists-sticky .app { --app-h: 360px; }
  .lists-steps { padding-top: 400px; padding-bottom: 20vh; position: relative; z-index: 3; }
  .step { min-height: 64vh; justify-content: flex-end; padding-bottom: 8vh; }
  .step-inner { padding: 20px; border: 1px solid var(--ds-border-soft); border-radius: var(--ds-radius-lg); background: var(--ds-bg-app); box-shadow: var(--ds-shadow-medium); }
  .step { opacity: 1; }
  .step:not(.active) .step-inner h3, .step:not(.active) .step-inner p { color: var(--ds-text-tertiary); }
  .time-grid > * { grid-column: span 12; }
  .privacy-facts { grid-template-columns: 1fr 1fr; }
  .cipher { grid-template-columns: 1fr; gap: 0; }
  .cipher-wire { width: 2px; height: 72px; margin: 0 auto; background: repeating-linear-gradient(180deg, var(--night-border) 0 6px, transparent 6px 12px); }
  .cipher-packet { left: 50% !important; margin-left: -22px; top: 0; margin-top: 0; }
  .cipher-packet.go { animation-name: packet-v; }
  .numbers { grid-template-columns: 1fr; gap: 0; }
  .plans { grid-template-columns: 1fr; }
  .road { grid-template-columns: 1fr; gap: 0; }
  .road-line { left: 6px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .road-line::after { transform-origin: 50% 0; transform: scaleY(var(--p)); }
  .stop { padding: 0 0 32px 36px; }
  .stop::before { top: 4px; }
  .fan { height: 600px; --dx: 14px; --s: 1; }
  .sheet { width: calc(100% - 72px); }
}
@keyframes packet-v {
  0% { top: -11px; opacity: 0; }
  15%, 85% { opacity: 1; }
  100% { top: calc(100% - 11px); opacity: 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .app, .offline-demo .app { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .app-main { border: 0; padding: 22px 14px 16px; }
  .window-url { min-width: 0; }
  .privacy-facts { grid-template-columns: 1fr; gap: 32px; }
  .horizon { grid-template-columns: 1fr; }
  .strike-list li { flex-direction: column; gap: 4px; }
  .strike-list .why { text-align: start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .theme-switch { margin-inline-start: 0; }
  .kb-row { gap: 4px; }
  .kb { gap: 4px; padding: 12px 8px; }
  .key { width: calc((100vw - 32px - 16px - 36px) / 10); border-bottom-width: 2px; }
  .key.wide { width: calc((100vw - 32px - 16px - 36px) / 10 * 1.5); }
  .key.space { width: 44vw; }
  .qa-foot .hint-kbd { display: none; }
  .task-meta .tag { display: none; }
  .hero { padding-top: 112px; }
  .stage { margin-top: 48px; }
  .card { padding: 22px; }
}

/* ---------- Reduced motion: every state is shown settled, nothing moves. ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .ink-word, .rise, .reveal { opacity: 1; filter: none; transform: none; }
  .stage-inner { transform: none !important; }
  .manifesto-text .w { opacity: 1 !important; }
  .fan { --p: 1 !important; }
  .week { --p: 1 !important; }
  .road { --p: 1 !important; }
}

@media (forced-colors: active) {
  .side-select { background: Highlight; }
  .task.done .check .box { background: Highlight; }
}
