/* MONADOCORE — readability direction: the secondary-page interior. Shared shell (header, page intro, content grid, colophon),
   the clickable unit system for Projects / Tools, readable rows for Blog, the article measure, and the About reading layout.
   Loads on top of ../shared/proposal.css (tokens, header, grid, marks, links, colophon). Responsive: one column ≤ 820 px. */
.page { padding-top: 112px; }
.grid { row-gap: 0; }

/* page intro: eyebrow · title · description · rule (a grid anchor) */
.intro { padding-top: 16px; padding-bottom: 0; }
.intro .g-mark { grid-column: 1 / 7; grid-row: 1; }
.intro .g-title { grid-column: 1 / 9; grid-row: 2; margin-top: clamp(28px, 4vh, 44px); }
.pg-title { font-size: clamp(2.8rem, 5.6vw, 5.2rem); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; color: var(--ink); position: relative; }
.intro .g-desc { grid-column: 1 / 7; grid-row: 3; margin-top: 22px; }
.intro .g-aside { grid-column: 9 / 13; grid-row: 2 / 4; align-self: end; justify-self: end; text-align: right; }
.intro .g-rule { grid-column: 1 / 13; grid-row: 4; height: 1px; background: var(--line); margin-top: clamp(28px, 4vh, 44px); transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease) 0.4s; }
.in .intro .g-rule, .intro.in .g-rule { transform: none; }
.pg-desc { font-size: clamp(1.1rem, 1.35vw, 1.3rem); line-height: 1.4; color: var(--ink); letter-spacing: -0.01em; max-width: 44ch; }
.pg-desc + .pg-note { margin-top: 12px; color: var(--muted); font-size: 0.98rem; max-width: 52ch; }

/* section labels inside a page */
.sec { padding-top: clamp(36px, 5vh, 56px); }
.sec-head { grid-column: 1 / 13; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 26px; }
.sec-head h2 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-2); font-weight: 400; }
.sec-head .sec-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* category / term line — typographic, anchors, active underline; no pills */
.cats { grid-column: 1 / 13; display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding: 18px 0 0; }
.cats a { position: relative; padding: 8px 0; color: var(--muted); transition: color 0.3s; }
.cats a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--crimson-2); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.cats a:hover { color: var(--ink); } .cats a.is-active { color: var(--ink); } .cats a.is-active::after { transform: none; }

