/* ==========================================================================
   Portfolio stylesheet. Engineer's-notebook / datasheet look.
   Edit the tokens in :root and the dark block to re-theme the whole site.
   ========================================================================== */

/* ---- Fonts (self-hosted, IBM Plex, OFL license) ------------------------- */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --font-sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f5f4f0;
  --surface: #fbfaf7;
  --ink: #16181a;
  --ink-2: #444a50;
  --muted: #5a6067;
  --rule: #d4d1c8;
  --rule-strong: #16181a;
  --accent: #0b6a8f;
  --accent-ink: #ffffff;
  --copper: #8a4b00;
  --copper-bg: #f3e6d3;
  --code-bg: #ecebe5;
  --grid-line: rgba(22, 24, 26, 0.055);
  --shadow: 0 1px 0 rgba(22, 24, 26, 0.04);

  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 4px;
}

:root[data-theme="dark"] {
  --bg: #0f1113;
  --surface: #15181b;
  --ink: #e8e6e1;
  --ink-2: #bcbfc3;
  --muted: #9aa0a6;
  --rule: #2a2e33;
  --rule-strong: #e8e6e1;
  --accent: #5bb6da;
  --accent-ink: #0f1113;
  --copper: #e0a15a;
  --copper-bg: #2a2118;
  --code-bg: #1a1d21;
  --grid-line: rgba(232, 230, 225, 0.05);
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --surface: #15181b;
    --ink: #e8e6e1;
    --ink-2: #bcbfc3;
    --muted: #9aa0a6;
    --rule: #2a2e33;
    --rule-strong: #e8e6e1;
    --accent: #5bb6da;
    --accent-ink: #0f1113;
    --copper: #e0a15a;
    --copper-bg: #2a2118;
    --code-bg: #1a1d21;
    --grid-line: rgba(232, 230, 225, 0.05);
    --shadow: none;
  }
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
ul { margin: 0; padding: 0; list-style: none; }
code, kbd, pre { font-family: var(--font-mono); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; font-family: var(--font-mono); font-size: 0.875rem; text-decoration: none; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* ---- Header -------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.wordmark { font-family: var(--font-mono); font-weight: 500; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: 0.02em; }
.wordmark span { color: var(--muted); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-2); text-decoration: none; padding: 10px 12px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-toggle { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink); background: transparent; border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 8px 12px; min-height: 44px; cursor: pointer; margin-left: 8px; }
.theme-toggle:hover { background: var(--ink); color: var(--bg); }

/* ---- Buttons, chips ----------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; text-decoration: none; border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--ink); background: transparent; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.chip--tag { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); background: transparent; }
.status { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status[data-status="In progress"]::before, .status[data-status="Ongoing"]::before { background: transparent; border: 2px solid var(--accent); }

.ph-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--copper); border: 1px dashed var(--copper); background: var(--copper-bg); padding: 3px 7px; border-radius: 2px; vertical-align: middle; }

/* ---- Sections ------------------------------------------------------------ */
.section { padding-block: clamp(48px, 8vw, 96px); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head .label { margin-bottom: 8px; display: block; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding-block: clamp(48px, 9vw, 112px) clamp(40px, 6vw, 72px); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 32px 32px; background-position: -1px -1px; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: end; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: -0.03em; margin: 16px 0 24px; }
.hero .intro { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; margin-bottom: 28px; }

.spec { background: var(--surface); border: 1px solid var(--rule-strong); }
.spec-title { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule-strong); }
.spec ol { margin: 0; padding: 0; list-style: none; }
.spec li { display: grid; grid-template-columns: 2.2rem 7.5rem 1fr; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.spec li:last-child { border-bottom: 0; }
.spec .n { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.spec .layer { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; }
.spec .what { font-size: 0.92rem; color: var(--ink-2); line-height: 1.45; }

/* ---- Project cards ------------------------------------------------------ */
.focus-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.focus-row .label { margin-right: 4px; }
.focus-row a { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink); text-decoration: none; padding: 9px 12px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.focus-row a:hover { background: var(--ink); color: var(--bg); }

.project-grid { display: grid; gap: 24px; }
.project-grid--featured { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.project-grid--index { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); grid-auto-rows: 1fr; }

.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--rule-strong); }
.card:focus-within { border-color: var(--accent); }
.card-media { position: relative; overflow: hidden; background: var(--code-bg); border-bottom: 1px solid var(--rule); aspect-ratio: 16 / 10; }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-media video { opacity: 0; transition: opacity .2s; }
.card-media video.is-playing { opacity: 1; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 12px; padding: 20px 20px 22px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h3 { font-size: 1.4rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; }
.card .chips { margin-top: auto; }
.card .chips + .chips { margin-top: 0; }
.card-index { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }

/* ---- Placeholder slots --------------------------------------------------- */
.ph-slot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; color: var(--copper); background-color: var(--copper-bg); background-image: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--copper) 14%, transparent) 10px 11px); border: 1px dashed var(--copper); font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.4; }
.ph-slot strong { font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.7rem; }

