/* Swiss International Style — antjanus.com redesign 001
   One 12-column grid, one grotesque family, black, paper, and one red. */

:root {
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #2b2b2b;
  --muted: #555555;
  --hairline: #cfcdc6;
  --rule: #111111;
  --red: #d0021b;
  --red-block: #d0021b;
  --on-red: #ffffff;
  --code-bg: #ecebe6;
  --grid-overlay: rgba(208, 2, 27, 0.07);
  --grid-overlay-line: rgba(208, 2, 27, 0.35);
  --photo-filter: grayscale(1) contrast(1.08);

  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: 24px;
  --margin: clamp(16px, 3.2vw, 48px);
  --max: 1440px;
  --unit: 8px;

  --t-label: 0.875rem;   /* 14px */
  --t-small: 1rem;       /* 16px */
  --t-body: 1.125rem;    /* 18px */
  --t-lede: 1.5rem;
  --t-h3: 1.75rem;
  --t-h2: clamp(2.25rem, 4.2vw, 3.75rem);
  --t-h1: clamp(3rem, 8.4vw, 8.5rem);
  --t-giant: clamp(4.5rem, 16vw, 15rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f0f;
    --surface: #181818;
    --ink: #f2f2f2;
    --ink-2: #d9d9d9;
    --muted: #a6a6a6;
    --hairline: #333333;
    --rule: #f2f2f2;
    --red: #ff4d4d;
    --red-block: #d0021b;
    --code-bg: #1c1c1c;
    --grid-overlay: rgba(255, 77, 77, 0.06);
    --grid-overlay-line: rgba(255, 77, 77, 0.3);
    --photo-filter: grayscale(1) contrast(1.05) brightness(0.92);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f0f0f;
  --surface: #181818;
  --ink: #f2f2f2;
  --ink-2: #d9d9d9;
  --muted: #a6a6a6;
  --hairline: #333333;
  --rule: #f2f2f2;
  --red: #ff4d4d;
  --red-block: #d0021b;
  --code-bg: #1c1c1c;
  --grid-overlay: rgba(255, 77, 77, 0.06);
  --grid-overlay-line: rgba(255, 77, 77, 0.3);
  --photo-filter: grayscale(1) contrast(1.05) brightness(0.92);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font); margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--red-block); color: var(--on-red); padding: 12px 16px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Grid ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.c-label { grid-column: 1 / 4; }
.c-body { grid-column: 4 / 13; }
.c-main { grid-column: 4 / 11; }
.c-full { grid-column: 1 / -1; }
.c-1-7 { grid-column: 1 / 8; }
.c-1-9 { grid-column: 1 / 10; }
.c-1-6 { grid-column: 1 / 7; }
.c-7-13 { grid-column: 7 / 13; }
.c-8-13 { grid-column: 8 / 13; }
.c-9-13 { grid-column: 9 / 13; }
.c-10-13 { grid-column: 10 / 13; }
.c-4-9 { grid-column: 4 / 9; }
.c-4-8 { grid-column: 4 / 8; }

@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .grid > [class*="c-"] { grid-column: 1 / -1; }
}

/* Visible grid overlay (toggle with the Grid button or the "g" key) */
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 90; display: none;
}
.grid-overlay .wrap { height: 100%; }
.grid-overlay .grid { height: 100%; }
.grid-overlay span { background: var(--grid-overlay); border-left: 1px solid var(--grid-overlay-line); border-right: 1px solid var(--grid-overlay-line); }
html.show-grid .grid-overlay { display: block; }
@media (max-width: 900px) { .grid-overlay span:nth-child(n+5) { display: none; } .grid-overlay .grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--rule);
}
.site-header .grid { align-items: center; min-height: 72px; }
.brand { grid-column: 1 / 4; display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--font); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.1; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: var(--t-label); letter-spacing: 0; }
.nav { grid-column: 4 / 11; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; }
.nav a {
  display: flex; align-items: baseline; gap: 6px; padding: 12px 14px 12px 0; margin-right: 10px;
  text-decoration: none; font-family: var(--font); font-weight: 600; font-size: 1.0625rem;
  min-height: 44px; position: relative;
}
.nav a .num { font-weight: 500; color: var(--muted); font-size: var(--t-label); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; right: 14px; top: -14px; height: 6px; background: var(--red);
}
.nav a[aria-current="page"] { color: var(--ink); }
.tools { grid-column: 11 / 13; display: flex; justify-content: flex-end; gap: 8px; }
.tool-btn {
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--rule); background: transparent;
  cursor: pointer; font-family: var(--font); font-weight: 600; font-size: var(--t-label); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tool-btn:hover { background: var(--ink); color: var(--paper); }
.tool-btn[aria-pressed="true"] { background: var(--red-block); color: var(--on-red); border-color: var(--red-block); }
.tool-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
:root[data-theme="dark"] .theme-icon-light { display: none; }

