/* ==========================================================================
   joesaad.win — design system
   Navy ink, graphite text, steel grey, off-white paper, copper accent.
   Sections:  1 tokens · 2 base · 3 layout · 4 header · 5 buttons · 6 home
              7 shared blocks · 8 case study · 9 toolbox · 10 CV · 11 footer
              12 motion · 13 print
   ========================================================================== */

/* 1 ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #f3f2ee;
  --bg-2: #eae8e2;
  --surface: #fbfaf7;
  --ink: #0e1b2e;
  --text: #28313d;
  --muted: #5d6876;
  --faint: #8d96a2;
  --line: #d7d8d8;
  --line-strong: #b8bdc3;
  --accent: #a24e22;          /* copper — text-safe on --bg (≈5:1) */
  --accent-soft: rgba(162, 78, 34, .10);
  --cold: #2c63a8;            /* glycol supply / links in diagrams */
  --warm: #b4582a;            /* glycol return */
  --btn-bg: #0e1b2e;
  --btn-fg: #f7f6f2;
  --grid: rgba(14, 27, 46, .045);
  --shadow: 0 1px 0 rgba(14, 27, 46, .04), 0 24px 48px -32px rgba(14, 27, 46, .28);

  --f-display: "Bahnschrift", "DIN Alternate", "DIN Next", "Barlow", "Segoe UI Variable Display", system-ui, sans-serif;
  --f-text: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: .8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.45rem, 1.1rem + 1vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.2rem + 1.7vw, 2.35rem);
  --step-4: clamp(2.2rem, 1.4rem + 2.6vw, 3.2rem);
  --step-5: clamp(2.6rem, 1.6rem + 3.4vw, 4.1rem);

  --wrap: 1240px;
  --gutter: clamp(20px, 3.2vw, 40px);
  --section: clamp(72px, 9vw, 128px);
  --radius: 3px;
  --header-h: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #0f1827;
  --surface: #121c2d;
  --ink: #eef1f5;
  --text: #c9d0da;
  --muted: #98a3b2;
  --faint: #6c7889;
  --line: #1f2b3e;
  --line-strong: #2f3e56;
  --accent: #e08a52;
  --accent-soft: rgba(224, 138, 82, .12);
  --cold: #74a6ea;
  --warm: #e08a52;
  --btn-bg: #eef1f5;
  --btn-fg: #0b1220;
  --grid: rgba(150, 180, 220, .05);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 48px -28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-2: #0f1827; --surface: #121c2d; --ink: #eef1f5; --text: #c9d0da;
    --muted: #98a3b2; --faint: #6c7889; --line: #1f2b3e; --line-strong: #2f3e56;
    --accent: #e08a52; --accent-soft: rgba(224, 138, 82, .12); --cold: #74a6ea; --warm: #e08a52;
    --btn-bg: #eef1f5; --btn-fg: #0b1220; --grid: rgba(150, 180, 220, .05);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 24px 48px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* 2 ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.theme-anim, body.theme-anim * { transition: background-color .25s ease, border-color .25s ease, color .25s ease, fill .25s ease, stroke .25s ease !important; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--cold); outline-offset: 3px; border-radius: 1px; }
::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 { color: var(--ink); font-family: var(--f-display); font-weight: 600; line-height: 1.12; letter-spacing: -.012em; margin: 0; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; letter-spacing: -.005em; }
h4 { font-size: var(--step-0); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
strong { color: var(--ink); font-weight: 600; }

.mono, .label {
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.label--accent { color: var(--accent); }
.label svg, .illus svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; flex: none; }
.contact-card .label { display: flex; align-items: center; gap: 8px; }
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.case-nav ~ section[id] { scroll-margin-top: calc(var(--header-h) + 64px); }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--text); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.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: 200; background: var(--btn-bg); color: var(--btn-fg); padding: 10px 14px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* 3 ── Layout ─────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
.band + .section { padding-top: var(--section); }

/* section header: sheet-index style */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 16px 32px;
  padding-top: 18px;
  margin-bottom: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line-strong);
  position: relative;
}
.sec-head::before, .sec-head::after { content: ""; position: absolute; top: -5px; width: 1px; height: 9px; background: var(--line-strong); }
.sec-head::before { left: 0; }
.sec-head::after { right: 0; }
.sec-head .label { padding-top: .45em; }
.sec-head .label b { color: var(--accent); font-weight: 600; margin-right: .75em; }
.sec-head h2 { max-width: 22ch; }
.sec-head p { color: var(--muted); max-width: 62ch; margin-top: 14px; }
.sec-head .sec-link { margin-top: 18px; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } .sec-head .label { padding-top: 0; } }

