/* =============================================================================
   Tahir Hasan — academic portfolio
   Theme: quiet academic-modern. One accent (deep teal), generous whitespace.

   To change the accent colour, edit the two --accent-* palette values below —
   everything else derives from them.
   ============================================================================= */

/* ---- Fonts (self-hosted, latin subsets, ~165 KB total) -------------------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

/* ---- Design tokens --------------------------------------------------------- */
:root {
  /* palette — accent pair (light theme / dark theme) */
  --accent-on-light: #0c6b64;   /* deep teal */
  --accent-on-dark:  #4cc8bb;

  /* light theme mapping */
  --bg:        #fbfbf9;
  --bg-2:      #f2f2ee;
  --text:      #20262b;
  --muted:     #586470;
  --line:      #e2e4df;
  --accent:    var(--accent-on-light);
  --accent-tint: rgba(12, 107, 100, 0.07);
  --amber:     #8a5a06;
  --amber-tint: rgba(180, 124, 20, 0.12);
  --shadow:    0 1px 3px rgba(25, 35, 35, 0.07);

  /* code tokens (light) */
  --code-kw:  #7c3aed; --code-str: #0c6b64; --code-num: #b45309;
  --code-com: #6b7480; --code-fn:  #1d4ed8;

  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono:  ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  color-scheme: light;
}

/* dark theme mapping — duplicated below for prefers-color-scheme auto-detect */
:root[data-theme="dark"] {
  --bg:        #14181d;
  --bg-2:      #1c2229;
  --text:      #e7eaec;
  --muted:     #9aa6ae;
  --line:      #2b333b;
  --accent:    var(--accent-on-dark);
  --accent-tint: rgba(76, 200, 187, 0.10);
  --amber:     #ddb15f;
  --amber-tint: rgba(221, 177, 95, 0.12);
  --shadow:    0 1px 3px rgba(0, 0, 0, 0.35);
  --code-kw:  #c4b5fd; --code-str: #7dd3c8; --code-num: #fbbf24;
  --code-com: #828f99; --code-fn:  #93c5fd;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #14181d;
    --bg-2:      #1c2229;
    --text:      #e7eaec;
    --muted:     #9aa6ae;
    --line:      #2b333b;
    --accent:    var(--accent-on-dark);
    --accent-tint: rgba(76, 200, 187, 0.10);
    --amber:     #ddb15f;
    --amber-tint: rgba(221, 177, 95, 0.12);
    --shadow:    0 1px 3px rgba(0, 0, 0, 0.35);
    --code-kw:  #c4b5fd; --code-str: #7dd3c8; --code-num: #fbbf24;
    --code-com: #828f99; --code-fn:  #93c5fd;
    color-scheme: dark;
  }
}