@media (max-width: 1020px) {
  .brand { grid-column: 1 / 7; }
  .tools { grid-column: 7 / 13; }
  .menu-btn { display: inline-flex; }
  .nav { grid-column: 1 / -1; display: none; border-top: 1px solid var(--hairline); padding: 8px 0 16px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { font-size: 1.5rem; padding: 10px 0; border-bottom: 1px solid var(--hairline); margin: 0; }
  .nav a[aria-current="page"]::before { top: auto; bottom: -1px; right: auto; width: 48px; height: 4px; }
  .grid-btn-label { display: none; }
}

/* ---------- Type primitives ---------- */
.eyebrow { font-family: var(--font); font-weight: 600; font-size: var(--t-label); letter-spacing: 0.01em; color: var(--muted); display: block; }
.eyebrow.red { color: var(--red); }
.index-num { font-family: var(--font); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--t-label); }
.display { font-size: var(--t-h1); line-height: 0.92; letter-spacing: -0.045em; font-weight: 700; }
.giant { font-size: var(--t-giant); line-height: 0.82; letter-spacing: -0.06em; font-weight: 800; font-family: var(--font); }
.lede { font-size: var(--t-lede); line-height: 1.35; font-family: var(--font); font-weight: 500; letter-spacing: -0.01em; max-width: 34ch; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.tnum { font-variant-numeric: tabular-nums; }
.measure { max-width: 66ch; }

/* ---------- Sections ---------- */
.section { padding-top: calc(var(--unit) * 12); padding-bottom: calc(var(--unit) * 4); }
.section-head { border-top: 2px solid var(--rule); padding-top: 16px; margin-bottom: 48px; row-gap: 12px; align-items: start; }
.section-head .num { font-family: var(--font); font-weight: 700; font-size: var(--t-h3); line-height: 1; }
.section-head .num span { color: var(--red); }
.section-head h2 { font-size: var(--t-h2); line-height: 1; letter-spacing: -0.035em; }
.section-head p { margin: 16px 0 0; color: var(--muted); font-size: var(--t-body); max-width: 50ch; }
.section-head .head-link { font-family: var(--font); font-weight: 600; white-space: nowrap; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }

/* Links with an arrow */
.arrow-link { font-family: var(--font); font-weight: 600; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.arrow-link:hover { color: var(--red); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; font-family: var(--font); font-weight: 600; font-size: 1.0625rem; text-decoration: none; border: 2px solid var(--rule); background: transparent; cursor: pointer; transition: background 150ms, color 150ms; }
.btn-primary { background: var(--red-block); border-color: var(--red-block); color: var(--on-red); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-tertiary { border-color: transparent; padding: 0; min-height: 44px; color: var(--muted); }
.btn-tertiary:hover { background: transparent; color: var(--red); }

/* ---------- Home hero ---------- */
.hero { padding-top: 40px; }
.hero-meta { border-bottom: 1px solid var(--hairline); padding-bottom: 12px; margin-bottom: 36px; row-gap: 4px; }
.hero-meta span { font-family: var(--font); font-weight: 600; font-size: var(--t-label); }
.hero-title { grid-column: 1 / 10; align-self: end; }
.hero-photo { grid-column: 10 / 13; grid-row: span 2; }
.hero-photo figure { margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 30% 30%; filter: var(--photo-filter); }
.hero-photo figcaption { font-size: var(--t-label); color: var(--muted); margin-top: 8px; font-family: var(--font); }
.hero-sub { grid-column: 4 / 9; margin-top: 40px; }
.hero-sub p { font-size: var(--t-lede); line-height: 1.35; font-family: var(--font); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 28px; }
.red-square { display: inline-block; width: 0.5em; height: 0.5em; background: var(--red); vertical-align: 0.12em; margin-left: 0.05em; }

/* Stat row with hairlines as grid gaps */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); margin-top: 64px; }
.stat-row > div { background: var(--paper); padding: 20px 20px 24px 0; }
.stat-row > div + div { padding-left: 20px; }
.stat-row .figure { font-family: var(--font); font-weight: 700; font-size: clamp(3rem, 7vw, 6.5rem); line-height: 0.95; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.stat-row .figure sup { color: var(--red); font-size: 0.5em; vertical-align: 0.8em; }
.stat-row .label { font-family: var(--font); font-weight: 600; margin-top: 8px; }
@media (max-width: 600px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat-row > div, .stat-row > div + div { padding: 16px 0; }
}
@media (max-width: 900px) {
  .hero-photo { grid-row: auto; margin-top: 32px; }
  .hero-photo img { aspect-ratio: 4 / 3; }
  .hero-sub { margin-top: 24px; }
}

/* ---------- Index list (numbered rows) ---------- */
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.index-list li { border-bottom: 1px solid var(--hairline); }
.index-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 8rem; column-gap: var(--gutter); padding: 20px 0; text-decoration: none; align-items: baseline; }
.index-row.with-img { grid-template-columns: 3rem minmax(0, 1fr) 7.5rem 10rem; align-items: start; }
.index-row .no { font-family: var(--font); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.index-row h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.15; letter-spacing: -0.02em; }
.index-row p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.index-row .date { font-family: var(--font); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; font-size: var(--t-small); }
.index-row .thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: var(--photo-filter); transition: filter 200ms; }
.index-row:hover { color: var(--ink); }
.index-row:hover h3 { color: var(--red); }
.index-row:hover .thumb { filter: none; }
.tag-line { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-family: var(--font); font-size: var(--t-label); font-weight: 600; color: var(--muted); }
.tag-line span::before { content: "#"; color: var(--red); }
@media (max-width: 700px) {
  .index-row, .index-row.with-img { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .index-row .date { grid-column: 2; text-align: left; order: -1; margin-bottom: 4px; grid-row: 1; }
  .index-row .no { grid-row: 1 / span 2; }
  .index-row .thumb { display: none; }
}

/* ---------- Feature cards (asymmetric shelf) ---------- */
.shelf { row-gap: 48px; }
.shelf-item { text-decoration: none; display: block; }
.shelf-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: var(--photo-filter); transition: filter 200ms; border-top: 6px solid var(--ink); }
.shelf-item:hover img { filter: none; border-top-color: var(--red); }
.shelf-item .meta { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 8px; font-family: var(--font); font-weight: 600; font-size: var(--t-label); color: var(--muted); }
.shelf-item h3 { font-size: clamp(1.5rem, 2.4vw, 2.25rem); line-height: 1.05; letter-spacing: -0.03em; }
.shelf-item p { margin-top: 12px; color: var(--ink-2); }
.shelf-item:hover h3 { color: var(--red); }
.shelf-lead { grid-column: 1 / 8; grid-row: span 2; }
.shelf-lead h3 { font-size: clamp(2rem, 3.6vw, 3.25rem); }
.shelf-side { grid-column: 8 / 13; }
@media (max-width: 900px) { .shelf-lead, .shelf-side { grid-row: auto; } }

