/* ==========================================================================
   Safiul Azam — Portfolio
   Design system + components. Plain CSS, custom properties, no framework.

   Contents
   01. Tokens (light)
   02. Tokens (dark)
   03. Reset & base
   04. Typography
   05. Layout: container, shell, sections
   06. Header & navigation
   07. Right section rail
   08. Profile card
   09. Buttons
   10. Cards, pills, badges, tags
   11. Hero
   12. KPI band & stat tiles
   13. Charts (SVG chrome, legend, tooltip)
   14. Skills
   15. Projects
   16. Timeline
   17. Certificates coverflow + lightbox
   18. Case study (doc) pages
   19. Contact & forms
   20. Footer
   21. Motion, reveal, reduced-motion
   22. Print
   ========================================================================== */

/* 01. Tokens (light) ------------------------------------------------------ */
:root {
  color-scheme: light;

  /* Brand — matched to the CV so one identity carries across both */
  --navy:        #16324F;
  --navy-deep:   #0E2237;
  --navy-mid:    #1E4470;
  --bronze:      #8C5E10;   /* 5.64:1 on white — AA for text */
  --bronze-soft: #B8862A;   /* dark backgrounds + chart fills only */
  --blue:        #2E74B5;

  /* Surfaces */
  --page:          #F4F6F9;
  --surface:       #FFFFFF;
  --surface-2:     #EDF1F6;
  --surface-sunken:#E6ECF3;
  --line:          #DCE3EB;
  --line-strong:   #C3CEDB;

  /* Ink */
  --ink:      #14202E;
  --ink-2:    #46586E;
  --ink-3:    #6B7C91;
  --on-dark:  #FFFFFF;
  --on-dark-2:#B9C8D9;

  /* Data-viz categorical — validated: lightness band, chroma floor,
     CVD separation, normal-vision floor and 3:1 contrast on #FFFFFF.
     Assign in fixed slot order; never cycle, never reassign by rank. */
  --viz-1: #2E74B5;  /* blue   — brand */
  --viz-2: #C2570C;  /* orange */
  --viz-3: #0F9A80;  /* teal   */
  --viz-4: #B8862A;  /* bronze — brand */
  --viz-5: #8A4FBF;  /* violet */
  --viz-6: #C0356B;  /* rose   */

  /* Sequential ramp — one hue, light to dark (magnitude only) */
  --seq-1: #D9E7F4;
  --seq-2: #B3CFE9;
  --seq-3: #8DB7DE;
  --seq-4: #5E97CB;
  --seq-5: #2E74B5;
  --seq-6: #235A8D;
  --seq-7: #16324F;

  /* Chart chrome */
  --viz-surface: #FFFFFF;
  --viz-grid:    #E6EBF1;
  --viz-axis:    #C3CEDB;
  --viz-ink:     #46586E;

  /* Status — reserved. Never reused as a series colour.
     Always shipped with an icon or label, never colour alone. */
  --good: #0F7A3D;
  --warn: #B45309;
  --crit: #B3261E;

  /* Type */
  --font-display: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;

  /* Spacing — 8px scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* Radii */
  --r-xs: 4px; --r-sm: 6px; --r: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;

  /* Elevation — subtle only */
  --shadow-1: 0 1px 2px rgba(22,50,79,.06);
  --shadow-2: 0 1px 2px rgba(22,50,79,.06), 0 8px 24px rgba(22,50,79,.08);
  --shadow-3: 0 2px 4px rgba(22,50,79,.08), 0 18px 48px rgba(22,50,79,.14);

  /* Motion */
  --ease:     cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-1: .18s; --dur-2: .32s; --dur-3: .6s; --dur-4: 1.1s;

  /* Layout */
  --container: 1240px;
  --rail-w: 60px;
  --aside-w: 300px;
  --header-h: 68px;
}

