/* The web field guide. Mobile-first and one-handed: one column, big numbers, the controls in a
   dock at the bottom. Dark by default; theme.js sets data-theme before first paint. */
:root {
  --sans: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, "SF Pro Display", "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --gold: #E8A35A;
  --bg: #000; --fg: #fff; --muted: #B8B8B8; --line: #38383B; --card: #141416; --core: #8a8a8e; --on-fg: #38383B;
  --w: 40rem;
  --dock: 4.25rem;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fff; --fg: #000; --muted: #48484c; --line: #c7c7cc; --card: #F3F3F3; --core: #8a8a8e; --on-fg: #B8B8B8;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.4; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); }
.ic { width: 1.35rem; height: 1.35rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic .fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: .4rem; }
[hidden] { display: none !important; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; max-width: var(--w); margin: 0 auto; padding: env(safe-area-inset-top) 1rem 0; height: calc(3.25rem + env(safe-area-inset-top)); background: var(--bg); }
.home-link { display: flex; align-items: center; min-height: 2.75rem; }
.logo { display: block; height: 1.15rem; width: auto; color: var(--fg); }
.bar-r { display: flex; gap: .25rem; margin-right: -.6rem; }
.icon-btn { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 99px; color: var(--fg); }

main { max-width: var(--w); margin: 0 auto; overflow-x: clip; padding: .75rem 1rem calc(var(--dock) + env(safe-area-inset-bottom) + 2rem); }

/* one page at a time: the #target, else the cover. app.js also sets .cur (old browsers, no :has). */
.js .page { display: none; }
.js .page:target, .js .page.cur, .js main:not(:has(.page:target)) > #cover { display: block; }
.page { scroll-margin-top: 4rem; }
html:not(.js) .page + .page { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2rem; }
.page.from-right { animation: in-right .18s ease-out; }
.page.from-left { animation: in-left .18s ease-out; }
@keyframes in-right { from { transform: translateX(1.25rem); opacity: .4; } }
@keyframes in-left { from { transform: translateX(-1.25rem); opacity: .4; } }

/* type */
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
h1 { font-family: var(--display); font-weight: 600; font-size: 2.1rem; line-height: 1.08; letter-spacing: -.03em; margin-bottom: 1.25rem; }
h1.second { margin-top: 2.5rem; }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; letter-spacing: -.02em; margin: 2.25rem 0 .9rem; }
h3 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 1.75rem 0 .6rem; }
.titled { display: inline-block; max-width: 100%; margin-bottom: 1.25rem; }
.titled h1 { margin-bottom: 0; }
.swash { display: block; width: 100%; height: .5rem; margin-top: .3rem; overflow: visible; }
.swash path { fill: none; stroke: currentColor; stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
.pill { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 99px; font-size: .78rem; letter-spacing: .03em; color: var(--muted); }
.pill b { font-weight: 600; color: var(--fg); }
.pdot { width: .4rem; height: .4rem; border-radius: 50%; background: var(--fg); display: block; }
.eyebrow-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; flex-wrap: wrap; }
.eyebrow-row .eyebrow { margin-bottom: 0; }

