@font-face { font-family: "Newsreader"; src: url(/assets/fonts/newsreader.woff2) format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/assets/fonts/newsreader-italic.woff2) format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url(/assets/fonts/geist.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/assets/fonts/geist-mono.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --paper: #f6f4ef;
  --surface: #eeebe3;
  --ink: #1a1a17;
  --ink-2: #57544c;
  --ink-3: #807c72;
  --rule: #dcd7cb;
  --accent: #a83f17;
  --accent-ink: #fffaf5;
  --code-bg: #1b1c1a;
  --code-ink: #e6e3da;
  --code-com: #8f8b80;
  --code-str: #c7d68f;
  --code-kw: #e8a07b;
  --code-ann: #d8b4f0;
  --code-num: #f0c674;
  --code-typ: #9cc7e8;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1120px;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 1px 2px rgb(26 26 23 / .06), 0 8px 24px -12px rgb(26 26 23 / .18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121311;
    --surface: #1b1c19;
    --ink: #ecebe5;
    --ink-2: #a9a69c;
    --ink-3: #85827a;
    --rule: #2c2d29;
    --accent: #ec9466;
    --accent-ink: #1a0f08;
    --code-bg: #0c0d0c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -14px rgb(0 0 0 / .7);
  }
}
:root[data-theme="dark"] {
  --paper: #121311; --surface: #1b1c19; --ink: #ecebe5; --ink-2: #a9a69c; --ink-3: #85827a;
  --rule: #2c2d29; --accent: #ec9466; --accent-ink: #1a0f08; --code-bg: #0c0d0c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
code { font-family: var(--font-mono); font-size: .875em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip:focus { left: 8px; }
.icon { width: 1.05em; height: 1.05em; flex: none; }

/* header / footer */
.site { display: flex; justify-content: space-between; align-items: baseline; padding-block: 22px; font-size: .9375rem; }
.mark { font-family: var(--font-display); font-size: 1.25rem; text-decoration: none; letter-spacing: -.01em; }
.byline { color: var(--ink-2); }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 48px 40px; margin-top: 96px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .9375rem; }
.site-foot p { margin: 0; }
.site-foot a { color: var(--ink); }

/* index */
.intro { padding-block: clamp(40px, 9vw, 112px) clamp(40px, 6vw, 72px); max-width: 52rem; }
.intro h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -.03em; }
.lede { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.4; color: var(--ink-2); margin-top: 24px; max-width: 40ch; }
.works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.works li { border-bottom: 1px solid var(--rule); }
.work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding-block: clamp(24px, 3.5vw, 40px); text-decoration: none; }
.work-thumb { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 8 / 5; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.work-text { display: flex; flex-direction: column; gap: 10px; }
.work-title { font-family: var(--font-display); font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -.02em; }
.work-dek { color: var(--ink-2); max-width: 46ch; }
.work-meta { color: var(--ink-3); font-size: .875rem; font-variant-numeric: tabular-nums; }
.work:hover .work-thumb img { transform: scale(1.025); }
.work:hover .work-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.elsewhere { margin-top: clamp(64px, 9vw, 112px); }
.elsewhere h2, .block h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin-bottom: 20px; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.rows a { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; gap: 8px 24px; align-items: baseline; padding-block: 16px; text-decoration: none; }
.row-title { font-weight: 500; }
.row-note { color: var(--ink-2); }
.rows .icon { align-self: center; color: var(--ink-3); transition: transform .3s var(--ease-out), color .2s; }
.rows a:hover .row-title { text-decoration: underline; text-underline-offset: .2em; }
.rows a:hover .icon { transform: translateX(3px); color: var(--accent); }

/* project */
.p-head { padding-block: clamp(24px, 5vw, 64px) clamp(28px, 4vw, 48px); max-width: 60rem; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-size: .9375rem; margin-bottom: clamp(24px, 4vw, 48px); }
.back:hover { color: var(--ink); }
.p-head h1 { font-size: clamp(2.5rem, 6.2vw, 4.75rem); line-height: 1.02; letter-spacing: -.03em; }
.dek { font-family: var(--font-display); font-size: clamp(1.2rem, 2.1vw, 1.5rem); line-height: 1.4; color: var(--ink-2); margin-top: 20px; max-width: 46ch; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 16px 32px; margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--rule); }
.meta div { min-width: 0; }
.meta dt { color: var(--ink-3); font-size: .8125rem; margin-bottom: 2px; }
.meta dd { margin: 0; font-size: .9375rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; font-size: .9375rem; font-weight: 500; background: transparent; color: var(--ink); transition: border-color .2s, background-color .2s, transform .2s var(--ease-out); }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.hero { margin: 0 0 clamp(48px, 7vw, 88px); }
.hero img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.intro-prose { margin-bottom: clamp(48px, 6vw, 72px); }
.intro-prose p { font-family: var(--font-display); font-size: clamp(1.2rem, 1.9vw, 1.4rem); line-height: 1.5; }

.block { margin-top: clamp(56px, 7vw, 96px); }
.block:first-of-type { margin-top: 0; }
.prose { max-width: var(--measure); }
.list, .steps { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.list li { position: relative; padding-left: 22px; margin-bottom: 12px; }
.list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 1px; background: var(--accent); }
.steps { counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; padding: 14px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step); font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; color: var(--accent); font-variant-numeric: tabular-nums; }
.note { color: var(--ink-3); font-size: .875rem; margin-top: 14px; }
.note a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.row .note { margin: 0; }

figure { margin: 0; }
figcaption { color: var(--ink-3); font-size: .875rem; margin-top: 10px; }
figcaption a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }

.gallery img { width: 100%; border-radius: var(--radius); background: var(--surface); }
.gallery-photos { columns: 2 22rem; column-gap: 16px; }
.gallery-photos figure { break-inside: avoid; margin-bottom: 16px; }
.gallery-screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 16px; align-items: start; }
.gallery-screens img { border: 1px solid var(--rule); }
.gallery-slides { display: grid; gap: 16px; }
.gallery-slides img, .gallery-pages img { border: 1px solid var(--rule); }
.gallery-phones { display: flex; flex-wrap: wrap; gap: 20px; }
.gallery-phones figure { width: min(100%, 280px); }
.gallery-phones img { border-radius: 18px; border: 1px solid var(--rule); }
.gallery-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 16px; align-items: start; }
.paper img { box-shadow: var(--shadow); }
.figure-wide img { width: 100%; border-radius: var(--radius); border: 1px solid var(--rule); background: #fff; }

.video video { width: 100%; border-radius: var(--radius); background: #000; }
.video.portrait { max-width: 360px; }
.pair { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }
.pair img { border-radius: var(--radius); }
.audio { max-width: 34rem; padding: 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.audio audio { width: 100%; }

/* slide viewer */
.viewer { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; }
.slide img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--rule); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color .2s; }
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.count { min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .9375rem; }
.spacer { flex: 1; }

/* diagram */
.diagram-wrap { max-width: 640px; }
.diagram { width: 100%; font-family: var(--font-sans); }
.diagram .d-nodes rect { fill: var(--surface); stroke: var(--rule); stroke-width: 1; }
.diagram .d-nodes .d-strong { stroke: var(--ink-3); }
.diagram .d-nodes .d-gate { stroke: var(--accent); stroke-width: 1.5; }
.diagram .d-edges line { stroke: var(--ink-3); stroke-width: 1.25; fill: none; }
.diagram .d-edges .d-accent { stroke: var(--accent); }
.diagram .d-head { fill: var(--ink-3); }
.diagram .d-title { fill: var(--ink); font-size: 15px; font-weight: 600; }
.diagram .d-sub { fill: var(--ink-2); font-size: 12.5px; }
.diagram .d-labels text { fill: var(--ink-2); font-size: 11.5px; }
.diagram .d-labels .d-accent-text { fill: var(--accent); }

/* code components */
.components { display: grid; gap: clamp(40px, 5vw, 64px); }
.component { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-top: 28px; border-top: 1px solid var(--rule); }
.component h3 { font-size: 1.625rem; line-height: 1.15; }
.component-repo { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-3); margin: 6px 0 14px; }
.component-text p:last-of-type { color: var(--ink-2); }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: underline; text-underline-offset: .25em; }
.link:hover { color: var(--accent); }
.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; }
.code figcaption { margin: 0; padding: 10px 16px; font-family: var(--font-mono); font-size: .75rem; color: var(--code-com); border-bottom: 1px solid rgb(255 255 255 / .08); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; font-size: .8125rem; line-height: 1.65; tab-size: 4; scrollbar-color: #444 transparent; }
.code code { font-size: inherit; }
.t-com { color: var(--code-com); font-style: italic; }
.t-str { color: var(--code-str); }
.t-kw { color: var(--code-kw); }
.t-ann { color: var(--code-ann); }
.t-num { color: var(--code-num); }
.t-typ { color: var(--code-typ); }

/* panorama */
.pano-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; scrollbar-color: var(--ink-3) transparent; }
.pano-scroll img { height: clamp(360px, 62vh, 680px); width: auto; max-width: none; }

/* playdaq */
.concept-stage { display: grid; place-items: center; padding: clamp(24px, 5vw, 56px); background: var(--surface); border-radius: var(--radius); }
.pd-concept { width: min(100%, 360px); font-family: var(--font-sans); filter: drop-shadow(0 18px 30px rgb(0 0 0 / .25)); }
.pd-concept .pd-label { fill: var(--pd-text-2); font-size: 12px; letter-spacing: .08em; font-weight: 500; }
.pd-concept .pd-team { fill: var(--pd-text-2); font-size: 14px; }
.pd-concept .pd-price { font-size: 56px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pd-concept .pd-price-quiet { fill: var(--pd-text); }
.pd-concept .pd-axis { fill: var(--pd-text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.pd-concept .pd-small { fill: var(--pd-text); font-size: 13px; }
.pd-concept .pd-cta { font-size: 16px; font-weight: 600; }
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 32px; }
.swatches h3 { font-family: var(--font-sans); font-size: .9375rem; font-weight: 500; margin-bottom: 12px; letter-spacing: 0; }
.swatches ul { list-style: none; margin: 0; padding: 0; }
.swatches li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.chip { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .25); }
.swatches code { color: var(--ink); overflow-wrap: anywhere; }
.hex { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* next */
.next { margin-top: clamp(72px, 9vw, 120px); border-top: 1px solid var(--rule); }
.next a { display: flex; align-items: baseline; gap: 16px; padding-block: 28px; text-decoration: none; }
.next-label { color: var(--ink-3); font-size: .9375rem; }
.next-title { font-family: var(--font-display); font-size: clamp(1.75rem, 3.6vw, 2.75rem); letter-spacing: -.02em; line-height: 1.1; }
.next .icon { align-self: center; width: 1.5em; height: 1.5em; color: var(--accent); transition: transform .4s var(--ease-out); }
.next a:hover .icon { transform: translateX(6px); }

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .work { grid-template-columns: 1fr; gap: 16px; }
  .rows a { grid-template-columns: minmax(0, 1fr) auto; }
  .rows .row-note { grid-column: 1; grid-row: 2; }
  .rows .icon { grid-column: 2; grid-row: 1 / span 2; }
  .component { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .video.portrait { max-width: 300px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .viewer-bar .btn span { display: none; }
  .viewer-bar .btn { padding: 10px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.pd-concept .pd-profit { fill: var(--pd-profit); }