/* 02. Tokens (dark) ------------------------------------------------------- */
/* Dark is a *selected* theme, not an inverted one: each viz step was
   re-chosen for the dark band and re-validated against --viz-surface.
   Declared under both scopes so the toggle beats the OS setting either way. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { color-scheme: dark;
    --page:           #071320;
    --surface:        #12283D;
    --surface-2:      #17334C;
    --surface-sunken: #0C1E30;
    --line:           #24405C;
    --line-strong:    #33536F;
    --ink:      #EAF1F8;
    --ink-2:    #AABFD4;
    --ink-3:    #7F94AC;
    --navy:     #E7EEF6;
    --bronze:   #D8A63F;
    --blue:     #6FA8DC;
    --viz-1: #4A8BCC; --viz-2: #D9691F; --viz-3: #16A98B;
    --viz-4: #B8862A; --viz-5: #8A5FD6; --viz-6: #DB4A72;
    --seq-1: #17334C; --seq-2: #1D4569; --seq-3: #235A8D;
    --seq-4: #2E74B5; --seq-5: #4A8BCC; --seq-6: #7FB0DC; --seq-7: #B7D3EE;
    --viz-surface: #12283D;
    --viz-grid:    #1E3A55;
    --viz-axis:    #2E4C6A;
    --viz-ink:     #AABFD4;
    --good: #3BB56B; --warn: #E0A030; --crit: #E8615A;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.42);
    --shadow-3: 0 2px 4px rgba(0,0,0,.5), 0 18px 48px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] { color-scheme: dark;
  --page:           #071320;
  --surface:        #12283D;
  --surface-2:      #17334C;
  --surface-sunken: #0C1E30;
  --line:           #24405C;
  --line-strong:    #33536F;
  --ink:      #EAF1F8;
  --ink-2:    #AABFD4;
  --ink-3:    #7F94AC;
  --navy:     #E7EEF6;
  --bronze:   #D8A63F;
  --blue:     #6FA8DC;
  --viz-1: #4A8BCC; --viz-2: #D9691F; --viz-3: #16A98B;
  --viz-4: #B8862A; --viz-5: #8A5FD6; --viz-6: #DB4A72;
  --seq-1: #17334C; --seq-2: #1D4569; --seq-3: #235A8D;
  --seq-4: #2E74B5; --seq-5: #4A8BCC; --seq-6: #7FB0DC; --seq-7: #B7D3EE;
  --viz-surface: #12283D;
  --viz-grid:    #1E3A55;
  --viz-axis:    #2E4C6A;
  --viz-ink:     #AABFD4;
  --good: #3BB56B; --warn: #E0A030; --crit: #E8615A;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.42);
  --shadow-3: 0 2px 4px rgba(0,0,0,.5), 0 18px 48px rgba(0,0,0,.55);
}

/* 03. Reset & base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--bronze); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--bronze); color: #fff; }

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 999;
  background: var(--navy); color: #fff; padding: var(--s-3) var(--s-5);
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

.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;
}

/* 04. Typography ---------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.18; color: var(--ink); }

h1 { font-size: clamp(2.15rem, 1.35rem + 3.2vw, 3.5rem); font-weight: 700; letter-spacing: -.028em; }
h2 { font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.3rem);  font-weight: 700; letter-spacing: -.022em; }
h3 { font-size: clamp(1.15rem, 1.02rem + .5vw, 1.35rem); font-weight: 650; letter-spacing: -.012em; }
h4 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.008em; }

p { text-wrap: pretty; }
.lede  { font-size: clamp(1.05rem, .99rem + .3vw, 1.2rem); color: var(--ink-2); max-width: 68ch; }
.prose { max-width: 68ch; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: var(--s-4); }
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); }
.prose ul { display: grid; gap: var(--s-2); }
.prose ul li { position: relative; padding-left: var(--s-5); color: var(--ink-2); }
.prose ul li::before {
  content: ""; position: absolute; left: 2px; top: .68em;
  width: 6px; height: 6px; border-radius: 2px; background: var(--bronze);
}
.prose strong { color: var(--ink); font-weight: 650; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--bronze);
  display: flex; align-items: center; gap: var(--s-3);
}
.eyebrow::before {
  content: ""; width: 24px; height: 2px; border-radius: 2px;
  background: var(--bronze); flex: none;
}
.muted   { color: var(--ink-3); }
.small   { font-size: .875rem; }
.mono    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num     { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; }

/* 05. Layout -------------------------------------------------------------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: var(--s-5);
}
@media (max-width: 600px) { .container { padding-inline: var(--s-4); } }

.section { padding-block: clamp(var(--s-7), 5vw, var(--s-9)); position: relative; }
.section--tight { padding-block: var(--s-7); }
.section-head { margin-bottom: var(--s-6); display: grid; gap: var(--s-3); }
.section-head .lede { margin-top: calc(var(--s-1) * -1); }
.section--alt { background: var(--surface-2); }

.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.rule { height: 1px; background: var(--line); border: 0; margin-block: var(--s-6); }

/* Home shell: sticky profile aside + main column */
.shell { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 1100px) {
  .shell { grid-template-columns: var(--aside-w) minmax(0, 1fr); gap: var(--s-7); }
  .shell__aside { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}

/* 06. Header & navigation ------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
.header.is-stuck { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; gap: var(--s-5); width: 100%; }

.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--ink); flex: none; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--navy-mid), var(--navy-deep));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  letter-spacing: -.02em; box-shadow: var(--shadow-1);
}
:root[data-theme="dark"] .brand__mark { background: linear-gradient(140deg, #2b5c8e, #16324F); }
.brand__text { display: grid; line-height: 1.25; }
.brand__name { font-family: var(--font-display); font-weight: 650; font-size: .96rem; letter-spacing: -.015em; }
.brand__role { font-size: .72rem; color: var(--ink-3); letter-spacing: .01em; }
@media (max-width: 520px) { .brand__text { display: none; } }

.nav { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.nav__link {
  position: relative; padding: var(--s-2) var(--s-3);
  font-size: .9rem; font-weight: 500; color: var(--ink-2);
  text-decoration: none; border-radius: var(--r-sm);
  transition: color var(--dur-1) var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--bronze);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-2) var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .nav { display: none; } }

.header__actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
@media (min-width: 901px) { .header__actions { margin-left: var(--s-4); } }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface);
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-sun  { display: block; }
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-moon { display: none; }
}

.burger { display: none; }
@media (max-width: 900px) { .burger { display: grid; } }

/* Mobile slide-in panel */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90;
  visibility: hidden; pointer-events: none;
}
.mobile-nav.is-open { visibility: visible; pointer-events: auto; }
.mobile-nav__scrim {
  position: absolute; inset: 0; background: rgba(8,20,33,.5);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
  backdrop-filter: blur(2px);
}
.mobile-nav.is-open .mobile-nav__scrim { opacity: 1; }
.mobile-nav__panel {
  position: absolute; inset-block: 0; right: 0; width: min(320px, 86vw);
  background: var(--surface); border-left: 1px solid var(--line);
  padding: var(--s-5); display: grid; gap: var(--s-2);
  align-content: start; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--dur-3) var(--ease-out);
  box-shadow: var(--shadow-3);
}
.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.mobile-nav__link {
  padding: var(--s-3) var(--s-3); border-radius: var(--r-sm);
  font-weight: 550; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-nav__link:hover { background: var(--surface-2); }

/* 07. Right section rail -------------------------------------------------- */
.rail {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 50; display: none; flex-direction: column; gap: 6px;
  padding: var(--s-2) 6px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
@media (min-width: 1360px) { .rail { display: flex; } }
.rail__btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
  transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.rail__btn svg { width: 17px; height: 17px; }
.rail__btn:hover { color: var(--ink); background: var(--surface-2); }
.rail__btn.is-active { color: #fff; background: var(--navy-mid); }
:root[data-theme="dark"] .rail__btn.is-active { background: var(--blue); color: var(--navy-deep); }
.rail__btn::after {
  content: attr(data-label);
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--navy-deep); color: #fff; font-size: .74rem; font-weight: 550;
  padding: 5px 10px; border-radius: var(--r-sm); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.rail__btn:hover::after, .rail__btn:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* 08. Profile card -------------------------------------------------------- */
.profile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
  box-shadow: var(--shadow-2); display: grid; gap: var(--s-4);
  position: relative; overflow: hidden;
}
.profile::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--viz-1), var(--viz-4) 45%, var(--viz-2));
}
.profile__photo {
  width: 108px; height: 108px; border-radius: 50%; margin-inline: auto;
  object-fit: cover; border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-2);
}
.profile__id { text-align: center; display: grid; gap: 2px; }
.profile__name { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.profile__title { font-size: .85rem; color: var(--ink-2); line-height: 1.45; }
.profile__socials { display: flex; justify-content: center; gap: var(--s-2); }
.profile__facts { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.profile__fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  background: var(--surface); padding: var(--s-3) var(--s-3);
  font-size: .82rem;
}
.profile__fact dt { color: var(--ink-3); flex: none; }
.profile__fact dd { color: var(--ink); font-weight: 550; text-align: right; }

/* 09. Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 11px 20px; border-radius: var(--r-sm);
  font-size: .92rem; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; border: 1px solid transparent;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--bronze); color: #fff; box-shadow: var(--shadow-1); }
.btn--primary:hover { background: #7a5210; box-shadow: var(--shadow-2); }
:root[data-theme="dark"] .btn--primary { background: var(--bronze-soft); color: #16324F; }
:root[data-theme="dark"] .btn--primary:hover { background: #cf9a30; }

.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink-2); background: var(--surface); }

.btn--navy { background: var(--navy-mid); color: #fff; }
.btn--navy:hover { background: var(--navy-deep); }
:root[data-theme="dark"] .btn--navy { background: var(--blue); color: var(--navy-deep); }

.btn--ghost { color: var(--ink-2); padding-inline: var(--s-3); }
.btn--ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: .85rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: .9rem; color: var(--blue); text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--dur-1) var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* 10. Cards, pills, badges, tags ------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}
.card--hover:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.card--flush { padding: 0; overflow: hidden; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-pill);
  font-size: .79rem; font-weight: 500; line-height: 1.4;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill-set { display: flex; flex-wrap: wrap; gap: 6px; }
.pill--done {
  margin-top: var(--s-2);
  color: var(--good); font-weight: 600;
  background: color-mix(in srgb, var(--good) 10%, transparent);
  border-color: color-mix(in srgb, var(--good) 30%, transparent);
}

.tag {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
}

/* Illustrative-rebuild badge — required on every synthetic visual (spec §0) */
.mock-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 6px;
  max-width: calc(100% - 20px);          /* must never widen its container */
  padding: 5px 10px; border-radius: var(--r-xs);
  background: rgba(14,34,55,.88); color: #fff;
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500;
  line-height: 1.35; letter-spacing: .05em; text-transform: uppercase;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.18);
}
/* Two classes (0,2,0) so no container's `X svg { width: 100% }` can ever
   outrank it — this badge is a data-protection requirement, not decoration. */