/* 4 ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 .8rem/1 var(--f-mono); letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font: 600 1.02rem/1.1 var(--f-display); letter-spacing: -.005em; }
.brand-role { font: 500 .66rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 12px;
  font-size: .94rem; color: var(--text); text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.menu-btn { display: none; }

@media (max-width: 960px) {
  .nav { display: none; }
  .header-actions .menu-btn { display: inline-grid; }
  .header-actions .header-cta { display: none; }
}
@media (max-width: 420px) { .brand-role { display: none; } }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
  background: var(--bg);
  padding: 24px var(--gutter) 40px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a.m-link {
  display: flex; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font: 600 1.5rem/1.2 var(--f-display); color: var(--ink); text-decoration: none;
}
.mobile-nav a.m-link span { font: 500 .72rem/1 var(--f-mono); color: var(--accent); letter-spacing: .08em; width: 2.2em; }
.mobile-nav a.m-link[aria-current="page"] { color: var(--accent); }
.mobile-nav .m-foot { margin-top: auto; padding-top: 32px; display: grid; gap: 12px; }
body.menu-open { overflow: hidden; }

/* 5 ── Buttons & links ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 20px;
  font: 600 .95rem/1.2 var(--f-text); text-decoration: none; letter-spacing: .005em;
  border: 1px solid var(--btn-bg); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { color: var(--btn-fg); background: var(--accent); border-color: var(--accent); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: .88rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 3px;
}
.arrow-link svg { width: 16px; height: 16px; transition: transform .18s ease; }
.arrow-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow-link:hover svg { transform: translateX(3px); }

/* 6 ── Home ───────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.hero .wrap {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
  padding-block: clamp(56px, 8vw, 112px) clamp(56px, 7vw, 96px);
}
.hero-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.hero-eyebrow .dot { width: 8px; height: 8px; background: var(--accent); flex: none; }
.hero h1 { font-size: var(--step-5); letter-spacing: -.025em; line-height: 1.02; }
.hero-headline { font: 500 var(--step-2)/1.3 var(--f-display); color: var(--ink); margin: 14px 0 0; max-width: 28ch; }
.hero-statement { display: flex; align-items: center; gap: 14px; margin: 24px 0 0; font: 500 .82rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero-statement::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.hero-text { margin: 22px 0 34px; color: var(--muted); max-width: 54ch; font-size: 1.08rem; }

/* title-block card */
.tb-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  position: relative;
}
.tb-card::before, .tb-card::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--accent); border-style: solid; }
.tb-card::before { top: -6px; left: -6px; border-width: 1px 0 0 1px; }
.tb-card::after { bottom: -6px; right: -6px; border-width: 0 1px 1px 0; }
.tb-figure { padding: 18px 18px 8px; border-bottom: 1px solid var(--line); color: var(--ink); }
.tb-figure img.portrait { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tb-figure figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; }
.tb-rows { display: grid; }
.tb-row { display: grid; grid-template-columns: 104px 1fr; border-bottom: 1px solid var(--line); }
.tb-row:last-child { border-bottom: 0; }
.tb-row > * { padding: 12px 16px; }
.tb-row dt { border-right: 1px solid var(--line); padding-top: 15px; }
.tb-row dd { margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.4; }
.tb-row dd a { text-decoration: none; }
.tb-row dd a:hover { text-decoration: underline; }
.tb-row dd small { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } .tb-card { max-width: 560px; } }

/* expertise index */
.index-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); }
.index-item { display: grid; grid-template-columns: 52px 1fr; gap: 4px 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.index-item .mono { color: var(--accent); padding-top: 4px; grid-row: span 2; }
.index-item h3 { font-size: 1.16rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.index-item p { color: var(--muted); margin: 0; }
.tag { display: inline-block; font: 500 .66rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; padding: 4px 6px 3px; }
@media (max-width: 760px) { .index-list { grid-template-columns: 1fr; } }

/* intro split */
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 16px 32px; }
.split-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); }
.split-body .lead { color: var(--ink); }
.facts-list { display: grid; align-content: start; border-top: 1px solid var(--line); }
.facts-list div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts-list dt { padding-top: 3px; }
.facts-list dd { margin: 0; color: var(--ink); font-size: .96rem; }
@media (max-width: 960px) { .split, .split-body { grid-template-columns: 1fr; } }

