/* =============================================================================
   ANGEL — "Lux Aeterna · Catalogue of Light"
   A monochrome catalogue-raisonné aesthetic. The page carries no saturation,
   so every coloured rectangle reads as a WORK, never as UI. The only accent is
   a single filament of warm gold light — the restrained "Angel" motif.

   You normally never need to touch this file. To recolour, edit the variables
   in the :root / [data-theme] blocks below.
   ============================================================================= */

/* ----------------------------------- THEME TOKENS ------------------------- */
:root {
  /* Light (default) — warm paper, never pure white */
  --bg: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #1C1B19;
  --muted: #6B6A64;
  --line: rgba(28, 27, 25, 0.14);
  --accent: #9A7B43;        /* muted antique gold — markers, focus, beam, underlines */
  --accent-strong: #8A6B33; /* hover / pressed */
  --accent-alt: #5B5547;    /* taupe-ink for italic captions / secondary meta */
  --shadow-plate: 0 1px 0 var(--line);

  /* Type */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Spacing scale (8px base) */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 96px; --s7: 128px;

  --maxw: 1140px;
  --reading: 66ch;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --section-gap: clamp(52px, 7vw, 84px);
  --header-h: 60px;

  --beam-w: 120px;
  --t-fast: 120ms; --t: 200ms; --t-slow: 240ms;
}

[data-theme="dark"] {
  --bg: #111110;
  --surface: #1A1A18;
  --ink: #ECEAE3;
  --muted: #A6A49B;
  --line: rgba(236, 234, 227, 0.16);
  --accent: #C2A05A;
  --accent-strong: #D4B570;
  --accent-alt: #C9C3B6;
  --shadow-plate: 0 1px 0 var(--line);
}

/* Follow OS preference only when the visitor hasn't chosen a theme themselves */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #111110; --surface: #1A1A18; --ink: #ECEAE3; --muted: #A6A49B;
    --line: rgba(236, 234, 227, 0.16);
    --accent: #C2A05A; --accent-strong: #D4B570; --accent-alt: #C9C3B6;
  }
}

/* ----------------------------------- RESET / BASE ------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s2)); -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  background: transparent; /* the fixed .site-bg provides the backdrop */
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----------------------------------- HELPERS ------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px;
  transform: translateY(-150%); transition: transform var(--t);
}
.skip-link:focus { transform: translateY(0); }

.wordmark { font-family: var(--serif); font-weight: 500; letter-spacing: 0.02em; }
.eyebrow {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); font-weight: 600;
}

/* The single gold filament — used as the recurring "light" motif */
.rule-light {
  display: block; height: 2px; width: var(--beam-w); margin: var(--s3) 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
}
.rule-light--center { margin-inline: auto; }

/* ----------------------------------- HEADER ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); /* fallback for engines without color-mix() */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { color: var(--accent); display: inline-flex; transition: transform var(--t); }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }
.brand__mark--avatar { width: 34px; height: 34px; }
.brand__mark--avatar img { width: 100%; height: 100%; object-fit: contain; }
.brand__name { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; letter-spacing: 0.06em; }
.brand--footer .brand__name { font-size: 1.6rem; }

.site-nav { margin-left: auto; }
.nav-menu { list-style: none; padding: 0; display: flex; gap: var(--s3); align-items: center; }
.nav-menu a {
  text-decoration: none; font-size: 0.95rem; color: var(--muted);
  padding: 6px 2px; position: relative; transition: color var(--t);
}
.nav-menu a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: var(--accent); transition: right var(--t) ease;
}
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--ink); }
.nav-menu a:hover::after, .nav-menu a[aria-current="true"]::after { right: 0; }
.nav-menu a[aria-current="true"] { color: var(--ink); }

.nav-toggle { display: none; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink); transition: border-color var(--t), transform var(--t-fast);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