.mock-badge .mock-badge__i { width: 12px; height: 12px; opacity: .85; flex: none; }

/* Inside a chart card the badge sits in the flow, so a wrapped label can
   never overlap the chart title. */
.viz > .mock-badge {
  position: static; justify-self: start; max-width: 100%;
  margin-bottom: calc(var(--s-2) * -1);
}

.notice {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4) var(--s-5); border-radius: var(--r);
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent);
  border-left: 3px solid var(--blue);
  font-size: .9rem; color: var(--ink-2);
}
.notice svg { width: 18px; height: 18px; color: var(--blue); flex: none; margin-top: 2px; }
.notice strong { color: var(--ink); }

/* 11. Hero ---------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(var(--s-7), 6vw, var(--s-9)) var(--s-8); overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: .55; mask-image: radial-gradient(120% 80% at 50% 25%, #000 35%, transparent 78%);
}
:root[data-theme="dark"] .hero__bg { opacity: .8; }
.hero__grid { display: grid; gap: var(--s-7); align-items: center; position: relative; z-index: 1; }
@media (min-width: 980px) { .hero__grid { grid-template-columns: 1.08fr .92fr; gap: var(--s-8); } }

.hero__copy { display: grid; gap: var(--s-5); }
.hero h1 { max-width: 15ch; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--bronze), var(--bronze-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="dark"] .hero h1 .accent {
  background: linear-gradient(100deg, #D8A63F, #EDC475);
  -webkit-background-clip: text; background-clip: text;
}
.hero__proof { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; }
.hero__proof-item { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--ink-2); }
.hero__proof-item svg { width: 15px; height: 15px; color: var(--good); flex: none; }

/* Portrait with floating BI tiles */
.hero__visual { position: relative; }
.hero__portrait {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-3);
  aspect-ratio: 4 / 3.4; background: var(--navy-deep);
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.hero__portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(190deg, transparent 45%, rgba(9,20,32,.55));
}
.hero__tile {
  position: absolute; z-index: 2;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-3) var(--s-4); box-shadow: var(--shadow-3);
  display: grid; gap: 3px; min-width: 148px;
}
.hero__tile-label {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.hero__tile-value { font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; letter-spacing: -.03em; }
.hero__tile--a { left: -22px;  top: 16%;  animation: floatY 7s var(--ease) infinite; }
.hero__tile--b { right: -18px; top: 46%;  animation: floatY 8.4s var(--ease) infinite .9s; }
.hero__tile--c { left: 6%;     bottom: -20px; animation: floatY 9s var(--ease) infinite .4s; min-width: 190px; }
@media (max-width: 560px) {
  .hero__tile--a { left: -8px; }
  .hero__tile--b { right: -6px; }
  .hero__tile { min-width: 120px; padding: var(--s-2) var(--s-3); }
  .hero__tile-value { font-size: 1.08rem; }
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.scroll-cue {
  display: flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-top: var(--s-6);
}
.scroll-cue__line { width: 42px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.scroll-cue__line::after {
  content: ""; position: absolute; inset-block: 0; left: 0; width: 14px;
  background: var(--bronze); animation: cueSlide 2.2s var(--ease) infinite;
}
@keyframes cueSlide { 0% { transform: translateX(-14px); } 100% { transform: translateX(42px); } }

/* 12. KPI band & stat tiles ----------------------------------------------- */
.kpi-band {
  background: linear-gradient(150deg, var(--navy-deep), #16324F 55%, #1b3d61);
  color: #fff; position: relative; overflow: hidden;
}
.kpi-band::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 52px 52px; mask-image: radial-gradient(90% 120% at 30% 0%, #000, transparent 72%);
  transform: translate3d(0, var(--grid-shift, 0px), 0);
}
.kpi-band > * { position: relative; }
.kpi-band h2, .kpi-band .lede { color: #fff; }
.kpi-band .lede { color: var(--on-dark-2); }
.kpi-band .eyebrow { color: var(--bronze-soft); }
.kpi-band .eyebrow::before { background: var(--bronze-soft); }

.kpi-grid {
  display: grid; gap: 1px; margin-top: var(--s-6);
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.11);
  border-radius: var(--r-md); overflow: hidden;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 460px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi {
  background: rgba(11,26,42,.55); padding: var(--s-5);
  display: grid; gap: 4px; align-content: start;
  transition: background-color var(--dur-2) var(--ease);
}
.kpi:hover { background: rgba(11,26,42,.25); }
.kpi__value {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.4rem);
  letter-spacing: -.035em; color: var(--bronze-soft); line-height: 1.1;
}
.kpi__label { font-size: .84rem; color: var(--on-dark-2); line-height: 1.45; }

/* Stat tile — light context */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s-4);
  display: grid; gap: 3px; position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; inset-block: 0; width: 3px;
  background: var(--accent, var(--viz-1));
}
.stat__value { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.03em; }
.stat__label { font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.stat__delta { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; }
.stat__delta svg { width: 13px; height: 13px; }
.stat__delta--good { color: var(--good); }

/* 13. Charts -------------------------------------------------------------- */
.viz {
  background: var(--viz-surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
  display: grid; gap: var(--s-4); position: relative;
}
.viz--flush { padding: var(--s-4); }
.viz__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.viz__title { font-family: var(--font-display); font-size: .98rem; font-weight: 650; letter-spacing: -.012em; }
.viz__sub { font-size: .8rem; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.viz__body { position: relative; min-height: 40px; }
/* Scoped to the plot only — a bare `.viz svg` also caught the badge icon. */
.viz__body > svg { width: 100%; height: auto; overflow: visible; }

.viz-grid-line { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis-line { stroke: var(--viz-axis); stroke-width: 1; }
.viz-label {
  fill: var(--viz-ink); font-family: var(--font-body); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.viz-label--axis { fill: var(--ink-3); font-size: 10.5px; }
.viz-label--value { fill: var(--ink); font-weight: 600; font-size: 11.5px; }
.viz-label--strong { fill: var(--ink); font-weight: 650; font-size: 12px; }

/* Legend — always present for 2+ series; identity never colour-alone */
.viz-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.viz-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink-2); }
.viz-legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.viz-legend__swatch--line { height: 3px; border-radius: 2px; width: 15px; }

/* Tooltip */
.viz-tip {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--navy-deep); color: #fff;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-sm);
  padding: 8px 11px; font-size: .78rem; line-height: 1.5;
  box-shadow: var(--shadow-3); opacity: 0; transform: translate(-50%, -122%);
  transition: opacity var(--dur-1) var(--ease);
  white-space: nowrap; max-width: 260px;
}
.viz-tip.is-on { opacity: 1; }
.viz-tip__k { color: var(--on-dark-2); }
.viz-tip__v { font-weight: 650; font-variant-numeric: tabular-nums; }
.viz-tip__row { display: flex; align-items: center; gap: 7px; }
.viz-tip__dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* Dashboard frame — the "report page" look */
.report {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-4);
  position: relative; overflow: hidden;
}
.report__bar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-2) var(--s-4);
}
.report__dots { display: flex; gap: 6px; }
.report__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.report__name {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--ink-3); text-transform: uppercase;
}
.report__grid { display: grid; gap: var(--s-3); }
@media (min-width: 760px) { .report__grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.report__grid > .span-2 { grid-column: 1 / -1; }

/* Table view — the accessible companion to every chart */
.data-table-wrap { overflow-x: auto; }
details.viz-table { margin-top: var(--s-2); }
details.viz-table > summary {
  cursor: pointer; font-size: .78rem; color: var(--ink-3);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 0;
}
details.viz-table > summary::-webkit-details-marker { display: none; }
details.viz-table > summary::before { content: "▸"; transition: transform var(--dur-1) var(--ease); }
details.viz-table[open] > summary::before { transform: rotate(90deg); }
details.viz-table > summary:hover { color: var(--ink); }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: var(--s-2); }
.data-table th, .data-table td {
  text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line);
}
.data-table th { color: var(--ink-3); font-weight: 550; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td:not(:first-child), .data-table th:not(:first-child) { text-align: right; padding-right: 0; }

/* 14. Skills -------------------------------------------------------------- */
.filter-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.chip {
  padding: 7px 15px; border-radius: var(--r-pill);
  font-size: .84rem; font-weight: 550; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  transition: all var(--dur-1) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { background: var(--navy-mid); border-color: var(--navy-mid); color: #fff; }
:root[data-theme="dark"] .chip.is-active { background: var(--blue); border-color: var(--blue); color: var(--navy-deep); }

.skill-card { display: grid; gap: var(--s-3); align-content: start; }
.skill-card__head { display: flex; align-items: center; gap: var(--s-3); }
.skill-card__icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--viz-1)) 13%, transparent);
  color: var(--accent, var(--viz-1));
}
.skill-card__icon svg { width: 17px; height: 17px; }
.is-filtered-out { opacity: .22; filter: saturate(.25); pointer-events: none; }
.skill-grid > * { transition: opacity var(--dur-2) var(--ease), filter var(--dur-2) var(--ease); }

