/* jonmcgee.online: a ruled, light, technical-editorial system.
   Type: Familjen Grotesk (text) + Spline Sans Mono (labels). One pine-green accent. White paper, ink rules, square corners. */
:root {
  --bg: #ffffff; --fg: #0d0f12; --muted: #4a505a; --faint: #7a808a;
  --surface: #f6f6f3; --rule: rgba(13, 15, 18, .14); --rule-strong: rgba(13, 15, 18, .34);
  --accent: #087056; --accent-rgb: 8, 112, 86; --accent-soft: rgba(8, 112, 86, .08);
  --glyph-rgb: 13, 15, 18; --glyph-a: .12;
  --card: #ffffff; --card-2: var(--surface); --border: var(--rule); --border-strong: var(--rule-strong);
  --f-sans: "Familjen Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px; --r-sm: 4px; --max: 1120px;
  --gutter: clamp(1.1rem, 4vw, 2rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
@media (hover: none) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 1.0625rem/1.62 var(--f-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--fg); color: var(--bg); }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--fg); color: var(--bg); padding: .6rem 1rem; }
.skip:focus { top: 1rem; }

.site { position: relative; overflow-x: clip; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
main, .masthead > *:not(.glyphs), .foot-in { position: relative; z-index: 1; }
.meta, .mono { font-family: var(--f-mono); font-size: .8125rem; line-height: 1.45; color: var(--muted); }

/* ---------- code bands (header and footer only) ---------- */
.glyphs { position: absolute; left: 0; width: 100%; pointer-events: none; z-index: 0; }
.masthead { position: relative; }
.masthead .glyphs { top: 0; height: 290px; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 22%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 22%, transparent 100%); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 1.25rem; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; min-height: 44px; }
.mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--fg); color: var(--bg); border-radius: var(--r-sm); font: 700 .95rem/1 var(--f-sans); letter-spacing: -.05em; }
.topnav { display: flex; gap: .1rem; margin-left: auto; }
.topnav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem; text-decoration: none; font: 500 .9375rem/1 var(--f-sans); color: var(--muted); transition: color .2s; }
.topnav a::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .55rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.topnav a:hover, .topnav a[aria-current="true"] { color: var(--fg); }
.topnav a:hover::after, .topnav a[aria-current="true"]::after { transform: scaleX(1); }
.searchbtn { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .85rem; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--muted); font: 400 .875rem/1 var(--f-sans); transition: border-color .2s, color .2s; }
.searchbtn:hover { border-color: var(--fg); color: var(--fg); }
.searchbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.searchbtn kbd { font: 500 .6875rem/1 var(--f-mono); padding: .3rem .4rem; border: 1px solid var(--rule); border-radius: 3px; color: var(--faint); }
.band-row { padding-block: .1rem 0; }
.band-hint { display: inline-flex; gap: .5rem; background: var(--bg); padding: .2rem .5rem .2rem 0; font: 400 .75rem/1.4 var(--f-mono); color: var(--faint); transition: opacity .4s; }
.band-hint::before { content: "\2191"; }
.glyph-used .band-hint { opacity: 0; }

