/* Folio landing page.
 *
 * The page wears the app's own design system (HeroUI v3, as ported in
 * Sources/FolioKit/Design/Hero.swift), so the mockups in the feature grid use the same
 * colors, radii and type as the real windows. Spacing sits on a 4 px grid.
 */

/* ---------- Tokens (Hero.swift) ---------- */

:root {
  color-scheme: light;
  --background: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #EFEFF0;
  --overlay: #FFFFFF;
  --segment: #FFFFFF;
  --fg: #18181B;
  --muted: #71717A;
  --muted-on-bg: #67676F;       /* 5.1:1 on the page background */
  --default: #EBEBEC;
  --default-hover: #E1E1E2;
  --border: #DEDEE0;
  --separator: #E4E4E7;
  --accent: #0485F7;
  --accent-fill: #0070E0;        /* filled buttons: white label passes AA */
  --accent-soft: rgb(4 133 247 / 0.15);
  --accent-soft-fg: #1E63AE;
  --success: #17C964;
  --shadow-surface: 0 2px 4px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06), 0 0 1px rgb(0 0 0 / 0.06);
  --shadow-overlay: 0 4px 16px rgb(24 24 27 / 0.08), 0 8px 24px rgb(24 24 27 / 0.09), 0 0 0 1px rgb(0 0 0 / 0.04);
  --shadow-window: 0 40px 80px -24px rgb(0 0 0 / 0.25), 0 0 0 1px rgb(0 0 0 / 0.06);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --container: 1200px;
  --gutter: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #060607; --surface: #18181B; --surface-2: #232325; --overlay: #18181B; --segment: #46464C;
    --fg: #FCFCFC; --muted: #9F9FA9; --muted-on-bg: #9F9FA9; --default: #27272A; --default-hover: #2E2E31;
    --border: #28282C; --separator: #212124; --accent-soft: rgb(4 133 247 / 0.12); --accent-soft-fg: #61A8FB;
    --shadow-surface: 0 0 0 1px #28282C; --shadow-overlay: 0 0 0 1px #2E2E31, 0 16px 40px rgb(0 0 0 / 0.5);
    --shadow-window: 0 0 0 1px #28282C, 0 40px 80px -24px rgb(0 0 0 / 0.8);
  }
}
/* Same values for an explicit dark choice. Keep both blocks identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #060607; --surface: #18181B; --surface-2: #232325; --overlay: #18181B; --segment: #46464C;
  --fg: #FCFCFC; --muted: #9F9FA9; --muted-on-bg: #9F9FA9; --default: #27272A; --default-hover: #2E2E31;
  --border: #28282C; --separator: #212124; --accent-soft: rgb(4 133 247 / 0.12); --accent-soft-fg: #61A8FB;
  --shadow-surface: 0 0 0 1px #28282C; --shadow-overlay: 0 0 0 1px #2E2E31, 0 16px 40px rgb(0 0 0 / 0.5);
  --shadow-window: 0 0 0 1px #28282C, 0 40px 80px -24px rgb(0 0 0 / 0.8);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--background); color: var(--fg); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
button { font: inherit; color: inherit; }
.sprite { position: absolute; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 30; padding: 8px 12px; border-radius: 8px; background: var(--fg); color: var(--background); }
.skip-link:focus { top: 16px; }
.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons (HeroButton: pill, press scale 0.97) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font: 500 15px/1 var(--font);
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-lg { height: 48px; padding: 0 22px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-icon { width: 36px; height: 36px; padding: 0; color: var(--muted); }
.btn-primary { background: var(--accent-fill); color: #fff; }
.btn-primary:hover { background: #0064C8; }
.btn-secondary { background: var(--default); color: var(--fg); }
.btn-secondary:hover { background: var(--default-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--default); color: var(--fg); }
.btn-glass { background: rgb(255 255 255 / 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-glass:hover { background: rgb(255 255 255 / 0.24); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color 150ms var(--ease);
}
.site-header[data-scrolled] { border-bottom-color: var(--separator); }
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { border-radius: 6px; }
.wordmark { width: 44px; height: 17px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.site-nav a:hover { color: var(--fg); background: var(--default); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#theme-toggle .icon-moon { display: none; }
#theme-toggle[data-next="light"] .icon-sun { display: none; }
#theme-toggle[data-next="light"] .icon-moon { display: block; }

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

.hero { padding-top: 96px; text-align: center; overflow: clip; }
.hero-copy { display: grid; justify-items: center; gap: 24px; }
.eyebrow { max-width: 100%;
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-surface);
  font-size: 13px; color: var(--muted);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font: 600 clamp(48px, 7.4vw, 88px)/1.02 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.lede { max-width: 38rem; font-size: 19px; line-height: 1.55; color: var(--muted-on-bg); text-wrap: pretty; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; }
.oss-badge { color: var(--fg); transition: background-color 150ms var(--ease); }
.oss-badge:hover { background: var(--default); }
.oss-badge .icon { width: 14px; height: 14px; }
.count { margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; color: var(--muted-on-bg); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.meta { font-size: 13px; color: var(--muted-on-bg); font-variant-numeric: tabular-nums; }

.hero-shot {
  margin-top: 64px; height: min(42vw, 560px); overflow: hidden;
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-window);
  mask-image: linear-gradient(#000 70%, transparent);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
}
.hero-shot img { width: 100%; height: auto; }
.hero-shot.is-video { height: auto; aspect-ratio: 16 / 10; border-radius: 16px; background: #060607; mask-image: none; -webkit-mask-image: none; }
.hero-video, .hero-shot.is-video .hero-poster { width: 100%; height: 100%; object-fit: cover; }
.hero-poster { display: none; }
.hero-shot.is-video { position: relative; }
.hero-sound {
  position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 11px;
  border: 0; border-radius: 18px; background: rgba(18, 18, 22, .72); color: #fff; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
  transition: background-color .15s ease;
}
.hero-sound:hover { background: rgba(18, 18, 22, .88); }
.hero-sound:focus-visible { outline: 2px solid #0485f7; outline-offset: 2px; }
.hero-sound .icon { stroke-width: 1.8; }
.hero-sound[aria-pressed="true"] span { display: none; }
@media (prefers-reduced-motion: reduce) { .hero-video, .hero-sound { display: none; } .hero-shot.is-video .hero-poster { display: block; } }

/* ---------- Features: the bento ---------- */