/* featured case study */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.feature-text h3 { font-size: var(--step-3); line-height: 1.1; margin: 14px 0 6px; }
.feature-meta { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.feature-fig { margin: 0; background: var(--surface); border: 1px solid var(--line-strong); padding: clamp(12px, 2vw, 24px); color: var(--ink); }
.feature-fig figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.feature-fig--wide { margin-top: clamp(32px, 4vw, 48px); }
.feature-fig--wide .fig-scroll { overflow-x: auto; }
.feature-fig--wide svg { min-width: 680px; }
.feature-side .figures { margin-top: 6px; }
@media (max-width: 960px) { .feature { grid-template-columns: 1fr; } }

.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); margin: 24px 0 28px; }
.figures div { padding: 14px 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figures b { display: block; font: 600 1.5rem/1.1 var(--f-display); color: var(--ink); letter-spacing: -.01em; white-space: nowrap; }
.figures b small { font-size: .62em; font-weight: 500; color: var(--muted); margin-left: 3px; }
.figures span { display: block; margin-top: 6px; font-size: .8rem; line-height: 1.35; color: var(--muted); }
.figures--wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .figures--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .figures, .figures--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* project entries */
.entries { border-top: 1px solid var(--line-strong); }
.entry {
  display: grid; grid-template-columns: 72px minmax(0, 4fr) minmax(0, 6fr) 40px; gap: 8px 28px; align-items: start;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; position: relative;
}
.entry .mono { padding-top: 6px; }
.entry h3 { font-size: var(--step-2); line-height: 1.15; }
.entry p { color: var(--muted); margin: 0; }
.entry .entry-arrow { width: 40px; height: 40px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink); transition: all .2s ease; }
.entry .entry-arrow svg { width: 16px; height: 16px; }
.entry:hover { color: inherit; }
.entry:hover h3 { color: var(--accent); }
.entry:hover .entry-arrow { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
@media (max-width: 760px) {
  .entry { grid-template-columns: 1fr 40px; }
  .entry .mono { grid-column: 1 / -1; padding: 0; }
  .entry p { grid-column: 1 / -1; }
  .entry .entry-arrow { grid-row: 2; grid-column: 2; }
}

/* timeline */
.timeline { list-style: none; position: relative; }
.tl-item { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 8px 32px; padding: 0 0 36px; position: relative; }
.tl-when { padding-top: 4px; }
.tl-when .mono { display: block; color: var(--ink); }
.tl-when .tl-sub { display: block; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.tl-body { position: relative; padding-left: 28px; border-left: 1px solid var(--line-strong); padding-bottom: 4px; }
.tl-item:last-child .tl-body { border-left-color: transparent; }
.tl-body::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--ink); }
.tl-item.is-current .tl-body::before { background: var(--accent); border-color: var(--accent); }
.tl-body h3 { font-size: 1.2rem; }
.tl-org { color: var(--accent); font-weight: 600; margin: 2px 0 8px; font-size: .98rem; }
.tl-body p { color: var(--muted); max-width: 64ch; }
@media (max-width: 760px) { .tl-item { grid-template-columns: 1fr; } .tl-when { padding-left: 28px; } }

/* toolbox showcase */
.showcase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.showcase-text h3 { font-size: var(--step-3); margin: 14px 0 10px; }
.showcase-text p { color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 26px; }
.meta-row span { font: 500 .74rem/1 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.meta-row span b { color: var(--ink); font-weight: 600; }
.module-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 28px; border-top: 1px solid var(--line); }
.module-groups div { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.module-groups b { color: var(--ink); font-weight: 600; }
.module-groups span { color: var(--muted); }
@media (max-width: 960px) { .showcase { grid-template-columns: 1fr; } }

.frame { margin: 0; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.frame-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.frame-bar i { width: 9px; height: 9px; border: 1px solid var(--line-strong); border-radius: 50%; }
.frame-bar span { margin-left: 10px; font: 500 .7rem/1 var(--f-mono); color: var(--muted); letter-spacing: .04em; }
.frame img { width: 100%; }
.frame figcaption { padding: 10px 12px; border-top: 1px solid var(--line); }

/* skills */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); }
.skill-col { border-top: 1px solid var(--line-strong); padding-top: 16px; }
.skill-col h3 { font-size: 1.05rem; margin-bottom: 14px; }
.skill-col ul { list-style: none; }
.skill-col li { padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--text); font-size: .95rem; }
.skill-col li:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }

/* CTA band */
.cta { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.cta h2 { font-size: var(--step-4); max-width: 18ch; }
.cta p { color: var(--muted); margin-top: 16px; max-width: 52ch; }
.cta-links { display: grid; gap: 10px; justify-items: start; }
@media (max-width: 960px) { .cta { grid-template-columns: 1fr; } }

/* 7 ── Shared blocks ──────────────────────────────────────────────────── */
.page-head { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.page-head .wrap { position: relative; padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 72px); }
.page-head h1 { margin-top: 18px; max-width: 24ch; }
.page-head .lead { margin-top: 20px; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.crumbs li { display: flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; color: var(--faint); font-family: var(--f-mono); font-size: .75rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.prose p { max-width: 68ch; }
.prose p + p { margin-top: 1em; }

/* involvement markers */
.inv { display: inline-flex; align-items: center; gap: 8px; font: 500 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.inv::before { content: ""; width: 9px; height: 9px; border: 1.5px solid var(--accent); flex: none; }
.inv--performed::before { background: var(--accent); }
.inv--contributed::before { background: linear-gradient(135deg, var(--accent) 50%, transparent 50%); }
.inv--exposure::before { background: transparent; }
.inv--developing::before { border-style: dashed; border-color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 14px 0; border-block: 1px solid var(--line); }
.legend li { list-style: none; display: flex; align-items: center; gap: 10px; }
.legend .legend-text { font-size: .85rem; color: var(--muted); }

/* experience detail */
.xp { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px 32px; padding: 40px 0; border-top: 1px solid var(--line-strong); }
.xp:first-of-type { border-top: 0; padding-top: 0; }
.xp-org h2 { font-size: var(--step-3); }
.xp-org p { color: var(--muted); margin-top: 10px; font-size: .95rem; }
.xp-org .mono { display: block; margin-top: 14px; color: var(--ink); }
.role { padding: 0 0 32px 28px; border-left: 1px solid var(--line-strong); position: relative; }
.role:last-child { padding-bottom: 4px; }
.role::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--ink); }
.role.is-current::before { background: var(--accent); border-color: var(--accent); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.role-head h3 { font-size: 1.3rem; }
.role-dept { color: var(--accent); font-weight: 600; margin: 4px 0 10px; }
.role > p { color: var(--muted); max-width: 64ch; }
.role-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 32px; margin-top: 18px; }
.role-group h4 { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .95rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.role-group ul { list-style: none; }
.role-group li { padding: 6px 0 6px 16px; position: relative; font-size: .95rem; }
.role-group li::before { content: ""; position: absolute; left: 0; top: 1em; width: 7px; height: 1px; background: var(--line-strong); }
.xp-links { margin-top: 24px; }
@media (max-width: 860px) { .xp { grid-template-columns: 1fr; } }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); }
.side-panel { border: 1px solid var(--line-strong); background: var(--surface); align-self: start; }
.side-panel > * { padding: 18px 20px; }
.side-panel > * + * { border-top: 1px solid var(--line); }
.side-panel h3 { font-size: 1rem; margin-bottom: 10px; }
.side-panel ul { list-style: none; }
.side-panel li { padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li { border: 1px solid var(--line-strong); padding: 5px 10px; font-size: .88rem; color: var(--ink); background: var(--bg); }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; } }