/* ---------- Hairline cell grid ---------- */
.cells { display: grid; gap: 1px; background: var(--hairline); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); }
.cells-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cells-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cells-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell { background: var(--paper); padding: 24px 24px 28px 0; text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.cells > .cell:not(:first-child) { padding-left: 24px; }
.cells-2 > .cell:nth-child(2n+1), .cells-3 > .cell:nth-child(3n+1), .cells-4 > .cell:nth-child(4n+1) { padding-left: 0; }
.cell h3 { font-size: var(--t-h3); line-height: 1.05; letter-spacing: -0.025em; }
.cell p { margin: 0; color: var(--ink-2); }
.cell .kind { font-family: var(--font); font-weight: 600; font-size: var(--t-label); color: var(--red); }
.cell .foot { margin-top: auto; padding-top: 12px; font-family: var(--font); font-size: var(--t-label); font-weight: 600; color: var(--muted); }
a.cell:hover h3 { color: var(--red); }
.cell.red-cell { background: var(--red-block); color: var(--on-red); }
.cell.red-cell p, .cell.red-cell .kind, .cell.red-cell .foot { color: var(--on-red); }
.cell.red-cell a:hover { color: var(--on-red); }
.cell.ink-cell { background: var(--ink); color: var(--paper); }
.cell.ink-cell p { color: var(--paper); }
.cell-list { list-style: none; margin: 0; padding: 0; }
.cell-list li { border-top: 1px solid var(--hairline); }
.cell-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; text-decoration: none; font-family: var(--font); font-weight: 600; min-height: 44px; }
.cell-list a span { color: var(--muted); font-weight: 500; }
@media (max-width: 1000px) { .cells-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cells-4 > .cell:nth-child(odd) { padding-left: 0; } .cells-4 > .cell:nth-child(even) { padding-left: 24px; } }
@media (max-width: 700px) {
  .cells-4, .cells-3, .cells-2 { grid-template-columns: 1fr; }
  .cells > .cell, .cells > .cell:not(:first-child), .cells-4 > .cell:nth-child(even) { padding-left: 0; padding-right: 0; }
  .cells > .cell.red-cell, .cells > .cell.ink-cell { padding: 24px 20px; }
}
.cells > .cell.red-cell, .cells > .cell.ink-cell { padding-left: 24px; padding-right: 24px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-top: 48px; }
.page-head .grid { row-gap: 24px; align-items: end; }
.page-head .display { grid-column: 1 / 12; }
.page-head .lede { grid-column: 4 / 10; }
.page-head .aside { grid-column: 10 / 13; font-family: var(--font); font-weight: 500; color: var(--muted); }
.page-head .kicker { grid-column: 1 / -1; display: flex; gap: 24px; border-bottom: 1px solid var(--hairline); padding-bottom: 12px; }
.head-img { margin-top: 48px; }
.head-img img { width: 100%; height: clamp(180px, 28vw, 380px); object-fit: cover; filter: var(--photo-filter); }

/* Jump index */
.jump { display: flex; flex-wrap: wrap; gap: 0; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); margin-top: 48px; }
.jump a { flex: 1 1 auto; padding: 14px 20px 14px 0; font-family: var(--font); font-weight: 600; text-decoration: none; min-height: 44px; display: flex; gap: 8px; align-items: baseline; }
.jump a span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.jump a:hover span { color: var(--red); }

