/* Scriby website.
   One typeface (the app's own book face), the app's warm black and brass, and almost no chrome.
   Every scene is exactly one screen. Type and spacing scale with the viewport HEIGHT as well as the width,
   so nothing is clipped on a short laptop screen. Every scene is written in its finished state;
   site.js animates toward it. */

@font-face { font-family: 'TeX Gyre Pagella'; src: url('assets/fonts/pagella-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'TeX Gyre Pagella'; src: url('assets/fonts/pagella-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'TeX Gyre Pagella'; src: url('assets/fonts/pagella-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #1a1814;
  --ink: #d6d2c6;
  --dim: #9a9486;
  --brass: #c9a86a;
  --line: rgba(214, 210, 198, 0.16);
  --chrome: #d6d2c6;                       /* colour of the fixed furniture; site.js flips it in the light rooms */
  --serif: 'TeX Gyre Pagella', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --display: 'Didot', 'Bodoni 72', 'Playfair Display', Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --m: clamp(24px, 8vw, 140px);
  --fs: clamp(16px, min(1.3vw, 2.35vh), 19px);       /* body */
  --h2: clamp(28px, min(4.6vw, 7.2vh), 72px);        /* scene headings */
  --pt: clamp(72px, 11vh, 120px);                    /* clears the top bar */
  --pb: clamp(52px, 8vh, 90px);                      /* clears the word count */
  --rail: 0px;                                       /* room kept clear for the section rail */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: var(--fs); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-kerning: normal;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--brass) 38%, transparent); }