/* theme-toggle icon visibility mirrors the mapping above */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-sans);
  font-feature-settings: "cv05", "cv11";
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 71rem; margin-inline: auto; padding-inline: 1.25rem; }

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; margin: 0 0 0.5rem; text-wrap: balance; }
h1 { font-size: clamp(1.65rem, 1.2rem + 2.2vw, 2.15rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem;  font-weight: 700; margin-top: 2.75rem; }
h3 { font-size: 1.12rem; font-weight: 600; margin-top: 1.75rem; }
p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
img { max-width: 100%; height: auto; }
strong { font-weight: 600; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero-demo-link { margin-top: 0.85rem; font-size: 0.92rem; }
.eyebrow { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 0.3rem; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--accent); color: var(--bg); padding: 0.5rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- Header ----------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-row {
  display: flex; align-items: center; gap: 0.6rem 1.5rem; flex-wrap: wrap;
  padding-block: 0.85rem;
}
.brand {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.18rem;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.2rem; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  padding: 0.25rem 0.55rem; border-radius: 7px;
}
.site-nav a:hover { color: var(--text); background: var(--bg-2); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme-toggle {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.icon { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: none; }
.theme-toggle .icon { width: 1.1rem; height: 1.1rem; vertical-align: 0; }

main { padding-block: 2.25rem 3rem; }

/* ---- Buttons, badges, tags --------------------------------------------------- */
.btn-row, .iconrow { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.32rem 0.72rem; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); background: var(--bg); text-decoration: none;
  font-size: 0.875rem; font-weight: 500; line-height: 1.4; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn--primary:hover { color: var(--bg); filter: brightness(1.08); background: var(--accent); }

.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  vertical-align: middle;
}
.badge--venue  { background: var(--accent-tint); color: var(--accent); }
.badge--review { background: var(--amber-tint); color: var(--amber); }
.badge--prep   { border: 1px dashed var(--line); color: var(--muted); }

.tags-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0 0; }
.tag {
  font-size: 0.72rem; font-weight: 500; color: var(--muted);
  background: var(--bg-2); border-radius: 5px; padding: 0.08rem 0.45rem;
}

/* ---- Home: hero -------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 1.4rem 2.6rem; align-items: start; }
.hero h1 { margin-bottom: 0.2rem; }
.hero .identity { color: var(--muted); font-weight: 500; margin-bottom: 1rem; }
.hero-photo {
  width: 158px; aspect-ratio: 1; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero .positioning { max-width: 58ch; }

.hero-flourish { max-width: 54rem; margin: 2.4rem auto 0.4rem; color: var(--line); }
.hero-flourish svg { width: 100%; height: auto; display: block; }
.flow-path { stroke-dasharray: 6 7; animation: flow 26s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -520; } }

/* ---- Home: highlights, news, two-column body ---------------------------------- */
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 0 4rem; align-items: start; }
.home-side .news-list li { grid-template-columns: 4.4rem 1fr; gap: 0.6rem; font-size: 0.92rem; }
.home-main .pgrid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.9rem; margin-top: 1.1rem; }
.hl-card {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; background: var(--bg);
}
.hl-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.hl-card .hl-num { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 700; display: block; margin-bottom: 0.25rem; }
.hl-card p { font-size: 0.88rem; color: var(--muted); margin: 0; }
.hl-card a { color: inherit; text-decoration: none; }
.hl-card a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }

.news-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.news-list li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 1rem; padding: 0.32rem 0; }
.news-list time { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; padding-top: 0.1rem; }

.section-head { display: flex; align-items: baseline; gap: 1rem; justify-content: space-between; margin-top: 2.75rem; }
.section-head h2 { margin: 0; }
.section-head .see-all { font-size: 0.9rem; white-space: nowrap; }

/* ---- Publications ------------------------------------------------------------ */
.pub {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.15rem;
  padding: 1.4rem 0; border-bottom: 1px solid var(--line);
  max-width: 62rem;
}
.pub__body { max-width: 47rem; }
.pub:last-of-type { border-bottom: 0; }
.pub__thumb img {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2);
  display: block;
}
.pub__title { font-family: var(--font-sans); font-size: 1.02rem; font-weight: 600; line-height: 1.45; margin: 0 0 0.25rem; }
.pub__authors { font-size: 0.92rem; margin: 0 0 0.35rem; color: var(--muted); }
.pub__authors strong { color: var(--text); }
.pub__meta { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.35rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pub__venue { font-style: italic; }
.pub__summary { font-size: 0.93rem; color: var(--muted); margin: 0; max-width: 58ch; }
.pub--prep { opacity: 0.85; }
.pub--review .pub__thumb, .pub--prep .pub__thumb { opacity: 0.9; }

.bibtex { margin-top: 0.7rem; font-size: 0.9rem; }
.bibtex summary { cursor: pointer; color: var(--accent); font-weight: 500; width: fit-content; }
.codebox { position: relative; margin-top: 0.5rem; }
.codebox pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.85rem 1rem; overflow-x: auto; font: 0.78rem/1.55 var(--font-mono); margin: 0;
}
.copy-btn {
  position: absolute; top: 0.45rem; right: 0.45rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  font: 500 0.75rem var(--font-sans); color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.2rem 0.5rem; cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn .ic-check { display: none; color: var(--accent); }
.copy-btn.copied .ic-check { display: block; }
.copy-btn.copied .ic-copy { display: none; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ---- Project cards ------------------------------------------------------------ */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1rem; margin-top: 1.1rem; }
.pcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.pcard:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pcard__imglink { display: block; }
.pcard__imglink img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.pcard__body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.pcard__title { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.4; }
.pcard__title a { color: var(--text); text-decoration: none; }
.pcard__title a:hover { color: var(--accent); }
.pcard__summary { font-size: 0.88rem; color: var(--muted); margin: 0; flex: 1; }
.pcard__links { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; font-weight: 500; margin: 0.2rem 0 0; }
.pcard__links a { text-decoration: none; }
.pcard__links a:hover { text-decoration: underline; }

/* ---- Stats row (dataset hero) --------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.9rem; margin: 1.4rem 0; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.stat__num { display: block; font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat__label { font-size: 0.82rem; color: var(--muted); }

/* ---- Placeholder slots & TODO marks ---------------------------------------------- */
.slot {
  aspect-ratio: 16 / 9; border: 1.5px dashed var(--line); border-radius: 10px;
  display: grid; place-content: center; text-align: center; gap: 0.2rem;
  color: var(--muted); font-size: 0.85rem; padding: 1rem; background: var(--bg);
}
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.9rem; margin: 1.1rem 0; }
.slot-grid .slot { aspect-ratio: 4 / 3; }
mark.todo {
  background: var(--amber-tint); color: var(--amber); border-radius: 4px;
  padding: 0 0.3rem; font-size: 0.92em;
}