/* ---------- Projects ---------- */
.feature-block { row-gap: 32px; }
.feature-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.spec { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.spec li { font-family: var(--mono); font-size: var(--t-label); border: 1px solid var(--rule); padding: 4px 10px; }
.os-item { border-top: 1px solid var(--rule); padding: 32px 0 48px; row-gap: 20px; align-items: start; }
.os-item .os-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; background: #111; filter: var(--photo-filter); transition: filter 200ms; }
.os-item:hover .os-img img { filter: none; }
.os-item h3 { font-size: var(--t-h2); line-height: 1; letter-spacing: -0.04em; }
.os-item .os-num { font-family: var(--font); font-weight: 700; color: var(--red); font-size: var(--t-h3); }
.mini-stats { display: flex; gap: 32px; margin-top: 20px; }
.mini-stats div { font-family: var(--font); }
.mini-stats b { display: block; font-size: 2rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: var(--t-label); color: var(--muted); font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.table th { text-align: left; font-family: var(--font); font-weight: 600; font-size: var(--t-label); color: var(--muted); border-bottom: 2px solid var(--rule); padding: 10px 16px 10px 0; }
.table td { border-bottom: 1px solid var(--hairline); padding: 16px 16px 16px 0; vertical-align: top; }
.table td.name { font-family: var(--font); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
.table-wrap { overflow-x: auto; }
@media (max-width: 700px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--hairline); padding: 12px 0; }
  .table.stack td { border: 0; padding: 2px 0; }
  .table.stack td.name { white-space: normal; }
  .table.stack td.desc { grid-column: 1 / -1; }
  .table.stack td.tech { grid-column: 1 / -1; color: var(--muted); }
}

.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px var(--gutter); }
.module { display: block; text-decoration: none; border-top: 2px solid var(--rule); padding-top: 12px; }
.module .m-top { display: flex; justify-content: space-between; font-family: var(--font); font-weight: 600; font-size: var(--t-label); color: var(--muted); margin-bottom: 12px; }
.module img, .module .m-blank { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top left; filter: var(--photo-filter); background: #111; transition: filter 200ms; }
.module .m-blank { background: var(--ink); color: var(--paper); display: flex; align-items: flex-end; padding: 16px; font-family: var(--font); font-weight: 800; font-size: 4rem; line-height: 0.8; letter-spacing: -0.05em; }
.module .m-blank.red-bg { background: var(--red-block); color: var(--on-red); }
.module:hover img { filter: none; }
.module h3 { font-size: 1.375rem; margin-top: 14px; line-height: 1.1; }
.module p { margin: 8px 0 0; color: var(--ink-2); font-size: var(--t-small); line-height: 1.5; }
.module .tech { font-family: var(--mono); font-size: var(--t-label); color: var(--muted); margin-top: 10px; display: block; }
.module:hover h3 { color: var(--red); }
@media (max-width: 1100px) { .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .module-grid { grid-template-columns: 1fr; } }

/* ---------- Writing ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 32px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); background: transparent; font-family: var(--font); font-weight: 600; font-size: var(--t-small); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.chip span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--ink); color: var(--paper); }
.chip:hover span { color: var(--paper); }
.chip[aria-pressed="true"] { background: var(--red-block); border-color: var(--red-block); color: var(--on-red); }
.chip[aria-pressed="true"] span { color: var(--on-red); }
.year-block { border-top: 2px solid var(--rule); padding: 16px 0 40px; row-gap: 12px; }
.year-block .year { font-family: var(--font); font-weight: 800; font-size: clamp(3rem, 6vw, 5.5rem); line-height: 0.85; letter-spacing: -0.05em; position: sticky; top: 96px; align-self: start; }
.year-block .year small { display: block; font-size: var(--t-label); font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 12px; }
.w-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 11rem; column-gap: var(--gutter); padding: 16px 0; border-bottom: 1px solid var(--hairline); text-decoration: none; }
.w-row:first-child { padding-top: 0; }
.w-row .d { font-family: var(--font); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-row h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.015em; }
.w-row p { margin: 6px 0 0; color: var(--muted); font-size: var(--t-small); }
.w-row .col { font-family: var(--font); font-weight: 600; font-size: var(--t-label); text-align: right; }
.w-row .col i { font-style: normal; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; }
.w-row:hover h3 { color: var(--red); }
.w-row[hidden] { display: none; }
.sq-dg { background: var(--ink); }
.sq-dt { border: 2px solid var(--ink); }
.sq-ai { background: var(--red); }
.sq-st { background: linear-gradient(135deg, var(--red) 50%, var(--ink) 50%); }
@media (max-width: 700px) {
  .w-row { grid-template-columns: 1fr; }
  .w-row .col { text-align: left; margin-top: 6px; }
  .year-block .year { position: static; }
}
.empty-note { padding: 32px 0; border-top: 1px solid var(--hairline); }
.empty-note[hidden] { display: none; }

.duo { row-gap: 40px; }
.pick-list { list-style: none; margin: 0; padding: 0; counter-reset: pick; }
.pick-list li { counter-increment: pick; border-top: 1px solid var(--hairline); }
.pick-list a { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 12px; padding: 16px 0; text-decoration: none; }
.pick-list a::before { content: counter(pick, decimal-leading-zero); font-family: var(--font); font-weight: 700; color: var(--red); }
.pick-list h3 { font-size: 1.375rem; line-height: 1.15; }
.pick-list p { grid-column: 2; margin: 6px 0 0; color: var(--muted); font-size: var(--t-small); }
.pick-list a:hover h3 { color: var(--red); }
.col-title { font-family: var(--font); font-weight: 700; font-size: var(--t-h3); letter-spacing: -0.02em; border-top: 2px solid var(--rule); padding-top: 12px; }
.col-sub { color: var(--muted); margin: 4px 0 16px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--hairline); }
.tag-cloud a { font-family: var(--font); font-weight: 600; text-decoration: none; padding: 10px 24px 10px 0; min-height: 44px; display: inline-flex; gap: 6px; align-items: baseline; }
.tag-cloud a span { color: var(--muted); font-weight: 500; font-size: var(--t-label); font-variant-numeric: tabular-nums; }
.tag-cloud a.big { font-size: 1.75rem; letter-spacing: -0.02em; }
.tag-cloud a.mid { font-size: 1.3rem; }

/* Series */
.series-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--hairline); border-top: 2px solid var(--rule); }
.series-track > * { background: var(--paper); padding: 16px 16px 20px 0; text-decoration: none; }
.series-track > * + * { padding-left: 16px; }
.series-track .p { font-family: var(--font); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: -0.05em; }
.series-track .t { font-family: var(--font); font-weight: 600; margin-top: 8px; line-height: 1.25; }
.series-track .s { font-size: var(--t-label); color: var(--muted); font-family: var(--font); font-weight: 600; margin-top: 8px; }
.series-track a .p { color: var(--red); }
.series-track a:hover .t { color: var(--red); }
.series-track .soon { color: var(--muted); }
@media (max-width: 800px) { .series-track { grid-template-columns: 1fr; } .series-track > *, .series-track > * + * { padding-left: 0; display: grid; grid-template-columns: 4rem 1fr; column-gap: 12px; } .series-track .t, .series-track .s { grid-column: 2; margin-top: 0; } .series-track .p { grid-row: span 2; } }