h1, h2, h3, p, ol, ul { margin: 0; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8em; color: var(--ink); }
kbd { font-family: var(--ui); font-size: 0.72em; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; white-space: nowrap; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 100; left: 16px; top: -60px; background: var(--brass); color: #1a1814; padding: 10px 18px; border-radius: 999px; font-family: var(--ui); font-size: 14px; text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 14px; }

/* ---------- the fog (WebGL) ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; background: var(--bg); }
main, .foot { position: relative; z-index: 1; }

/* ---------- fixed furniture ---------- */
.bar, .count, .rail, .calm { color: var(--chrome); }
.bar { position: fixed; z-index: 20; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; padding: 14px var(--m); pointer-events: none; }
.bar a { pointer-events: auto; text-decoration: none; }
.mark { font-style: italic; font-size: 26px; line-height: 1; padding: 8px 0; }
.bar-dl { font-size: 16px; padding: 12px 4px; }
.bar-dl:hover { text-decoration: underline; }
.count { position: fixed; z-index: 20; left: var(--m); bottom: 22px; font-style: italic; font-size: 15px; opacity: 0.72; font-variant-numeric: tabular-nums; pointer-events: none; }
.calm { position: fixed; z-index: 20; right: var(--m); bottom: 14px; background: none; border: 0; font: italic 15px var(--serif); opacity: 0.6; cursor: pointer; padding: 8px 0; }
.calm:hover, .calm[aria-pressed='true'] { opacity: 1; }

/* section rail, desktop only: labels beside the dots from 1280px, dots alone below that */
@media (min-width: 861px) { :root { --rail: 72px; } }
@media (min-width: 1280px) { :root { --rail: 168px; } }
.rail { position: fixed; z-index: 20; right: clamp(14px, 2.2vw, 36px); top: 50%; transform: translateY(-50%); }
.rail ol { list-style: none; padding: 0; display: grid; gap: 0; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 30px; text-decoration: none; font-size: 14px; font-style: italic; opacity: 0.55; transition: opacity 0.3s; }
.rail a::after { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transition: width 0.4s var(--ease), border-radius 0.4s, background 0.3s; }
.rail a:hover, .rail a:focus-visible { opacity: 1; }
.rail a[aria-current='true'] { opacity: 1; }
.rail a[aria-current='true']::after { width: 22px; height: 2px; border-radius: 1px; }
.rail .lbl { transition: transform 0.4s var(--ease); }
.rail a[aria-current='true'] .lbl { transform: translateX(-2px); }
@media (max-width: 1279px) {            /* dots only; labels on hover or focus */
  .rail .lbl { position: absolute; right: 30px; padding: 3px 10px; background: var(--bg); border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity 0.2s; white-space: nowrap; }
  .rail a:hover .lbl, .rail a:focus-visible .lbl { opacity: 1; }
}

.btn {
  display: inline-block; text-decoration: none; background: var(--brass); color: #1a1814;
  font-family: var(--ui); font-size: 16px; font-weight: 500; line-height: 1.2;
  padding: 16px 34px; border-radius: 999px; transition: transform 0.4s var(--ease), background 0.3s;
}
.btn:hover { background: #d8ba80; transform: translateY(-2px); }

/* ---------- type ---------- */
.h2 { font-weight: 400; font-size: var(--h2); line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; max-width: 15em; }
.note { color: var(--dim); font-style: italic; font-size: 0.92em; }

/* ---------- every scene is one screen ---------- */
.screen { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: var(--pt) max(var(--m), var(--rail)) var(--pb) var(--m); }
.fade { width: 100%; }

/* 1. hero */
.hero { padding-top: 0; padding-bottom: 0; }
.title { font-weight: 400; font-size: clamp(88px, min(24vw, 40vh), 380px); line-height: 0.9; letter-spacing: -0.035em; margin-left: -0.04em; padding-bottom: 0.08em; }
.title span:not(.sr-only) { display: inline-block; will-change: transform, opacity; }
.tagline { font-size: clamp(22px, min(2.8vw, 4.6vh), 40px); font-style: italic; opacity: 0.9; margin-top: clamp(10px, 2.4vh, 30px); }
.hero-cta { display: flex; align-items: center; gap: 18px 30px; flex-wrap: wrap; margin-top: clamp(26px, 6vh, 64px); }
.hero-foot { color: var(--dim); font-style: italic; font-size: 0.92em; }

/* 2. promise */
.statement { font-size: clamp(28px, min(4.7vw, 8vh), 72px); line-height: 1.16; letter-spacing: -0.015em; max-width: 19em; text-wrap: pretty; }
.statement .w { display: inline-block; }

/* 3. the page, in four rooms */
.rooms {
  --room-bg: #1a1814; --sheet: #25221d; --sheet-ink: #d6d2c6; --sheet-dim: #918b7d; --room-ink: #d6d2c6;
  background: var(--room-bg); color: var(--room-ink); padding-inline: 16px; align-items: center;
}
.rooms-pin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 3vh, 28px); }
.sheet {
  --sf: clamp(13.5px, min(1.5vw, 2.15vh), 19.5px);
  width: min(680px, 100%); background: var(--sheet); color: var(--sheet-ink);
  padding: clamp(20px, 4.4vh, 64px) clamp(22px, 5.6vw, 76px) clamp(24px, 4.8vh, 70px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.38), 0 30px 80px rgba(0, 0, 0, 0.18);
}
.sheet .run { text-align: center; font-style: italic; font-size: 0.8em; color: var(--sheet-dim); opacity: 0.8; margin-bottom: clamp(10px, 2.6vh, 32px); font-size: calc(var(--sf) * 0.8); }
.sheet .chap { text-align: center; font-size: clamp(10px, calc(var(--sf) * 0.68), 13px); letter-spacing: 0.26em; text-transform: uppercase; color: var(--sheet-dim); margin-bottom: clamp(14px, 3.6vh, 40px); }
.sheet .para { font-size: var(--sf); line-height: 1.75; hyphens: auto; }
.sheet .para + .para { text-indent: 2em; }
.sheet .dc { float: left; font-family: var(--display); font-size: 4.4em; line-height: 0.8; padding: 0.05em 0.1em 0 0; }
.sheet .w { display: inline-block; text-indent: 0; }
.caret { display: inline-block; width: 1.5px; height: 1.05em; background: currentColor; vertical-align: -0.16em; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.room-label { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.room-name { font-size: clamp(20px, 3.4vh, 26px); font-style: italic; min-width: 6em; }
.room-note { font-size: 0.85em; font-style: italic; opacity: 0.65; }

/* 4. what the page does */
.quiet .h2 { margin-bottom: clamp(24px, 7vh, 80px); }
.quiet-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 26rem)); gap: clamp(16px, 3.4vh, 36px) clamp(32px, 8vw, 120px); }
.quiet-cols p { color: var(--dim); max-width: 26em; }

