/* Froblio landing page.
 *
 * Tokens are the app's own (packages/ui/lib/src/theme): paper on a desk
 * in the light, a grey board in the dark, mauve for what is active, gold
 * for study, teal for links and sync. Corner radius carries meaning the
 * way it does in the app: paper 6, controls 8, floating 14, tactile 24.
 */

@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --desk: #ECEEEB;
  --sheet: #FFFFFF;
  --raised: #FFFFFF;
  --ink: #000000;
  --ink-2: rgba(0, 0, 0, 0.62);
  --edge: rgba(0, 0, 0, 0.2);
  --divider: rgba(0, 0, 0, 0.09);
  --ruling: rgba(0, 0, 0, 0.13);
  --hover: rgba(0, 0, 0, 0.05);
  --mauve: #967AA1;
  /* Mauve deep enough to carry white text and to be read as text on paper:
     the brand mauve itself is 3.4:1 on white, fine for an edge, too faint
     for a word. */
  --mauve-strong: #7A5E8B;
  --mauve-wash: rgba(150, 122, 161, 0.18);
  --gold: #E6AF2E;
  --gold-wash: rgba(230, 175, 46, 0.22);
  --teal: #23B5D3;
  --teal-text: #0A7389;
  --warn-edge: #C98A00;
  --warn-wash: #FFF6DC;
  --pen: #1B1B1B;
  --font-text: "Lexend", system-ui, sans-serif;
  --font-display: "Literata", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-paper: 6px;
  --r-control: 8px;
  --r-float: 14px;
  --r-tactile: 24px;
  --strip-h: 40px;
  --caption-h: 48px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #1D1F21;
    --sheet: #27292C;
    --raised: #323539;
    --ink: #FFFFFF;
    --ink-2: rgba(255, 255, 255, 0.64);
    --edge: rgba(255, 255, 255, 0.22);
    --divider: rgba(255, 255, 255, 0.11);
    --ruling: rgba(255, 255, 255, 0.12);
    --hover: rgba(255, 255, 255, 0.06);
    --mauve-strong: #8C6F9C;
    --mauve-wash: rgba(150, 122, 161, 0.26);
    --teal-text: #4CC6E0;
    --warn-edge: #E6AF2E;
    --warn-wash: rgba(230, 175, 46, 0.12);
    --pen: #F1F1EE;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #1D1F21;
  --sheet: #27292C;
  --raised: #323539;
  --ink: #FFFFFF;
  --ink-2: rgba(255, 255, 255, 0.64);
  --edge: rgba(255, 255, 255, 0.22);
  --divider: rgba(255, 255, 255, 0.11);
  --ruling: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.06);
  --mauve-strong: #8C6F9C;
  --mauve-wash: rgba(150, 122, 161, 0.26);
  --teal-text: #4CC6E0;
  --warn-edge: #E6AF2E;
  --warn-wash: rgba(230, 175, 46, 0.12);
  --pen: #F1F1EE;
}

/* ------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-text); text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
code, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--mauve); outline-offset: 2px; }
::selection { background: var(--mauve-wash); }

/* One language at a time. */
html[lang="de"] [data-lang="en"],
html[lang="en"] [data-lang="de"] { display: none !important; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--sheet); border: 1px solid var(--edge); border-radius: var(--r-control);
  padding: 8px 12px;
}
.skip:focus { top: 8px; }

/* ---------------------------------------------------------- caption */

.caption {
  height: var(--caption-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--edge);
  background: var(--desk);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.2px;
}
.brand img { width: 30px; height: 30px; }
.caption-actions { display: flex; align-items: center; gap: 8px; }
.caption-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--edge); border-radius: var(--r-control);
  background: var(--sheet); cursor: pointer; font-size: 14px;
}
.caption-btn svg { width: 18px; height: 18px; }
.caption-btn:hover { background: var(--hover); }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-control); background: transparent; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--edge); border-radius: var(--r-control);
  background: var(--sheet);
}
.segmented button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; font-size: 14px; font-weight: 500;
  color: var(--ink-2);
}
.segmented button[aria-pressed="true"] { background: var(--mauve-wash); color: var(--ink); }
.segmented button:hover:not([aria-pressed="true"]) { background: var(--hover); color: var(--ink); }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-control); border: 1px solid transparent;
  font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--mauve-strong); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--mauve-strong) 88%, #000); }