/* ---------- AI ---------- */
.band-red { background: var(--red-block); color: var(--on-red); padding: 28px 0; }
.band-red .grid { align-items: center; row-gap: 16px; }
.band-red p { margin: 0; font-family: var(--font); font-weight: 600; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.015em; }
.band-red .btn { border-color: var(--on-red); color: var(--on-red); }
.band-red .btn:hover { background: var(--on-red); color: var(--red-block); }
.band-ink { background: #0b0b0b; color: #f2f2f2; padding: 72px 0 88px; margin-top: 64px; --muted: #a6a6a6; --hairline: #333; --rule: #f2f2f2; --paper: #0b0b0b; --ink: #f2f2f2; --ink-2: #d9d9d9; --red: #ff4d4d; }
.story { border-top: 2px solid var(--rule); padding-top: 16px; text-decoration: none; display: block; }
.story img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin: 16px 0; filter: grayscale(1) contrast(1.1); transition: filter 200ms; }
.story:hover img { filter: none; }
.story .pn { font-family: var(--font); font-weight: 800; font-size: 4.5rem; line-height: 0.8; letter-spacing: -0.06em; color: var(--red); }
.story h3 { font-size: 1.75rem; line-height: 1.05; }
.story p { color: var(--ink-2); font-size: var(--t-small); margin-top: 10px; }
.story .go { font-family: var(--font); font-weight: 600; border-bottom: 2px solid currentColor; }
.notice { border-left: 6px solid var(--red); padding: 4px 0 4px 20px; max-width: 60ch; }
.notice b { font-family: var(--font); }

/* ---------- About ---------- */
.about-hero { row-gap: 32px; }
.about-hero figure { margin: 0; }
.about-hero img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: var(--photo-filter); }
.career-bar { display: flex; height: 64px; gap: 2px; margin: 24px 0 8px; }
.career-bar div { background: var(--ink); color: var(--paper); font-family: var(--font); font-weight: 600; font-size: var(--t-label); padding: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.career-bar div:first-child { background: var(--red-block); color: var(--on-red); }
.career-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px var(--gutter); list-style: none; padding: 0; margin: 16px 0 0; font-family: var(--font); }
.career-legend li { border-top: 1px solid var(--hairline); padding-top: 8px; }
.career-legend b { display: block; }
.career-legend span { color: var(--muted); font-size: var(--t-label); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .career-bar { display: none; } .career-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.phase { border-top: 1px solid var(--rule); padding: 24px 0 32px; row-gap: 12px; }
.phase .period { font-family: var(--font); font-weight: 700; font-size: var(--t-h3); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.phase .pname { font-family: var(--font); font-weight: 600; color: var(--red); }
.roles { list-style: none; padding: 0; margin: 16px 0 0; }
.roles li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.roles li b { font-family: var(--font); }
.roles li span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--t-small); text-align: right; }
.bullets { margin: 16px 0 0; padding-left: 1.2em; color: var(--ink-2); }
.bullets li { margin-bottom: 8px; }
.bullets li::marker { color: var(--red); }
.principles { list-style: none; padding: 0; margin: 0; counter-reset: pr; }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 4rem 1fr; gap: var(--gutter); border-top: 1px solid var(--hairline); padding: 20px 0; font-family: var(--font); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; }
.principles li::before { content: counter(pr, decimal-leading-zero); color: var(--red); font-size: 1rem; font-weight: 700; letter-spacing: 0; padding-top: 0.5em; }
.cap-row { border-top: 1px solid var(--rule); padding: 20px 0 28px; row-gap: 12px; }
.cap-row h3 { font-size: var(--t-h3); }
.cap-row p { color: var(--muted); margin: 8px 0 0; }
.skill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list li { border: 1px solid var(--rule); padding: 6px 12px; font-family: var(--font); font-weight: 500; font-size: var(--t-small); }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--red); z-index: 60; }
.art-head { padding-top: 40px; }
.art-head .grid { row-gap: 20px; }
.crumb { font-family: var(--font); font-weight: 600; font-size: var(--t-small); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--red); }
.art-title { grid-column: 1 / 12; font-size: clamp(2.75rem, 7vw, 7rem); line-height: 0.95; letter-spacing: -0.045em; }
.art-desc { grid-column: 4 / 10; font-family: var(--font); font-weight: 500; font-size: var(--t-lede); line-height: 1.3; margin: 0; }
.art-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); padding: 12px 0; margin-top: 24px; font-family: var(--font); font-weight: 600; font-size: var(--t-small); }
.art-facts > div { grid-column: span 3; }
.art-facts span { display: block; color: var(--muted); font-size: var(--t-label); }
@media (max-width: 900px) { .art-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; } .art-facts > div { grid-column: auto; } }
.art-hero { margin: 40px 0 0; }
.art-hero img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; filter: var(--photo-filter); }
.art-hero figcaption { font-size: var(--t-label); color: var(--muted); margin-top: 8px; font-family: var(--font); }
.art-layout { padding-top: 56px; align-items: start; }
.art-aside { grid-column: 1 / 4; position: sticky; top: 100px; }
.art-body { grid-column: 4 / 11; min-width: 0; }
.toc-title { font-family: var(--font); font-weight: 700; border-top: 2px solid var(--rule); padding-top: 10px; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 2rem 1fr; padding: 8px 0; text-decoration: none; font-family: var(--font); font-weight: 500; font-size: var(--t-small); line-height: 1.3; border-top: 1px solid var(--hairline); min-height: 44px; align-items: center; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a.active { font-weight: 700; }
.toc a.active::before { color: var(--red); }
.aside-block { margin-top: 32px; }
.aside-block .toc-title { margin-bottom: 12px; }
.md-link { font-family: var(--mono); font-size: var(--t-label); }
details.toc-mobile { display: none; }
@media (max-width: 900px) {
  .art-aside { display: none; }
  details.toc-mobile { display: block; grid-column: 1 / -1; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); margin-bottom: 32px; }
  details.toc-mobile summary { font-family: var(--font); font-weight: 700; padding: 12px 0; min-height: 44px; cursor: pointer; }
}