/* 15. Projects ------------------------------------------------------------ */
.project-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; }
.project-card__media {
  position: relative; aspect-ratio: 16 / 9.6; overflow: hidden;
  background: var(--surface-sunken); border-bottom: 1px solid var(--line);
}
/* Direct child only — the illustration, never the badge icon inside it. */
.project-card__media > svg { width: 100%; height: 100%; }
/* Real dashboard screenshot as the card image */
.project-card__media--photo { background: var(--surface-2); }
.project-card__media--photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transition: transform 1.1s var(--ease-out);
}
.project-card:hover .project-card__media--photo img { transform: scale(1.04); }

.dash-grid { gap: var(--s-4); }
.dash-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; }
.dash-card__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.dash-card__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0;
  transition: transform 1.1s var(--ease-out);
}
.dash-card:hover .dash-card__media img { transform: scale(1.045); }
.dash-card__body { padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.dash-card:hover .project-card__title { color: var(--blue); }

.project-card__body { padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.project-card__meta { display: flex; align-items: center; gap: var(--s-2); font-size: .75rem; color: var(--ink-3); }
.project-card__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 650; letter-spacing: -.018em; }
.project-card__summary { font-size: .9rem; color: var(--ink-2); line-height: 1.6; }
.project-card__outcome {
  display: flex; align-items: baseline; gap: var(--s-2);
  padding-top: var(--s-3); border-top: 1px solid var(--line);
}
.project-card__outcome b { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -.025em; color: var(--bronze); }
.project-card__outcome span { font-size: .8rem; color: var(--ink-3); }
.project-card:hover .project-card__title { color: var(--blue); }

/* 16. Timeline ------------------------------------------------------------ */
.timeline { display: grid; gap: 0; position: relative; }
.tl-item { display: grid; gap: var(--s-3); padding-bottom: var(--s-6); position: relative; padding-left: var(--s-6); }
@media (min-width: 780px) {
  .tl-item { grid-template-columns: 190px minmax(0,1fr); gap: var(--s-6); padding-left: 0; }
  .tl-item__when { text-align: right; padding-right: var(--s-6); }
}
.tl-item::before {
  content: ""; position: absolute; top: 8px; bottom: -8px; left: 5px; width: 1px; background: var(--line);
}
@media (min-width: 780px) { .tl-item::before { left: 190px; } }
.tl-item:last-child::before { display: none; }
.tl-item::after {
  content: ""; position: absolute; top: 6px; left: 0; width: 11px; height: 11px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--bronze); z-index: 1;
}
@media (min-width: 780px) { .tl-item::after { left: 185px; } }
.tl-item__when { display: grid; gap: 2px; }
.tl-item__dates { font-family: var(--font-mono); font-size: .78rem; font-weight: 500; color: var(--ink); }
.tl-item__org { font-size: .78rem; color: var(--ink-3); line-height: 1.5; }
.tl-item__what { display: grid; gap: var(--s-3); }
.tl-item__role { font-family: var(--font-display); font-size: 1.08rem; font-weight: 650; letter-spacing: -.015em; }
.tl-item__sub { font-size: .84rem; color: var(--bronze); font-weight: 550; }

