/* The landing page wears the app's skin, scaled up: black ground, red
   chrome used sparingly, and the print samples as the only other color.
   Type: Jacquard 24, a high-res pixel blackletter that echoes the shop's
   T, for headlines only (sized in steps of 24 px so its grid stays sharp);
   Pixelify Sans for chrome; IBM Plex Mono at 15 px and up for reading. */
@font-face { font-family: "Jacquard 24"; src: url(fonts/jacquard-24-latin-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "Jacquard 24"; src: url(fonts/jacquard-24-latin-ext-400-normal.woff2) format("woff2"); font-display: swap; unicode-range: U+0100-0130, U+0132-024F; }
@font-face { font-family: "Pixelify Sans"; src: url(fonts/pixelify-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Pixelify Sans"; src: url(fonts/pixelify-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "Pixelify Sans"; src: url(fonts/pixelify-sans-latin-ext-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-0130, U+0132-024F; }
@font-face { font-family: "Pixelify Sans"; src: url(fonts/pixelify-sans-latin-ext-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-0130, U+0132-024F; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-ext-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F; }

:root {
  --void: #000000;
  --frame: #ff0000;
  --ink: #ffffff;
  --select: #00ffff;
  --dim: #c4c4c4;      /* secondary text, 12:1 on black */
  --well: #141414;
  --paper: #f3ecdc;    /* poster stock */
  --film: #f4f4f0;
  --display: "Jacquard 24", "UnifrakturMaguntia", Georgia, serif;
  --chrome: "Pixelify Sans", ui-monospace, monospace;
  --data: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --border: 2px;
  --gl: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--void); color: var(--ink); font: 16px/1.6 var(--data); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--select); outline-offset: 3px; }
::selection { background: var(--select); color: var(--void); }
img { max-width: 100%; height: auto; display: block; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
code { font: inherit; color: var(--ink); background: var(--well); padding: 0 4px; }
h1, h2, p { margin: 0; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 0 var(--gr) 0 var(--gl); padding-top: env(safe-area-inset-top, 0px); min-height: 60px; background: var(--void); border-bottom: var(--border) solid var(--frame); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 18px/1 var(--chrome); letter-spacing: .02em; }
.logo .t16 { width: 32px; height: 32px; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { font: 600 15px/1 var(--data); text-decoration: none; padding: 12px 12px; }
.top nav a:hover { background: var(--select); color: var(--void); }
@media (max-width: 640px) { .top nav a:not([href="app/"]) { display: none; } .logo span { font-size: 17px; } }

/* ---------- shared ---------- */
main { display: grid; gap: clamp(80px, 12vw, 160px); padding-bottom: 96px; }
section { padding-inline: var(--gl) var(--gr); max-width: calc(1240px + 32px); margin-inline: auto; width: 100%; }
h2 { font: 400 72px/.95 var(--display); text-wrap: balance; }
@media (max-width: 700px) { h2 { font-size: 48px; } }
.win { border: var(--border) solid var(--frame); background: var(--void); box-shadow: 5px 5px 0 var(--frame); min-width: 0; }
.tb { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--frame); color: var(--void); font: 600 15px/1 var(--chrome); letter-spacing: .08em; text-transform: uppercase; padding: 7px 8px; }
.tb i { width: 15px; height: 15px; border: var(--border) solid var(--void); flex: none; }
.tb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { font-size: 15px; color: var(--dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; font: 600 16px/1 var(--data); text-decoration: none; color: var(--ink); background: var(--void); border: var(--border) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); cursor: pointer; transition: transform .08s steps(2), box-shadow .08s steps(2); }
.btn:hover { background: var(--select); color: var(--void); border-color: var(--select); box-shadow: 4px 4px 0 var(--select); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 transparent; }
.btn.go { background: var(--ink); color: var(--void); border-color: var(--ink); box-shadow: 4px 4px 0 var(--frame); }
.btn.go:hover { background: var(--select); border-color: var(--select); box-shadow: 4px 4px 0 var(--ink); }
.btn.sm { min-height: 42px; padding: 0 16px; font-size: 15px; }

/* ---------- 1 · hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding-top: clamp(40px, 8vw, 104px); }
.hero h1 { font: 400 168px/.84 var(--display); margin-left: -.03em; }
@media (max-width: 1180px) { .hero h1 { font-size: 144px; } }
@media (max-width: 1000px) { .hero h1 { font-size: 120px; } }
@media (max-width: 480px) { .hero h1 { font-size: 96px; } }
.hero-copy { display: grid; gap: 22px; align-content: start; min-width: 0; }
.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; max-width: 34ch; margin-top: 12px; text-wrap: pretty; }
.sub { color: var(--dim); max-width: 44ch; }
.cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.lab { margin: 0; justify-self: end; width: min(100%, 440px); }
.lab-stage { background: var(--well); padding: clamp(16px, 3vw, 28px); display: grid; place-items: center; }
#poster { width: 100%; aspect-ratio: 4 / 5; background: var(--paper); }
.lab-stage { min-width: 0; }
.lab-inks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 16px 16px 0; font-size: 15px; color: var(--dim); }
.lab-inks span { display: flex; align-items: center; gap: 8px; }
.lab-inks i { width: 14px; height: 14px; border: 1px solid var(--ink); display: block; }
.lab-inks .paper { margin-left: auto; }
.lab-inks [hidden] { display: none; }
.lab-algos { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
.lab-algos button { font: 600 15px/1 var(--data); color: var(--ink); background: var(--void); border: var(--border) solid var(--ink); padding: 9px 11px; cursor: pointer; min-height: 40px; }
.lab-algos .then { align-self: center; font: 600 16px var(--data); color: var(--dim); }
.lab-algos button:hover { border-color: var(--select); color: var(--select); }
.lab-algos button[aria-pressed="true"] { background: var(--select); border-color: var(--select); color: var(--void); }
.lab figcaption { padding: 0 16px 18px; font-size: 15px; color: var(--dim); }
@media (max-width: 860px) { .lab { justify-self: stretch; width: 100%; max-width: 520px; } }

/* ---------- 2 · films into register ---------- */
.how { display: grid; gap: 40px; }
.how-head { display: grid; align-self: stretch; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.how-head p { color: var(--dim); font-size: 18px; max-width: 46ch; }
@media (max-width: 760px) { .how-head { grid-template-columns: 1fr; } }
.register { position: relative; display: grid; gap: 20px; justify-items: center; }
.films { display: grid; width: min(100%, 860px); isolation: isolate; }
.film { grid-area: 1 / 1; position: relative; width: 46%; margin: 0; background: var(--film); padding: 4.5% 4.5% 0; color: #000; box-shadow: 0 0 0 1px #000; transform: translateX(var(--x, 0)); will-change: transform; }
.film[data-ink="0"] { justify-self: start; margin-left: 2%; }
.film[data-ink="1"] { justify-self: end; margin-right: 2%; mix-blend-mode: multiply; }
.film .done { display: none; }
.in-register .film[data-ink="0"] .lbl, .in-register .film[data-ink="0"] b { display: none; }
.in-register .film[data-ink="0"] .done { display: inline; }
.in-register .film[data-ink="1"] figcaption { visibility: hidden; }
@media (max-width: 600px) { .film .mesh { display: none; } .film figcaption { font-size: 13px; gap: 6px; } .film figcaption b { display: none; } }
.film canvas { width: 100%; aspect-ratio: 4 / 5; }
.film figcaption { font: 600 14px/1 var(--chrome); letter-spacing: .04em; padding: 12px 0; border-top: 2px solid #000; margin-top: 10px; display: flex; gap: 10px; white-space: nowrap; overflow: hidden; }
.film figcaption b { background: #000; color: var(--film); padding: 2px 6px; }
.film::before, .film::after { content: ""; position: absolute; top: 1.2%; width: 7%; aspect-ratio: 1; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='11' fill='none' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M20 0v40M0 20h40' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E"); }
.film::before { left: 1.2%; } .film::after { right: 1.2%; }
.offset { font: 600 16px var(--data); color: var(--dim); }
.offset b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 3 · recipe + facts ---------- */
.recipe { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .recipe { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 8px 20px; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid #3a0000; }
.steps li:last-child { border-bottom: 0; }
.steps .box { width: 22px; height: 22px; background: var(--frame); margin-top: 2px; position: relative; }
.steps .box::after { content: ""; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px; border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.steps b { font: 600 20px/1.2 var(--chrome); }
.steps p { color: var(--dim); margin-top: 4px; }
.steps .kind { font-size: 15px; color: var(--dim); }
@media (max-width: 520px) { .steps .kind { display: none; } .steps li { grid-template-columns: 22px minmax(0, 1fr); } }
.facts { display: grid; gap: 28px; }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr 1fr; gap: 24px 20px; } }
.facts p { display: grid; align-content: start; gap: 6px; color: var(--dim); font-size: 16px; border-top: var(--border) solid var(--frame); padding-top: 14px; }
.facts b { font: 400 96px/.8 var(--display); color: var(--ink); }
@media (max-width: 700px) { .facts b { font-size: 72px; } }

/* ---------- 4 · screenshot ---------- */
.shot { display: grid; gap: 40px; }
.shot .frame img { width: 100%; }
/* the screenshot is a crop of a longer app, so it fades out instead of ending mid-panel */
.shot .frame { -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.how-head p code { font-size: .95em; }

/* ---------- footer ---------- */
footer { border-top: var(--border) solid var(--frame); padding: 32px var(--gr) calc(32px + env(safe-area-inset-bottom, 0px)) var(--gl); display: flex; gap: 20px; align-items: center; justify-content: center; color: var(--dim); font-size: 15px; }
footer .t48 { width: 54px; height: 54px; flex: none; }
footer b { color: var(--ink); font-weight: 600; }
footer p + p { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