.btn-quiet { background: var(--sheet); color: var(--ink); border-color: var(--edge); }
.btn-quiet:hover { background: color-mix(in srgb, var(--sheet) 92%, var(--ink)); }
.btn-large { min-height: 56px; padding: 0 26px; font-size: 18px; border-radius: 10px; }
.try-btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* -------------------------------------------------------- workspace */

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  outline: none;
}
.node { display: flex; min-width: 0; min-height: 0; }
.split { display: flex; flex: 1; min-width: 0; min-height: 0; }
.split[data-axis="column"] { flex-direction: column; }

/* The seam between tiles: a line you can see and take hold of. */
.seam {
  flex: none; position: relative; z-index: 2;
  background: var(--edge);
}
.split[data-axis="row"] > .seam { width: 1px; cursor: col-resize; }
.split[data-axis="column"] > .seam { height: 1px; cursor: row-resize; }
.seam::before { content: ""; position: absolute; inset: -5px; }
.split[data-axis="row"] > .seam::after,
.split[data-axis="column"] > .seam::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  background: var(--ink-2); border-radius: 2px; opacity: 0.55;
  transform: translate(-50%, -50%);
}
.split[data-axis="row"] > .seam::after { width: 3px; height: 28px; }
.split[data-axis="column"] > .seam::after { width: 28px; height: 3px; }
.seam:hover, .seam.dragging { background: var(--mauve); }

.pane {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  position: relative;
  background: var(--desk);
  container-type: inline-size;
  container-name: tile;
}

/* Not tiled: the tabs start where the page's content does — the left edge
   of the centred column (1180px wide, inside the panel's padding) — so
   the eye stays on the middle of the page. */
.workspace.untiled .strip {
  --pad: clamp(16px, 3.5cqi, 40px);
  padding-left: calc(max(0px, (100cqi - 2 * var(--pad) - 1180px) / 2) + var(--pad));
}
.workspace.untiled .tab:first-child { border-left: 1px solid var(--edge); }

/* ------------------------------------------------------------ strip */

.strip {
  flex: none; height: var(--strip-h);
  display: flex; align-items: stretch;
  background: var(--desk);
  border-bottom: 1px solid var(--edge);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  position: relative;
}
.strip::-webkit-scrollbar { display: none; }
.strip.drop-candidate { background: color-mix(in srgb, var(--desk) 88%, var(--mauve)); }
.tab {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  padding: 0 4px 0 14px;
  border-right: 1px solid var(--edge);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-x;
  font-size: 15px;
  white-space: nowrap;
}
.tab:hover { background: var(--hover); }
.tab[aria-selected="true"] {
  background: var(--sheet);
  color: var(--ink);
  border-bottom-color: var(--mauve);
}
.pane:not(.active-pane) .tab[aria-selected="true"] { color: var(--ink-2); }
.tab .tab-label { padding: 6px 0; }
.tab .tab-close {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 6px; color: inherit; opacity: 0.8;
}
.tab .tab-close svg { width: 14px; height: 14px; }
.tab .tab-close:hover { background: var(--hover); opacity: 1; }
.tab.dragging-source { opacity: 0.35; }
.tab.refuses { animation: refuse 260ms ease; }
@keyframes refuse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.strip-marker {
  position: absolute; top: 6px; bottom: 6px; width: 2px;
  background: var(--mauve); border-radius: 2px; pointer-events: none;
}

.pane-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  container-type: inline-size;
  container-name: pane;
  position: relative;
  scroll-behavior: auto;
}
.pane-body > .panel { min-height: 100%; }

/* Dock zones: the half a drop would make lights up, as in the app. */
.dock-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--strip-h);
  pointer-events: none; z-index: 5;
}
.dock-overlay .zone {
  position: absolute; display: none;
  background: var(--mauve-wash);
  border: 1px solid var(--mauve);
  border-radius: 2px;
}
.dock-overlay[data-side] .zone { display: block; }
.dock-overlay[data-side="left"] .zone { left: 0; top: 0; bottom: 0; width: 50%; }
.dock-overlay[data-side="right"] .zone { right: 0; top: 0; bottom: 0; width: 50%; }
.dock-overlay[data-side="top"] .zone { left: 0; right: 0; top: 0; height: 50%; }
.dock-overlay[data-side="bottom"] .zone { left: 0; right: 0; bottom: 0; height: 50%; }
.dock-overlay[data-side="center"] .zone { inset: 0; background: color-mix(in srgb, var(--mauve-wash) 50%, transparent); }