.edu { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 16px 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.edu h3 { font-size: 1.3rem; }
.edu .edu-meta { color: var(--accent); font-weight: 600; margin: 4px 0 0; }
.fyp { margin-top: 22px; padding: 20px 22px; border-left: 2px solid var(--accent); background: var(--surface); }
.fyp .fyp-title { font: 600 1.12rem/1.35 var(--f-display); margin: 8px 0 10px; letter-spacing: -.005em; }
.fyp p { color: var(--muted); margin: 0; font-size: .95rem; }
.fyp p + p { margin-top: 6px; }
@media (max-width: 760px) { .edu { grid-template-columns: 1fr; } }

.sw-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sw-table th, .sw-table td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sw-table th { font: 500 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-strong); }
.sw-table td:first-child { color: var(--ink); font-weight: 600; }
.sw-table td.note { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.status--practical::before { background: var(--accent); }
.status--learning::before { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.status--exposure::before { background: transparent; }

.cert-list { list-style: none; border-top: 1px solid var(--line); }
.cert-list li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cert-list b { color: var(--ink); font-weight: 600; display: block; }
.cert-list span { color: var(--muted); font-size: .92rem; }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.contact-card { padding: 26px 24px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.contact-card .c-value { font: 600 1.12rem/1.35 var(--f-display); color: var(--ink); word-break: break-word; }
.contact-card .c-actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; }
.copy-status { font-size: .85rem; color: var(--accent); min-height: 1.2em; }

/* 8 ── Case study ─────────────────────────────────────────────────────── */
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line-strong); }
.case-meta div { padding: 14px 16px 0 0; }
.case-meta dd { margin: 6px 0 0; color: var(--ink); font-weight: 600; line-height: 1.35; }
@media (max-width: 860px) { .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; } }