/* ---------------- clickable units: Projects cards (image first) and Tools units (symbol first) ---------------- */
.cards { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px var(--col-gap); }
@media (max-width: 1199px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto auto; gap: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); transition: color 0.3s; }
.card::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--crimson-2); transition: width 0.45s var(--ease); }
.card:hover::before, .card:focus-visible::before { width: 100%; }
.c-no { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: var(--crimson-2); margin-bottom: 14px; }
.c-img { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.c-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.86; filter: saturate(0.94); transition: opacity 0.5s var(--ease), filter 0.5s var(--ease); }
.card:hover .c-img img { opacity: 1; filter: saturate(1) contrast(1.03); }
.c-img.ph { background: linear-gradient(135deg, #111114 0%, #0b0b0d 100%); }
.c-img.ph::before { content: ""; position: absolute; inset: 12px; border: 1px dashed var(--line-2); }
.c-img .c-cap { position: absolute; left: 12px; bottom: 10px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); background: rgba(11,11,13,0.72); padding: 4px 8px; }
.c-name { margin-top: 18px; font-size: clamp(1.3rem, 1.55vw, 1.55rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); }
.c-name .ph { font-size: 0.6em; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.c-desc { margin-top: 8px; font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.c-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.c-meta .st { color: var(--ink-2); }
.c-link { display: inline-block; margin-top: 18px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.c-link::after { content: "→"; margin-left: 10px; color: var(--crimson-2); display: inline-block; transition: transform 0.3s var(--ease); }
.card:hover .c-link::after, .unit:hover .c-link::after, .row:hover .r-arrow { transform: translateX(6px); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); margin-right: 8px; vertical-align: 1px; }
.dot--live { background: var(--cyan); box-shadow: 0 0 8px rgba(79, 216, 255, 0.5); } .dot--wip { background: var(--crimson-2); } .dot--arch { background: var(--line); }

/* archive rows (all projects) — whole row clickable */
.rows { grid-column: 1 / 13; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 160px 72px 150px 24px; gap: var(--col-gap); align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-2); position: relative; transition: color 0.3s; }
.row:hover { color: var(--ink); }
.row::before { content: ""; position: absolute; left: -14px; top: 24px; width: 0; height: 1px; background: var(--crimson-2); transition: width 0.35s var(--ease); }
.row:hover::before { width: 8px; }
.r-no { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; color: var(--muted); }
.r-name { font-size: 1.1rem; font-weight: 500; letter-spacing: -0.01em; }
.r-name small { display: block; font-size: 0.9rem; font-weight: 400; color: var(--muted); margin-top: 4px; }
.r-type, .r-year, .r-st { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.r-st { color: var(--ink-2); }
.r-arrow { color: var(--crimson-2); display: inline-block; transition: transform 0.3s var(--ease); }

/* tools: unit grid, three across, hairlines as the geometry */
.units { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.unit { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; padding: 24px 24px 26px; border: 1px solid var(--line); background: rgba(236, 233, 226, 0.028); min-height: 250px; color: var(--ink-2); transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.unit::before { content: ""; position: absolute; left: -1px; top: -1px; height: 1px; width: 0; background: var(--crimson-2); transition: width 0.45s var(--ease); }
.unit:hover, .unit:focus-visible { background: rgba(236, 233, 226, 0.05); border-color: rgba(236, 233, 226, 0.2); } .unit:hover::before { width: calc(100% + 2px); }
.u-top { display: flex; justify-content: space-between; align-items: flex-start; }
.u-sym { width: 44px; height: 44px; color: var(--ink-2); }
.u-sym svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1; }
.u-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.u-name { margin-top: 22px; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.u-name .ph { font-size: 0.7em; font-weight: 400; color: var(--muted); }
.u-desc { margin-top: 8px; font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); }
.u-meta { align-self: end; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 22px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.u-meta .ok { color: var(--cyan); }
.unit .c-link { margin-top: 14px; }

/* blog: featured + rows */
.feat { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding: 8px 0 0; }
.feat .f-meta { grid-column: 1 / 4; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); line-height: 2; padding-top: 10px; }
.feat .f-meta b { display: block; color: var(--crimson-2); font-weight: 400; }
.feat .f-body { grid-column: 4 / 10; }
.feat .f-img { grid-column: 10 / 13; margin: 0; aspect-ratio: 4 / 3; border: 1px solid var(--line-2); background: #000; overflow: hidden; }   /* rendered only when the latest post has a feature image */
.feat .f-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-title { font-size: clamp(1.8rem, 2.9vw, 2.7rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; color: var(--ink); }
.f-title a { transition: color 0.3s; } .f-title a:hover { color: var(--ink-2); }
.f-sum { margin-top: 16px; font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.posts { grid-column: 1 / 13; }
.year { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: var(--col-gap); padding-top: 26px; }
.year-no { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-2); padding-top: 22px; }
.post { display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px 80px 24px; gap: var(--col-gap); align-items: baseline; padding: 20px 0; border-top: 1px solid var(--line-2); color: var(--ink-2); position: relative; transition: color 0.3s; }
.post:hover { color: var(--ink); }
.post:hover .p-title { color: var(--ink); }
.p-date { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--muted); }
.p-title { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; color: var(--ink-2); transition: color 0.3s; }
.p-title small { display: block; font-size: 0.92rem; font-weight: 400; color: var(--muted); margin-top: 6px; max-width: 60ch; letter-spacing: 0; }
.p-cat, .p-time { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pager { grid-column: 1 / 13; display: flex; justify-content: space-between; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.pager a { color: var(--ink-2); } .pager a:hover { color: var(--ink); }

/* article */
.art-head { padding-top: 16px; }
.art-head .g-mark { grid-column: 1 / 8; grid-row: 1; }
.art-head .g-title { grid-column: 2 / 11; grid-row: 2; margin-top: clamp(28px, 4vh, 44px); }
.art-title { font-size: clamp(2.2rem, 3.8vw, 3.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; color: var(--ink); }
.art-head .g-meta { grid-column: 2 / 11; grid-row: 3; margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 26px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.art-head .g-meta b { color: var(--crimson-2); font-weight: 400; }
.art-head .g-rule { grid-column: 2 / 11; grid-row: 4; height: 1px; background: var(--line); margin-top: 26px; }
.art { grid-column: 3 / 10; max-width: 720px; padding-top: 40px; font-size: 1.1rem; line-height: 1.7; color: var(--ink-2); }
.art > * + * { margin-top: 1.25em; }
.art p { text-wrap: pretty; }
.art h2 { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; color: var(--ink); margin-top: 2.2em; }
.art h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); margin-top: 1.8em; }
.art a { border-bottom: 1px solid var(--line); transition: border-color 0.3s; } .art a:hover { border-color: var(--crimson-2); }
.art ul, .art ol { padding-left: 1.3em; } .art li + li { margin-top: 0.4em; }
.art blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--crimson-2); color: var(--ink); font-size: 1.15rem; line-height: 1.55; }
.art blockquote footer { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.art pre { margin: 1.6em 0; padding: 18px 20px; background: #0a0a0c; border: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; color: var(--ink-2); overflow-x: auto; }
.art code { font-family: var(--font-mono); font-size: 0.9em; color: var(--ink); }
.art p code { padding: 1px 5px; background: rgba(236, 233, 226, 0.06); border-radius: 2px; }
.art figure { margin: 2em 0; }
.art figure.wide { width: calc(100% + 220px); margin-left: -110px; max-width: none; }
.art figure img, .art p > img { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); background: #000; }   /* inline article images: Markdown output (<p><img>) or a figure with caption */
.art p:has(> img) { margin: 2em 0; }
.art figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.art table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1.6em 0; }
.art th, .art td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.art th { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.art .tags { margin-top: 3em; padding-top: 18px; border-top: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.art .tags a { border: 0; color: var(--ink-2); margin-right: 18px; }
.postnav { grid-column: 3 / 10; max-width: 720px; display: grid; grid-template-columns: 1fr 1fr; gap: var(--col-gap); margin-top: 40px; border-top: 1px solid var(--line); }
.postnav a { padding: 20px 0; color: var(--ink-2); display: grid; gap: 6px; transition: color 0.3s; } .postnav a:hover { color: var(--ink); }
.postnav a:last-child { text-align: right; border-left: 1px solid var(--line-2); padding-left: var(--col-gap); }
.postnav .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.postnav .ttl { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.art-back { grid-column: 3 / 10; margin-top: 32px; }

/* about: reading column split around a small Constantia display (right, sticky on desktop; between the text blocks on mobile) */
.about-body { padding-top: clamp(36px, 5vh, 56px); }
.about-body .g-read { max-width: 640px; }
.about-body .g-read-a { grid-column: 1 / 8; grid-row: 1; }
.about-body .g-read-b { grid-column: 1 / 8; grid-row: 2; }
.about-body .g-side { grid-column: 9 / 13; grid-row: 1 / 3; position: sticky; top: 100px; align-self: start; }
.ab-sec { padding: 8px 0 34px; }
.ab-sec + .ab-sec, .ab-sec--first { border-top: 1px solid var(--line-2); padding-top: 30px; }
.ab-h { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--crimson-2); margin-bottom: 14px; }
.ab-sec p { font-size: 1.08rem; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.ab-sec p + p { margin-top: 1em; }
.ab-sec p.ph { color: var(--muted); }
/* the display: open (no card), transparent canvas upscaled without smoothing, scanlines only on the figure, marks + a tiny label */
.cx { position: relative; margin: 0; width: 100%; max-width: 300px; aspect-ratio: 2 / 3; }
.cx-tex { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); opacity: 0.16; pointer-events: none; }
.cx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; filter: contrast(1.05) saturate(1.06); }
.cx-crt { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: 0.85;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.26) 0px, rgba(0, 0, 0, 0.26) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 3px); }
.cx-label { position: absolute; left: 0; right: 0; top: 100%; margin-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.cx-name { color: var(--ink); grid-column: 1; }
.cx-sub { grid-column: 1; }
.cx-clip { grid-column: 2; grid-row: 1 / 3; align-self: start; text-align: right; }
.cx-clip b { font-weight: 400; color: var(--cyan); }
.g-side .cx { margin-bottom: 56px; }
.else { grid-column: 1 / 8; max-width: 640px; }
.else-rows { border-top: 1px solid var(--line); }
.else-rows a, .else-rows .e-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 24px; gap: var(--col-gap); align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-2); transition: color 0.3s; }
.else-rows .e-row .e-val { color: var(--muted); font-weight: 400; }   /* rows without a destination yet: same row, no arrow, no hover, no pointer */
.else-rows a:hover { color: var(--ink); }
.else-rows .e-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.else-rows .e-val { font-size: 1.05rem; font-weight: 500; }
.else-rows .e-val small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.else-rows a[data-placeholder] .e-val { color: var(--muted); }

/* endings */
.ending { padding-top: clamp(40px, 6vh, 64px); }
.ending .g-end { grid-column: 1 / 13; }
.site-foot { margin-top: clamp(56px, 8vh, 96px); }

/* motion: enter-once reveals */
[data-rv] { opacity: 0; transform: translateY(12px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.in [data-rv] { opacity: 1; transform: none; }
.pg-title .ct-word { transform: translateY(104%); transition: transform 0.8s var(--ease) 0.15s; } .in .pg-title .ct-word { transform: none; }
.art-title .ct-word { transform: translateY(104%); transition: transform 0.8s var(--ease) 0.15s; } .in .art-title .ct-word { transform: none; }

/* ---------------- one column ≤ 820 px: same anatomy, stacked, large targets ---------------- */
@media (max-width: 820px) {
  .page { padding-top: 96px; }
  .site-head { padding: 12px var(--gutter); } .site-nav { gap: 14px; } .site-nav a { font-size: 11px; letter-spacing: 0.04em; padding: 16px 0; min-height: 44px; display: inline-flex; align-items: center; }
  .site-head .wordmark { padding: 16px 0; min-height: 44px; display: inline-flex; align-items: center; }   /* preview: 44 px tap targets on the secondary-page header */
  .intro .g-aside { text-align: left; justify-self: start; margin-top: 18px; }
  .pg-title { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .cards { grid-template-columns: 1fr; gap: 40px; }
  .c-img { aspect-ratio: 16 / 10; }
  .c-link { padding: 8px 0; }
  .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
  .row .r-no { flex: 0 0 40px; } .row .r-name { flex: 1 1 60%; } .row .r-arrow { margin-left: auto; }
  .row .r-type { margin-left: 54px; }
  .units { grid-template-columns: 1fr; gap: 16px; }
  .unit { min-height: 0; padding: 22px 20px 24px; }
  .feat { display: flex; flex-direction: column; }   /* mobile: metadata → image (only if the post has one) → title / summary / read */
  .feat .f-meta { order: 0; } .feat .f-img { order: 1; margin: 14px 0 20px; aspect-ratio: 16 / 9; } .feat .f-body { order: 2; }
  .feat .f-img { aspect-ratio: 16 / 9; margin-top: 18px; }
  .year { grid-template-columns: 1fr; }
  .year-no { padding-bottom: 8px; }
  .post { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
  .post .p-date { flex-basis: 100%; } .post .p-title { flex: 1 1 70%; } .post .r-arrow { margin-left: auto; }
  .art-head .g-title, .art-head .g-meta, .art-head .g-rule { grid-column: 1 / -1; }
  .art, .postnav, .art-back { grid-column: 1 / -1; max-width: none; font-size: 1.05rem; }
  .art figure.wide { width: auto; margin-left: 0; }
  .about-body .g-read, .about-body .g-side, .else { grid-column: 1 / -1; max-width: none; }
  .about-body .g-side { position: static; padding: 8px 0 12px; }
  .cx { max-width: 220px; margin: 0 auto; } .g-side .cx { margin-bottom: 84px; }
  .cx-label { grid-template-columns: 1fr; text-align: center; } .cx-clip { grid-column: 1; grid-row: auto; text-align: center; margin-top: 4px; }
  .else-rows a, .else-rows .e-row { grid-template-columns: 110px minmax(0, 1fr) 24px; padding: 16px 0; }
}
@media (prefers-reduced-motion: reduce) { [data-rv], .ct-word, .intro .g-rule { opacity: 1 !important; transform: none !important; transition: none !important; } }
/* page tones — the homepage chapter tones carried to their pages */
body.pg-projects { background: var(--bg-projects); } body.pg-tools { background: var(--bg-tools); } body.pg-blog { background: var(--bg-blog); } body.pg-about { background: var(--bg-about); }

/* ---------------- interactive prototype: focus, return links, detail pages, external markers, start page ---------------- */
a:focus-visible, .card:focus-visible, .unit:focus-visible, .row:focus-visible, .post:focus-visible, .else-rows a:focus-visible { outline: 1px solid var(--crimson-2); outline-offset: 4px; }
a[aria-disabled="true"] { cursor: default; }
.intro .g-return, .art-head .g-return { grid-column: 10 / 13; grid-row: 1; justify-self: end; }
.ext::after { content: "↗"; margin-left: 8px; color: var(--crimson-2); font-family: var(--font-mono); }
.ext-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-left: 12px; }
.pg-title--detail { font-size: clamp(2.4rem, 4.6vw, 4.2rem); }
.meta-dl { display: grid; grid-template-columns: auto auto; gap: 8px 22px; margin: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; text-align: left; }
.meta-dl dt { color: var(--muted); } .meta-dl dd { color: var(--ink-2); white-space: nowrap; }
.intro .g-aside.meta-wrap { justify-self: end; }
.det-img { grid-column: 3 / 10; max-width: 760px; margin: 36px 0 0; border: 1px solid var(--line-2); aspect-ratio: 16 / 9; overflow: hidden; background: #000; position: relative; }
.det-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.det-img.ph { background: linear-gradient(135deg, #111114 0%, #0b0b0d 100%); }
.det-img.ph::before { content: ""; position: absolute; inset: 14px; border: 1px dashed var(--line-2); }
.det-img .c-cap { position: absolute; left: 14px; bottom: 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); background: rgba(11,11,13,0.72); padding: 4px 8px; }
.det { grid-column: 3 / 10; max-width: 720px; padding-top: 28px; }
.det .ab-sec p { font-size: 1.08rem; }
.det ol { padding-left: 1.3em; color: var(--ink-2); font-size: 1.05rem; line-height: 1.6; } .det ol li + li { margin-top: 0.5em; }
.det .link-arrow { margin-top: 6px; }
.postnav a[aria-disabled="true"] { color: var(--muted); pointer-events: none; }
.postnav .ttl.ph { color: var(--muted); font-weight: 400; }
.start { grid-column: 1 / 13; border-top: 1px solid var(--line); margin-top: 8px; }
.start a { display: grid; grid-template-columns: 90px minmax(0, 1fr) 24px; gap: var(--col-gap); align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-2); transition: color 0.3s; }
.start a:hover { color: var(--ink); }
.start .s-no { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: var(--crimson-2); }
.start .s-name { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; color: var(--ink); line-height: 1.05; }
.start .s-name small { display: block; font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: 8px; }
.start-note { grid-column: 1 / 8; margin-top: 28px; }
@media (max-width: 820px) {
  .intro .g-return, .art-head .g-return { justify-self: start; }
  .meta-dl { grid-template-columns: auto auto; }
  .det { grid-column: 1 / -1; max-width: none; }
  .start a { grid-template-columns: 56px minmax(0, 1fr) 24px; padding: 22px 0; }
}

/* Projects: the category line is generated from data but stays hidden until enough projects exist (data-future-filter) */
.cats[hidden] { display: none; }

/* ======================================================================================================================
   THIRD LEVEL — Project Detail and Blog Article (integrated preview). Both keep the shared header, grid, mono metadata,
   crimson / cyan accents, hairlines and the colophon. Project detail: cover → title / intro → metadata → actions → content →
   a closer look → credits → project navigation. Article: quiet long-form reading page for a Hugo single template.
   ====================================================================================================================== */

/* ---- project detail: cover, wide, inside the grid with margins; not a screen */
.pd-cover { grid-column: 1 / 13; margin: 8px 0 0; position: relative; aspect-ratio: 2.35 / 1; max-height: none; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.pd-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pd-cover .c-cap { position: absolute; left: 14px; bottom: 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); background: rgba(11,11,13,0.72); padding: 4px 8px; }
.pd-cover.ph { background: linear-gradient(135deg, #111114 0%, #0b0b0d 100%); }
.pd-cover.ph::before { content: ""; position: absolute; inset: 14px; border: 1px dashed var(--line-2); }
/* ---- title block: title / summary / personal context left, metadata right, actions under the text */
.pd-head { padding-top: clamp(28px, 4vh, 44px); }
.pd-head .g-title { grid-column: 1 / 9; grid-row: 1; }
.pd-head .g-sum { grid-column: 1 / 8; grid-row: 2; margin-top: 18px; }
.pd-head .g-desc2 { grid-column: 1 / 8; grid-row: 3; margin-top: 14px; }
.pd-head .g-meta { grid-column: 9 / 13; grid-row: 1 / 4; justify-self: end; }
.pd-head .g-actions { grid-column: 1 / 13; grid-row: 4; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.pd-title { font-size: clamp(2.6rem, 5vw, 4.6rem); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; color: var(--ink); }
.pd-sum { font-size: clamp(1.15rem, 1.45vw, 1.35rem); line-height: 1.4; color: var(--ink); letter-spacing: -0.01em; max-width: 52ch; }
.pd-desc { font-size: 1.02rem; line-height: 1.6; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
/* metadata as square, hairlined tags — the old page's badges in MONADOCORE's language — plus a small facts list */
.pd-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pd-tag { display: inline-block; padding: 7px 10px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.pd-tag.st { color: var(--ink-2); } .pd-tag .dot { margin-right: 8px; }
.pd-facts { margin: 18px 0 0; display: grid; grid-template-columns: auto auto; gap: 8px 22px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; text-align: left; justify-content: end; }
.pd-facts dt { color: var(--muted); } .pd-facts dd { color: var(--ink-2); white-space: nowrap; }
/* actions: one primary (bordered, square), the rest as quiet arrow links; disabled = placeholder */
.pd-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.pd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 0 18px; border: 1px solid rgba(236, 233, 226, 0.34); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); transition: border-color 0.3s, color 0.3s, background 0.3s; }
.pd-btn::after { content: "→"; color: var(--crimson-2); display: inline-block; transition: transform 0.3s var(--ease); }
.pd-btn.ext::after { content: "↗"; }
.pd-btn.primary { border-color: var(--ink); color: var(--ink); background: rgba(236, 233, 226, 0.045); }
.pd-btn:hover { border-color: var(--ink); color: var(--ink); background: rgba(236, 233, 226, 0.08); } .pd-btn:hover::after { transform: translateX(4px); }
.pd-btn:focus-visible { outline: 1px solid var(--crimson-2); outline-offset: 3px; }
.pd-note { grid-column: 1 / 8; grid-row: 5; margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); line-height: 1.8; }
/* content: reading column, wider than the article because of media; sections in the site's small crimson mono headings */
.pd-body { padding-top: clamp(32px, 5vh, 56px); }
.pd-body .det { grid-column: 1 / 9; max-width: 780px; padding-top: 0; }
.pd-body .det .ab-sec:first-child { padding-top: 0; border-top: 0; }
/* a closer look: portrait screenshots four across, landscape two across, each a quiet labelled plate; click opens the image */
.look { padding-top: clamp(40px, 6vh, 64px); }
.look .sec-head { margin-bottom: 22px; }
.shots { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px var(--col-gap); }
.shots.land { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot { display: block; color: var(--muted); }
.shot .frame { display: block; border: 1px solid var(--line-2); background: #000; overflow: hidden; aspect-ratio: 9 / 20; }
.shots.land .shot .frame { aspect-ratio: 16 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.92; transition: opacity 0.4s var(--ease); }
.shot:hover img, .shot:focus-visible img { opacity: 1; }
.shot .lbl { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
/* credits: quiet definition rows */
.credits { padding-top: clamp(36px, 5vh, 56px); }
.credits .cr { grid-column: 1 / 8; max-width: 640px; }
.cr dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 22px; margin: 0; }
.cr dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.cr dd { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.cr dd a { border-bottom: 1px solid var(--line); } .cr dd a:hover { border-color: var(--crimson-2); }
.pd-nav { padding-top: clamp(40px, 6vh, 64px); }
.pd-nav .postnav { grid-column: 1 / 9; max-width: 780px; margin-top: 0; }
.pd-nav .art-back { grid-column: 1 / 9; }

/* ---- blog article: the long-form reading page */
.ar-head { padding-top: 16px; }
.ar-head .g-mark { grid-column: 1 / 8; grid-row: 1; }
.ar-head .g-return { grid-column: 10 / 13; grid-row: 1; justify-self: end; }
.ar-head .g-cat { grid-column: 3 / 11; grid-row: 2; margin-top: clamp(36px, 5vh, 56px); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--crimson-2); }
.ar-head .g-title { grid-column: 3 / 11; grid-row: 3; margin-top: 14px; }
.ar-title { font-size: clamp(2.2rem, 3.6vw, 3.4rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; color: var(--ink); text-wrap: balance; }
.ar-head .g-deck { grid-column: 3 / 10; grid-row: 4; margin-top: 18px; font-size: clamp(1.1rem, 1.3vw, 1.25rem); line-height: 1.5; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.ar-head .g-meta { grid-column: 3 / 11; grid-row: 5; margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 26px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.ar-head .g-rule { grid-column: 3 / 11; grid-row: 6; height: 1px; background: var(--line); margin-top: 24px; transform: none; transition: none; }
/* optional feature image: between header and body, on the measure (or a little wider), only when the post has one */
.ar-fig { grid-column: 3 / 11; margin: 36px 0 0; }
.ar-fig .frame { border: 1px solid var(--line-2); background: #000; overflow: hidden; }
.ar-fig img { width: 100%; height: auto; display: block; opacity: 0.94; }
.ar-fig figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
/* body: the existing .art measure and rhythm, extended for h4, hr, ordered lists, table scrolling */
.art h2::before { content: ""; display: block; width: 22px; height: 1px; background: var(--crimson-2); margin-bottom: 14px; }
.art h4 { font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-top: 1.6em; letter-spacing: -0.01em; }
.art hr { border: 0; height: 1px; background: var(--line-2); margin: 2.4em 0; }
.art ol { padding-left: 1.3em; } .art li::marker { color: var(--muted); }
.art em { font-style: italic; } .art strong { color: var(--ink); font-weight: 600; }
.art table { display: block; overflow-x: auto; white-space: nowrap; }
.art table th, .art table td { white-space: normal; min-width: 120px; }
.art img { max-width: 100%; height: auto; display: block; }
.art .tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.art .tags a { border: 1px solid var(--line); padding: 6px 10px; margin: 0; color: var(--ink-2); font-size: 10px; letter-spacing: 0.2em; }
.art .tags a[aria-disabled="true"] { color: var(--muted); }
.art .tags .lbl { margin-right: 8px; }

/* ---- responsive (one column) */
@media (max-width: 820px) {
  .pd-cover { aspect-ratio: 16 / 10; max-height: none; }
  .pd-head .g-title, .pd-head .g-sum, .pd-head .g-desc2, .pd-head .g-meta, .pd-head .g-actions, .pd-note { grid-column: 1 / -1; }
  .pd-head .g-meta { justify-self: start; margin-top: 18px; }
  .pd-tags { justify-content: flex-start; } .pd-facts { justify-content: start; }
  .pd-actions { flex-direction: column; align-items: stretch; gap: 10px; max-width: 360px; } .pd-btn { width: 100%; min-height: 48px; }   /* mobile: one stacked button family, content-column width */
  .pd-body .det, .credits .cr, .pd-nav .postnav, .pd-nav .art-back { grid-column: 1 / -1; max-width: none; }
  .shots, .shots.land { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .look .sec-head { display: block; } .look .sec-head .sec-note { display: block; margin-top: 8px; }
  .ar-head .g-return { justify-self: start; }   /* same placement as the project pages on mobile */
  .g-return, .art-back { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; }   /* 44 px tap targets on the tertiary pages */
  .pd-nav .postnav a, .art + .postnav a { min-height: 44px; }
  .cr dl { grid-template-columns: 110px minmax(0, 1fr); }
  .ar-head .g-cat, .ar-head .g-title, .ar-head .g-deck, .ar-head .g-meta, .ar-head .g-rule, .ar-fig { grid-column: 1 / -1; }
  .ar-head .g-cat { margin-top: 28px; }
  .ar-title { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
}
@media (max-width: 380px) { .shots, .shots.land { grid-template-columns: 1fr; } }

/* ---- tertiary pages: header safe area (rd.js measures the real header height into --head-h; the fallbacks equal the header's designed heights) ---- */
.pg-detail .page, .pg-article .page { padding-top: calc(var(--head-h, 92px) + 36px); }
.pg-detail .site-head::before, .pg-article .site-head::before { opacity: 1; }   /* always on: the page's own ground, invisible at the top, a solid band over the header row while content scrolls beneath */
.pg-detail .site-head::before { background: linear-gradient(to bottom, var(--bg-projects) 0%, var(--bg-projects) 71%, rgba(11, 11, 13, 0) 100%); }
.pg-article .site-head::before { background: linear-gradient(to bottom, var(--bg-blog) 0%, var(--bg-blog) 71%, rgba(10, 10, 12, 0) 100%); }
@media (max-width: 820px) { .pg-detail .page, .pg-article .page { padding-top: calc(var(--head-h, 68px) + 28px); } }