.drag-ghost {
  position: fixed; z-index: 40; pointer-events: none;
  padding: 8px 14px;
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--edge); border-bottom: 2px solid var(--mauve);
  border-radius: var(--r-paper);
  font-size: 15px;
  transform: translate(-50%, -60%);
}
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
body.resizing-row, body.resizing-row * { cursor: col-resize !important; user-select: none; }
body.resizing-column, body.resizing-column * { cursor: row-resize !important; user-select: none; }

.menu {
  position: fixed; z-index: 45; min-width: 220px;
  padding: 6px;
  background: var(--raised);
  border: 1px solid var(--edge);
  border-radius: calc(var(--r-float) - 4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; background: transparent; border-radius: 6px;
  font-size: 14px; text-align: left; cursor: pointer;
}
.menu button svg { width: 18px; height: 18px; color: var(--ink-2); }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button[disabled] { opacity: 0.45; cursor: default; }
.menu hr { border: 0; border-top: 1px solid var(--divider); margin: 6px 4px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--sheet);
  padding: 10px 16px; border-radius: var(--r-control);
  font-size: 14px; pointer-events: none;
  transition: opacity 160ms, transform 160ms;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ paper */

.panel { padding: clamp(16px, 3.5cqi, 40px); }
.sheet {
  background: var(--sheet);
  border: 1px solid var(--edge);
  border-radius: var(--r-paper);
}
.dotted {
  background-color: var(--sheet);
  background-image: radial-gradient(circle, var(--ruling) 1.1px, transparent 1.4px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
.muted { color: var(--ink-2); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.3px; line-height: 1.2; }
h2 { font-size: clamp(24px, 3.2cqi, 34px); margin: 0 0 12px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
p { margin: 0 0 12px; }
.section-head { max-width: 62ch; margin-bottom: 24px; }
.section-head p { color: var(--ink-2); font-size: 17px; }
.small-head { font-family: var(--font-text); font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin: 0 0 12px; }

/* ------------------------------------------------------------- home */

.home { display: flex; flex-direction: column; gap: clamp(40px, 7cqi, 88px); max-width: 1180px; margin: 0 auto; }
.home > * { flex: none; }

.hero {
  padding: clamp(24px, 5cqi, 64px);
  background-color: var(--sheet);
  background-image: radial-gradient(circle, var(--ruling) 1.1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  position: relative;
  overflow: hidden;
}
.hero-text { max-width: 680px; }
.hero-phone { display: none; margin: 0; }
@container pane (min-width: 980px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 48px; align-items: center; }
  .hero-phone { display: block; transform: rotate(2.5deg); }
}
.ink-headline {
  display: block;
  width: min(100%, 540px);
  height: auto;
  margin: 0 0 20px -6px;
  overflow: visible;
}
.ink-headline path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ink-headline .underline { stroke: var(--mauve); stroke-width: 3.4; }
.lede { font-size: clamp(17px, 1.9cqi, 19px); max-width: 60ch; margin-bottom: 28px; }

/* The download widget, used on Home and on the Download tab. */
.get { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.get-meta { font-size: 14px; color: var(--ink-2); }
.get-detected { font-size: 14px; color: var(--ink-2); margin: 0; }
.get-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.get-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.linkish {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--teal-text); text-decoration: underline; text-underline-offset: 0.18em;
  font-size: inherit;
}
.unavailable {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; max-width: 60ch;
  background: var(--desk); border: 1px solid var(--edge); border-radius: var(--r-paper);
}
.unavailable svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--ink-2); }
.unavailable p { margin: 0; }

.command { width: 100%; max-width: 640px; }
.command-label { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.command-box {
  display: flex; align-items: stretch;
  border: 1px solid var(--edge); border-radius: var(--r-control);
  background: var(--desk);
  overflow: hidden;
}
.command-box code {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  font-size: 14px;
  overflow-x: auto; white-space: nowrap;
}
.command-box .prompt { color: var(--ink-2); user-select: none; margin-right: 8px; }
.copy-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-left: 1px solid var(--edge);
  background: var(--sheet); padding: 0 14px; cursor: pointer; font-size: 14px;
}
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn:hover { background: var(--hover); }

/* The tile scene: loose tiles that grow and dock into one window. */
.scene { position: relative; height: calc(var(--pane-h, 100vh) * 2.6); }
.scene-stage {
  position: sticky; top: 0;
  height: var(--pane-h, 100vh);
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 2.2fr;
  gap: clamp(20px, 3cqi, 48px);
  align-items: center;
  padding: 24px 0;
}
.scene-copy { position: relative; min-height: 220px; }
.scene-step {
  position: absolute; inset: 0 0 auto 0;
  margin: 0;
  opacity: 0; transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease;
}
.scene-step strong {
  display: block;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(22px, 2.6cqi, 30px); line-height: 1.2; letter-spacing: -0.3px;
  margin-bottom: 10px;
}
.scene-step span { color: var(--ink-2); font-size: 17px; }
.scene[data-active="0"] .scene-step[data-step="0"],
.scene[data-active="1"] .scene-step[data-step="1"],
.scene[data-active="2"] .scene-step[data-step="2"] { opacity: 1; transform: none; }

.scene-window {
  --p: 0;
  /* t: how far the tiles have come together (0 loose, 1 docked);
     g: how far the docked window has grown afterwards. */
  --t: clamp(0, calc((var(--p) - 0.08) / 0.5), 1);
  --g: clamp(0, calc((var(--p) - 0.62) / 0.3), 1);
  --gap: calc((1 - var(--t)) * 22px);
  display: grid;
  grid-template-columns: 0.206fr 0.394fr 0.394fr;
  grid-template-rows: 0.505fr 0.495fr;
  gap: var(--gap);
  aspect-ratio: 2880 / 1760;
  width: 100%;
  max-height: calc(var(--pane-h, 100vh) - 48px);
  transform: scale(calc(0.86 + 0.14 * var(--g)));
  transform-origin: 60% 50%;
}
.scene-window .tile {
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--edge);
  border-radius: calc((1 - var(--t)) * 10px);
  transform:
    translate(calc((1 - var(--t)) * var(--dx, 0px)), calc((1 - var(--t)) * var(--dy, 0px)))
    scale(calc(0.62 + 0.38 * var(--t)));
  transform-origin: center;
}
.scene-window .tile img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.scene-window .tile-deck img { height: auto; }
.tile-side { grid-row: 1 / 3; grid-column: 1; --dx: -30px; --dy: 18px; }
.tile-note { grid-row: 1 / 3; grid-column: 2; --dx: 0px; --dy: -24px; }
.tile-board { grid-row: 1; grid-column: 3; --dx: 34px; --dy: -14px; }
.tile-deck { grid-row: 2; grid-column: 3; --dx: 26px; --dy: 30px; }

/* Narrow tiles get a plain stack that grows as it comes into view. */
.scene.flat { height: auto; }
.scene.flat .scene-stage { position: static; height: auto; grid-template-columns: 1fr; padding: 0; }
.scene.flat .scene-copy { min-height: 0; }
.scene.flat .scene-step { position: static; opacity: 1; transform: none; margin-bottom: 20px; }
.scene.flat .scene-step[data-step="2"] { display: none; }
.scene.flat .wide-only { display: none; }
.scene.flat .scene-window { max-height: none; --t: var(--p); --g: var(--p); transform: scale(calc(0.9 + 0.1 * var(--p))); }

.phones .section-head { margin-bottom: 32px; }
.phone-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 3cqi, 40px);
  align-items: end;
  max-width: 920px;
  margin: 0 auto;
}
.phone { margin: 0; --g: 1; transform: scale(calc(0.8 + 0.2 * var(--g))); transform-origin: 50% 100%; }
.phone:nth-child(2) { transform: scale(calc(0.84 + 0.22 * var(--g))) translateY(calc(-14px * var(--g))); }
.phone-frame {
  padding: 8px;
  background: #16171A;
  border-radius: 34px;
  box-shadow: 0 0 0 1px var(--edge);
}
.phone-frame img { border-radius: 27px; aspect-ratio: 720 / 1548; width: 100%; height: auto; }
.phone figcaption { text-align: center; color: var(--ink-2); font-size: 14px; margin-top: 12px; }