/* ----------------------------------- HERO --------------------------------- */
.hero { position: relative; padding-block: clamp(40px, 8vh, 88px); text-align: center; overflow: hidden; }
.hero__rays {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 42%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  opacity: 0.06;
}
.hero__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero__title {
  font-size: clamp(2.75rem, 9vw, 4.75rem); line-height: 1.02; margin-top: var(--s2);
  letter-spacing: 0.14em;
}
/* Brand logo in the hero (chrome render) — entrance, then a gentle float */
.hero__logo {
  width: min(560px, 84vw); height: auto; margin-top: var(--s1);
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.20));
  animation: heroIn 0.9s cubic-bezier(.2,.7,.2,1) both, heroFloat 6s ease-in-out 0.9s infinite;
}
[data-theme="dark"] .hero__logo { filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.55)); }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero__descriptor {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--accent-alt); margin-top: var(--s2); max-width: 30ch;
}
.hero__cue {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--muted); margin-top: var(--s2); transition: color var(--t), gap var(--t);
}
.hero__cue:hover { color: var(--accent-strong); gap: 12px; }
.hero__cue svg { color: var(--accent); }

/* ----------------------------------- SECTIONS ----------------------------- */
.section { padding-block: var(--section-gap); border-top: 1px solid var(--line); }
.section--alt { background: transparent; }
.section__head { max-width: var(--reading); }
.section__head--cv { max-width: none; }
.section__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.08; margin-top: 6px; }
.section__lede { color: var(--muted); margin-top: var(--s2); max-width: var(--reading); }

/* ----------------------------------- CAROUSEL ----------------------------- */
.series-stack { display: flex; flex-direction: column; gap: var(--section-gap); margin-top: var(--s4); }
.series__head { max-width: var(--reading); margin-bottom: var(--s3); }
.series__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 3vw, 2rem); }
.series__blurb { color: var(--muted); font-size: 0.95rem; }

.carousel { position: relative; }
/* Transform-centred track: the active slide is explicitly centred (set via JS),
   so it is correct from first paint — no scroll-position dependency. */
.carousel__viewport { overflow: hidden; width: 100%; }
.carousel__track {
  display: flex; gap: clamp(16px, 4vw, 48px);
  list-style: none; margin: 0; padding-block: var(--s2);
  transition: transform var(--t-slow) cubic-bezier(.22,.61,.36,1); will-change: transform;
}
.slide {
  flex: 0 0 min(680px, 80vw);
  transition: opacity var(--t-slow) ease, filter var(--t-slow) ease;
}
/* neighbours sit "in shadow off the gallery wall" */
.slide[data-active="false"] { opacity: 0.5; filter: saturate(0.55); }
.slide[data-active="true"]  { opacity: 1; filter: none; }

.plate {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); padding: clamp(14px, 2.4vw, 26px);
}
.plate__frame {
  position: relative; overflow: hidden; background: var(--bg);
  aspect-ratio: 4 / 3;
}
.plate__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) ease; }
.plate { transition: transform var(--t) ease, border-color var(--t) ease; }
.slide[data-active="true"] .plate:hover { transform: translateY(-5px); border-color: var(--accent); }
.slide[data-active="true"] .plate:hover .plate__frame img { transform: scale(1.04); }
.plate__btn {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: zoom-in;
}
.plate__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 0.85rem; padding: var(--s3); gap: 6px;
}
.plate__placeholder svg { color: var(--line); width: 40px; height: 40px; }

