/* barackliu.org — 2026-09 redesign: "drafting table".
   Light: cool graph paper, graphite ink, one vermilion accent.
   Dark: blueprint navy with chalk-white lines.
   Display type is a sharp grotesque; labels, dates and numbers are monospaced, like the
   annotations on an engineering drawing. Sections are numbered like drawing sheets. */

:root {
  --paper: #f4f5f2;
  --paper-2: #e9ebe6;
  --card: #ffffff;
  --ink: #1a1d21;
  --ink-2: #40454c;
  --muted: #6a7078;
  --line: #d6d9d3;
  --line-2: #b9bdb6;
  --grid: rgba(26, 29, 33, .045);
  --accent: #c63d2a;
  --accent-ink: #a6301e;
  --accent-soft: #f7ded8;
  --screen: #111317;
  --screen-ink: #ece9e2;
  --screen-muted: #9da2aa;
  --screen-line: #2a2e35;
  --focus: #2457d6;
  /* rings palette (light) — read by rings.js */
  --c-film: #e0561c;
  --c-chapter: #b8892a;
  --c-devlog: #1f78c8;
  --c-code: #2f8a46;
  --c-research: #7650e0;
  --c-drawing: #d4366e;
  --c-blooper: #a8754a;
  --c-project: #1a1d21;
  --ring-line: rgba(26, 29, 33, .16);
  --ring-label: #6a7078;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;

  --display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1724;
    --paper-2: #122033;
    --card: #12213a;
    --ink: #e9eef5;
    --ink-2: #bcc8d6;
    --muted: #8496ab;
    --line: #213650;
    --line-2: #2f4a6b;
    --grid: rgba(150, 185, 230, .07);
    --accent: #ff7a5c;
    --accent-ink: #ff9a80;
    --accent-soft: #3b2328;
    --screen: #08101b;
    --screen-line: #1e3049;
    --c-film: #ffa063;
    --c-chapter: #ecd9a4;
    --c-devlog: #7cc4f2;
    --c-code: #8fd49a;
    --c-research: #c6a8ff;
    --c-drawing: #ff9aae;
    --c-blooper: #f2c79c;
    --c-project: #ffffff;
    --ring-line: rgba(190, 215, 245, .16);
    --ring-label: #8fa3bb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1724; --paper-2: #122033; --card: #12213a; --ink: #e9eef5; --ink-2: #bcc8d6; --muted: #8496ab;
  --line: #213650; --line-2: #2f4a6b; --grid: rgba(150, 185, 230, .07); --accent: #ff7a5c; --accent-ink: #ff9a80; --accent-soft: #3b2328;
  --screen: #08101b; --screen-line: #1e3049;
  --c-film: #ffa063; --c-chapter: #ecd9a4; --c-devlog: #7cc4f2; --c-code: #8fd49a; --c-research: #c6a8ff; --c-drawing: #ff9aae; --c-blooper: #f2c79c; --c-project: #ffffff;
  --ring-line: rgba(190, 215, 245, .16); --ring-label: #8fa3bb;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 400 16.5px/1.68 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(zh) body, body:lang(zh) { line-height: 1.85; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
p, li, dd, figcaption { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
time, .mono, .num { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 4px; z-index: 100; }
.skip:focus { left: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- section heads: numbered like drawing sheets ---------- */
.section { padding-block: clamp(64px, 9vw, 108px); }
.section-head { display: grid; gap: 4px; margin-bottom: clamp(26px, 4vw, 40px); max-width: 780px; }
.section-head .sheet { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 500 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.section-head .sheet::after { content: ""; flex: 0 0 56px; height: 1px; background: currentColor; opacity: .5; }
.section-head h2 {
  margin: 0;
  font: 700 clamp(32px, 4.6vw, 50px)/1.04 var(--display);
  letter-spacing: -.025em;
  font-variation-settings: "opsz" 96;
}
:lang(zh) .section-head h2 { letter-spacing: .01em; font-weight: 700; }
.section-head p { margin: 10px 0 0; color: var(--ink-2); font-size: 17.5px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 17px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; color: var(--ink); }
.brand .core { fill: var(--accent); }
.brand .core-ring { stroke: var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a { text-decoration: none; color: var(--ink-2); font: 500 13px/1 var(--mono); letter-spacing: .02em; padding: 9px 10px; border-radius: 4px; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a b { color: var(--accent); font-weight: 500; margin-right: 4px; }
.nav .lang { margin-left: 8px; border: 1px solid var(--line-2); color: var(--ink); padding: 8px 12px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.nav .lang:hover { border-color: var(--ink); background: transparent; }
.nav-links { display: flex; gap: 2px; }
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; font: 500 13px/1 var(--mono); padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 4px; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { border-color: var(--ink); }
.nav-menu > div { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; display: grid; padding: 6px; background: var(--card); border: 1.5px solid var(--ink); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.nav-menu > div a { padding: 10px 10px; }
@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
  .site-header .wrap { height: 56px; }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(44px, 7vw, 96px) clamp(36px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero .label { margin: 0 0 16px; color: var(--accent); }
.hero h1 {
  margin: 0 0 22px;
  font: 800 clamp(52px, 9.4vw, 112px)/.92 var(--display);
  letter-spacing: -.045em;
  font-variation-settings: "opsz" 96;
}
.hero h1 .alt { display: block; margin-top: 14px; font: 500 clamp(17px, 2vw, 22px)/1 var(--mono); letter-spacing: .04em; color: var(--muted); }
:lang(zh) .hero h1 { letter-spacing: .02em; font-weight: 800; }
.lede { font-size: clamp(18px, 2.05vw, 21px); line-height: 1.62; color: var(--ink-2); margin: 0 0 28px; max-width: 38em; }
:lang(zh) .lede { line-height: 1.9; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* title block — like the corner block on an engineering drawing */
.titleblock { border: 1.5px solid var(--ink); background: var(--card); font-size: 14.5px; }
.titleblock .tb-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1.5px solid var(--ink); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.titleblock .tb-head span:last-child { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: .02em; }
.titleblock dl { margin: 0; }
.titleblock .tb-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: 50% 30%; border-bottom: 1.5px solid var(--ink); }
.titleblock dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.titleblock dl > div:last-child { border-bottom: 0; }
.titleblock dt { padding: 10px 12px; font: 500 11.5px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); }
.titleblock dd { margin: 0; padding: 9px 12px; font-weight: 550; line-height: 1.45; }
.titleblock dd a { text-decoration: none; }
.titleblock dd a:hover { text-decoration: underline; }
.titleblock .film { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center; }
.titleblock .film img { aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.titleblock small { display: block; color: var(--muted); font: 500 12px/1.4 var(--mono); margin-top: 2px; }
.titleblock dd.thin { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.titleblock dd.thin small a { color: var(--accent-ink); text-decoration: none; }
.titleblock dd.thin small a:hover { text-decoration: underline; }
.tb-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.tb-specs a { display: grid; gap: 1px; padding: 10px 12px 11px; text-decoration: none; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.tb-specs a:nth-child(odd) { border-left: 0; }
.tb-specs a:nth-child(-n+2) { border-top: 0; }
.tb-specs .k { font: 500 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tb-specs .n { font: 750 27px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.tb-specs .l { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.tb-specs a:hover .n { color: var(--accent); }
.tb-foot { display: flex; justify-content: space-between; padding: 7px 12px; border-top: 1.5px solid var(--ink); font: 500 11.5px/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tb-foot time { color: var(--ink); }

/* ---------- résumé ruler (time to scale) ---------- */
.ruler-sec { margin: 0 0 clamp(28px, 4vw, 44px); }
.ruler-sec .label { margin: 0 0 14px; }
.ruler { position: relative; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent); padding: 14px 16px 10px 116px; }
.ruler .ticks { position: relative; height: 22px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.ruler .tick { position: absolute; bottom: -1px; height: 7px; border-left: 1px solid var(--line-2); }
.ruler .tick span { position: absolute; bottom: 9px; left: 0; transform: translateX(-50%); font: 500 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.ruler .tick.minor span { display: none; }
.ruler .track { position: relative; border-bottom: 1px dashed var(--line); }
.ruler .track:last-of-type { border-bottom: 0; }
.ruler .track-name { position: absolute; left: -100px; top: 50%; transform: translateY(-50%); width: 88px; font: 500 11.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ruler .row { position: relative; height: 30px; }
.ruler .span { position: absolute; top: 9px; height: 12px; border-radius: 2px; text-decoration: none; min-width: 5px; }
.ruler .span .t { position: absolute; bottom: 14px; left: 0; white-space: nowrap; font-size: 12.5px; font-weight: 600; line-height: 1; color: var(--ink); }
.ruler .span.r .t { left: auto; right: 0; }
.ruler .row { height: 40px; }
.ruler .span { top: 22px; }
.ruler .edu { background: repeating-linear-gradient(135deg, var(--ink-2) 0 1.5px, transparent 1.5px 5px); border: 1px solid var(--ink-2); }
.ruler .work { background: var(--ink); }
.ruler .make { background: transparent; border: 1.5px dashed var(--c-film); }
.ruler .now { background: var(--accent); }
.ruler .now::after { content: ""; position: absolute; right: -6px; top: -3px; width: 12px; height: 18px; background: linear-gradient(90deg, var(--accent), transparent); }
.ruler .span:hover .t, .ruler .span:focus-visible .t { color: var(--accent); }
.ruler .today { position: absolute; top: 0; bottom: 0; border-left: 1.5px solid var(--accent); pointer-events: none; }
.ruler .today span { position: absolute; top: 2px; right: 4px; font: 600 10.5px/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.ruler-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.ruler-legend i { display: inline-block; width: 18px; height: 9px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.ruler-list { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .ruler { display: none; }
  .ruler-legend { display: none; }
  .ruler-list { position: static !important; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
  .ruler-list h3 { margin: 0 0 6px; }
  .ruler-list ol { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line-2); }
  .ruler-list li a { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0 6px 12px; text-decoration: none; font-size: 15px; }
  .ruler-list li a time { font: 500 12.5px/1.5 var(--mono); color: var(--muted); }
  .ruler-list li.is-now a { color: var(--accent); font-weight: 600; }
}

/* ---------- spec row: four checkable numbers ---------- */
.spec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-2); background: var(--card); }
.spec a { display: grid; gap: 4px; padding: 16px 18px 18px; text-decoration: none; position: relative; border-left: 1px solid var(--line); }
.spec a:first-child { border-left: 0; }
.spec .label { padding-right: 18px; }
.spec .n { font: 750 clamp(32px, 3.8vw, 44px)/1.05 var(--display); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.spec .l { color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.spec .go { position: absolute; top: 14px; right: 14px; color: var(--muted); font-size: 14px; transition: transform .2s ease, color .2s ease; }
.spec a:hover .go { transform: translate(2px, -2px); color: var(--accent); }
.spec a:hover .n { color: var(--accent); }
@media (max-width: 860px) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec a:nth-child(3) { border-left: 0; }
  .spec a:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- cards ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px); min-width: 0; display: flex; flex-direction: column; }
.card h3 { font: 700 clamp(21px, 2.2vw, 25px)/1.18 var(--display); letter-spacing: -.015em; margin: 0 0 8px; }
:lang(zh) .card h3 { letter-spacing: .01em; }
.card .meta { font: 500 12.5px/1.5 var(--mono); color: var(--muted); margin: 0 0 14px; }
.card p { margin: 0 0 16px; color: var(--ink-2); }
.card .links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 4px; }
.card .links a { font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--accent-ink); }
.card .links a:hover { text-decoration: underline; }
.ext::after { content: "↗"; display: inline-block; margin-left: 3px; font-size: .88em; transition: transform .2s ease; }
a.ext:hover::after { transform: translate(1px, -1px); }

/* the film card is a small screening room */
.card.films { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 3vw, 36px); background: var(--screen); color: var(--screen-ink); border-color: var(--screen); }
.card.films h3 { color: #fff; }
.card.films .meta { color: var(--screen-muted); }
.card.films p { color: #cfccc4; }
.card.films .links a { color: #ffab8f; }
.feature { position: relative; display: block; overflow: hidden; text-decoration: none; background: #000; border-radius: 3px; }
.feature img { aspect-ratio: 16/9; object-fit: cover; width: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.feature:hover img { transform: scale(1.025); }
.badge {
  position: absolute; right: 10px; top: 10px; z-index: 1;
  background: #fff4e8; color: #5b2a12; border: 1px solid #f0c9a6;
  font: 600 11.5px/1.25 var(--mono); letter-spacing: .02em; padding: 6px 9px; border-radius: 3px;
}
.feature-wrap { position: relative; }
.laurel { position: absolute; right: 10px; top: 10px; z-index: 2; display: block; width: clamp(150px, 38%, 210px); padding: 4px 6px 2px; border-radius: 6px; background: rgba(10, 11, 14, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .2s ease, background .2s ease; }
.laurel:hover { transform: translateY(-1px); background: rgba(10, 11, 14, .78); }
.laurel-svg { display: block; width: 100%; height: auto; }
.laurel-svg .lf { fill: #e6b85c; }
.laurel-svg .st { fill: none; stroke: #e6b85c; stroke-width: 1.2; }
.laurel-svg text { text-anchor: middle; fill: #f6e3b4; }
.laurel-svg .l1 { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; fill: #e6b85c; }
.laurel-svg .l2 { font: 700 14px var(--display); letter-spacing: -.01em; fill: #fff6e0; }
.laurel-svg .l3 { font: 500 9.5px var(--mono); letter-spacing: .06em; fill: #d9c79c; }
.titleblock dd.cert { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; }
.titleblock .cert-thumb img { border: 1px solid var(--line-2); width: 32px; height: 48px; object-fit: cover; }
.titleblock dd.cert small a { color: var(--accent-ink); text-decoration: none; }
.titleblock dd.cert small a:hover { text-decoration: underline; }
.feature-cap { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0 4px; font-size: 14px; font-weight: 600; color: #fff; }
.feature-cap time { color: var(--screen-muted); font: 500 12.5px/1.6 var(--mono); }
.feature-cap a { text-decoration: none; }
.feature-cap a:hover { text-decoration: underline; }
.reel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.reel a { position: relative; display: block; overflow: hidden; text-decoration: none; background: #000; border-radius: 2px; }
.reel img { aspect-ratio: 16/9; object-fit: cover; width: 100%; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.reel a:hover img { transform: scale(1.04); }
.reel span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 5px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.82)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; padding: 0; list-style: none; border: 1px solid var(--screen-line); width: fit-content; max-width: 100%; }
.pipeline li { font: 500 12px/1 var(--mono); color: #e6e2d8; padding: 7px 10px; border-right: 1px solid var(--screen-line); }
.pipeline li:last-child { border-right: 0; }
.pipeline b { color: #ffab8f; font-weight: 600; margin-right: 4px; }

.card.vdanmu, .card.novel, .card.hongyi, .card.devlog { grid-column: span 3; }
.chapters { display: block; width: 100%; height: 50px; margin: 2px 0 6px; color: var(--c-chapter); border-bottom: 1px solid var(--line-2); }
.chapters rect { fill: currentColor; }
.chart-cap { font: 500 12px/1.4 var(--mono) !important; color: var(--muted) !important; margin: 0 0 14px !important; }
@media (max-width: 900px) {
  .card.films { grid-template-columns: 1fr; }
  .card.vdanmu, .card.novel, .card.hongyi, .card.devlog { grid-column: 1 / -1; }
}

/* ---------- rings: a figure on the drafting table ---------- */
.rings-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search input { width: 100%; height: 42px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 0 14px 0 38px; font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.tool-btn { height: 42px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 0 14px; font: 600 14px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tool-btn:hover { border-color: var(--ink); }
.tool-btn svg { width: 16px; height: 16px; }
.match-count { font: 500 12.5px/1 var(--mono); color: var(--muted); min-width: 6em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 500 12.5px/1 var(--mono); cursor: pointer; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip b { font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip.all b { color: var(--ink-2); }
.rings-stage { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: clamp(18px, 3vw, 36px); align-items: start; }
.figure { position: relative; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--card) 55%, transparent); padding: clamp(10px, 2vw, 22px); }
.figure::before, .figure::after, .figure .corner::before, .figure .corner::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--ink); border-style: solid; pointer-events: none;
}
.figure::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.figure::after { top: -1px; right: -1px; border-width: 1.5px 1.5px 0 0; }
.figure .corner::before { bottom: -1px; left: -1px; border-width: 0 0 1.5px 1.5px; }
.figure .corner::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }
.figure figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font: 500 12px/1.4 var(--mono); color: var(--muted); }
.figure figcaption b { color: var(--ink); font-weight: 600; }
.canvas-wrap { position: relative; width: 100%; max-width: 720px; aspect-ratio: 1; margin-inline: auto; touch-action: manipulation; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-wrap canvas.hit { cursor: pointer; }
.tip { position: absolute; z-index: 3; pointer-events: none; max-width: 280px; padding: 9px 11px; border-radius: 3px; background: var(--ink); color: var(--paper); font-size: 13.5px; line-height: 1.45; box-shadow: 0 10px 28px rgba(0,0,0,.25); opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; }
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; font-weight: 600; }
.tip small { display: block; margin-top: 3px; opacity: .72; font: 500 11.5px/1.45 var(--mono); }
.panel { position: sticky; top: 80px; display: grid; gap: 14px; }
.pick { border: 1.5px solid var(--ink); background: var(--card); min-height: 170px; }
.pick .label { display: block; padding: 8px 12px; border-bottom: 1.5px solid var(--ink); color: var(--ink); }
.pick .body { padding: 14px 14px 16px; }
.pick .cat { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1.4 var(--mono); color: var(--muted); }
.pick .cat i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); }
.pick h3 { margin: 8px 0 4px; font: 700 17.5px/1.32 var(--display); word-break: break-word; }
.pick p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.pick a.open { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-ink); text-decoration: none; font-size: 14.5px; }
.pick a.open:hover { text-decoration: underline; }
.pick .empty { color: var(--muted); font-size: 14px; margin: 0; }
.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend svg { width: 22px; height: 12px; flex: none; }
.rings-note { font: 500 12px/1.5 var(--mono); color: var(--muted); margin: 0; }
.rings-list { display: none; max-height: 640px; overflow: auto; border: 1px solid var(--line-2); background: var(--card); padding: 4px 16px 16px; }
.rings-list h3 { position: sticky; top: 0; background: var(--card); margin: 0; padding: 12px 0 6px; font: 600 13px/1 var(--mono); color: var(--accent); border-bottom: 1px solid var(--line); }
.rings-list ul { list-style: none; margin: 0; padding: 0; }
.rings-list li { display: grid; grid-template-columns: 10px 86px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.rings-list li i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); align-self: center; }
.rings-list time { color: var(--muted); font: 500 12px/1 var(--mono); }
.rings-list a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rings-list a:hover { color: var(--accent); text-decoration: underline; }
.as-list .figure { display: none; }
.as-list .rings-list { display: block; }
@media (max-width: 980px) { .rings-stage { grid-template-columns: 1fr; } .panel { position: static; } }

/* ---------- experience ---------- */
.xp { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.xp > li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); padding: 26px 0; border-bottom: 1px solid var(--line); }
.xp .when { font: 500 13px/1.5 var(--mono); color: var(--ink-2); padding-top: 5px; }
.xp .when small { display: block; color: var(--muted); font-size: 12px; }
.xp h3 { margin: 0; font: 700 21px/1.28 var(--display); letter-spacing: -.01em; }
.xp h3 .at { color: var(--muted); font-weight: 600; }
.xp h3 a { text-decoration: none; }
.xp h3 a:hover { color: var(--accent); }
.xp .summary { margin: 10px 0 8px; }
.xp ul.b { margin: 10px 0 0; padding-left: 1.1em; color: var(--ink-2); display: grid; gap: 6px; }
.xp ul.b li::marker { content: "– "; color: var(--accent); }
.xp .ev { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.xp .ev a { font: 500 12.5px/1.3 var(--mono); text-decoration: none; color: var(--accent-ink); border: 1px solid currentColor; border-radius: 3px; padding: 5px 9px; }
.xp .ev a:hover { background: var(--accent-soft); }
.also { margin: 20px 0 0; color: var(--muted); font-size: 15px; }
@media (max-width: 680px) { .xp > li { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- education ---------- */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.edu .card h3 { font-size: 20px; }
.edu .card .deg { font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.edu .card ul { margin: 8px 0 0; padding-left: 1.05em; color: var(--ink-2); font-size: 15px; display: grid; gap: 4px; }
.edu .card ul li::marker { content: "– "; color: var(--accent); }
.pubs { margin: 36px 0 0; }
.pubs h3 { font: 700 20px/1.3 var(--display); margin: 0 0 12px; }
.pubs ol { margin: 0; padding: 0; list-style: none; counter-reset: p; border-top: 1px solid var(--line); }
.pubs li { counter-increment: p; display: grid; grid-template-columns: 34px minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.pubs li::before { content: "[" counter(p) "]"; font: 500 12.5px/1.9 var(--mono); color: var(--muted); }
.pubs a { font: 500 12.5px/1 var(--mono); color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.pubs a:hover { text-decoration: underline; }
@media (max-width: 900px) { .edu { grid-template-columns: 1fr; } }

/* ---------- drawings ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.gallery button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.gallery button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.gallery .frame { background: #fff; padding: 10px; border: 1px solid var(--line-2); aspect-ratio: 4/5; display: grid; place-items: center; overflow: hidden; }
.gallery img { max-height: 100%; width: auto; object-fit: contain; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gallery button:hover img { transform: scale(1.03); }
.gallery figcaption { margin-top: 8px; font-size: 14px; line-height: 1.4; }
.gallery figcaption time { display: block; color: var(--muted); font: 500 12px/1.5 var(--mono); }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 12, 15, .93); display: none; place-items: center; padding: 56px 16px 72px; }
.lightbox.on { display: grid; }
.lightbox img { max-width: min(1100px, 100%); max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); width: auto; height: auto; background: #fff; object-fit: contain; }
.lightbox button[hidden] { display: none; }
.lightbox p { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: #e8e4dc; margin: 0; padding-inline: 70px; font-size: 15px; }
.lightbox button { position: absolute; width: 44px; height: 44px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.lightbox .x { top: 12px; right: 12px; }
.lightbox .pv { left: 12px; top: 50%; translate: 0 -50%; }
.lightbox .nx { right: 12px; top: 50%; translate: 0 -50%; }

/* ---------- contact ---------- */
.doors { margin: 0 0 28px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.doors > div { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 8px 32px; padding: 16px 0; border-top: 1px solid var(--line); }
.doors > div:first-child { border-top: 0; }
.doors dt { font: 700 19px/1.3 var(--display); letter-spacing: -.01em; }
.doors dt .label { display: block; margin-bottom: 4px; color: var(--accent); }
.doors dd { margin: 0; color: var(--ink-2); align-self: end; }
@media (max-width: 720px) { .doors > div { grid-template-columns: 1fr; } }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.mail { font: 700 clamp(19px, 2.6vw, 28px)/1.2 var(--display); letter-spacing: -.01em; text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; word-break: break-all; }
.mail:hover { color: var(--accent); }
.copy { font-size: 14px; }
.elsewhere { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--ink-2); }
.elsewhere span { color: var(--muted); font: 500 12.5px/1.9 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.elsewhere a { font-weight: 550; text-decoration: none; }
.elsewhere a:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1.5px solid var(--ink); padding-block: 22px 44px; font: 500 12.5px/1.6 var(--mono); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; font-family: var(--sans); font-size: 13.5px; }

@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; align-items: start; } }

/* ---------- motion ---------- */
.js .rise { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: .25; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.pending { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) {
  .js .rise { animation: none; }
  .reveal, .reveal.pending { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .feature img, .reel img, .gallery img, .tip { transition: none !important; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 12px; padding: 40px 16px; }
.notfound h1 { font: 800 clamp(56px, 10vw, 104px)/1 var(--display); letter-spacing: -.04em; margin: 0; }
.notfound p { margin: 0; color: var(--ink-2); }

@media print {
  .site-header, #rings, .gallery, .lightbox, .cta { display: none !important; }
  body { background: #fff; color: #000; }
}