/* ---- Filters ------------------------------------------------------------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) 32px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 12px 0 16px; }
.page-head p { color: var(--ink-2); max-width: 40em; }
.filters { display: grid; gap: 14px; padding: 20px 0 28px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-group .label { width: 5.5rem; }
.filter-btn { font-family: var(--font-mono); font-size: 0.8rem; min-height: 44px; padding: 8px 14px; color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.filter-btn:hover { border-color: var(--rule-strong); }
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.result-count { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); margin: 0 0 20px; }
.empty-state { padding: 40px 0; color: var(--ink-2); }

/* ---- Project detail ------------------------------------------------------ */
.crumbs { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.detail-head { padding-block: 20px 36px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: end; }
.detail-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.03em; margin: 12px 0 16px; }
.detail-head .lede { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 20px; }
.kv { margin: 0; border: 1px solid var(--rule-strong); background: var(--surface); }
.kv div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.kv div:last-child { border-bottom: 0; }
.kv dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font-size: 0.95rem; }
.detail-links { margin-top: 20px; }

.detail-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding-block: 56px 24px; }
.toc { position: sticky; top: 88px; align-self: start; }
.toc ol { margin: 12px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.toc a { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); text-decoration: none; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }

.doc-section { padding-bottom: 56px; max-width: 820px; }
.doc-section + .doc-section { padding-top: 40px; border-top: 1px solid var(--rule); }
.doc-section > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 20px; }
.doc-section h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.sec-n { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.doc-section ul.bullets { margin: 0 0 1.2em; }
.bullets li { position: relative; padding-left: 1.5em; margin-bottom: 0.6em; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.75em; height: 1px; background: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 0 0 1.4em; border: 1px solid var(--rule); background: var(--surface); }
.facts div { padding: 14px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 -1px -1px 0; }
.facts dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 500; }

.entries { display: grid; gap: 20px; margin: 0 0 1.4em; }
.entry { border: 1px solid var(--rule); background: var(--surface); }
.entry h3 { font-size: 1.05rem; padding: 14px 16px; border-bottom: 1px solid var(--rule); letter-spacing: -0.01em; }
.entry dl { margin: 0; }
.entry dl div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.entry dl div:last-child { border-bottom: 0; }
.entry dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.entry dd { margin: 0; font-size: 0.97rem; color: var(--ink-2); }

/* ---- Media --------------------------------------------------------------- */
.media { margin: 0 0 1.6em; }
.media-frame { position: relative; overflow: hidden; background: var(--code-bg); border: 1px solid var(--rule); aspect-ratio: 16 / 9; }
.media-frame img, .media-frame video, .media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-frame img, .media-frame video { object-fit: cover; }
.media--diagram .media-frame { background: var(--surface); }
.media--diagram .media-frame img { object-fit: contain; }
.media figcaption { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding-top: 10px; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
.media figcaption .fig { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.media--hero { margin-bottom: 0; }
.hero-media { padding-top: 8px; }

.embed-facade { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink); background: var(--surface); border: 0; cursor: pointer; }
.embed-facade:hover { background: var(--code-bg); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 24px; }
.gallery-grid .media { margin: 0; }
.lightbox-btn { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; z-index: 1; }
dialog.lightbox { width: min(1100px, 94vw); max-height: 94vh; padding: 16px; background: var(--bg); color: var(--ink); border: 1px solid var(--rule-strong); }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, 0.72); }
dialog.lightbox img { width: 100%; max-height: 74vh; object-fit: contain; background: var(--code-bg); }
dialog.lightbox p { margin: 12px 0 0; color: var(--ink-2); font-size: 0.95rem; }
dialog.lightbox .btn { margin-top: 12px; }