.plate__caption { margin-top: var(--s2); display: flex; flex-direction: column; gap: 4px; }
.plate__num { font-family: var(--serif); font-style: italic; color: var(--accent-strong); font-size: 0.9rem; }
.plate__title { font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.15; }
.plate__meta { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* the travelling picture-light beam + controls */
.carousel__beam-track { position: relative; height: 2px; margin: var(--s3) auto var(--s2); max-width: min(720px, 78vw); }
.carousel__beam {
  position: absolute; top: 0; left: 0; height: 2px; width: var(--beam-w);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform var(--t-slow) ease;
}
.carousel__controls {
  display: flex; align-items: center; justify-content: center; gap: var(--s3);
  flex-wrap: wrap;
}
.carousel__dots { list-style: none; display: flex; align-items: center; gap: 8px; padding: 0; }
.dot {
  width: 8px; height: 8px; padding: 0; border-radius: 99px;
  background: var(--line); transition: width var(--t), background var(--t);
}
.dot[aria-current="true"] { width: 22px; background: var(--accent); }
.nav-btn {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  transition: border-color var(--t), color var(--t), transform var(--t-fast);
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.nav-btn:active { transform: scale(0.96); }
.nav-btn[disabled] { opacity: 0.35; cursor: default; }
.carousel__counter { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1rem; min-width: 5ch; text-align: center; }

.empty-note {
  border: 1px dashed var(--line); padding: var(--s4); text-align: center; color: var(--muted);
  font-size: 0.9rem;
}

/* ----------------------------------- CV ----------------------------------- */
.cv-actions { margin-top: var(--s3); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 11px 18px; border-radius: 4px; font-size: 0.95rem; font-weight: 500;
  transition: border-color var(--t), background var(--t), color var(--t), transform var(--t-fast);
}
.btn:active { transform: scale(0.98); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn--solid { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn--solid:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.cv { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s5); }
.cv-block__title { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: var(--s3); }
.cv-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.cv-entry {
  display: grid; grid-template-columns: 230px 1fr; gap: var(--s4);
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.cv-entry:first-child { border-top: 0; }
.cv-entry__rail { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-entry__period { display: block; }
.cv-entry__role { font-family: var(--serif); font-style: italic; font-size: 1.25rem; position: relative; display: inline-block; }
.cv-entry__role::after { content: ""; display: block; height: 2px; width: 56px; margin-top: 6px; background: linear-gradient(90deg, var(--accent), transparent); }
.cv-entry__org { color: var(--accent-alt); font-size: 0.95rem; }
.cv-entry__detail { color: var(--muted); margin-top: 6px; max-width: var(--reading); }

.cv-simple { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.cv-simple li { display: grid; grid-template-columns: 80px 1fr; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.cv-simple .yr { font-family: var(--mono); color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.cv-simple .venue { color: var(--muted); font-size: 0.92rem; }

.skill-groups { display: flex; flex-direction: column; gap: var(--s4); }
.skill-group .eyebrow { margin-bottom: var(--s2); display: block; }
.skill-grid { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.skill-logo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 108px; padding: 18px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: transform var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.skill-logo:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--accent-strong); }
.skill-logo__mark { display: inline-flex; height: 34px; align-items: center; }
.skill-logo__mark svg { width: 32px; height: 32px; }
.skill-logo__name { font-size: 0.78rem; color: var(--muted); text-align: center; line-height: 1.25; }
.skill-logo:hover .skill-logo__name { color: var(--ink); }

/* ----------------------------------- ABOUT (portrait + bio in Profile) ---- */
.cv-about { display: grid; grid-template-columns: 180px 1fr; gap: var(--s4); align-items: start; margin-bottom: var(--s5); }
.cv-about--noportrait { grid-template-columns: 1fr; max-width: var(--reading); }
.cv-about__portrait { border: 1px solid var(--line); padding: 8px; background: var(--surface); }
.cv-about__portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.cv-about__bio { font-size: 1.125rem; line-height: 1.75; color: var(--ink); max-width: var(--reading); }
@media (max-width: 640px) { .cv-about { grid-template-columns: 1fr; } .cv-about__portrait { max-width: 200px; } }

/* ----------------------------------- NOSCRIPT ----------------------------- */
.noscript-note { padding-block: var(--s4); }
.noscript-note p { border: 1px solid var(--line); border-radius: 6px; padding: var(--s3); color: var(--muted); max-width: var(--reading); }

/* ----------------------------------- CONTACT ------------------------------ */
.contact { max-width: 760px; }
.contact-form { margin-top: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px;
  transition: border-color var(--t), box-shadow var(--t);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.field input:invalid:not(:placeholder-shown), .field textarea:invalid:not(:placeholder-shown) { border-color: #b4452f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form__foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.contact-form__hint { color: var(--muted); font-size: 0.9rem; }
.contact-form__hint[data-state="ok"] { color: var(--accent-strong); }
.contact-form__hint[data-state="err"] { color: #b4452f; }

.contact-direct { font-style: normal; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: var(--s3); }
.email-link { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; position: relative; }
.email-link::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1.5px; background: var(--accent); transition: right var(--t) ease; }
.email-link:hover::after, .email-link:focus-visible::after { right: 0; }
.contact-phone { font-family: var(--mono); color: var(--muted); }

/* Social/contact icons in the hero, right under the logo */
.hero-social { list-style: none; padding: 0; margin: var(--s3) 0 var(--s2); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
/* icons only — dynamic circular buttons (used in the hero) */
.social-icon-only {
  width: 46px; height: 46px; padding: 0; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
  transition: transform var(--t), border-color var(--t), color var(--t), background var(--t);
}
.social-icon-only svg { width: 20px; height: 20px; }
.social-icon-only:hover, .social-icon-only:focus-visible {
  transform: translateY(-3px) scale(1.06); border-color: var(--accent);
  color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Slim gold scroll-progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width 0.1s linear; pointer-events: none;
}

/* Avatar logo is black line art on transparent — invert it for dark themes so
   the lines read as light. Applies to the header mark and the About portrait. */
[data-theme="dark"] .av-invert { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .av-invert { filter: invert(1); }
}

/* ----------------------------------- FOOTER ------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-top: var(--s6); }
.site-footer__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s5); padding-bottom: var(--s5); }
.site-footer__brand .brand__name { display: inline-block; }
.site-footer__tag { color: var(--muted); font-size: 0.95rem; }
.site-footer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.footer-col .eyebrow { display: block; margin-bottom: var(--s2); }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { text-decoration: none; color: var(--muted); transition: color var(--t); }
.footer-col a:hover { color: var(--ink); }
.footer-social-link { display: inline-flex; align-items: center; gap: 8px; }
.footer-social-link svg { width: 16px; height: 16px; color: var(--accent); }
.site-footer__base {
  display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-block: var(--s3) var(--s4);
}
.colophon { font-size: 0.85rem; color: var(--muted); }
.colophon--muted { font-family: var(--serif); font-style: italic; }

/* ----------------------------------- LIGHTBOX ----------------------------- */
.lightbox {
  width: min(1100px, 92vw); max-height: 92vh; padding: 0; border: none; background: transparent; color: var(--ink);
}
.lightbox::backdrop { background: rgba(0,0,0,0.78); background: color-mix(in srgb, #000 78%, transparent); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.lightbox__fig { background: var(--surface); border: 1px solid var(--line); padding: clamp(12px, 2vw, 22px); }
.lightbox__img { width: 100%; max-height: 78vh; object-fit: contain; background: var(--bg); }
.lightbox__cap { margin-top: var(--s2); font-family: var(--serif); font-style: italic; text-align: center; color: var(--accent-alt); }
.lightbox__close {
  position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox__close:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ----------------------------------- DYNAMIC BACKGROUND ------------------- */
/* A fixed, blurred artwork behind everything that cross-fades between repo
   illustrations as you scroll. A theme-coloured scrim keeps text readable. */
.site-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.site-bg__layer {
  position: absolute; inset: -4%; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.05); filter: blur(3px);
  transition: opacity 1100ms ease; will-change: opacity;
}
.site-bg__layer.is-active { opacity: 1; }
.site-bg__scrim { position: absolute; inset: 0; background: var(--bg); opacity: 0.9; }
[data-theme="dark"] .site-bg__scrim { opacity: 0.8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .site-bg__scrim { opacity: 0.8; }
}

/* ----------------------------------- ENTRANCE MOTION ---------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.reveal.from-left  { transform: translateX(-32px); }
.reveal.from-right { transform: translateX(32px); }
.reveal.pop { transform: scale(.9); transition: opacity .55s ease, transform .55s cubic-bezier(.34,1.45,.5,1); }
.reveal.fade { transform: none; }
.reveal.is-in { opacity: 1; transform: none; }

/* ----------------------------------- RESPONSIVE --------------------------- */
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 0 11px;
  }
  .nav-toggle__bar { height: 2px; width: 100%; background: var(--ink); transition: transform var(--t), opacity var(--t); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .site-nav { margin-left: auto; position: static; }
  .nav-menu {
    position: absolute; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height var(--t-slow) ease;
  }
  .nav-menu.is-open { max-height: 60vh; }
  .nav-menu li { border-top: 1px solid var(--line); }
  .nav-menu a { display: block; padding: 16px var(--gutter); font-size: 1.05rem; }
  .nav-menu a::after { display: none; }

  .cv-entry { grid-template-columns: 1fr; gap: 8px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: var(--s4); }
}

/* ----------------------------------- REDUCED MOTION ----------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .carousel__viewport { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