.index-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.index-card {
  background: var(--sheet);
  border: 1px solid var(--edge);
  border-top: 4px solid var(--layer, var(--mauve));
  border-radius: var(--r-paper);
  padding: 18px 20px 20px;
}
.index-card[data-layer="ink"] { --layer: var(--mauve); }
.index-card[data-layer="study"] { --layer: var(--gold); }
.index-card[data-layer="link"] { --layer: var(--teal); }
.index-card h3 { margin: 0 0 12px; padding-bottom: 10px; font-size: 19px; border-bottom: 1px solid var(--divider); }
.index-card p { margin: 0; color: var(--ink-2); font-size: 15.5px; }

.closing {
  display: flex; gap: clamp(16px, 4cqi, 48px); align-items: center;
  padding: clamp(24px, 4cqi, 48px);
  margin-bottom: 24px;
}
.closing h2 { margin-bottom: 10px; }
.closing p { color: var(--ink-2); max-width: 56ch; margin-bottom: 20px; }
.sloth { width: clamp(110px, 18cqi, 200px); height: auto; flex: none; }

/* --------------------------------------------------------- download */

.download { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; padding-bottom: 32px; }
.download-main {
  background: var(--sheet); border: 1px solid var(--edge); border-radius: var(--r-paper);
  padding: clamp(28px, 6cqi, 64px) clamp(16px, 4cqi, 48px);
}
.download-main .get { align-items: center; text-align: center; }
.download-main .get-actions { justify-content: center; }
.download-main .get-links { justify-content: center; }
.download-main .command { margin: 0 auto; text-align: left; }
.get-os-icon { width: 56px; height: 56px; color: var(--ink); }
.get-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4cqi, 36px); margin: 0; letter-spacing: -0.4px; }
.download-main .unavailable { text-align: left; }