/* ---- Embeds (click-to-load iframes) ----------------------------------------------- */
.embed {
  position: relative; aspect-ratio: var(--aspect, 16 / 9); margin: 1.2rem 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); overflow: hidden;
}
.embed__cover { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0.5rem; padding: 1.2rem; }
.embed__cover--todo { border: none; color: var(--muted); }
.embed__cover--todo p { margin: 0; }
.embed__load { justify-self: center; }
.embed__load { display: inline-flex; align-items: center; gap: 0.5rem; font: 600 0.95rem var(--font-sans); color: var(--bg); background: var(--accent); border: 0; border-radius: 9px; padding: 0.55rem 1rem; cursor: pointer; }
.embed__load:hover { filter: brightness(1.08); }
.embed__note { font-size: 0.8rem; color: var(--muted); margin: 0; max-width: 38ch; justify-self: center; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Results tables ----------------------------------------------------------------- */
.results { margin: 1.4rem 0; overflow-x: auto; }
.results table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.results caption { caption-side: top; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--muted); padding-bottom: 0.5rem; }
.results th, .results td { padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--line); text-align: left; }
.results thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.results tbody th { font-weight: 500; }
.results td { text-align: right; font-variant-numeric: tabular-nums; }
.results .best { font-weight: 700; color: var(--accent); }
.results figcaption { font-size: 0.8rem; color: var(--muted); padding-top: 0.5rem; }

/* ---- Page width tiers -------------------------------------------------------------------
   .prose            → centred reading column (posts, write-ups, about, blog index)
   .prose--wide      → full-width desktop pages (projects, publications, dataset, CV);
                       bare text blocks inside stay capped at a readable measure. */