/* 17. Certificates coverflow ---------------------------------------------- */
.coverflow { position: relative; }
.coverflow__stage {
  position: relative; height: clamp(300px, 42vw, 430px);
  perspective: 1500px; perspective-origin: 50% 42%;
  overflow: hidden; touch-action: pan-y;
  cursor: grab; user-select: none;
}
.coverflow__stage:active { cursor: grabbing; }
.coverflow__track { position: absolute; inset: 0; transform-style: preserve-3d; }
.cf-card {
  position: absolute; top: 50%; left: 50%;
  width: clamp(260px, 40vw, 420px);
  margin: 0; padding: 0; border: 0; background: none;
  transform-origin: 50% 50%;
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out),
              filter var(--dur-3) var(--ease-out);
  will-change: transform, opacity;
}
.cf-card__inner {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-3);
  display: grid; grid-template-rows: auto auto;
}
.cf-card__img {
  aspect-ratio: 1.4 / 1; width: 100%; object-fit: contain;
  background: #fff; border-bottom: 1px solid var(--line); padding: 6px;
}
.cf-card__cap { padding: var(--s-3) var(--s-4); display: grid; gap: 3px; text-align: left; }
.cf-card__title {
  font-family: var(--font-display); font-size: .86rem; font-weight: 650;
  letter-spacing: -.01em; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cf-card__meta { font-size: .74rem; color: var(--ink-3); display: flex; gap: 7px; align-items: center; }
.cf-card__cat {
  width: 7px; height: 7px; border-radius: 2px; flex: none;
  background: var(--accent, var(--viz-1));
}
.cf-card.is-far { opacity: 0; pointer-events: none; }
.cf-card:not(.is-active) .cf-card__inner { box-shadow: var(--shadow-2); }
.cf-card:not(.is-active) { filter: saturate(.7); }

.coverflow__controls {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-4); margin-top: var(--s-5);
}
.coverflow__dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 420px; }
.coverflow__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
  transition: all var(--dur-1) var(--ease);
}
.coverflow__dot.is-active { background: var(--bronze); width: 22px; border-radius: var(--r-pill); }
.coverflow__count {
  font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3);
  font-variant-numeric: tabular-nums; min-width: 62px; text-align: center;
}