.os-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.os-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 10px;
  border: 1px solid var(--edge); border-radius: var(--r-control);
  background: var(--sheet); cursor: pointer; font-size: 15px;
}
.os-chip svg { width: 20px; height: 20px; }
.os-chip:hover { background: var(--hover); }
.os-chip[aria-checked="true"] { border-color: var(--mauve); background: var(--mauve-wash); }
.os-chip .soon { font-size: 12px; color: var(--ink-2); }

.versions { border: 1px solid var(--edge); border-radius: var(--r-paper); background: var(--sheet); overflow: hidden; }
.version-group + .version-group { border-top: 1px solid var(--edge); }
.version-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px 6px;
}
.version-head strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.badge {
  font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px;
  background: var(--mauve-wash); color: var(--ink);
}
.version-head .when { font-size: 14px; color: var(--ink-2); }
.file-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--divider);
}
.version-head + .file-row { border-top: 0; }
.file-row .file-what { min-width: 0; }
.file-row .file-name { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.file-row .size { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.file-row .btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
.versions-empty { padding: 20px 16px; color: var(--ink-2); margin: 0; }

/* ------------------------------------------------------------- help */

.help { max-width: 1080px; margin: 0 auto; }
.question-tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.question {
  display: flex; flex-direction: column; height: 100%;
  color: var(--ink); text-decoration: none;
  background: var(--sheet);
  border: 1px solid var(--edge);
  border-radius: var(--r-paper);
  overflow: hidden;
  transition: border-color 140ms;
}
.question:hover { border-color: var(--mauve); }
.question img {
  aspect-ratio: 16 / 9; width: 100%; object-fit: cover; object-position: top left;
  border-bottom: 1px solid var(--edge);
  border-top: 4px solid var(--layer, var(--mauve));
}
.question[data-layer="ink"] { --layer: var(--mauve); }
.question[data-layer="study"] { --layer: var(--gold); }
.question[data-layer="link"] { --layer: var(--teal); }
.question .q { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.3; padding: 16px 18px 6px; }
.question .a { color: var(--ink-2); font-size: 15px; padding: 0 18px 18px; }

.help-article {
  max-width: 820px; margin: 0 auto;
  background: var(--sheet); border: 1px solid var(--edge); border-radius: var(--r-paper);
  padding: clamp(18px, 4cqi, 44px);
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 4px 0; margin-bottom: 14px; cursor: pointer;
  color: var(--teal-text); font-size: 15px;
}
.back-link svg { width: 16px; height: 16px; }
.article-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.article-head h2 { margin: 0; }
.article-head .segmented { align-self: flex-start; flex-wrap: wrap; }
.article-intro { font-size: 17px; }
.help-article h3 { font-size: 21px; }
.help-article h3 small { font-family: var(--font-text); font-weight: 400; font-size: 14px; color: var(--ink-2); }
.steps { padding-left: 1.4em; margin: 0 0 20px; }
.steps li { margin-bottom: 12px; padding-left: 4px; }
.steps li::marker { font-family: var(--font-display); font-weight: 600; color: var(--mauve-strong); }
.shot { margin: 8px 0 24px; }
.shot img { border: 1px solid var(--edge); border-radius: var(--r-paper); width: 100%; }
.shot figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 520px; }
.phone-shot img { border-radius: 18px; }
.note { font-size: 15px; color: var(--ink-2); }
pre.code {
  position: relative;
  padding-right: 92px !important;
  background: var(--desk); border: 1px solid var(--edge); border-radius: var(--r-control);
  padding: 12px 14px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; margin: 0 0 16px;
}
code { font-size: 0.92em; }
.code-copy {
  position: absolute; top: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border: 1px solid var(--edge); border-radius: 6px;
  background: var(--sheet); font-family: var(--font-text); font-size: 13px; cursor: pointer;
}
.code-copy svg { width: 14px; height: 14px; }
.code-copy:hover { background: var(--hover); }
.steps pre.code { margin: 10px 0 0; }
.help-article h4 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 26px 0 8px; letter-spacing: -0.2px; }
.help-article h4 small { font-family: var(--font-text); font-weight: 400; font-size: 14px; color: var(--ink-2); }
.help-article .variant-switch { margin: 4px 0 8px; flex-wrap: wrap; }
.help-article ul { padding-left: 1.2em; }
.help-article li { margin-bottom: 8px; }
.callout {
  margin: 8px 0 24px; padding: 16px 18px;
  border-radius: var(--r-paper);
  border: 1px solid var(--edge);
  border-left: 4px solid var(--teal);
  background: var(--desk);
}
.callout h3 { margin: 0 0 6px; font-size: 18px; }
.callout p:last-child { margin-bottom: 0; }
.callout[data-tone="warn"] {
  border-color: var(--warn-edge);
  border-left-width: 4px;
  background: var(--warn-wash);
  display: flex; gap: 16px; align-items: flex-start;
}
.no-phone-icon { width: 48px; height: 48px; flex: none; color: var(--ink); --sheet: var(--warn-wash); }
[data-variant][hidden] { display: none !important; }