.page-header { margin-bottom: 1.6rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.prose { max-width: 49rem; margin-inline: auto; }
.prose--wide { max-width: none; margin-inline: 0; }
.prose--wide > p, .prose--wide > ul, .prose--wide > ol,
.prose--wide section > p, .prose--wide section > ul, .prose--wide section > ol { max-width: 72ch; }
.prose--wide .results { max-width: 58rem; }
.prose--wide .bibtex { max-width: 58rem; }
.prose--wide .slot-grid { grid-template-columns: repeat(3, 1fr); max-width: 58rem; }
.prose h2 { padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
.prose figure { margin: 1.4rem 0; }
.prose figure img { border: 1px solid var(--line); border-radius: 10px; display: block; }
.prose figcaption { font-size: 0.82rem; color: var(--muted); padding-top: 0.45rem; }
.prose blockquote { margin: 1.2rem 0; padding: 0.1rem 0 0.1rem 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 8px; background: var(--bg-2); padding: 0.7rem 1rem; font-size: 0.92rem; margin: 0 0 1.4rem; }
.post-nav { margin-top: 2.6rem; font-size: 0.92rem; }

code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-2); border-radius: 4px; padding: 0.1em 0.35em; }
pre code { background: none; padding: 0; font-size: inherit; }
div.highlighter-rouge { margin: 1.2rem 0; }
.highlight pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.9rem 1.1rem; overflow-x: auto; font: 0.82rem/1.6 var(--font-mono); margin: 0;
}
/* rouge tokens */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .ow { color: var(--code-kw); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se { color: var(--code-str); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh { color: var(--code-num); }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp { color: var(--code-com); font-style: italic; }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nd { color: var(--code-fn); }

/* ---- Blog index --------------------------------------------------------------------------- */
.post-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.post-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 0; }
.post-list h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; margin: 0 0 0.15rem; }
.post-list h3 a { text-decoration: none; color: var(--text); }
.post-list h3 a:hover { color: var(--accent); }
.post-list .post-meta { font-size: 0.84rem; margin-bottom: 0.15rem; }
.post-list p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---- CV ------------------------------------------------------------------------------------ */
.cv-section { margin-top: 2.4rem; }
.cv-item { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1.4rem; margin-bottom: 1.3rem; max-width: 62rem; }
.cv-item ul { max-width: 75ch; }
.prose--wide .cv-skills { display: grid; grid-template-columns: 15rem minmax(0, 1fr); column-gap: 2.5rem; max-width: 62rem; align-items: baseline; }
.prose--wide .cv-skills dd { margin-top: 0.7rem; }
.cv-item__head { font-weight: 600; }
.cv-item__org { color: var(--muted); font-size: 0.95rem; grid-column: 1; }
.cv-item__dates { color: var(--muted); font-size: 0.88rem; text-align: right; white-space: nowrap; grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; }
.cv-item ul { grid-column: 1 / -1; margin: 0.35rem 0 0; font-size: 0.95rem; }
.cv-item li { margin-bottom: 0.2rem; }
.cv-skills dt { font-weight: 600; font-size: 0.95rem; margin-top: 0.7rem; }
.cv-skills dd { margin: 0.1rem 0 0; font-size: 0.95rem; color: var(--muted); }

/* ---- BdSL live demo -------------------------------------------------------------------------- */
.live-demo { margin: 1.4rem 0; }
.live-demo__stage { position: relative; aspect-ratio: 4 / 3; max-width: 560px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); display: none; }
.live-demo.running .live-demo__stage { display: block; }
.live-demo video, .live-demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.live-demo__status { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.live-demo__fps { position: absolute; top: 0.5rem; right: 0.6rem; font: 600 0.75rem var(--font-mono); color: #fff; background: rgba(0,0,0,0.55); border-radius: 5px; padding: 0.1rem 0.4rem; z-index: 2; }

/* ---- Footer ------------------------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); margin-top: 1rem; }
.site-footer .wrap { padding-block: 1.4rem 2rem; font-size: 0.85rem; color: var(--muted); }
.site-footer p { margin: 0 0 0.3rem; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--accent); }

/* ---- Responsive ---------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .home-cols { grid-template-columns: 1fr; gap: 0; }
  .home-side { order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-nav { order: 3; flex-basis: 100%; }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { width: 104px; border-radius: 13px; order: -1; }
  .pub { grid-template-columns: 1fr; gap: 0.7rem; }
  .pub__thumb { max-width: 13rem; }
  .news-list li { grid-template-columns: 4.6rem 1fr; gap: 0.7rem; }
  .stat__num { font-size: 1.4rem; }
  .cv-item { grid-template-columns: 1fr; }
  .cv-item__dates { text-align: left; grid-row: auto; grid-column: 1; }
  .prose--wide .cv-skills { display: block; }
  .prose--wide .slot-grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
  main { padding-block: 1.6rem 2.2rem; }
}

/* ---- Print (CV page prints clean) ------------------------------------------------------------------ */
@media print {
  .site-header, .site-footer, .btn-row, .iconrow, .skip-link, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  main { padding: 0; }
}

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