/* 5. Enter, Enter, Enter */
.enter { align-items: center; }
.enter-pin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 5vh, 52px); }
.keys { display: flex; gap: 14px; }
.key { font-family: var(--ui); font-size: 13px; padding: 11px 22px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 10px; color: var(--dim); }
.typed { width: min(34rem, 100%); font-size: clamp(17px, min(2.1vw, 3.3vh), 30px); line-height: 1.55; }
.typed .t-p2 { text-indent: 1.6em; }
.typed .t-break { text-align: center; color: var(--brass); letter-spacing: 0.7em; padding-left: 0.7em; margin: 0.7em 0; }
.typed .t-chap { font-style: italic; text-align: center; color: var(--dim); font-size: 0.7em; margin: 1.6em 0 0.4em; }
.enter-caps { position: relative; height: 1.6em; width: min(34rem, 100%); text-align: center; font-style: italic; font-size: clamp(17px, min(1.9vw, 3vh), 24px); color: var(--brass); }
.enter-caps .cap { position: absolute; inset: 0; opacity: 0; }
.enter-caps .c3 { opacity: 1; }

/* 6, 9. image and text, side by side */
.split-in { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 110px); align-items: center; }
.companion .split-in { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
.split-text { display: grid; gap: clamp(10px, 2.2vh, 20px); align-content: center; }
.split-text .h2 { font-size: calc(var(--h2) * 0.82); margin-bottom: 0.15em; }
.split-text p:not(.note) { color: var(--dim); max-width: 31em; }
.shot { margin: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5); height: min(62vh, 560px); width: 100%; justify-self: center; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; will-change: transform; }
.companion .shot { max-width: 640px; }
.shelf .shot { justify-self: end; max-width: 680px; }

/* 7. outline */
.outline-pin { display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 5vh, 56px); }
.outline-head { display: grid; gap: clamp(8px, 2vh, 18px); }
.outline-head p { color: var(--dim); max-width: 34em; }
.outline-head .h2 { font-size: calc(var(--h2) * 0.95); }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px); padding-right: clamp(0px, 5vw, 72px); }
.icard { position: relative; background: #e2ddd1; color: #1c1c1c; border-radius: 5px; padding: 12px 14px 16px; min-height: clamp(100px, 19vh, 170px); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); will-change: transform; }
.icard .n { font-family: var(--display); font-size: clamp(22px, 3.6vh, 30px); line-height: 1; color: #7a6538; }
.icard .w { position: absolute; top: 15px; right: 14px; font-family: var(--ui); font-size: 11px; color: #6f6a5e; }
.icard p { margin-top: 0.6em; padding-top: 0.6em; border-top: 1px solid #cdc6b4; font-size: clamp(13px, 1.2vw, 17px); line-height: 1.35; }
.outline-foot { color: var(--dim); font-style: italic; }

/* 8. darlings */
.darlings-pin { display: flex; flex-direction: column; gap: clamp(20px, 5vh, 56px); height: calc(100svh - var(--pt) - var(--pb)); position: relative; }
.dl-copy { display: grid; gap: clamp(8px, 2vh, 18px); }
.dl-copy .h2 { font-size: calc(var(--h2) * 0.95); }
.dl-caps { position: relative; height: 3em; max-width: 34rem; color: var(--dim); font-style: italic; }
.dl-caps .cap { position: absolute; inset: 0 auto auto 0; opacity: 0; }
.dl-caps .k1 { opacity: 1; }
.dl-page { width: min(36rem, 100%); font-size: clamp(17px, min(2vw, 3.2vh), 26px); line-height: 1.5; margin-block: auto; }
.dl-line { margin-bottom: 0.7em; }
.drawer { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: baseline; gap: 14px; font-style: italic; color: var(--dim); }
.drawer-count { font-style: normal; color: var(--brass); font-variant-numeric: tabular-nums; }

/* 10. contents */
.contents .h2 { margin-bottom: clamp(18px, 5vh, 56px); }
.toc { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 96px); max-width: 64rem; }
.toc li { display: grid; gap: 0.25em; padding: clamp(10px, 1.9vh, 20px) 0; border-top: 1px solid var(--line); align-content: start; }
.toc .wide { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
.toc .t { font-size: clamp(19px, min(1.9vw, 3.1vh), 26px); line-height: 1.2; }
.toc .d { color: var(--dim); line-height: 1.45; max-width: 36em; }
.toc .wide .d { max-width: none; }

/* 11. files */
.files-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: center; }
.files-text { display: grid; gap: clamp(10px, 2.2vh, 20px); }
.files-text p { color: var(--dim); max-width: 32em; }
.tree { margin: 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: clamp(12px, 1.05vw, 14px); line-height: 2; color: var(--dim); border-left: 1px solid var(--line); padding: 0 0 0 clamp(16px, 3vw, 40px); overflow-x: auto; white-space: pre; }

/* 12. install */
.install-in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 110px); align-items: center; }
.install-head { display: grid; gap: clamp(12px, 2.6vh, 24px); justify-items: start; }
.install-head p { color: var(--dim); max-width: 22em; }
.steps { list-style: none; padding: 0; display: grid; gap: clamp(14px, 3.4vh, 34px); }
.steps li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.8rem; color: var(--dim); }
.steps .sn { font-family: var(--display); font-size: clamp(26px, 4.4vh, 34px); line-height: 1; color: var(--brass); }
.steps p { max-width: 36em; }
.steps code { background: rgba(214, 210, 198, 0.07); padding: 2px 7px; border-radius: 4px; overflow-wrap: anywhere; }
.install .update { margin-top: clamp(14px, 3vh, 30px); }