/* Training record — every course completed, whether or not a certificate
   was issued. The badge marks the ones viewable in the gallery above. */
.training-cols { display: grid; gap: var(--s-4); }
@media (min-width: 900px) { .training-cols { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.training-group { display: grid; gap: var(--s-3); align-content: start; }
.training-group__head { display: flex; align-items: center; gap: var(--s-3); }
.training-group__dot {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
  background: var(--accent, var(--viz-1));
}
.training-group__title { font-family: var(--font-display); font-size: .98rem; font-weight: 650; letter-spacing: -.012em; }
.training-group__count {
  margin-left: auto; font-family: var(--font-mono); font-size: .74rem; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.training-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.training-item {
  background: var(--surface); padding: var(--s-3) var(--s-4);
  display: flex; gap: var(--s-3); align-items: baseline; justify-content: space-between;
}
.training-item__name { font-size: .87rem; font-weight: 500; line-height: 1.45; color: var(--ink); }
.training-item__note { display: block; font-size: .75rem; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.training-item__year {
  font-family: var(--font-mono); font-size: .74rem; color: var(--ink-3);
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.training-item__cert { color: var(--good); display: inline-flex; }
.training-item__cert svg { width: 13px; height: 13px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: var(--s-5); background: rgba(7,17,28,.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__panel {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  max-width: min(1000px, 94vw); max-height: 92vh; width: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  transform: scale(.96) translateY(10px); transition: transform var(--dur-3) var(--ease-out);
  box-shadow: var(--shadow-3);
}
.lightbox.is-open .lightbox__panel { transform: scale(1) translateY(0); }
.lightbox__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line);
}
.lightbox__title { font-family: var(--font-display); font-size: 1rem; font-weight: 650; letter-spacing: -.015em; }
.lightbox__meta { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.lightbox__body { overflow: auto; background: #fff; display: grid; place-items: center; padding: var(--s-4); }
.lightbox__body img { max-width: 100%; max-height: 68vh; width: auto; object-fit: contain; }
.lightbox__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line);
}

/* 18. Case study (doc) pages ---------------------------------------------- */
.doc { max-width: 860px; margin-inline: auto; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: .8rem; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb svg { width: 13px; height: 13px; opacity: .6; }

.meta-bar {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width: 760px) { .meta-bar { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.meta-bar__cell { background: var(--surface); padding: var(--s-3) var(--s-4); display: grid; gap: 2px; }
.meta-bar__k {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.meta-bar__v { font-size: .86rem; font-weight: 550; line-height: 1.45; }

.figure { display: grid; gap: var(--s-3); margin: 0; }
.figure + .figure { margin-top: var(--s-5); }
.figure__frame {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
}
.figure__frame img { width: 100%; height: auto; display: block; }
.figure__cap { font-size: .8rem; color: var(--ink-3); line-height: 1.6; }
.figure__cap b { color: var(--ink-2); font-weight: 600; }

/* Real output from public data — the opposite of .mock-badge, and it earns
   the distinction: nothing here is a rebuild. */
.src-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 6px;
  max-width: calc(100% - 20px);
  padding: 5px 10px; border-radius: var(--r-xs);
  background: rgba(15,122,61,.92); color: #fff;
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500;
  line-height: 1.35; letter-spacing: .05em; text-transform: uppercase;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.22);
}
.src-badge .src-badge__i { width: 12px; height: 12px; flex: none; opacity: .9; }

/* Dashboard page strip — several report pages shown in sequence */
.pagestrip { display: grid; gap: var(--s-5); }
.pagestrip__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.pagestrip__label i {
  width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); font-style: normal;
  font-size: .68rem; font-weight: 600; border: 1px solid var(--line);
}

/* Live-artifact callout — a link a reviewer can actually open and click */
.live-link {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-radius: var(--r);
  background: color-mix(in srgb, var(--viz-3) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--viz-3) 28%, transparent);
  text-decoration: none; color: inherit;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.live-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.live-link__icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--viz-3); color: #fff;
}
.live-link__icon svg { width: 19px; height: 19px; }
.live-link__k { font-size: .74rem; color: var(--ink-3); }
.live-link__v { font-size: .95rem; font-weight: 600; color: var(--ink); }
.live-link__go { margin-left: auto; color: var(--viz-3); flex: none; }
.live-link__go svg { width: 18px; height: 18px; }

.outcome-band {
  background: linear-gradient(140deg, var(--navy-deep), #1b3d61);
  color: #fff; border-radius: var(--r-md); padding: var(--s-6);
  display: grid; gap: var(--s-4); position: relative; overflow: hidden;
}
.outcome-band::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.09) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(80% 100% at 100% 0%, #000, transparent 70%);
}
.outcome-band > * { position: relative; }
.outcome-band .eyebrow { color: var(--bronze-soft); }
.outcome-band .eyebrow::before { background: var(--bronze-soft); }
.outcome-band p { color: var(--on-dark-2); }
.outcome-band strong { color: #fff; }

.prevnext { display: grid; gap: var(--s-3); }
@media (min-width: 700px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.prevnext__link {
  display: grid; gap: 4px; padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line); border-radius: var(--r); text-decoration: none;
  background: var(--surface); transition: all var(--dur-2) var(--ease);
}
.prevnext__link:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.prevnext__dir { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.prevnext__title { font-family: var(--font-display); font-weight: 650; font-size: .96rem; color: var(--ink); letter-spacing: -.015em; }
.prevnext__link--next { text-align: right; }

/* 19. Contact & forms ----------------------------------------------------- */
.contact-grid { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.15fr .85fr; gap: var(--s-7); } }

.field { display: grid; gap: 6px; }
.field label { font-size: .84rem; font-weight: 550; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: .92rem; transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: .8; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 132px; }
.field__error { font-size: .78rem; color: var(--crit); display: none; }
.field.has-error input, .field.has-error textarea { border-color: var(--crit); }
.field.has-error .field__error { display: block; }

.form { display: grid; gap: var(--s-4); }
.form__row { display: grid; gap: var(--s-4); }
@media (min-width: 620px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__status { font-size: .86rem; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); display: none; }
.form__status.is-on { display: block; }
.form__status--ok  { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good);
                     border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.form__status--err { background: color-mix(in srgb, var(--crit) 12%, transparent); color: var(--crit);
                     border: 1px solid color-mix(in srgb, var(--crit) 30%, transparent); }

.contact-list { display: grid; gap: var(--s-2); }
.contact-item {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: all var(--dur-2) var(--ease);
}
.contact-item:hover { border-color: var(--line-strong); transform: translateX(3px); }
.contact-item__icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue);
}
.contact-item__icon svg { width: 18px; height: 18px; }
.contact-item__k { font-size: .74rem; color: var(--ink-3); }
.contact-item__v { font-size: .9rem; font-weight: 550; word-break: break-word; }

/* 20. Footer -------------------------------------------------------------- */
.footer {
  background: var(--navy-deep); color: var(--on-dark-2);
  padding-block: var(--s-7) var(--s-5); margin-top: var(--s-8);
}
.footer a { color: var(--on-dark-2); text-decoration: none; }
.footer a:hover { color: #fff; }
.footer__top { display: grid; gap: var(--s-6); padding-bottom: var(--s-6); border-bottom: 1px solid rgba(255,255,255,.11); }
@media (min-width: 760px) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.footer__desc { font-size: .86rem; max-width: 42ch; margin-top: var(--s-2); line-height: 1.65; }
.footer__h { font-size: .74rem; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
             color: var(--bronze-soft); margin-bottom: var(--s-3); }
.footer__links { display: grid; gap: var(--s-2); font-size: .88rem; }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between;
  align-items: center; padding-top: var(--s-5); font-size: .8rem;
}

/* 21. Motion, reveal ------------------------------------------------------ */
/* Every start-state below is scoped to .js — set by an inline script in
   <head>. Without JavaScript (or if main.js fails to load) nothing is ever
   hidden, so the page degrades to plain, fully readable content. */
.js [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js .draw-in { stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000); }
.js .is-drawn .draw-in { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out); }

.js .grow-y { transform: scaleY(0); transform-origin: 50% 100%; }
.js .is-drawn .grow-y { transform: scaleY(1); transition: transform .9s var(--ease-out) var(--d, 0ms); }
.js .grow-x { transform: scaleX(0); transform-origin: 0 50%; }
.js .is-drawn .grow-x { transform: scaleX(1); transition: transform .9s var(--ease-out) var(--d, 0ms); }

.js .fade-mark { opacity: 0; }
.js .is-drawn .fade-mark { opacity: 1; transition: opacity .6s var(--ease-out) var(--d, 0ms); }

/* Section headings draw a short rule as they arrive */
.section-head h2 { position: relative; }
.js .section-head h2::after {
  content: ""; position: absolute; left: 0; bottom: -10px; height: 2px; width: 46px;
  background: var(--bronze); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .75s var(--ease-out) .15s;
}
.js .section-head h2[data-reveal].is-in::after { transform: scaleX(1); }
.section-head[style*="center"] h2::after { left: 50%; transform-origin: center; margin-left: -23px; }

/* Cards lean very slightly toward the pointer */
.card--hover, .dash-card { transform-style: preserve-3d; }
.js .tilt { transition: transform .35s var(--ease-out); will-change: transform; }

/* Hero portrait drifts a little slower than the page scrolls */
.js .hero__portrait { will-change: transform; }

/* Images fade up as they enter, instead of snapping in on load */
.js .figure__frame img,
.js .dash-card__media img { opacity: 0; transition: opacity .8s var(--ease-out); }
.js .figure__frame img.is-loaded,
.js .dash-card__media img.is-loaded { opacity: 1; }

/* The KPI band's grid drifts on scroll — very slight, purely atmospheric */
.js .kpi-band::before { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .draw-in { stroke-dashoffset: 0; }
  .js .grow-y, .js .grow-x { transform: none; }
  .js .fade-mark { opacity: 1; }
  .js .section-head h2::after { transform: scaleX(1); }
  .js .figure__frame img, .js .dash-card__media img { opacity: 1; }
  .js .hero__portrait, .js .kpi-band::before { transform: none !important; }
  .hero__tile { animation: none; }
  .scroll-cue__line::after { animation: none; }
}

/* 22b. Content protection -------------------------------------------------
   A transparent shield sits over protected imagery so a long-press or a
   right-click lands on the shield, not the <img>. Combined with the JS guard
   and the .htaccess hotlink rules this stops casual copying; it is deliberate
   friction, not DRM, and nothing here can defeat a screenshot. */
[data-protect] {
  position: relative;
  -webkit-user-select: none; -moz-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
[data-protect] img {
  -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none;
  -o-user-drag: none; user-drag: none;
  pointer-events: none;
}
[data-protect]::after {
  content: ""; position: absolute; inset: 0; z-index: 4;
  background: transparent; pointer-events: auto;
}
/* Controls that must stay clickable sit above the shield */
[data-protect] .src-badge,
[data-protect] .mock-badge { z-index: 5; }

/* 22. Print --------------------------------------------------------------- */
@media print {
  .header, .rail, .mobile-nav, .coverflow__controls, .scroll-cue, .btn, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .viz { break-inside: avoid; border-color: #ccc; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; color: #555; }
}