.features { padding: 96px 0 128px; }
.section-head { display: grid; justify-items: center; gap: 12px; text-align: center; margin-bottom: 48px; }
.section-head h2 { font: 600 clamp(32px, 4.2vw, 48px)/1.1 var(--display); letter-spacing: -0.025em; text-wrap: balance; max-width: 22ch; }
.section-head p { max-width: 36rem; font-size: 17px; color: var(--muted-on-bg); text-wrap: pretty; }

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }

.tile {
  display: flex; flex-direction: column; min-height: 440px;
  border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-surface);
  overflow: hidden;
}
.tile-copy { display: grid; gap: 6px; padding: 28px 28px 0; }
.tile h3 { font: 600 19px/1.3 var(--display); letter-spacing: -0.01em; }
.tile-copy p { font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; max-width: 34rem; }
.tile-copy code { color: var(--fg); }
/* The stage is where the replica sits: a quiet panel that lets app surfaces read as surfaces. */
.stage { position: relative; flex: 1; margin: 24px 0 0; padding: 0 28px; display: flex; align-items: flex-end; justify-content: center; min-height: 280px; }

/* Shared app pieces */
.app-panel { background: var(--overlay); border-radius: 24px; box-shadow: var(--shadow-overlay); }
.app-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font: 500 14px/1 var(--font); cursor: pointer; transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.app-btn:active { transform: scale(0.97); }
.app-btn-primary { background: var(--accent); color: #FCFCFC; }
.app-btn-secondary { background: var(--default); color: var(--fg); }
.app-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.app-btn .icon { width: 16px; height: 16px; }
.caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 1. Convert panel (ConvertPanel.swift) and result card (ResultCard.swift) */
.stage-convert { align-items: flex-start; justify-content: flex-start; gap: 0; padding-bottom: 28px; }
.convert-panel { width: 380px; padding: 24px; display: grid; gap: 0; flex: none; }
.cp-title { font-size: 16px; font-weight: 600; }
.cp-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.cp-label { margin: 18px 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cp-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip {
  height: 32px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--default); color: var(--fg); font: 500 13px/1 var(--font);
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.chip:hover { background: var(--default-hover); }
.chip:active { transform: scale(0.97); }
.chip[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-soft-fg); }
.cp-fidelity { margin-top: 8px; font-size: 12px; color: var(--muted); min-height: 18px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 20px; background: var(--default); }
.segmented button { height: 30px; border: 0; border-radius: 17px; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.segmented button[aria-checked="true"] { background: var(--segment); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 1px rgb(0 0 0 / 0.1); }
.segmented button:disabled { opacity: 0.4; cursor: not-allowed; }
.cp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.result-card {
  position: absolute; right: 28px; bottom: 28px; width: 360px; padding: 16px;
  display: grid; grid-template-columns: 56px 1fr; gap: 12px 14px; align-items: center;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.result-card[data-hidden] { opacity: 0; transform: translateY(8px); }
.rc-thumb {
  width: 56px; height: 56px; border-radius: 10px; outline: 1px solid rgb(0 0 0 / 0.1); outline-offset: -1px;
  background: radial-gradient(circle at 70% 30%, #FFD59E 0 12%, transparent 13%), linear-gradient(180deg, #7FB3F5 0%, #B9D7F7 55%, #3F7A4F 56%, #2F5E3C 100%);
}
.rc-name { font-size: 14px; font-weight: 600; }
.rc-size { font-size: 14px; font-variant-numeric: tabular-nums; }
.rc-meta { font-size: 13px; color: var(--muted); }
.rc-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; }
.rc-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--fg); }
.rc-icon .icon, .rc-undo .icon { width: 17px; height: 17px; }
.rc-undo { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 600; }

/* 2. Menu bar and shelf (ShelfController.swift) */
.stage-shelf { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; margin-top: 24px; background: linear-gradient(160deg, #DCE7F5, #EDE6F3); }
:root[data-theme="dark"] .stage-shelf { background: linear-gradient(160deg, #18202C, #211B26); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage-shelf { background: linear-gradient(160deg, #18202C, #211B26); } }
.menubar { display: flex; align-items: center; justify-content: flex-end; gap: 4px; height: 28px; padding: 0 12px; background: rgb(255 255 255 / 0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: 13px; font-weight: 500; color: #18181B; }
:root[data-theme="dark"] .menubar { background: rgb(30 30 34 / 0.6); color: #FCFCFC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .menubar { background: rgb(30 30 34 / 0.6); color: #FCFCFC; } }
.mb-item { display: grid; place-items: center; width: 30px; height: 22px; border-radius: 5px; }
.mb-item.is-open { background: rgb(0 0 0 / 0.12); }
:root[data-theme="dark"] .mb-item.is-open { background: rgb(255 255 255 / 0.18); }
.mb-item .icon { width: 14px; height: 14px; stroke-width: 2; }
.mb-glyph { width: 18px; height: 18px; color: currentColor; }
.mb-clock { margin-left: 8px; font-variant-numeric: tabular-nums; }
.shelf { width: 300px; margin: 6px 24px 0 auto; padding: 12px; display: grid; gap: 0; border-radius: 20px; transform-origin: top right; }
.drop { display: grid; justify-items: center; gap: 2px; padding: 22px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted); }
.drop .icon { width: 22px; height: 22px; margin-bottom: 6px; }
.drop-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.drop-sub { font-size: 12px; }
.shelf-label { margin: 12px 4px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.shelf-list li { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 4px; font-size: 13px; }
.shelf-list b { margin-left: auto; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-ico { width: 16px; height: 20px; border-radius: 3px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.shelf-foot { display: flex; justify-content: space-between; margin: 8px -12px -12px; padding: 12px 16px; border-top: 1px solid var(--separator); font-size: 13px; font-weight: 500; }

/* 3. Terminal (dark in both themes, like a real terminal) */
.stage-term { padding-bottom: 28px; align-items: stretch; }
.term { width: 100%; border-radius: 12px; overflow: hidden; background: #111113; color: #E8E8EA; font: 12.5px/1.65 var(--mono); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 20px 40px -16px rgb(0 0 0 / 0.5); }
.term-bar { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; background: #1C1C1F; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.term-bar i:nth-child(2) { background: #FEBC2E; } .term-bar i:nth-child(3) { background: #28C840; }
.term-bar span { margin: 0 auto; padding-right: 50px; font-size: 11px; color: #8E8E93; }
.term-body { display: grid; gap: 8px; padding: 16px; }
.t-call, .t-reply { display: flex; gap: 10px; align-items: baseline; }
.t-dot { width: 7px; height: 7px; border-radius: 50%; background: #4CC38A; flex: none; transform: translateY(-1px); }
.t-dot.white { background: #E8E8EA; }
.t-args { color: #8E8E93; }
.t-result { padding-left: 17px; color: #A6D9BD; }
.t-prompt { color: #8E8E93; }
.t-prompt .caret { background: #E8E8EA; }

/* 4. Spreadsheet window (FolioSheets) */
.stage-sheet { padding-right: 0; justify-content: flex-start; }
.window { width: 100%; border-radius: 12px 0 0 0; background: var(--surface); box-shadow: var(--shadow-window); overflow: hidden; }
.win-title { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--separator); }
.win-title i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.win-title i:nth-child(2) { background: #FEBC2E; } .win-title i:nth-child(3) { background: #28C840; }
.win-title span { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 13px; font-weight: 600; }
.win-title .icon { width: 15px; height: 15px; color: var(--muted); }
.fx { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--separator); font-size: 13px; }
.fx-ref { width: 64px; padding: 5px 8px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); }
.fx-f { font-style: italic; color: var(--muted); font-family: Georgia, serif; }
.fx-val { flex: 1; padding: 5px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); font-family: var(--mono); font-size: 12.5px; }
.grid { display: grid; grid-template-columns: 32px repeat(6, minmax(72px, 1fr)); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid > span { height: 28px; padding: 0 8px; display: flex; align-items: center; border-right: 1px solid var(--separator); border-bottom: 1px solid var(--separator); white-space: nowrap; overflow: hidden; }
.grid .h { justify-content: center; font-size: 11px; color: var(--muted); background: var(--background); }
.grid .h.is-sel { background: var(--accent-soft); color: var(--accent-soft-fg); }
.grid .n { justify-content: flex-end; }
.grid .sel { box-shadow: inset 0 0 0 2px var(--accent); }

/* 5. Command palette (CommandPalette.swift: 52 px search, 36 px rows) */
.stage-palette { padding-bottom: 28px; }
.palette { width: 100%; max-width: 360px; overflow: hidden; }
.pal-search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--separator); font-size: 15px; }
.pal-search .icon { color: var(--muted); }
.pal-list { padding: 8px; }
.pal-group { padding: 4px 10px; font-size: 11px; font-weight: 500; color: var(--muted); }
.pal-group + .pal-row { margin-top: 0; }
.pal-list .pal-group:not(:first-child) { margin-top: 6px; }
.pal-row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.pal-row .icon { width: 16px; height: 16px; color: var(--muted); }
.pal-row b { font-weight: 500; }
.pal-row span, .pal-row kbd { margin-left: auto; font-size: 12px; color: var(--muted); }
.pal-row.is-selected { background: var(--default); }

/* 6. PDF page with the annotation toolbar (FolioPDF) */
.stage-pdf { padding-bottom: 0; align-items: stretch; }
.pdf-page { width: 100%; max-width: 300px; padding: 24px 24px 72px; background: #FFFFFF; color: #111; border-radius: 4px 4px 0 0; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 12px 32px -12px rgb(0 0 0 / 0.25); font: 11px/1.55 Helvetica, Arial, sans-serif; }
.pdf-h { font-size: 17px; font-weight: 700; line-height: 1.2; margin-bottom: 10px; }
.pdf-p { margin-bottom: 8px; }
.pdf-page mark { background: rgb(255 214 10 / 0.55); color: inherit; padding: 0 1px; }
.redacted { background: #000; color: transparent; border-radius: 1px; user-select: none; }
.pdf-sig { margin-top: 14px; font: italic 22px/1 "Snell Roundhand", "Brush Script MT", cursive; color: #1E3A8A; }
.pdf-tools { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 14px; }
.pdf-tools span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--fg); }
.pdf-tools span.is-on { background: var(--accent-soft); color: var(--accent-soft-fg); }
.pdf-tools .icon { width: 16px; height: 16px; }

/* 7. Speed */
.stage-speed { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 16px; padding-bottom: 28px; }
.bench { display: grid; gap: 18px; }
.bench li { display: grid; gap: 6px; }
.bench .task { font-size: 13px; font-weight: 500; }
.bench .row { display: grid; grid-template-columns: 1fr 64px; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.bench .row b { font-weight: 600; color: var(--fg); text-align: right; }
.bench .bar { height: 8px; border-radius: 4px; background: var(--default); }
.bench .bar.us { background: var(--accent); }
.bench-note { font-size: 12px; color: var(--muted); }

/* 8. Video timeline (FolioMedia/Timeline): lanes top layer first, then audio, then captions */
.stage-video { padding-right: 0; justify-content: flex-start; }
.win-video .tl { position: relative; display: grid; gap: 6px; padding: 8px 0 20px; }
.tl-ruler { display: flex; justify-content: space-between; margin-left: 44px; padding-right: 24px; font: 11px/16px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-track { position: relative; height: 32px; margin-left: 44px; }
.tl-track b { position: absolute; left: -36px; top: 8px; font: 500 11px/16px var(--mono); color: var(--muted); }
.tl-captions { height: 24px; }
.clip { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--surface); background: var(--default); font-size: 11px; font-weight: 500; }
.clip.is-sel { background: var(--accent-soft); color: var(--accent-soft-fg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.clip-title { background: var(--surface-2); color: var(--muted); }
.clip-audio { color: var(--muted); background: repeating-linear-gradient(90deg, var(--default) 0 2px, var(--surface-2) 2px 4px); }
.cue { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; border-radius: 4px; background: var(--surface-2); font-size: 11px; color: var(--muted); }
.tl-playhead { position: absolute; top: 24px; bottom: 16px; width: 1.5px; margin-left: 22px; background: var(--accent); }

/* 9. Layers panel (FolioImage LayersPanel) */
.stage-layers { padding-bottom: 28px; }
.layers { width: 100%; max-width: 340px; padding: 8px; }
.ly-head { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; font-size: 13px; font-weight: 600; }
.ly-head .icon, .ly-row .icon { width: 16px; height: 16px; color: var(--muted); }
.ly-head span { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.ly-row { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px; border-radius: 8px; font-size: 13px; }
.ly-row b { font-weight: 500; }
.ly-row > span:last-child { margin-left: auto; font-size: 12px; color: var(--muted); }
.ly-row.is-selected { background: var(--default); }
.ly-thumb { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1); font: 600 13px/1 var(--display); color: var(--muted); }
.ly-adj { background: linear-gradient(135deg, #2A2A2E, #D8D8DC); }
.ly-photo { background: radial-gradient(circle at 50% 40%, #C9A27E 0 30%, #5B6B7A 31%); }
.ly-mask { background: radial-gradient(circle at 50% 40%, #FFFFFF 0 34%, #000000 35%); }
.ly-bg { background: linear-gradient(#9CB4C8, #D9C7B0); }

/* 10. Summary panel (FolioIntelligence) */
.stage-ai { padding-bottom: 28px; }
.summary { width: 100%; max-width: 320px; padding: 20px; }
.sm-title { font-size: 15px; font-weight: 600; }
.sm-doc { margin-top: 2px; font-size: 12px; color: var(--muted); }
.sm-points { display: grid; gap: 8px; margin: 14px 0 16px; padding-left: 16px; list-style: disc; font-size: 13px; line-height: 1.45; }
.sm-points li::marker { color: var(--muted); }
.sm-ask { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--default); font-size: 13px; line-height: 36px; }

/* 11. Archive window (FolioArchive) */
.stage-archive { padding-right: 0; justify-content: flex-start; }
.ar-list { padding: 8px; }
.ar-row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.ar-row .icon { width: 16px; height: 16px; color: var(--muted); }
.ar-row b { font-weight: 500; }
.ar-row span { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ar-row.is-selected { background: var(--accent-soft); color: var(--accent-soft-fg); }
.ar-row.is-selected .icon, .ar-row.is-selected span { color: inherit; }
.ar-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 20px; font-size: 12px; color: var(--muted); }

/* 12. Watched-folder rule (Automations) */
.stage-auto { padding-bottom: 28px; }
.rule { width: 100%; max-width: 320px; padding: 20px; }
.rl-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.rl-title .icon { width: 16px; height: 16px; color: var(--muted); }
.rl-label { margin: 14px 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.rl-line { height: 32px; margin-top: 4px; padding: 0 12px; border-radius: 8px; background: var(--default); font-size: 13px; line-height: 32px; }
.rl-meta { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- CTA: the Dock ---------- */

.cta { padding: 32px 0 112px; }
.cta-inner { display: grid; justify-items: center; gap: 16px; text-align: center; }
.cta-inner h2 { font: 600 clamp(36px, 5vw, 56px)/1.05 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.cta-inner > p { max-width: 30rem; font-size: 17px; color: var(--muted-on-bg); }
.cta-inner .actions { margin-top: 8px; }

/* The Dock sits straight on the page: no panel behind it. Sizes are in cqw, so it scales
   as one picture from a phone to the desktop column. */
.dock-stage {
  container-type: inline-size;
  width: 100%; margin-top: 40px;
  display: grid; place-items: center; padding: 6cqw 0 2cqw;
  user-select: none;
}

/* The shelf: frosted glass, lit from above, with a bright top edge and a soft shadow. */
.dock {
  --slot: 5.4cqw;
  display: flex; align-items: flex-end; gap: 0.5cqw;
  padding: 0.55cqw 0.9cqw 0.75cqw;
  border-radius: 2.4cqw;
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px rgb(0 0 0 / 0.06), 0 1.2cqw 3.2cqw rgb(31 41 66 / 0.14);
}
:root[data-theme="dark"] .dock { background: rgb(40 40 46 / 0.72); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1.6cqw 4cqw rgb(0 0 0 / 0.45); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dock { background: rgb(40 40 46 / 0.72); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1.6cqw 4cqw rgb(0 0 0 / 0.45); } }
@media (prefers-reduced-transparency: reduce) { .dock { background: var(--surface); backdrop-filter: none; } }

.slot { position: relative; width: var(--slot); height: var(--slot); flex: none; display: grid; place-items: center; }
/* The system icons carry macOS's own padding and shadow, so they fill the slot as they are. */
.slot > img { width: 100%; height: 100%; }
/* Full-bleed artwork sits on the same 80 % grid, rounded and shadowed the way the Dock draws it. */
.dock-tile { position: relative; width: 80%; height: 80%; border-radius: 22.5%; overflow: hidden; box-shadow: 0 0.25cqw 0.6cqw rgb(0 0 0 / 0.22); }
.dock-tile img { width: 100%; height: 100%; }
/* macOS lights a Dock icon from above: a sheen down the tile and a rim brightest on top. */
.sheen { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to bottom, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.03) 45%, rgb(0 0 0 / 0.12)); box-shadow: inset 0 0.08cqw 0 rgb(255 255 255 / 0.22), inset 0 0 0 0.05cqw rgb(255 255 255 / 0.1); }
.running::after { content: ""; position: absolute; left: 50%; bottom: -0.55cqw; width: 0.3cqw; height: 0.3cqw; margin-left: -0.15cqw; border-radius: 50%; background: rgb(29 29 31 / 0.6); }
:root[data-theme="dark"] .running::after { background: rgb(255 255 255 / 0.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .running::after { background: rgb(255 255 255 / 0.7); } }

/* Folio, raised the way the Dock lifts an app you point at, with its name above it. */
.is-folio { transform: translateY(-1.3cqw); }
.is-folio .dock-tile { box-shadow: 0 0.9cqw 1.6cqw rgb(0 0 0 / 0.26), 0 0.2cqw 0.5cqw rgb(0 0 0 / 0.18); }
.is-folio.running::after { bottom: -1.85cqw; }
.dock-label {
  position: absolute; bottom: calc(100% + 0.9cqw); left: 50%; transform: translateX(-50%);
  padding: 0.25cqw 0.8cqw; border-radius: 0.55cqw; white-space: nowrap;
  font: 500 max(11px, 1.05cqw)/1.35 var(--font); color: #1D1D1F;
  background: rgb(246 246 248 / 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 0 0.5px rgb(0 0 0 / 0.12), 0 0.3cqw 1cqw rgb(0 0 0 / 0.14);
}
:root[data-theme="dark"] .dock-label { color: #F5F5F7; background: rgb(48 48 52 / 0.86); box-shadow: 0 0 0 0.5px rgb(255 255 255 / 0.16), 0 0.3cqw 1cqw rgb(0 0 0 / 0.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dock-label { color: #F5F5F7; background: rgb(48 48 52 / 0.86); box-shadow: 0 0 0 0.5px rgb(255 255 255 / 0.16), 0 0.3cqw 1cqw rgb(0 0 0 / 0.4); } }
.divider { width: 1px; height: calc(var(--slot) * 0.8); margin: 0 0.4cqw; align-self: center; background: rgb(0 0 0 / 0.14); }
:root[data-theme="dark"] .divider { background: rgb(255 255 255 / 0.18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .divider { background: rgb(255 255 255 / 0.18); } }

/* ---------- Footer: one line ---------- */

.site-footer { border-top: 1px solid var(--separator); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 20px 0; font-size: 13px; color: var(--muted-on-bg); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-inner a { transition: color 150ms var(--ease); }
.footer-inner a:hover { color: var(--fg); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 600ms var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: 60ms; } .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .hero-copy > :nth-child(4) { animation-delay: 180ms; } .hero-copy > :nth-child(5) { animation-delay: 240ms; }
  .hero-shot { animation: rise 700ms var(--ease) 300ms both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .caret { animation: none; } }

/* ---------- Small screens ---------- */

/* FAQ: plain cards in the tile style. */
.faq { padding: 0 0 128px; }
.faq-list { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.faq-item { border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-surface); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; cursor: pointer; list-style: none; border-radius: 20px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-item h3 { font: 600 17px/1.35 var(--display); letter-spacing: -0.01em; }
.faq-item .chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1); }
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-answer { display: grid; gap: 8px; padding: 0 24px 22px; }
.faq-item p { font-size: 15px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.faq-item a { color: var(--accent-soft-fg); text-decoration: underline; text-underline-offset: 2px; }
.faq-item code { color: var(--fg); }
/* The drawer slides open where the browser can animate details content; elsewhere it just opens. */
@supports (interpolate-size: allow-keywords) {
  .faq-list { interpolate-size: allow-keywords; }
  .faq-item::details-content { height: 0; overflow: clip; transition: height 220ms cubic-bezier(0.2, 0, 0, 1), content-visibility 220ms allow-discrete; }
  .faq-item[open]::details-content { height: auto; }
}
@media (prefers-reduced-motion: reduce) { .faq-item .chev, .faq-item::details-content { transition: none; } }

@media (max-width: 1040px) {
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 6; }
  .tile-convert, .tile-speed { grid-column: span 12; }
}
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .site-nav { display: none; }
  .hero { padding-top: 56px; }
  .hero-shot { margin-top: 40px; height: 56vw; border-radius: 12px 12px 0 0; }
  .bento > * { grid-column: span 12 !important; }
  .hero-shot.is-video { border-radius: 12px; }
  .tile { min-height: 0; }
  .stage-convert { flex-direction: column; align-items: stretch; gap: 16px; }
  .convert-panel { width: 100%; }
  .result-card { position: static; width: 100%; }
  .shelf { margin: 6px auto 0; }
  /* On a phone the whole Dock would be tiny, so zoom in on Folio: scale the Dock about
     Folio's centre (55.8 % across: 8 slots and gaps in, of about 91 cqw), shift Folio to
     the middle, and let the neighbours run off both edges into a fade. */
  .dock-stage {
    overflow: hidden; padding: 24cqw 0 6cqw; margin-top: 24px;
    mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  }
  .dock { transform-origin: 55.8% 60%; transform: translateX(-5.25cqw) scale(2.6); }
  /* Pre-scale size, so the label lands at the Dock's real 13 px. */
  .dock-label { font-size: 1.35cqw; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-inner nav { justify-content: center; }
}

/* ---------- Legal pages ---------- */

.legal { max-width: 720px; padding: 80px 0 96px; }
.legal h1 { font: 600 44px/1.1 var(--display); letter-spacing: -0.03em; }
.legal-meta { margin-top: 8px; font-size: 13px; color: var(--muted-on-bg); }
.legal-lede { margin-top: 24px; font-size: 19px; line-height: 1.55; color: var(--muted-on-bg); }
.legal h2 { margin: 48px 0 12px; font: 600 21px/1.3 var(--display); letter-spacing: -0.01em; }
.legal p, .legal li { font-size: 16px; line-height: 1.65; color: var(--fg); }
.legal ul { display: grid; gap: 10px; padding-left: 20px; list-style: disc; }
.legal li::marker { color: var(--muted); }
.legal a { color: var(--accent-soft-fg); text-decoration: underline; text-underline-offset: 2px; }
.legal code { padding: 1px 5px; border-radius: 6px; background: var(--default); }