/* cover */
.cover .eyebrow { margin-top: .75rem; }
.cover-title h1 { font-size: 2.9rem; line-height: 1; letter-spacing: -.04em; }
.cover-title .swash { margin-top: .5rem; }
.searchbox { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 3.25rem; margin-top: 1.5rem; padding: 0 1.1rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--muted); font-size: 1rem; text-align: left; }
.picker { border-bottom: 1px solid var(--line); }
.picker a { display: flex; align-items: center; gap: .9rem; min-height: 3.75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.picker .num { font-size: .8rem; color: var(--muted); width: 1.5rem; flex: none; }
.picker .n { flex: 1; font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.015em; line-height: 1.2; }
.picker .v { font-size: .78rem; color: var(--muted); text-align: right; }
.picker .ic, .chips .ic { color: var(--muted); width: 1.1rem; height: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a { display: flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; color: var(--muted); }
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.downloads a { display: flex; align-items: center; gap: .6rem; min-height: 3.25rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--card); font-size: .95rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.foot a { text-decoration: underline; text-underline-offset: .2em; }

/* locked pages and the buy card */
.buycard { border: 1px solid var(--line); border-radius: 1rem; background: var(--card); padding: 1.25rem; }
.buycard > .ic { color: var(--muted); }
.buycard .bt { font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.015em; margin-top: .6rem; }
.buycard .bd { color: var(--muted); margin-top: .4rem; font-size: .95rem; }
.buy { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 3.25rem; margin-top: 1.1rem; padding: .6rem 1rem; border-radius: 99px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 1.02rem; }
.buy.off { opacity: .5; cursor: not-allowed; }
.unlock-link { display: block; text-align: center; padding: .9rem .5rem .2rem; font-size: .92rem; color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }

/* settings grid: the biggest thing on a scene page; numbers sized to the longest line (--ch) */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; container-type: inline-size; }
.cell { display: flex; flex-direction: column; min-height: clamp(8.5rem, 23vh, 12rem); padding: .9rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); }
.cell .label { display: flex; align-items: center; gap: .45rem; font-size: .84rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cell .label .ic { width: 1.3rem; height: 1.3rem; stroke-width: 1.6; }
.cell .value { margin-top: auto; padding-top: .5rem; font-weight: 600; line-height: 1.02; }
.cell .value.num { font-family: var(--mono); letter-spacing: -.03em; white-space: nowrap; font-size: 2rem; font-size: min(3.6rem, calc((50cqi - 2.4rem) / (var(--ch) * .6))); }
.cell .value.word { font-family: var(--display); letter-spacing: -.02em; line-height: 1.1; font-size: 1.4rem; font-size: clamp(1.15rem, 5.6cqi, 1.9rem); }
.cell .sub { margin-top: .45rem; font-size: .85rem; line-height: 1.3; color: var(--muted); }
.cell.hl { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.cell.hl .label, .cell.hl .sub { color: var(--on-fg); }
.cell.hl.gold { background: var(--gold); border-color: var(--gold); color: #000; }
.cell.hl.gold .label, .cell.hl.gold .sub { color: #000; }

/* scene */
.strip { display: flex; gap: .3rem; }
.strip a { display: grid; place-items: center; min-width: 2.4rem; height: 2.2rem; border: 1px solid var(--line); border-radius: 99px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.strip a.cur { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.strip a.shut { opacity: .45; }
.scene .eyebrow-row .pill { display: none; }
.watch { display: flex; gap: .8rem; align-items: baseline; margin-top: 1rem; padding: .9rem 1rem; border: 1.5px solid var(--fg); border-radius: .9rem; }
.watch .k { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.watch .w { font-size: 1.05rem; font-weight: 500; line-height: 1.35; }
.dots li { display: flex; gap: .7rem; align-items: flex-start; padding: .3rem 0; font-size: 1.05rem; line-height: 1.4; }
.dot { flex: none; width: .38rem; height: .38rem; margin-top: .55rem; border-radius: 50%; background: var(--fg); }
.dot.gold { background: var(--gold); width: .46rem; height: .46rem; margin-top: .5rem; }
.still { height: 11rem; margin-top: 1.5rem; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 1rem; background: var(--card) center / cover; color: var(--muted); font-size: .72rem; letter-spacing: .24em; }
.still.has-img { border-style: solid; }

/* checklists */
.checks-head { display: flex; justify-content: space-between; align-items: baseline; }
.checks-head h3 { margin-bottom: .4rem; }
.preroll .checks-head { margin-top: -.5rem; }
.count { font-size: .8rem; color: var(--muted); }
.checks.done .count { color: var(--fg); }
.check { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 3.5rem; padding: .7rem 0; border-top: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none; }
.checks li:last-child .check { border-bottom: 1px solid var(--line); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { position: relative; flex: none; width: 1.65rem; height: 1.65rem; border: 2px solid var(--fg); border-radius: .45rem; }
.check input:checked + .box { background: var(--fg); }
.check input:checked + .box::after { content: ""; position: absolute; left: .48rem; top: .16rem; width: .4rem; height: .8rem; border: solid var(--bg); border-width: 0 .17rem .17rem 0; transform: rotate(45deg); }
.check input:focus-visible + .box { outline: 2px solid var(--fg); outline-offset: 3px; }
.check .body { display: flex; flex-direction: column; }
.check .t { font-size: 1.1rem; font-weight: 500; line-height: 1.3; }
.check .d { font-size: .9rem; color: var(--muted); margin-top: .15rem; }
.check input:checked ~ .body .t { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.preroll .check { min-height: 4.5rem; padding: 1rem 0; }
.preroll .check .t { font-family: var(--display); font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }
.reset { display: block; min-height: 3rem; margin-top: 1rem; padding: 0 1.2rem; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; color: var(--muted); }

/* numbered rows */
.rows { border-top: 1px solid var(--line); }
.rows li { display: flex; gap: 1.1rem; align-items: baseline; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.rows .num { font-size: .8rem; color: var(--muted); width: 1.5rem; flex: none; }
.rows .t { font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.015em; line-height: 1.25; }
.rows .d { font-size: .95rem; color: var(--muted); margin-top: .2rem; }

/* why + how */
.who { border: 1px solid var(--line); border-radius: 1rem; padding: .3rem 1.1rem .8rem; margin-bottom: 2rem; }
.who h3 { margin-top: .9rem; }
.lede { font-size: 1.12rem; line-height: 1.55; }
.sign { margin-top: 1rem; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.steps { display: grid; gap: .6rem; }
.step { display: flex; align-items: center; gap: 1.1rem; min-height: 3.75rem; padding: .6rem 1.1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); }
.step .num { font-size: .8rem; color: var(--muted); }
.step .t { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.015em; }

/* white balance */
.scale { margin: .5rem 0 0; }
.scale-track { position: relative; height: 1.3rem; margin: 0 .65rem; }
.scale-bar { position: absolute; left: 0; right: 0; top: .4rem; height: .5rem; border-radius: 99px; }
.scale-dot { position: absolute; top: 0; width: 1.3rem; height: 1.3rem; margin-left: -.65rem; border-radius: 50%; border: 3px solid var(--bg); }
.scale-labels { position: relative; height: 3.4rem; margin: .6rem .65rem 0; }
.scale-label { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.scale-label:first-child { transform: translateX(-.65rem); text-align: left; }
.scale-label:last-child { transform: translateX(calc(-100% + .65rem)); text-align: right; }
.scale-label .k { font-size: 1.35rem; font-weight: 600; letter-spacing: -.04em; }
.scale-label .n { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .15rem; }
.presets { display: grid; gap: .5rem; }
.preset { display: flex; justify-content: space-between; align-items: baseline; padding: .95rem 1.1rem; border-radius: 1rem; color: #000; }
.preset .n { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.preset .k { font-size: 1.5rem; font-weight: 600; letter-spacing: -.04em; }

/* cheat sheet */
.cards-head { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 1rem .45rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cards { display: grid; gap: .45rem; }
.card { display: grid; gap: .15rem; padding: .7rem 1rem .75rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--card); }
.card .n { font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.015em; }
.card .v { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: .5rem; font-size: 1.05rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.card .o { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.card .core { color: var(--core); font-weight: 400; }
.core-note { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.core-key { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--core); }

/* dock: prev, home, search, next, under the thumb */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .dock { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
html:not(.js) .dock { display: none; }
.dock-in { display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr); gap: .25rem; max-width: var(--w); margin: 0 auto; }
.dock a, .dock button { display: flex; align-items: center; gap: .3rem; min-height: 3.4rem; padding: 0 .55rem; border-radius: .9rem; font-size: .9rem; min-width: 0; }
.dock .prev { grid-column: 1; justify-content: flex-start; }
.dock .next { grid-column: 4; justify-content: flex-end; text-align: right; }
.dock .sq { width: 3.4rem; justify-content: center; padding: 0; }
.dock .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock a:active, .dock button:active, .icon-btn:active { background: var(--card); }

/* search */
#search { width: 100%; max-width: var(--w); height: 100%; max-height: none; margin: 0 auto; border: 0; background: var(--bg); color: var(--fg); }
#search::backdrop { background: rgb(0 0 0 / .6); }
.search-in { padding: calc(.75rem + env(safe-area-inset-top)) 1rem 2rem; }
.search-top { display: flex; gap: .5rem; align-items: center; }
#q { flex: 1; min-width: 0; min-height: 3.25rem; padding: 0 1.1rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--fg); font: inherit; font-size: 1.1rem; -webkit-appearance: none; appearance: none; }
#q::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
#q:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
#results { margin-top: .75rem; }
#results a { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; min-height: 3.5rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
#results .hn { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.015em; }
#results .hs { flex-basis: 100%; font-size: .9rem; color: var(--muted); }
#results .ic { width: 1rem; height: 1rem; color: var(--muted); }
#results .none { padding: 1rem .2rem; color: var(--muted); }

/* unlock page */
.unlock-page main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-bottom: 2rem; }
.unlock { width: 100%; max-width: 22rem; display: grid; gap: .9rem; }
.unlock h1 { margin: .5rem 0 0; font-size: 1.9rem; }
.unlock p { color: var(--muted); font-size: .95rem; }
.unlock input { min-height: 3.25rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--card); color: var(--fg); font: inherit; font-family: var(--mono); font-size: 1rem; }
.unlock button { min-height: 3.25rem; border-radius: 99px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 1.02rem; }
.unlock .err { color: var(--gold); font-size: .95rem; }
.unlock .note { padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: .9rem; font-size: .88rem; }
.unlock .links { font-size: .9rem; }
.unlock .links a { text-decoration: underline; text-underline-offset: .2em; }

/* wider screens: the same column, a little more room */
@media (min-width: 34rem) {
  .grid { gap: .75rem; }
  .cell { padding: 1.1rem; }
  .presets { grid-template-columns: repeat(3, 1fr); }
  .preset { display: block; }
  .preset .k { margin-top: .5rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; align-items: flex-start; justify-content: space-between; min-height: 7rem; padding: 1rem 1.1rem; }
  .scene .eyebrow-row .pill { display: inline-flex; }
  h1 { font-size: 2.5rem; }
  .cover-title h1 { font-size: 3.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .page.from-right, .page.from-left { animation: none; }
}