/* ------------------------------------------------------------ prose */

.prose { max-width: 780px; margin: 0 auto; padding: clamp(20px, 5cqi, 52px); }
.prose h3 { font-size: 20px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
.draft-note { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--divider); color: var(--ink-2); font-size: 14px; }
.email-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 20px; padding: 18px;
  background: var(--desk); border: 1px solid var(--edge); border-radius: var(--r-paper);
}
.email-card a.address { font-size: clamp(18px, 3cqi, 24px); font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.email-card a.address:hover { color: var(--teal-text); }
address { font-style: normal; font-size: 17px; line-height: 1.7; }
.donate-action { margin: 24px 0; }
.sloth-small { width: 140px; margin: 24px 0 0 auto; opacity: 0.95; }
.config-missing { color: var(--ink-2); font-style: italic; }

.noscript { margin: 24px; padding: 24px; }

/* ------------------------------------------------- narrow / phones */

@container pane (max-width: 760px) {
  .scene-stage { grid-template-columns: 1fr; }
  .closing { flex-direction: column; align-items: flex-start; }
  .file-row { grid-template-columns: 1fr auto; }
  .file-row .size { display: none; }
}
@container pane (max-width: 520px) {
  .phone-row { grid-template-columns: 1fr 1fr; }
  .phone-row .phone:nth-child(3) { display: none; }
  .shot-pair { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root { --caption-h: 52px; }
  .caption { padding: 0 8px 0 12px; }
  .try-btn > span { display: none; }
  .try-btn { padding: 0 9px; }
  .brand { font-size: 18px; }
  .tab { padding-left: 12px; font-size: 14px; }
  .btn-large { width: 100%; }
  .get, .get-actions { width: 100%; }
  .get-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .scene { height: auto; }
  .scene-stage { position: static; height: auto; }
  .scene-step { position: static; opacity: 1; transform: none; margin-bottom: 16px; }
  .scene-copy { min-height: 0; }
  .scene-window { --t: 1; --g: 1; transform: none; }
  .phone, .phone:nth-child(2) { transform: none; }
}

/* --------------------------------------------------------- lightbox */

.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--mauve); outline-offset: 3px; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 56px 16px 16px; border: 0;
  background: transparent;
  display: none;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox::backdrop { background: rgba(16, 17, 19, 0.86); }
.lightbox img {
  max-width: min(100%, 1800px); max-height: calc(100dvh - 120px);
  width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  cursor: zoom-out;
}
.lightbox img.phone-sized { border-radius: 22px; }
.lightbox-caption { color: #fff; font-size: 15px; margin: 0; text-align: center; max-width: 70ch; }
.lightbox-caption:empty { display: none; }
.lightbox-close { position: fixed; top: 12px; right: 12px; color: #fff; background: rgba(255, 255, 255, 0.12); }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