/* ---- Code ---------------------------------------------------------------- */
.code-block { margin: 0 0 1.6em; border: 1px solid var(--rule); background: var(--code-bg); }
.code-head { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; tab-size: 4; }
.code-block code { font-family: var(--font-mono); }
.code-cap { padding: 10px 14px; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-2); }
/* Syntax colours (highlight.js token classes), tuned for both themes */
.hljs { color: var(--ink); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--muted); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in, .hljs-type { color: var(--accent); }
.hljs-string, .hljs-attr, .hljs-regexp, .hljs-addition { color: var(--copper); }
.hljs-number, .hljs-symbol, .hljs-meta, .hljs-variable, .hljs-template-variable { color: var(--ink-2); font-weight: 500; }
.hljs-title, .hljs-section, .hljs-name, .hljs-function { color: var(--ink); font-weight: 500; }

/* ---- Prev / next --------------------------------------------------------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-block: 40px 72px; border-top: 1px solid var(--rule); margin-top: 24px; }
.pager a { display: block; padding: 18px 20px; border: 1px solid var(--rule); text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--rule-strong); }
.pager a:last-child { text-align: right; }
.pager .label { display: block; margin-bottom: 6px; }
.pager strong { font-size: 1.1rem; }

/* ---- Skills -------------------------------------------------------------- */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule-strong); background: var(--surface); }
.skill-group { padding: 20px; border-right: 1px solid var(--rule); }
.skill-group:last-child { border-right: 0; }
.skill-group h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 14px; color: var(--accent); }
.skill-group li { font-size: 0.95rem; padding: 6px 0; border-bottom: 1px solid var(--rule); line-height: 1.35; }
.skill-group li:last-child { border-bottom: 0; }

/* ---- About / Resume / Contact ------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-grid h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.about-grid h2:first-child { margin-top: 0; }
.photo-slot { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--rule); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.plain-list li:first-child { border-top: 1px solid var(--rule); }
.plain-list small { display: block; color: var(--muted); font-size: 0.88rem; }
.pdf-frame { width: 100%; height: min(80vh, 1000px); min-height: 520px; border: 1px solid var(--rule-strong); background: var(--surface); }
.contact-list { max-width: 640px; border-top: 1px solid var(--rule-strong); }
.contact-list a { display: grid; grid-template-columns: 8rem 1fr; gap: 12px; align-items: baseline; min-height: 64px; padding: 16px 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: 1.15rem; }
.contact-list a:hover { color: var(--accent); }
.contact-list .label { padding-top: 4px; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 32px 48px; color: var(--muted); font-size: 0.88rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { color: var(--muted); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.noscript { padding: 16px var(--gutter); background: var(--copper-bg); color: var(--copper); font-family: var(--font-mono); font-size: 0.85rem; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid, .detail-head, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 16px; border-left: 0; }
  .toc a { padding: 8px 0; border-left: 0; margin: 0; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-group:nth-child(2) { border-right: 0; }
  .skill-group:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .project-grid--featured { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .project-grid--index { grid-auto-rows: auto; }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .skill-group { border-right: 0; border-bottom: 1px solid var(--rule); }
  .skill-group:last-child { border-bottom: 0; }
  .spec li { grid-template-columns: 1.8rem 1fr; }
  .spec .what { grid-column: 2; }
  .kv div, .entry dl div { grid-template-columns: 1fr; gap: 2px; }
  .filter-group .label { width: 100%; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .contact-list a { grid-template-columns: 1fr; gap: 2px; }
  .site-header .container { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .toc, .theme-toggle { display: none; }
}

/* Inline [bracketed] placeholder text inside rendered copy */
.ph-inline { color: var(--copper); background: var(--copper-bg); border-radius: 2px; padding: 0 0.25em; }