.prose { font-size: var(--t-body); line-height: 1.65; max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-size: clamp(1.9rem, 3.2vw, 2.75rem); line-height: 1.02; letter-spacing: -0.035em; margin-top: 2.2em; padding-top: 14px; border-top: 2px solid var(--rule); display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline; }
.prose h2 .hn { font-size: 1rem; color: var(--red); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--red); font-family: var(--font); font-weight: 700; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.3em; }
.prose a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.prose a:hover { color: var(--red); }
.prose blockquote { margin: 1.6em 0; padding: 0; }
.callout { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--gutter); border-top: 1px solid var(--rule); padding-top: 12px; }
.callout .ck { font-family: var(--font); font-weight: 700; font-size: var(--t-small); line-height: 1.5; }
.callout .ck::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; background: var(--ink); vertical-align: -1px; }
.callout.why .ck::before { background: var(--red); }
.callout.q { background: var(--surface); border: 1px solid var(--hairline); border-top: 4px solid var(--red); padding: 16px 20px; }
.callout.q .ck { color: var(--red); }
.callout.q .ck::before { border-radius: 50%; background: var(--red); }
.callout.skill { background: var(--ink); color: var(--paper); border: 0; padding: 20px; }
.callout.skill .ck::before { background: var(--red); }
.callout.skill a { color: var(--paper); }
.callout.skill code { background: #333; color: #f2f2f2; }
.callout p { margin: 0; }
@media (max-width: 700px) { .callout { grid-template-columns: 1fr; gap: 6px; } }

.code { margin: 1.8em 0; border-top: 2px solid var(--rule); background: var(--code-bg); max-width: none; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 0 0 16px; font-family: var(--font); font-weight: 600; font-size: var(--t-label); border-bottom: 1px solid var(--hairline); }
.code-bar button { min-height: 44px; padding: 0 16px; border: 0; border-left: 1px solid var(--hairline); background: transparent; cursor: pointer; font-family: var(--font); font-weight: 600; font-size: var(--t-label); }
.code-bar button:hover { background: var(--ink); color: var(--paper); }
.code pre { margin: 0; padding: 18px 16px 20px; overflow-x: auto; font-family: var(--mono); font-size: 0.9rem; line-height: 1.6; tab-size: 2; }
.code .tk-c { color: var(--muted); font-style: italic; }
.code .tk-s { color: var(--red); }
.code .tk-k { font-weight: 600; }
@media (min-width: 1200px) { .art-body .code { margin-right: -12%; } }

.filed { margin-top: 56px; border-top: 2px solid var(--rule); padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; font-family: var(--font); font-weight: 600; }
.filed a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.filed a::before { content: "#"; color: var(--red); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.newsletter { row-gap: 20px; align-items: end; }
.newsletter h2 { font-size: var(--t-h2); line-height: 1; letter-spacing: -0.04em; }
.nl-form { display: flex; gap: 0; flex-wrap: wrap; }
.nl-form input[type="email"] { flex: 1 1 200px; min-width: 0; width: 100%; min-height: 52px; border: 2px solid var(--rule); background: var(--surface); padding: 0 16px; font-size: var(--t-small); border-radius: 0; }
.nl-form input:focus-visible { outline-offset: 0; }
.nl-form .btn { border-left: 0; }
.nl-note { font-size: var(--t-small); color: var(--muted); margin-top: 10px; }
.nl-success { display: none; font-family: var(--font); }
.nl-success b { display: block; font-size: 1.5rem; }
form.done .nl-fields { display: none; }
form.done .nl-success { display: block; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: var(--t-small); color: var(--muted); }
.consent input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--red-block); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 120px; border-top: 2px solid var(--rule); padding: 20px 0 32px; }
.site-footer .grid { row-gap: 32px; }
.foot-mark { grid-column: 1 / -1; font-family: var(--font); font-weight: 800; font-size: clamp(4rem, 17vw, 16rem); line-height: 0.8; letter-spacing: -0.07em; margin: 8px 0 24px; overflow: hidden; }
.foot-mark span { color: var(--red); }
.foot-col h2 { font-size: var(--t-small); font-weight: 700; margin-bottom: 10px; letter-spacing: 0; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col a { text-decoration: none; display: inline-flex; min-height: 36px; align-items: center; font-weight: 500; }
.foot-col p { color: var(--muted); }
.foot-bottom { grid-column: 1 / -1; border-top: 1px solid var(--hairline); padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font); font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.f-a { grid-column: 1 / 4; } .f-b { grid-column: 4 / 6; } .f-c { grid-column: 6 / 8; } .f-d { grid-column: 9 / 13; }
@media (max-width: 900px) { .site-footer .grid > .f-b, .site-footer .grid > .f-c { grid-column: span 6; } }

/* ---------- Patterns ---------- */
.three-ways { counter-reset: tw; }
.three-ways .cell h3::before { counter-increment: tw; content: counter(tw) "  "; color: var(--red); white-space: pre; }
.pattern-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: end; border-top: 2px solid var(--rule); padding-top: 20px; }
.search-field label { display: block; font-family: var(--font); font-weight: 600; font-size: var(--t-label); margin-bottom: 6px; }
.search-field input { width: 100%; min-height: 56px; border: 0; border-bottom: 2px solid var(--rule); background: transparent; font-family: var(--font); font-weight: 500; font-size: clamp(1.125rem, 2vw, 1.5rem); padding: 0; border-radius: 0; }
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus-visible { outline: none; border-bottom-color: var(--red); box-shadow: 0 2px 0 var(--red); }
.sort label { font-family: var(--font); font-weight: 600; font-size: var(--t-label); display: block; margin-bottom: 6px; }
.sort select { min-height: 48px; border: 1px solid var(--rule); background: var(--paper); padding: 0 12px; font-family: var(--font); font-weight: 600; border-radius: 0; }
.result-line { display: flex; gap: 16px; align-items: center; font-family: var(--font); font-weight: 600; margin: 20px 0 32px; flex-wrap: wrap; }
.result-line .clear { min-height: 44px; border: 0; background: transparent; border-bottom: 2px solid currentColor; cursor: pointer; font-family: var(--font); font-weight: 600; padding: 0; }
.result-line .clear[hidden] { display: none; }
@media (max-width: 700px) { .pattern-tools { grid-template-columns: 1fr; } }