/* ---------- buttons: a label and an arrow cell, squared off ---------- */
.btn { display: inline-flex; align-items: stretch; gap: 1.1rem; min-height: 46px; padding: 0 0 0 1.1rem; border: 1px solid var(--fg); border-radius: var(--r-sm); background: transparent; color: var(--fg); text-decoration: none; font: 500 .9375rem/1.2 var(--f-sans); white-space: nowrap; transition: background-color .22s, color .22s, border-color .22s; }
.btn { align-items: center; }
.btn::after { align-self: stretch; content: "\2192"; display: grid; place-items: center; width: 46px; flex: none; border-left: 1px solid currentColor; font: 400 1rem/1 var(--f-mono); transition: transform .3s var(--ease), background-color .22s; }
.btn[target="_blank"]::after { content: "\2197"; }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:hover::after { transform: translateX(2px); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid::after { border-left-color: rgba(255, 255, 255, .3); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-lg { min-height: 54px; font-size: 1rem; }
.btn-lg::after { width: 54px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tags span, .chip { display: inline-flex; align-items: center; min-height: 26px; padding: .2rem .55rem; border: 1px solid var(--rule); border-radius: 3px; background: transparent; font: 400 .75rem/1 var(--f-mono); color: var(--muted); }
.badge { display: inline-flex; align-items: center; padding: .35rem .5rem; border-radius: 3px; background: var(--bg); border: 1px solid var(--fg); font: 500 .6875rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg); }
.badge.live { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); align-items: start; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(3rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); }
.hero-copy { border-top: 1px solid var(--fg); padding-top: 1rem; }
.eyebrow { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font: 400 .8125rem/1.4 var(--f-mono); color: var(--muted); margin-bottom: clamp(1.5rem, 4vw, 2.6rem); }
.eyebrow span + span::before { content: "/"; margin-right: 1.1rem; color: var(--faint); }
.hero h1 { font: 600 clamp(2.4rem, 5.3vw, 4.3rem)/1.03 var(--f-sans); letter-spacing: -.035em; margin-bottom: 1.5rem; max-width: 15ch; text-wrap: balance; }
.lede { max-width: 36rem; font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--muted); margin-bottom: 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.portrait { --x: 50%; --y: 40%; position: relative; margin: 0 0 0 auto; width: min(100%, 22rem); aspect-ratio: 332 / 477; background: var(--surface); border: 1px solid var(--fg); border-radius: var(--r-sm); overflow: hidden; cursor: crosshair; touch-action: manipulation; }
.p-swoosh { display: none; }
.p-line, .p-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-line { background: var(--fg); -webkit-mask: url(../assets/line-mask.png) center / 100% 100% no-repeat; mask: url(../assets/line-mask.png) center / 100% 100% no-repeat; }
.p-photo { object-fit: cover; clip-path: circle(0 at var(--x) var(--y)); transition: clip-path .45s var(--ease); pointer-events: none; }
.portrait.peek .p-photo { clip-path: circle(22% at var(--x) var(--y)); }
.portrait.show-photo .p-photo { clip-path: circle(110% at 50% 50%); }
.portrait::after { content: ""; position: absolute; left: var(--x); top: var(--y); width: 44%; aspect-ratio: 1; border: 1.5px solid #fff; border-radius: 50%; transform: translate(-50%, -50%) scale(.3); opacity: 0; transition: opacity .3s, transform .45s var(--ease); pointer-events: none; }
.portrait.peek::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.portrait.show-photo::after { opacity: 0; }
.portrait figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: .6rem .85rem; background: rgba(255, 255, 255, .94); border-top: 1px solid var(--fg); font: 400 .75rem/1.3 var(--f-mono); color: var(--fg); transition: opacity .25s; }
.portrait.peek figcaption { opacity: 0; }

/* ---------- sections: numbered, ruled, stacked ---------- */
main { counter-reset: sec; }
.section { padding-block: clamp(2.25rem, 5vw, 4rem); }
.sec-head { counter-increment: sec; display: grid; gap: .7rem; border-top: 1px solid var(--fg); padding-top: 1rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.sec-head::before { content: counter(sec, decimal-leading-zero); font: 400 .8125rem/1 var(--f-mono); color: var(--faint); }
.sec-head h2 { font: 600 clamp(2rem, 4.2vw, 3rem)/1.05 var(--f-sans); letter-spacing: -.035em; }
.sec-head p { max-width: 38rem; color: var(--muted); }
.sec-head a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sec-head a:hover { color: var(--accent); }

/* ---------- arcade ---------- */
.arcade { display: grid; grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.picker { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule-strong); }
.pick { text-align: left; display: flex; flex-direction: column; gap: .3rem; padding: 1.15rem 1rem 1.15rem 1.1rem; background: transparent; border: 0; border-bottom: 1px solid var(--rule-strong); border-left: 3px solid transparent; transition: background-color .2s, border-color .2s; }
.pick:hover { background: var(--surface); }
.pick-name { font: 600 1.3rem/1.2 var(--f-sans); letter-spacing: -.02em; }
.pick-name::before { content: ""; display: inline-block; width: .6rem; height: .6rem; margin-right: .6rem; background: var(--g, var(--accent)); vertical-align: .05em; }
.pick-sub { font-size: .9375rem; line-height: 1.4; color: var(--muted); }
.pick[aria-selected="true"] { background: var(--surface); border-left-color: var(--fg); }
.cab { background: var(--surface); border: 1px solid var(--fg); border-radius: var(--r-sm); padding: .6rem; }
.cab-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .4rem .5rem .75rem; }
.cab-title { font: 600 1.125rem/1.2 var(--f-sans); letter-spacing: -.01em; }
.cab-note { font: 400 .75rem/1.3 var(--f-mono); color: var(--muted); text-align: right; }
.screen { position: relative; aspect-ratio: 9 / 7; min-height: 26rem; overflow: hidden; background: #000; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.screen iframe[hidden] { display: none; }
.poster { position: absolute; inset: 0; display: flex; align-items: flex-end; background: #0b0c0f; }
.poster picture { position: absolute; inset: 0; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }
.poster-body { position: relative; margin: clamp(.75rem, 2vw, 1.25rem); padding: clamp(1rem, 2.4vw, 1.5rem); display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; background: rgba(11, 12, 15, .9); border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--r-sm); max-width: 30rem; color: #f4f4f1; }
.poster-blurb { font-size: 1.125rem; line-height: 1.45; }
.poster-hint { font: 400 .75rem/1.4 var(--f-mono); color: #aeb3bd; }
#start { background: #fff; color: #0d0f12; border-color: #fff; }
#start::after { border-left-color: rgba(13, 15, 18, .3); }
#start:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.cab-bar { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem .1rem .1rem; }
.tool { display: inline-flex; align-items: center; min-height: 40px; padding: .5rem .8rem; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--bg); text-decoration: none; font: 500 .75rem/1 var(--f-mono); color: var(--fg); transition: border-color .2s, background-color .2s; }
.tool:hover:not(:disabled) { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.tool:disabled { color: var(--faint); border-color: var(--rule); cursor: not-allowed; }
.tool-link { margin-left: auto; }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.card { --mx: 50%; --my: 0%; position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; transition: border-color .25s; }
@media (hover: hover) { .card:hover { border-color: var(--fg); } .card:hover .card-media img { transform: scale(1.025); } }
.card-media { position: relative; z-index: 3; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border: 0; padding: 0; text-align: left; border-bottom: 1px solid var(--rule-strong); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
button.card-media { cursor: pointer; }
.card-badges { position: absolute; left: .7rem; top: .7rem; display: flex; gap: .4rem; z-index: 2; }
.card-open { position: absolute; right: .7rem; bottom: .7rem; z-index: 2; display: inline-flex; align-items: center; min-height: 34px; padding: .4rem .65rem; border-radius: 3px; background: var(--fg); color: var(--bg); font: 500 .75rem/1 var(--f-mono); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .25s var(--ease); }
@media (hover: hover) { .card:hover .card-open, .card-media:focus-visible .card-open { opacity: 1; transform: none; } }
@media (hover: none) { .card-open { opacity: 1; transform: none; } }
.card-body { display: flex; flex-direction: column; gap: .8rem; flex: 1; padding: 1.25rem 1.3rem 1.35rem; position: relative; z-index: 2; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.card h3 { font: 600 1.4rem/1.2 var(--f-sans); letter-spacing: -.025em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card time { font: 400 .75rem/1 var(--f-mono); color: var(--faint); white-space: nowrap; }
.card p { color: var(--muted); font-size: 1rem; line-height: 1.55; flex: 1; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; position: relative; z-index: 3; }
.card-actions .btn { min-height: 42px; font-size: .875rem; padding-left: .9rem; }
.card-actions .btn::after { width: 40px; }
.tour-tabs { position: absolute; left: .6rem; right: .6rem; bottom: .6rem; z-index: 3; display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.tour-tabs::-webkit-scrollbar { display: none; }
.tour-tabs button { flex: none; min-height: 36px; padding: .4rem .75rem; border-radius: 3px; border: 1px solid var(--fg); background: var(--bg); font: 500 .75rem/1 var(--f-mono); color: var(--fg); }
.tour-tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); }

/* ---------- stack, notes, faq, about ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips .chip { min-height: 38px; padding: .45rem .85rem; font-size: .8125rem; color: var(--fg); border-color: var(--rule-strong); }
.notes-index { list-style: none; padding: 0; margin: 0; }
.note { display: grid; grid-template-columns: 12rem minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 2rem; padding: 1.5rem 0; border-top: 1px solid var(--rule-strong); }
.note:last-child { border-bottom: 1px solid var(--rule-strong); }
.note .meta { grid-row: 1 / 3; padding-top: .4rem; }
.note .meta time { display: block; color: var(--fg); }
.note .meta span { display: block; margin-top: .3rem; color: var(--faint); font-size: .75rem; overflow-wrap: normal; hyphens: none; }
.note h2, .note h3 { font: 600 clamp(1.3rem, 2.4vw, 1.7rem)/1.2 var(--f-sans); letter-spacing: -.025em; margin: 0 0 .5rem; }
.note h2 a, .note h3 a { text-decoration: none; transition: color .2s; }
.note h2 a:hover, .note h3 a:hover { color: var(--accent); }
.note p:not(.meta) { color: var(--muted); max-width: 60ch; }
.qa-list { border-top: 1px solid var(--rule-strong); }
.qa { border-bottom: 1px solid var(--rule-strong); }
.qa summary { list-style: none; cursor: pointer; position: relative; min-height: 44px; padding: 1.2rem 3rem 1.2rem 0; font: 500 1.1875rem/1.35 var(--f-sans); letter-spacing: -.01em; transition: color .2s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--rule-strong); border-radius: 3px; font: 400 1rem/1 var(--f-mono); transition: background-color .2s, color .2s; }
.qa[open] summary::after { content: "\2212"; background: var(--fg); color: var(--bg); border-color: var(--fg); }
.qa summary:hover { color: var(--accent); }
.qa p { color: var(--muted); max-width: 62ch; padding-bottom: 1.3rem; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-copy .sec-head { margin-bottom: 1.5rem; }
.about-copy p { font-size: 1.125rem; color: var(--muted); max-width: 40rem; }
.about-copy p + p { margin-top: 1rem; }
.about-copy p strong { color: var(--fg); font-weight: 600; }
.facts { border-top: 1px solid var(--fg); padding-top: 1rem; }
.fact { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: center; gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.fact:last-child { border-bottom: 0; }
.fact b { font: 600 2.4rem/1 var(--f-sans); letter-spacing: -.04em; }
.fact span { color: var(--muted); }

/* ---------- footer ---------- */
.foot { position: relative; margin-top: clamp(2.5rem, 6vw, 5rem); padding-top: 16.5rem; padding-bottom: 2rem; }
.foot .glyphs { top: 0; height: 250px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 45%, #000 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 45%, #000 100%); }
/* the footer line is giant outline type that fills in with ink as it scrolls into view */
@property --fill { syntax: "<percentage>"; inherits: true; initial-value: 100%; }
.foot-line { position: relative; font: 700 clamp(2.5rem, 7.6vw, 6.4rem)/.98 var(--f-sans); letter-spacing: -.05em; margin-bottom: 2.25rem; text-wrap: balance; color: transparent; -webkit-text-stroke: 1px var(--fg); }
.foot-line::after { content: attr(data-t); position: absolute; inset: 0; color: var(--fg); -webkit-text-stroke: 0; clip-path: inset(-.3em calc(100% - var(--fill)) -.3em -.1em); pointer-events: none; }
@keyframes type-fill { from { --fill: 0%; } to { --fill: 100%; } }
@supports (animation-timeline: view()) {
  .foot { view-timeline-name: --foot; }
  .foot-line { animation: type-fill linear both; animation-timeline: --foot; animation-range: entry 40% entry 100%; }
}
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; border-top: 1px solid var(--fg); padding-top: .4rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.foot nav a { color: var(--fg); text-decoration: none; padding: .8rem 0; display: inline-block; font: 500 .9375rem/1.2 var(--f-sans); }
.foot nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.foot p:not(.foot-line) { font: 400 .8125rem/1.2 var(--f-mono); color: var(--muted); }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }

/* ---------- palette and dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--fg); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(13, 15, 18, .5); }
.palette { width: min(34rem, calc(100vw - 1.5rem)); margin: 12vh auto auto; background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r); overflow: hidden; }
.palette-in { display: flex; align-items: center; gap: .7rem; padding: .35rem 1rem; border-bottom: 1px solid var(--fg); }
.palette-in svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.palette input { flex: 1; min-width: 0; min-height: 52px; border: 0; background: transparent; color: var(--fg); font: 400 1.0625rem/1.2 var(--f-sans); outline: 0; }
.palette ul { list-style: none; margin: 0; padding: .35rem; max-height: min(52vh, 24rem); overflow: auto; }
.palette li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 46px; padding: .5rem .75rem; border-radius: 3px; text-decoration: none; border-left: 3px solid transparent; }
.palette li a small { font: 400 .6875rem/1 var(--f-mono); color: var(--faint); flex: none; text-transform: uppercase; letter-spacing: .06em; }
.palette li a[aria-selected="true"] { background: var(--surface); border-left-color: var(--fg); }
.palette-empty { padding: 1.4rem 1rem; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 1rem; padding: .6rem 1rem; border-top: 1px solid var(--rule-strong); font: 400 .6875rem/1 var(--f-mono); color: var(--faint); }

.pdlg { width: min(96vw, 1400px); max-height: 94vh; margin: auto; background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r); overflow: hidden; }
.dlg-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .6rem .5rem 1.1rem; border-bottom: 1px solid var(--fg); font: 500 .8125rem/1 var(--f-mono); }
.dlg-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-bar .btn { min-height: 40px; }
.dlg-bar .btn::after { content: "\00d7"; width: 40px; }

/* look-only browser frames (project pages and the preview dialog) */
.browser { border: 1px solid var(--fg); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.browser-top { display: flex; align-items: center; gap: .45rem; padding: .6rem .9rem; border-bottom: 1px solid var(--fg); background: var(--surface); }
.browser-top i { width: .6rem; height: .6rem; border-radius: 1px; background: var(--rule-strong); }
.browser-top .url { margin-left: .6rem; font: 400 .75rem/1 var(--f-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.browser-top .lock { margin-left: auto; flex: none; font: 500 .6875rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: .35rem .5rem; border-radius: 3px; border: 1px solid var(--fg); color: var(--fg); }
.browser-view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0d14 center top / cover no-repeat; --s: .5; }
.browser-view iframe { position: absolute; left: 0; top: 0; width: var(--vw, 1280px); height: var(--vh, 800px); border: 0; transform: scale(var(--s)); transform-origin: 0 0; background: #fff; visibility: hidden; }
.browser-view.is-live iframe, .dlg-view iframe { visibility: visible; }
.shield { position: absolute; inset: 0; cursor: not-allowed; touch-action: pan-y; }
.toast { position: absolute; left: 50%; bottom: 1rem; transform: translate(-50%, 1rem); background: var(--fg); color: var(--bg); font: 500 .8125rem/1.3 var(--f-mono); padding: .7rem 1rem; border-radius: 3px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.hint { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); margin: 0; padding: .5rem .75rem; border-radius: 3px; background: var(--fg); color: var(--bg); font: 500 .75rem/1 var(--f-mono); white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
@media (hover: hover) { .browser-view:hover:not(.armed) .hint { opacity: .95; } }
.browser-view.armed { box-shadow: inset 0 0 0 2px var(--accent); cursor: ns-resize; }
.dlg-view { aspect-ratio: 16 / 10; max-height: calc(94vh - 3.5rem); width: 100%; margin-inline: auto; }
.browser-view.tour { background: #0b0d14; }
.browser-view.tour img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.browser-view.tour picture { display: block; position: absolute; inset: 0; }

/* ---------- inner pages (projects, blog) ---------- */
.proj { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 7vw, 5rem); }
.back { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--muted); text-decoration: none; font: 400 .8125rem/1 var(--f-mono); transition: color .2s; }
.back:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.proj-head { margin-top: clamp(.5rem, 2vw, 1rem); border-top: 1px solid var(--fg); padding-top: 1rem; }
.proj-head h1, .post-head h1 { font: 600 clamp(2.3rem, 5.4vw, 4rem)/1.04 var(--f-sans); letter-spacing: -.04em; margin: .9rem 0 1.1rem; overflow-wrap: anywhere; }
.proj-head h1.long { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.proj-lede { max-width: 44rem; font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.55; color: var(--muted); margin-bottom: 1.6rem; }
.proj-media { margin-block: clamp(1.75rem, 4vw, 3rem); }
.proj-media .browser-view { max-height: 80vh; }
.playbox { position: relative; border: 1px solid var(--fg); border-radius: var(--r-sm); overflow: hidden; background: #000; aspect-ratio: 9 / 7; }
.playbox picture { display: block; position: absolute; inset: 0; }
.playbox img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.5); }
.playbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.playbox .go { position: absolute; left: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); }
.playbox .go .btn { background: #fff; color: #0d0f12; border-color: #fff; }
.playbox .go .btn::after { border-left-color: rgba(13, 15, 18, .3); }
.proj-body { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.glance { position: sticky; top: 1.5rem; border-top: 1px solid var(--fg); padding-top: 1rem; }
.glance h2 { font: 400 .75rem/1 var(--f-mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .9rem; }
.glance div { padding: .75rem 0; border-top: 1px solid var(--rule); }
.glance div:first-of-type { border-top: 0; padding-top: 0; }
.glance dt { font: 400 .75rem/1.3 var(--f-mono); color: var(--faint); margin-bottom: .15rem; }
.glance dd { margin: 0; font-size: 1rem; line-height: 1.45; }
.prose { min-width: 0; }
.prose > section + section { margin-top: clamp(2.4rem, 5vw, 3.6rem); }
.prose h2, .post-body > h2 { font: 600 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--f-sans); letter-spacing: -.03em; margin-bottom: .9rem; }
.prose p { max-width: 64ch; }
.prose p + p { margin-top: 1rem; }
.prose strong { font-weight: 600; }
.prose a, .byline a, .feedlink a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover, .byline a:hover, .feedlink a:hover { color: var(--accent); }
.prose ul { margin: 1rem 0 0; padding-left: 1.2rem; max-width: 64ch; }
.prose li + li { margin-top: .6rem; }
.prose li::marker { color: var(--accent); }
.steps { list-style: none; counter-reset: step; margin: 1.25rem 0 0; padding: 0; max-width: 68ch; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: .9rem; padding: 1.1rem 0; border-top: 1px solid var(--rule-strong); }
.steps li:last-child { border-bottom: 1px solid var(--rule-strong); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 400 .875rem/1.7 var(--f-mono); color: var(--faint); }
.steps b { display: block; font-weight: 600; margin-bottom: .15rem; }
.steps span { color: var(--muted); }
.related { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--fg); }
.related h2 { font: 600 1.3rem/1.2 var(--f-sans); margin-bottom: .6rem; }
.related ul { padding-left: 1.2rem; margin: 0; }
.related li { margin: .5rem 0; }
.proj-next { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: clamp(2.5rem, 6vw, 5rem); border-top: 1px solid var(--fg); }
.proj-next a { text-decoration: none; padding: 1.1rem 0; display: block; }
.proj-next small { display: block; font: 400 .75rem/1 var(--f-mono); color: var(--faint); margin-bottom: .45rem; }
.proj-next b { font: 600 clamp(1.15rem, 2vw, 1.5rem)/1.25 var(--f-sans); letter-spacing: -.02em; transition: color .2s; }
.proj-next a:hover b { color: var(--accent); }
.proj-next .next { text-align: right; }
.post-head { border-top: 1px solid var(--fg); padding-top: 1rem; margin-top: clamp(.5rem, 2vw, 1rem); }
.post-head .proj-lede { margin-bottom: 1rem; }
.byline { color: var(--muted); margin-bottom: .9rem; }
.post-body { max-width: 70ch; margin-top: 2rem; }
.post-body > h2 { margin: 2.5rem 0 .8rem; }
.post-body > p, .post-body > ul { margin-top: 1rem; max-width: 68ch; }
.post-body pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); padding: 1rem 1.2rem; margin: 1.25rem 0; font: 400 .875rem/1.65 var(--f-mono); }
.post-body code { font-family: var(--f-mono); font-size: .9em; }
.post-body p code, .post-body li code { background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: .08em .35em; }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.25rem 0; font-size: .9375rem; }
.post-body th, .post-body td { padding: .7rem 1rem; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.post-body th { font: 500 .75rem/1.3 var(--f-mono); color: var(--muted); border-bottom-color: var(--fg); }
.blog-index .notes-index { margin-top: 2rem; }

/* ---------- hero side: portrait with the contact line centred under it ---------- */
.hero-side { width: min(100%, 22rem); margin: 0 0 0 auto; display: grid; gap: 1.1rem; }
.hero-side .portrait { margin: 0; width: 100%; }
.portrait-mail { display: grid; justify-items: center; gap: .2rem; text-align: center; }
.portrait-mail span { font: 400 .75rem/1.3 var(--f-mono); color: var(--faint); }
.portrait-mail a { font: 500 1rem/1.3 var(--f-sans); color: var(--fg); text-underline-offset: 4px; text-decoration-thickness: 1px; overflow-wrap: anywhere; padding: .35rem 0; }
.portrait-mail a:hover { color: var(--accent); }

/* ---------- apps: a centred, wrapping row of cards, three across on desktop ---------- */
.app-grid { --gap: 1.5rem; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: var(--gap); }
.app-grid > .app-card { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); min-width: 0; max-width: 100%; }
@media (max-width: 1099px) { .app-grid > .app-card { flex-basis: calc((100% - var(--gap)) / 2); } }
@media (max-width: 639px) { .app-grid > .app-card { flex-basis: 100%; } }
.app-card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; transition: border-color .25s; }
.app-card .thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--rule-strong); }
.app-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
@media (hover: hover) { .app-card:hover { border-color: var(--fg); } .app-card:hover .thumb img { transform: scale(1.025); } }
.app-card .body { display: flex; flex-direction: column; gap: .6rem; flex: 1; padding: 1.15rem 1.2rem 1.25rem; }
.app-card .meta { font-size: .75rem; color: var(--faint); }
.app-card h2, .app-card h3 { font: 600 1.5rem/1.15 var(--f-sans); letter-spacing: -.03em; }
.app-card h2 a, .app-card h3 a { text-decoration: none; }
.app-card p { color: var(--muted); font-size: .975rem; line-height: 1.5; }
.app-card .meta, .app-card p.new { margin: 0; }
.app-card p.new { margin-top: .2rem; padding-top: .7rem; border-top: 1px solid var(--rule); font-size: .8125rem; line-height: 1.5; color: var(--fg); }
.app-card p.new strong { display: block; margin-bottom: .2rem; font: 500 .6875rem/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.app-card .go { margin-top: auto; padding-top: .8rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.app-card .go .btn { min-height: 42px; font-size: .875rem; padding-left: .85rem; gap: .75rem; }
.app-card .go .btn::after { width: 38px; }

/* app pages: the live preview */
.app-live { position: relative; border: 1px solid var(--fg); border-radius: var(--r); overflow: hidden; background: #111; }
.app-live .stage { position: relative; aspect-ratio: 16 / 10; background: #151613; }
.app-live .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.5); }
.app-live .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #262626; visibility: hidden; }
.app-live.is-live .stage iframe { visibility: visible; }
.app-live.is-live .stage img, .app-live.is-live .launch { display: none; }
.app-live .launch { position: absolute; left: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.2rem; }
.app-live .launch p { color: #fff; font-size: .9375rem; max-width: 40ch; text-shadow: 0 1px 12px #000; }
.app-live .launch .btn-solid { background: #fff; color: #0d0f12; border-color: #fff; }
.app-live .launch .btn-solid::after { border-left-color: rgba(13, 15, 18, .3); }
.app-live .launch .btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.app-live .launch .btn-line { background: rgba(13, 15, 18, .72); color: #fff; border-color: #fff; }
.app-live .launch .btn-line:hover { background: #fff; color: #0d0f12; }
.app-live .bar2 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .6rem 1rem; border-top: 1px solid var(--fg); background: var(--surface); font: 400 .75rem/1.3 var(--f-mono); color: var(--muted); }
.app-live .bar2 label { display: inline-flex; align-items: center; gap: .5rem; }
.app-live .bar2 select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--rule-strong); border-radius: 3px; padding: .4rem .6rem; min-height: 36px; max-width: 100%; }
.app-live .bar2 a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .25rem; margin-left: auto; color: var(--fg); text-underline-offset: 3px; }
.app-live .bar2 a + a { margin-left: 0; }
.app-note { margin-top: .8rem; color: var(--muted); font-size: .9rem; max-width: 70ch; }
.proj > .app-grid { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.proj > .app-note { margin-top: 1.5rem; }

/* Windows download */
.dl-row { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.1rem 0; }
.dl-row .btn { flex: 0 1 auto; }
code.sum { word-break: break-all; font-size: .8125em; }
#download, #changes, #added { scroll-margin-top: 1.5rem; }

/* what the fork added: right under the title of every app page */
.fork-new { margin: 1.75rem 0 0; padding: 1.25rem clamp(1rem, 2.5vw, 1.75rem) 1.35rem; border: 1px solid var(--fg); border-radius: var(--r); background: var(--surface); }
.fork-new h2 { font: 600 clamp(1.4rem, 3vw, 1.8rem)/1.1 var(--f-sans); letter-spacing: -.03em; margin: 0 0 .45rem; }
.fork-new-lede { margin: 0 0 1rem; color: var(--muted); font-size: .975rem; line-height: 1.5; max-width: 70ch; }
.fork-new-lede a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fork-new-lede a:hover { color: var(--accent); }
.fork-new-list { list-style: none; padding: 0; margin: 0; display: grid; column-gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.fork-new-list li { margin: 0; padding: .9rem 0; border-top: 1px solid var(--rule-strong); display: flex; flex-direction: column; gap: .3rem; }
.fork-new-list strong { font-weight: 600; font-size: 1rem; }
.fork-new-list span { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.fork-new-also { margin: .9rem 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* ---------- header extras: terminal button and the bug hunt switch ---------- */
.termbtn { display: inline-grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--muted); font: 500 .8125rem/1 var(--f-mono); letter-spacing: -.02em; transition: border-color .2s, color .2s, background-color .2s; }
.termbtn:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.termbtn + .searchbtn { margin-left: -.6rem; }
.band-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; }
.bug-start { display: inline-flex; align-items: center; gap: .55rem; min-height: 32px; padding: .3rem .75rem; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--bg); color: var(--fg); font: 500 .75rem/1 var(--f-mono); transition: border-color .2s, background-color .2s, color .2s; }
.bug-start::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bug-start:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }

/* ---------- reading progress and the section rail ---------- */
.progress { position: fixed; left: 0; top: 0; z-index: 60; display: none; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
.progress-js .progress { display: block; }
@keyframes progress-grow { to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
  .progress { display: block; animation: progress-grow linear both; animation-timeline: scroll(root block); }
  @media (prefers-reduced-motion: reduce) { .progress { animation-duration: auto !important; } }
}
.rail { position: fixed; right: clamp(.75rem, 1.5vw, 1.5rem); top: 50%; z-index: 30; display: none; flex-direction: column; align-items: flex-end; gap: .1rem; transform: translateY(-50%); }
@media (min-width: 1320px) and (hover: hover) { .rail { display: flex; } }
.rail a { display: flex; align-items: center; gap: .5rem; min-height: 24px; text-decoration: none; color: var(--faint); font: 400 .6875rem/1 var(--f-mono); transition: color .2s; }
.rail span { padding: .3rem .45rem; background: var(--fg); color: var(--bg); border-radius: 3px; opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .3s var(--ease); white-space: nowrap; pointer-events: none; }
.rail b { font-weight: 400; }
.rail a::after { content: ""; width: 12px; height: 1px; background: currentColor; transition: width .3s var(--ease), background-color .2s; }
.rail a:hover, .rail a[aria-current="true"] { color: var(--fg); }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail a[aria-current="true"]::after { width: 26px; height: 2px; background: var(--accent); }

/* ---------- 2026 timeline: swipe on phones, pinned and scrubbed by scrolling on desktop ---------- */
.tl { --p: 0; position: relative; }
.tl-pin { padding-top: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tl-pin::-webkit-scrollbar { display: none; }
.tl-track { display: flex; width: max-content; min-width: 100%; }
.tl-month { position: relative; flex: none; width: min(78vw, 19rem); padding: 1.4rem 1.25rem .25rem 0; border-top: 1px solid var(--fg); scroll-snap-align: start; }
.tl-month::before { content: ""; position: absolute; left: 0; top: -7px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--fg); }
.tl-month h3 { font: 600 1.6rem/1.1 var(--f-sans); letter-spacing: -.03em; margin-bottom: .9rem; }
.tl-month ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tl-month li a { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .95rem; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--bg); text-decoration: none; font: 600 1.0625rem/1.25 var(--f-sans); letter-spacing: -.01em; transition: border-color .2s, transform .3s var(--ease); }
.tl-month li a:hover { border-color: var(--fg); transform: translateY(-2px); }
.tl-month small { font: 400 .6875rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.tl-now { border-top-style: dashed; }
.tl-now::before { background: var(--accent); border-color: var(--accent); animation: now-pulse 2s ease-out infinite; }
@keyframes now-pulse { from { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); } to { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
.tl-now p { max-width: 16rem; color: var(--muted); }
.tl-now a { color: var(--fg); text-underline-offset: 3px; }
.tl-bar { height: 2px; margin-top: 1.5rem; background: var(--rule); }
.tl-bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p)); transform-origin: 0 50%; }
.tl.tl-scrub .tl-pin { position: sticky; top: max(1.5rem, calc(50vh - 15rem)); overflow: hidden; scroll-snap-type: none; }
.tl.tl-scrub .tl-track { transform: translate3d(calc(var(--p) * var(--tl-x, 0px) * -1), 0, 0); will-change: transform; }

/* ---------- shipping log: GitHub stats, a commit calendar, a typed-out git log and the repos ---------- */
.ship { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.ship-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--fg); }
.ship-stats div { padding: 1rem 1rem 1.1rem; border-left: 1px solid var(--rule); }
.ship-stats div:first-child { border-left: 0; padding-left: 0; }
.ship-stats dt { font: 400 .75rem/1.3 var(--f-mono); color: var(--faint); }
.ship-stats dd { margin: .45rem 0 0; font: 600 clamp(1.9rem, 3.6vw, 2.75rem)/1 var(--f-sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ship-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.ship-cal { --cell: 14px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .45rem; padding: 1.1rem 1.2rem 1rem; border: 1px solid var(--rule-strong); border-radius: var(--r); }
.ship-months, .ship-grid { display: grid; grid-auto-flow: column; grid-auto-columns: var(--cell); column-gap: 3px; }
.ship-months { height: .9rem; font: 400 .6875rem/1 var(--f-mono); color: var(--faint); }
.ship-months span { grid-row: 1; white-space: nowrap; }
.ship-grid { grid-template-rows: repeat(7, var(--cell)); row-gap: 3px; }
.ship-grid i, .ship-legend i { display: block; width: var(--cell); height: var(--cell); border-radius: 2px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(13, 15, 18, .06); }
.ship-grid i.x { visibility: hidden; }
.ship-grid i[data-l="1"], .ship-legend i[data-l="1"] { background: rgba(var(--accent-rgb), .3); }
.ship-grid i[data-l="2"], .ship-legend i[data-l="2"] { background: rgba(var(--accent-rgb), .55); }
.ship-grid i[data-l="3"], .ship-legend i[data-l="3"] { background: rgba(var(--accent-rgb), .8); }
.ship-grid i[data-l="4"], .ship-legend i[data-l="4"] { background: var(--accent); }
.ship-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: .35rem; font: 400 .6875rem/1 var(--f-mono); color: var(--faint); }
.ship-legend i { --cell: 11px; }
.ship-legend span { margin: 0 .35rem; }
.ship-log { min-width: 0; display: flex; flex-direction: column; background: #0d0f12; color: #d6dae0; border: 1px solid #0d0f12; border-radius: var(--r); overflow: hidden; font: 400 .8125rem/1.5 var(--f-mono); }
.ship-log-bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #8b929c; font-size: .75rem; }
.ship-log-bar i { flex: none; width: .55rem; height: .55rem; border-radius: 1px; background: rgba(255, 255, 255, .18); }
.ship-log-bar span { min-width: 0; margin-left: .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-log ol { list-style: none; margin: 0; padding: .7rem .9rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem; align-content: start; }
.ship-log li { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; clip-path: inset(0 100% 0 0); }
.ship-log li.on { clip-path: inset(0 0 0 0); transition: clip-path .6s steps(28, end); }
.ship-log li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.ship-log li a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ship-log .h { color: #e6b450; }
.ship-log li b { color: #4fd1a5; font-weight: 500; }
.ship-log time { flex: none; color: #6f7680; font-size: .75rem; }
.ship-log ol::after { content: "_"; color: #4fd1a5; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ship-repos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.ship-repos a { display: flex; flex-direction: column; gap: .5rem; height: 100%; padding: 1rem 1.1rem 1.05rem; border: 1px solid var(--rule-strong); border-radius: var(--r); text-decoration: none; transition: border-color .2s, transform .3s var(--ease); }
.ship-repos a:hover { border-color: var(--fg); transform: translateY(-2px); }
.ship-name { font: 600 1rem/1.2 var(--f-mono); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ship-desc { flex: 1; color: var(--muted); font-size: .9375rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ship-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font: 400 .75rem/1.3 var(--f-mono); color: var(--faint); }
.ship-meta i { display: inline-block; width: .6rem; height: .6rem; margin-right: .35rem; border-radius: 50%; vertical-align: -.05em; }
.ship-status { font-size: .75rem; color: var(--faint); }
.ship-status:empty { display: none; }
@media (max-width: 1099px) { .ship-repos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .ship-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- terminal ---------- */
.term { width: min(44rem, calc(100vw - 1.5rem)); margin: 10vh auto auto; background: #0d0f12; color: #d6dae0; border: 1px solid #000; border-radius: var(--r); overflow: hidden; font: 400 .875rem/1.55 var(--f-mono); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.term::backdrop { background: rgba(13, 15, 18, .45); }
.term-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem .4rem .35rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #8b929c; font-size: .75rem; }
.term-bar button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 3px; background: transparent; color: #8b929c; font: 400 1.35rem/1 var(--f-sans); }
.term-bar button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.term-out { height: min(50vh, 22rem); overflow-y: auto; overscroll-behavior: contain; padding: .9rem 1rem .4rem; }
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-cmd { margin-top: .55rem; color: #fff; }
.t-cmd:first-child { margin-top: 0; }
.t-ps, .term-in label { color: #4fd1a5; }
.t-dim { color: #8b929c; }
.t-err { color: #ff8f80; }
.t-ok { color: #4fd1a5; }
.t-key { display: inline-block; min-width: 16rem; color: #e6b450; }
.t-kw { color: #e6b450; }
.t-col { display: inline-block; min-width: 9.5rem; margin-right: 1rem; }
.term a { color: #9ecbff; text-underline-offset: 3px; }
.term-in { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem .75rem; }
.term-in label { flex: none; }
.term-in input { flex: 1; min-width: 0; min-height: 38px; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; caret-color: #4fd1a5; }
.term-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem 1rem .9rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.term-chips button { min-height: 36px; padding: .3rem .8rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: 3px; background: transparent; color: #d6dae0; font: 500 .75rem/1 var(--f-mono); transition: border-color .2s, color .2s; }
.term-chips button:hover { border-color: #4fd1a5; color: #4fd1a5; }

/* ---------- bug hunt ---------- */
.bh-canvas { position: fixed; inset: 0; z-index: 80; display: none; width: 100%; height: 100%; cursor: crosshair; touch-action: none; transition: box-shadow .15s; }
.bh-on .bh-canvas { display: block; }
.bh-hurt .bh-canvas { box-shadow: inset 0 0 0 5px rgba(179, 38, 30, .75); }
.bh-hud { position: fixed; left: 50%; top: max(.75rem, env(safe-area-inset-top, 0px)); z-index: 81; display: none; align-items: center; gap: .9rem; padding: .4rem .45rem .4rem 1rem; transform: translateX(-50%); background: var(--fg); color: var(--bg); border-radius: var(--r-sm); font: 400 .75rem/1 var(--f-mono); white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.bh-on .bh-hud { display: flex; }
.bh-hud b { margin-left: .3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bh-lives { display: inline-flex; gap: 3px; }
.bh-lives i { width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 1px; }
.bh-lives i.on { background: #4fd1a5; border-color: #4fd1a5; }
.bh-hud button { min-height: 34px; padding: .3rem .75rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: 3px; background: transparent; color: inherit; font: 500 .75rem/1 var(--f-mono); }
.bh-hud button:hover { background: #fff; color: var(--fg); }
.bh-banner { position: fixed; left: 50%; top: 4.6rem; z-index: 81; max-width: calc(100vw - 2rem); padding: .6rem 1rem; transform: translate(-50%, -.5rem); background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r-sm); font: 500 .875rem/1.35 var(--f-sans); text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); }
.bh-banner.on { opacity: 1; transform: translate(-50%, 0); }
.bh-over { position: fixed; left: 50%; top: 50%; z-index: 82; width: min(24rem, calc(100vw - 2rem)); padding: 1.6rem 1.5rem 1.5rem; transform: translate(-50%, -50%); background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.bh-over[hidden] { display: none; }
.bh-k { font: 400 .75rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.bh-over h2 { margin: .6rem 0 .5rem; font: 600 3.4rem/1 var(--f-sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.bh-over p { color: var(--muted); }
.bh-over .bh-badge { display: inline-block; margin-top: .9rem; padding: .45rem .7rem; border-radius: 3px; background: var(--accent); color: #fff; font: 500 .75rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.bh-tip { margin-top: .7rem; font-size: .875rem; }
.bh-act { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.25rem; }

/* ---------- Dribbble-inspired: serif accent, flexing headline, word-by-word intro ---------- */
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.07em; letter-spacing: -.01em; }
.hero h1 .wd { white-space: nowrap; }
.hero h1 .ch { display: inline-block; font-variation-settings: "wght" var(--w, 600); transform: translateY(var(--y, 0)); transition: font-variation-settings .3s var(--ease), transform .3s var(--ease); }
.hero-copy > .lede.split { animation: none; }
.lede .lw { display: inline-block; animation: word-in .7s var(--ease) both; animation-delay: calc(.2s + var(--i) * 24ms); }
@keyframes word-in { from { opacity: 0; transform: translateY(.45em); filter: blur(3px); } }

/* ---------- work index: big names, the screenshot trails the cursor (desktop) ---------- */
.work-view { display: none; margin: calc(-1 * clamp(.75rem, 2vw, 1.5rem)) 0 1.25rem; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); overflow: hidden; }
.work-view button { min-height: 36px; padding: 0 .95rem; border: 0; background: transparent; color: var(--muted); font: 500 .75rem/1 var(--f-mono); transition: background-color .2s, color .2s; }
.work-view button + button { border-left: 1px solid var(--rule-strong); }
.work-view button:hover { color: var(--fg); }
.work-view button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.windex { display: none; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fg); }
@media (min-width: 961px) and (hover: hover) {
  .work-view { display: inline-flex; }
  #work.work-index .cards { display: none; }
  #work.work-index .windex { display: block; }
}
.windex a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto 6.5rem; align-items: baseline; gap: 1.5rem; padding: 1.05rem 0; border-bottom: 1px solid var(--rule-strong); text-decoration: none; transition: padding-left .5s var(--ease); }
.wi-n, .wi-tags, .windex time { font: 400 .75rem/1.2 var(--f-mono); color: var(--faint); }
.windex time { text-align: right; }
.wi-name { font: 600 clamp(2rem, 3.6vw, 3rem)/1.05 var(--f-sans); letter-spacing: -.035em; transition: color .3s; }
.windex:hover .wi-name { color: rgba(var(--glyph-rgb), .2); }
.windex a:hover { padding-left: 1rem; }
.windex a:hover .wi-name, .windex a:focus-visible .wi-name { color: var(--fg); }
.wpv { position: fixed; left: 0; top: 0; z-index: 25; width: 300px; aspect-ratio: 16 / 10; border: 1px solid var(--fg); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); pointer-events: none; clip-path: inset(50% 0 50% 0); transition: clip-path .5s var(--ease); }
.wpv.on { clip-path: inset(0 0 0 0); }
.wpv img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- shutter between pages: ink bands up, new page, bands away ---------- */
.shutter { position: fixed; inset: 0; z-index: 200; display: flex; pointer-events: none; }
.shutter i { flex: 1; background: var(--fg); box-shadow: 2px 0 0 var(--fg); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .38s cubic-bezier(.65, 0, .35, 1); }
.shutter i:last-child { background: var(--accent); box-shadow: none; }
.shutter.in i, .shutter.cover i { transform: scaleY(1); }
.shutter.cover i { transition: none; }
.shutter.out i { transform: scaleY(0); transform-origin: 50% 0; }
html.shutter-in::after { content: ""; position: fixed; inset: 0; z-index: 201; background: linear-gradient(to right, var(--fg) 83.333%, var(--accent) 83.333%); animation: shutter-safety 0s 1.8s forwards; }
@keyframes shutter-safety { to { visibility: hidden; } }

/* ---------- ASCII portrait and dithered thumbnails (canvas layers drawn by fun.js) ---------- */
.p-ascii { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.portrait.is-ascii .p-line { display: none; }
.app-card .thumb { position: relative; }
.dither { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* tilted entrances for cards (desktop; site.js and fun.js add .reveal only there) */
.cards .card.reveal, .app-card.reveal { transition: opacity .7s var(--ease), transform .8s var(--ease), border-color .25s; }
.cards .card.reveal:not(.in) { transform: translateY(30px) rotate(-1deg) scale(.98); transform-origin: 0 100%; }
.cards .card:nth-child(even).reveal:not(.in) { transform: translateY(30px) rotate(1deg) scale(.98); transform-origin: 100% 100%; }
.app-card.reveal:not(.in) { transform: translateY(26px) scale(.97); }

/* phone versions of the extras, centred like the rest of the page */
@media (max-width: 720px) {
  .termbtn { margin-left: auto; }
  .band-row { justify-content: center; }
  .ship-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ship-stats div, .ship-stats div:first-child { padding: 1rem .5rem; border-left: 0; text-align: center; }
  .ship-stats div:nth-child(odd) { border-right: 1px solid var(--rule); }
  .ship-stats div:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
  .ship-cal { align-items: center; padding: 1rem .75rem; }
  .ship-legend { justify-content: center; }
  .ship-repos { grid-template-columns: minmax(0, 1fr); }
  .ship-repos a { align-items: center; text-align: center; }
  .ship-meta { justify-content: center; }
  .ship-status { text-align: center; }
  .tl-month { width: min(80vw, 18rem); padding: 1.4rem .6rem .25rem; text-align: center; scroll-snap-align: center; }
  .tl-month::before { left: 50%; margin-left: -6.5px; }
  .tl-month ul { gap: .4rem; }
  .tl-month li a { gap: .25rem; padding: .6rem .8rem; }
  .tl-now p { margin-inline: auto; }
  .term { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r) var(--r) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .term-out { height: min(46dvh, 20rem); }
  .term-in input { font-size: 16px; }
  .t-key { display: block; min-width: 0; }
  .term-chips { justify-content: center; }
  .bh-best { display: none; }
  .bh-hud { gap: .6rem; padding-left: .8rem; }
}

/* ---------- motion ---------- */@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-copy > * { animation: rise .8s var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: .06s; } .hero-copy > *:nth-child(3) { animation-delay: .12s; }
.hero-copy > *:nth-child(4) { animation-delay: .18s; } .hero-copy > *:nth-child(5) { animation-delay: .24s; }
.hero .portrait { animation: rise .9s .1s var(--ease) both; }
.reveal:not(.in) { opacity: 0; transform: translateY(14px); }
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { width: min(100%, 18rem); margin: 0; }
  .hero h1 { max-width: 18ch; }
  .arcade, .about-grid { grid-template-columns: 1fr; }
  .picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick { min-width: 0; border-right: 1px solid var(--rule-strong); }
  .pick:last-child { border-right: 0; }
  .proj-body { grid-template-columns: 1fr; }
  .glance { position: static; }
  .searchbtn kbd, .searchbtn span { display: none; }
  .searchbtn { width: 44px; justify-content: center; padding: 0; }
  .note { grid-template-columns: 9rem minmax(0, 1fr); }
}
@media (max-width: 720px) {
  body { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)); }
  .topnav { display: none; }
  .searchbtn { margin-left: auto; }
  .searchbtn span { display: none; }
  .searchbtn { width: 44px; justify-content: center; padding: 0; }
  .masthead .glyphs { height: 300px; }
  .cards { grid-template-columns: 1fr; }
  .screen { aspect-ratio: auto; height: min(78vh, 40rem); height: min(78dvh, 40rem); min-height: 0; }
  .cab-note { display: none; }
  .cab-bar .tool { flex: 1 1 auto; justify-content: center; }
  .tool-link { flex-basis: 100%; margin-left: 0; }
  .poster-body { max-width: none; margin-top: auto; }
  .poster { align-items: stretch; }
  .playbox { aspect-ratio: auto; height: min(78vh, 40rem); height: min(78dvh, 40rem); }
  .proj-next { grid-template-columns: 1fr; }
  .proj-next .next { text-align: left; }
  .app-live .stage { aspect-ratio: auto; height: min(78vh, 40rem); height: min(78dvh, 40rem); }
  .app-live .bar2 a { margin-left: 0; }
  .note { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .note .meta { grid-row: auto; padding: 0 0 .5rem; }
  .pdlg { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .dlg-view { aspect-ratio: auto; max-height: none; height: calc(100dvh - 3.5rem); overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background-image: none !important; }
  .dlg-view iframe { position: relative; transform: none; display: block; }
  .dlg-view .shield { display: none; }
  .browser-view { aspect-ratio: 4 / 5; }
  .foot { padding-top: 13.5rem; }
  .foot .glyphs { height: 200px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg); border-top: 1px solid var(--fg); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar a { position: relative; display: grid; place-items: center; min-height: 54px; text-decoration: none; font: 500 .75rem/1 var(--f-mono); color: var(--muted); }
  .tabbar a[aria-current="true"] { color: var(--fg); box-shadow: inset 0 3px 0 var(--fg); }
}
/* phone: one centred column, so nothing hangs off the left edge */
@media (max-width: 720px) {
  .band-row { text-align: center; }
  .band-hint { padding-inline: .5rem; }
  .hero-copy, .sec-head, .note, .about-copy, .foot-in, .proj-head, .post-head { text-align: center; }
  .eyebrow { justify-content: center; gap: .2rem .7rem; font-size: .75rem; }
  .eyebrow span + span::before { margin-right: .7rem; }
  .hero h1, .lede, .sec-head p, .note p:not(.meta), .about-copy p, .proj-lede { margin-inline: auto; }
  .cta, .tags, .chips, .card-actions, .app-card .go, .foot nav { justify-content: center; }
  .hero .cta { flex-direction: column; align-items: center; }
  .hero .cta .btn { width: min(100%, 18rem); justify-content: space-between; }
  .hero-side { margin-inline: auto; }
  .sec-head { justify-items: center; }
  .pick { align-items: center; text-align: center; padding-inline: .75rem; }
  .cab-top { justify-content: center; }
  .card-body, .app-card .body { align-items: center; text-align: center; }
  .card-top { flex-direction: column; align-items: center; gap: .35rem; }
  .app-card p.new { align-self: stretch; }
  .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; justify-items: center; text-align: center; gap: .45rem; padding: 1.2rem .6rem; border-bottom: 1px solid var(--rule); }
  .fact:nth-child(odd) { border-right: 1px solid var(--rule); }
  .fact:nth-last-child(-n + 2) { border-bottom: 0; }
  .foot-row { flex-direction: column; }
}
@media (max-width: 380px) { .hero h1 { font-size: 2.2rem; } .tabbar a { font-size: .6875rem; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal:not(.in) { opacity: 1; transform: none; }
  .foot-line { animation: none; --fill: 100%; }
}