.case-nav { position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.case-nav ol { display: flex; gap: 4px; list-style: none; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.case-nav ol::-webkit-scrollbar { display: none; }
.case-nav a { display: block; padding: 8px 12px; font-size: .86rem; color: var(--muted); text-decoration: none; white-space: nowrap; border: 1px solid transparent; }
.case-nav a:hover { color: var(--ink); border-color: var(--line); }
.case-nav a.is-active { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }

.role-box { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; padding: 28px; border: 1px solid var(--line-strong); background: var(--surface); }
.role-box p { margin: 0; }
.role-box .note { color: var(--muted); font-size: .95rem; padding-left: 18px; border-left: 2px solid var(--line-strong); }
@media (max-width: 860px) { .role-box { grid-template-columns: 1fr; } }

.schematic { margin: 0; border: 1px solid var(--line-strong); background: var(--surface); }
.schematic-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.schematic-body { padding: clamp(10px, 2vw, 24px); color: var(--ink); overflow-x: auto; }
.schematic-body svg { min-width: 680px; width: 100%; }
.schematic figcaption { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.illus { display: inline-flex; align-items: center; gap: 8px; font: 500 .68rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px dashed var(--accent); padding: 5px 8px; }
.scroll-hint { display: none; }
@media (max-width: 760px) { .scroll-hint { display: block; margin-top: 8px; } }

.sch-legend { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.sch-legend button {
  font: 500 .72rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 7px 9px; cursor: pointer;
}
.sch-legend button:hover, .sch-legend button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); background: var(--bg); }

/* diagram drawing language */
.dg .pipe { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dg .sup { stroke: var(--cold); }
.dg .ret { stroke: var(--warm); }
.dg .eq { fill: var(--surface); stroke: currentColor; stroke-width: 1.4; }
.dg .eq-fill { fill: var(--bg); }
.dg .ln { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.dg .thin { stroke-width: 1; }
.dg .ctl { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.dg .zone { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 6 4; }
.dg .arrow-s { fill: var(--cold); }
.dg .arrow-r { fill: var(--warm); }
.dg .solid { fill: currentColor; }
.dg text { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; fill: var(--muted); }
.dg text.t-ink { fill: var(--ink); font-weight: 600; }
.dg text.t-s { fill: var(--cold); }
.dg text.t-r { fill: var(--warm); }
.dg text.t-sm { font-size: 9.5px; }
.dg text.t-lg { font-size: 12.5px; }
.dg .flow { fill: none; stroke-width: 1; stroke-dasharray: 3 29; stroke-linecap: round; opacity: .9; }
.dg .flow.sup { stroke: var(--surface); }
.dg .flow.ret { stroke: var(--surface); }
.dg [data-g] { transition: opacity .25s ease; }
.dg.is-focus [data-g] { opacity: .16; }
.dg.is-focus [data-g].is-on { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .dg .flow { animation: flow 1.6s linear infinite; }
  .dg .flow.ret { animation-direction: reverse; }
}
@keyframes flow { to { stroke-dashoffset: -32; } }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); }
.spec-table th { width: 34%; font: 500 .74rem/1.4 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding-top: 16px; }
.spec-table td { color: var(--ink); }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 1px solid var(--line-strong); }
@media (max-width: 560px) {
  .spec-table, .spec-table tbody, .spec-table tr, .spec-table th, .spec-table td { display: block; width: auto; }
  .spec-table tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .spec-table th, .spec-table td { border: 0 !important; padding: 0; }
  .spec-table td { margin-top: 4px; }
  .spec-table tr:first-child { border-top: 1px solid var(--line-strong); }
}

.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.area--wide { grid-column: 1 / -1; background: var(--surface); }
.area--wide ul { columns: 3; column-gap: 40px; }
.area--wide li { break-inside: avoid; }
@media (max-width: 1100px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } .area--wide ul { columns: 2; } }
@media (max-width: 640px) { .areas { grid-template-columns: 1fr; } .area--wide ul { columns: 1; } }
.area { padding: 22px 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.area-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.area h3 { font-size: 1.08rem; }
.area ul { list-style: none; }
.area li { padding: 5px 0 5px 16px; position: relative; font-size: .94rem; }
.area li::before { content: ""; position: absolute; left: 0; top: .95em; width: 7px; height: 1px; background: var(--accent); }

.equip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
.equip-item { padding: 18px 0; border-top: 1px solid var(--line); }
.equip-item h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.equip-item h3 svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.equip-item p { color: var(--muted); font-size: .94rem; margin-top: 6px; }
@media (max-width: 960px) { .equip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .equip { grid-template-columns: 1fr; } }

.considerations { list-style: none; counter-reset: c; }
.considerations li { counter-increment: c; display: grid; grid-template-columns: 52px minmax(0, 4fr) minmax(0, 7fr); gap: 6px 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.considerations li::before { content: counter(c, decimal-leading-zero); font: 500 .75rem/1.9 var(--f-mono); color: var(--accent); letter-spacing: .08em; }
.considerations h3 { font-size: 1.08rem; }
.considerations p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .considerations li { grid-template-columns: 40px 1fr; } .considerations p { grid-column: 2; } }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.gallery figure { margin: 0; border: 1px solid var(--line-strong); background: var(--surface); display: flex; flex-direction: column; }
.gallery .g-body { padding: 18px; color: var(--ink); flex: 1; display: grid; place-items: center; }
.gallery figcaption { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; font-size: .9rem; color: var(--muted); }
.gallery figcaption b { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

.lessons { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.lessons li { padding: 16px 0 16px 28px; border-top: 1px solid var(--line); position: relative; }
.lessons li::before { content: ""; position: absolute; left: 0; top: 24px; width: 12px; height: 12px; border: 1.5px solid var(--accent); border-radius: 50%; }
@media (max-width: 760px) { .lessons { grid-template-columns: 1fr; } }

.disclosure { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: .92rem; }
.disclosure svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }

/* 9 ── Toolbox page ───────────────────────────────────────────────────── */
.tb-hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.page-head--split .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.page-head--split h1 { max-width: 16ch; }
.frame a { display: block; }
@media (max-width: 960px) { .tb-hero, .page-head--split .wrap { grid-template-columns: 1fr; } }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.shots .frame figcaption { color: var(--muted); font-size: .86rem; }
@media (max-width: 960px) { .shots { grid-template-columns: 1fr; } }
.groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 24px; }
.group { border-top: 2px solid var(--ink); padding-top: 14px; }
.group h3 { font-size: 1.02rem; }
.group .muted { font-size: .82rem; margin: 4px 0 0; }
.group ul { list-style: none; margin-top: 12px; }
.group li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
@media (max-width: 1100px) { .groups { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 32px; } }
@media (max-width: 640px) { .groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .groups { grid-template-columns: 1fr; } }

.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.methods div { padding: 18px 0; border-top: 1px solid var(--line); }
.methods h3 { font-size: 1.02rem; margin-bottom: 6px; }
.methods p { color: var(--muted); font-size: .95rem; margin: 0; }
@media (max-width: 760px) { .methods { grid-template-columns: 1fr; } }

.vclass { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 18px; }
.vclass li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); padding: 6px 10px; font-size: .88rem; background: var(--surface); }
.vclass b { font-family: var(--f-mono); font-size: .75rem; color: var(--accent); }

.versions { list-style: none; border-top: 1px solid var(--line-strong); }
.versions li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.versions li:first-child .mono { color: var(--accent); }
.versions .mono { color: var(--ink); padding-top: 3px; }
.versions p { margin: 0; color: var(--muted); font-size: .95rem; }