/* 13. faq */
.faq .h2 { margin-bottom: clamp(16px, 4vh, 44px); }
.qa { max-width: 46rem; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: clamp(12px, 2.3vh, 21px) 2.4rem clamp(12px, 2.3vh, 21px) 0; font-size: clamp(18px, min(1.8vw, 2.9vh), 24px); position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; position: absolute; right: 4px; top: 50%; width: 11px; height: 11px; margin-top: -8px; border-right: 1.5px solid var(--brass); border-bottom: 1.5px solid var(--brass); transform: rotate(45deg); transition: transform 0.4s var(--ease); }
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { color: var(--dim); max-width: 36em; padding: 0 2.4rem 1.4rem 0; }

/* 14. end */
.end { align-items: center; text-align: center; }
.end-in { display: flex; flex-direction: column; align-items: center; gap: clamp(22px, 5vh, 48px); }
.end-title { font-weight: 400; font-size: clamp(54px, min(11vw, 18vh), 170px); line-height: 0.98; letter-spacing: -0.03em; text-wrap: balance; }
.roadmap { color: var(--dim); font-style: italic; font-size: 0.92em; max-width: 34rem; margin-top: clamp(12px, 5vh, 56px); }

.foot { padding: 44px var(--m) 60px; display: grid; gap: 14px; color: var(--dim); font-size: 14px; line-height: 1.7; background: linear-gradient(transparent, rgba(0, 0, 0, 0.25)); }
.foot .tag { font-style: italic; font-size: 17px; color: var(--ink); }
.foot p { max-width: 58rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.foot-links a { padding: 8px 0; }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 860px) {
  :root { --pt: 84px; --pb: 64px; }
  .rail, .calm, .count { display: none; }
  .bar { padding: 10px var(--m); }
  .split-in, .companion .split-in, .files-in, .install-in { grid-template-columns: 1fr; gap: 28px; }
  .companion .shot { order: 2; }
  .shot { height: auto; aspect-ratio: 4 / 3; }
  .quiet-cols { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-right: 0; }
  .icard { min-height: 100px; padding: 10px 12px 14px; }
  .icard .w { top: 13px; right: 12px; }
  .outline-head p, .outline-foot { display: none; }
  .darlings-pin { height: auto; min-height: calc(100svh - var(--pt) - var(--pb)); }
  .hero-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .btn, .rail a, .rail a::after { transition: none; }
  .calm { display: none; }
}