.p-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--hairline); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hairline); }
.p-card { background: var(--paper); padding: 18px 20px 24px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.p-card[hidden] { display: none; }
.p-card .p-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font); font-weight: 600; font-size: var(--t-label); color: var(--muted); }
.p-card .p-no { font-weight: 800; font-size: 2.25rem; color: var(--ink); letter-spacing: -0.05em; line-height: 1; }
.p-card h3 { font-size: 1.375rem; line-height: 1.1; letter-spacing: -0.02em; }
.p-card p { margin: 0; color: var(--ink-2); font-size: var(--t-small); line-height: 1.5; }
.p-card .good { font-size: var(--t-label); color: var(--muted); font-family: var(--font); font-weight: 500; }
.p-card .good b { color: var(--ink); }
.p-card .tag-line { margin-top: auto; }
.p-card:hover h3 { color: var(--red); }
.badge { font-family: var(--font); font-weight: 700; font-size: var(--t-label); padding: 2px 8px; border: 1px solid var(--rule); color: var(--ink); }
.badge.new { background: var(--red-block); border-color: var(--red-block); color: var(--on-red); }
.glyph { height: 96px; display: grid; gap: 4px; margin: 4px 0 6px; }
.glyph i { display: block; background: var(--ink); }
.glyph.data { grid-template-columns: repeat(6, 1fr); align-items: end; }
.glyph.data i:nth-child(1) { height: 30%; } .glyph.data i:nth-child(2) { height: 70%; } .glyph.data i:nth-child(3) { height: 45%; }
.glyph.data i:nth-child(4) { height: 100%; background: var(--red); } .glyph.data i:nth-child(5) { height: 55%; } .glyph.data i:nth-child(6) { height: 20%; }
.glyph.layout { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.glyph.layout i:nth-child(1) { grid-row: span 2; } .glyph.layout i:nth-child(2) { background: var(--red); } .glyph.layout i:nth-child(3) { background: transparent; border: 2px solid var(--ink); } .glyph.layout i:nth-child(4) { grid-column: span 2; }
.glyph.inter { grid-template-columns: 96px 1fr; align-items: center; }
.glyph.inter i:nth-child(1) { width: 96px; height: 96px; border-radius: 50%; background: var(--red); }
.glyph.inter i:nth-child(2) { height: 8px; }
.glyph.forms { grid-template-rows: repeat(4, 1fr); }
.glyph.forms i { height: 2px; align-self: end; }
.glyph.forms i:nth-child(3) { width: 60%; height: 18px; background: var(--red); }
.glyph.color { grid-template-columns: repeat(5, 1fr); }
.glyph.color i:nth-child(1) { background: var(--ink); } .glyph.color i:nth-child(2) { background: var(--red); }
.glyph.color i:nth-child(3) { background: color-mix(in srgb, var(--red) 55%, var(--paper)); }
.glyph.color i:nth-child(4) { background: color-mix(in srgb, var(--ink) 35%, var(--paper)); }
.glyph.color i:nth-child(5) { background: transparent; border: 2px solid var(--ink); }
@media (max-width: 1200px) { .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .p-grid { grid-template-columns: 1fr; } .p-card { padding-left: 0; padding-right: 0; } }

/* Pattern detail */
.back { font-family: var(--font); font-weight: 600; text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.uses { columns: 2; column-gap: var(--gutter); padding-left: 1.2em; margin: 12px 0 0; }
.uses li { margin-bottom: 6px; break-inside: avoid; }
.uses li::marker { color: var(--red); }
@media (max-width: 600px) { .uses { columns: 1; } }
.panes { border: 2px solid var(--rule); margin-top: 48px; background: var(--surface); }
.pane-bar { display: flex; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.pane-tabs { display: flex; flex-wrap: wrap; }
.pane-tabs button { min-height: 52px; padding: 0 20px; border: 0; border-right: 1px solid var(--hairline); background: transparent; cursor: pointer; font-family: var(--font); font-weight: 600; font-size: var(--t-small); position: relative; }
.pane-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pane-tabs button:hover:not([aria-selected="true"]) { color: var(--red); }
.pane-actions { display: flex; }
.pane-actions button { min-height: 52px; padding: 0 18px; border: 0; border-left: 1px solid var(--hairline); background: transparent; cursor: pointer; font-family: var(--font); font-weight: 600; font-size: var(--t-small); }
.pane-actions button:hover { background: var(--red-block); color: var(--on-red); }
.pane-actions button[hidden] { display: none; }
.pane { padding: 28px; }
.pane[hidden] { display: none; }
.pane pre { margin: 0; font-family: var(--mono); font-size: 0.9rem; line-height: 1.6; overflow-x: auto; white-space: pre; }
.pane .prompt-text { max-width: 68ch; }
.pane .note { border-left: 4px solid var(--red); padding-left: 14px; margin-bottom: 20px; color: var(--ink-2); font-size: var(--t-small); }
@media (max-width: 600px) { .pane { padding: 18px 14px; } .pane-tabs button { padding: 0 14px; } }

/* The demo pattern itself: hairline stat strip */
.hss-caption { font-family: var(--font); font-weight: 600; margin: 0 0 12px; }
.hss-caption + .hss-caption { margin-top: 32px; }
.hss-strip { display: grid; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); grid-template-columns: 1fr; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 56rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 42rem) and (max-width: 56rem) { .hss-strip.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; border: 0; font: inherit; color: inherit; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--red) 14%, var(--surface)); box-shadow: inset 0 4px 0 var(--red); }
.hss-label { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); overflow-wrap: anywhere; }
.hss-fig { font-family: var(--font); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hss-fig.dim { color: var(--muted); }
.hss-sub { font-size: 0.875rem; color: var(--muted); }
.hss-list { list-style: none; padding: 0; margin: 16px 0 0; }
.hss-list li { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--hairline); padding: 10px 0; font-size: var(--t-small); }
.hss-list li[hidden] { display: none; }
.hss-list li span { font-family: var(--font); font-weight: 600; font-size: var(--t-label); }
.hss-status { margin-top: 12px; font-size: var(--t-small); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Tag filter buttons in the writing archive */
.tag-btn { font-family: var(--font); font-weight: 600; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 24px 8px 0; margin-right: 0; min-height: 44px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; font-size: var(--t-small); }
.tag-btn span { color: var(--muted); font-weight: 500; font-size: var(--t-label); font-variant-numeric: tabular-nums; }
.tag-btn.big { font-size: 1.75rem; letter-spacing: -0.02em; }
.tag-btn.mid { font-size: 1.3rem; }
.tag-btn:hover { color: var(--red); }
.tag-btn[aria-pressed="true"] { color: var(--red); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.os-item .c-label h3 { font-size: clamp(1.75rem, 3vw, 2.75rem); overflow-wrap: anywhere; }
.art-body.prose > * + *, .pane .prose > * + * { margin-top: 1.1em; }
.art-body.prose > h2 { margin-top: 2.4em; }
.art-body.prose > .code { margin-top: 1.8em; margin-bottom: 1.8em; }
@media (max-width: 900px) {
  .grid > .hero-title, .grid > .hero-photo, .grid > .hero-sub, .grid > .shelf-lead, .grid > .shelf-side,
  .grid > .brand, .grid > .nav, .page-head .grid > *, .art-head .grid > *, .art-layout > * { grid-column: 1 / -1; }
  .site-header .grid > .brand { grid-column: 1 / 8; }
  .site-header .grid > .tools { grid-column: 8 / 13; }
  .hero-photo { max-width: 420px; }
}
@media (max-width: 520px) {
  .brand small { display: none; }
  .tools { gap: 6px; }
  .grid-btn { display: none; }
}

/* Glyph variants so neighbouring cards differ */
.glyph.v1, .glyph.v3 { transform: scaleX(-1); }
.glyph.v2 i:nth-child(2), .glyph.v3 i:nth-child(1) { background: var(--red); }
.glyph.v2 i:nth-child(4), .glyph.v3 i:nth-child(4) { background: var(--ink); }
.glyph.data.v2 i:nth-child(4) { height: 40%; }
.glyph.data.v1 i:nth-child(2) { height: 90%; }
.glyph.inter.v2 i:nth-child(1), .glyph.inter.v3 i:nth-child(1) { border-radius: 0; }
.glyph.layout.v2 i:nth-child(3) { background: var(--ink); border: 0; }

/* UI pattern library article */
.callout-body > p + p { margin-top: 0.8em; }
.art-body .art-fig { margin: 1.8em 0; }
.art-body .art-fig img { width: 100%; border-top: 6px solid var(--ink); }
.prose .live-pattern a.btn { white-space: normal; text-decoration: none; }
.prose .live-pattern a.btn-primary { color: var(--on-red); }
.prose .live-pattern a.btn-primary:hover { color: var(--paper); }