.demo { border: 1px solid var(--line-strong); background: var(--surface); }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.demo-stage { position: relative; height: min(78vh, 760px); display: grid; place-items: center; text-align: center; padding: 24px; }
.demo-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.demo-stage p { color: var(--muted); max-width: 46ch; margin: 12px auto 20px; }

/* 10 ── CV page ───────────────────────────────────────────────────────── */
.cv-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.cv-doc { max-width: 900px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line-strong); padding: clamp(24px, 5vw, 64px); box-shadow: var(--shadow); }
.cv-doc header { border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.cv-doc h1 { font-size: 2.3rem; letter-spacing: -.02em; }
.cv-title { font: 500 1.1rem/1.3 var(--f-display); color: var(--ink); margin: 4px 0 10px; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; font-size: .92rem; color: var(--muted); }
.cv-contact a { text-decoration: none; }
.cv-doc section { margin-top: 26px; }
.cv-doc h2 { font: 600 .8rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cv-doc h3 { font-size: 1.05rem; }
.cv-item { margin-bottom: 16px; }
.cv-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; }
.cv-row .cv-date { font: 500 .8rem/1.4 var(--f-mono); color: var(--muted); white-space: nowrap; }
.cv-sub { color: var(--ink); font-weight: 600; font-size: .95rem; margin: 2px 0 4px; }
.cv-doc ul { padding-left: 18px; margin: 4px 0 0; }
.cv-doc li { margin: 2px 0; font-size: .95rem; }
.cv-doc p { font-size: .95rem; }
.cv-skills { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; font-size: .95rem; }
.cv-skills dt { color: var(--ink); font-weight: 600; }
.cv-skills dd { margin: 0; color: var(--text); }
@media (max-width: 560px) { .cv-skills { grid-template-columns: 1fr; } .cv-skills dd { margin-bottom: 8px; } }

/* 11 ── Footer ────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px 40px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; margin-bottom: 32px; }
.footer-top p { color: var(--muted); max-width: 44ch; margin-top: 10px; font-size: .95rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 24px; list-style: none; justify-self: end; }
.footer-nav a { text-decoration: none; color: var(--text); font-size: .95rem; }
.footer-nav a:hover { color: var(--accent); }
.titleblock { display: grid; grid-template-columns: 2.2fr repeat(5, 1fr); gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); }
.titleblock div { background: var(--bg); padding: 10px 14px; min-width: 0; }
.titleblock span { display: block; font: 500 .64rem/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.titleblock b { display: block; font: 600 .9rem/1.4 var(--f-mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 18px; font-size: .85rem; color: var(--muted); }
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-nav { justify-self: start; }
  .titleblock { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .titleblock div:first-child { grid-column: 1 / -1; }
}

/* 404 */
.nf { min-height: 60vh; display: grid; align-content: center; }

/* 12 ── Motion ────────────────────────────────────────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
.draw path, .draw line, .draw rect, .draw circle, .draw polyline { stroke-dasharray: var(--len, 1200); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* 13 ── Print (CV and general) ────────────────────────────────────────── */
@page { size: A4; margin: 14mm 15mm 14mm; }
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --bg-2: #fff; --surface: #fff; --ink: #0e1b2e; --text: #222a35; --muted: #4d5866;
    --line: #d5d8dc; --line-strong: #b5bbc2; --accent: #8f4319; color-scheme: light;
  }
  html { font-size: 10.2pt; }
  body { background: #fff; line-height: 1.45; }
  .site-header, .site-footer, .mobile-nav, .skip-link, .no-print, .cv-actions, .page-head { display: none !important; }
  .section { padding: 0 !important; }
  .wrap { padding: 0; max-width: none; }
  .cv-doc { border: 0; box-shadow: none; padding: 0; max-width: none; background: #fff; }
  .cv-doc h1 { font-size: 21pt; }
  .cv-doc section { margin-top: 13px; break-inside: auto; }
  .cv-doc h2 { margin-bottom: 7px; padding-bottom: 5px; break-after: avoid; }
  .cv-item { break-inside: avoid; margin-bottom: 10px; }
  .cv-doc li, .cv-doc p, .cv-skills { font-size: 9.6pt; }
  a { text-decoration: none; color: inherit; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
