  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  /* ─── TOKENS (canonical light + dark variant) ─── */
  :root, [data-theme="light"] {
    --brand-teal:        #0D9488;
    --brand-teal-deep:   #0F766E;
    --brand-teal-soft:   #CCFBF1;
    --brand-sunset:      #EA580C;
    --brand-sunset-soft: #FFEDD5;
    --brand-navy:        #0E3A47;
    --brand-primary-fg:  #FFFFFF;

    --bg:               #FAFAF8;
    --bg-grad:          radial-gradient(1200px 600px at 15% -10%, rgba(13,148,136,0.06), transparent 60%),
                        radial-gradient(900px 500px at 100% 0%, rgba(234,88,12,0.04), transparent 55%),
                        #FAFAF8;
    --surface-1:        #FFFFFF;
    --surface-2:        #F6F4EF;
    --surface-hover:    #EFEDE6;
    --border:           #E8E5DD;
    --border-strong:    #C8C5BD;
    --divider:          #EFEDE7;

    --text:             #14181C;
    --text-secondary:   #3D4148;
    --text-muted:       #707068;
    --text-dim:         #A8A6A0;

    --positive:         #059669;
    --positive-soft:    #D1FAE5;
    --negative:         #DC2626;
    --negative-soft:    #FEE2E2;
    --warning:          #B45309;
    --warning-soft:     #FEF3C7;
    --info:             #2563EB;
    --info-soft:        #DBEAFE;

    --c1: #0D9488; --c2: #EA580C; --c3: #2563EB;
    --c4: #7C3AED; --c5: #D97706; --c6: #DB2777;

    --topbar-bg: rgba(250,250,248,0.85);
    --grid-line: rgba(20,24,28,0.025);

    --shadow-sm: 0 1px 2px rgba(20,24,28,0.04), 0 1px 2px rgba(20,24,28,0.03);
    --shadow-md: 0 8px 24px -8px rgba(20,24,28,0.10), 0 2px 6px rgba(20,24,28,0.04);
    --shadow-lg: 0 24px 48px -16px rgba(20,24,28,0.14), 0 8px 16px -4px rgba(20,24,28,0.06);
    --shadow-glow-teal: 0 0 0 1px rgba(13,148,136,0.25), 0 8px 24px -8px rgba(13,148,136,0.35);

    --font-sans:   'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono:   'Geist Mono', ui-monospace, Menlo, monospace;
    --font-serif:  'Instrument Serif', 'Times New Roman', serif;

    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
    --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

    --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-xl: 14px; --r-2xl: 20px;
  }
  [data-theme="dark"] {
    --brand-teal:        #2DD4BF;
    --brand-teal-deep:   #0F766E;
    --brand-teal-soft:   #0B3D3A;
    --brand-sunset:      #F97316;
    --brand-sunset-soft: #3E1F0F;
    --brand-primary-fg:  #07101A;

    --bg:               #07101A;
    --bg-grad:          radial-gradient(1200px 600px at 15% -10%, rgba(45,212,191,0.08), transparent 60%),
                        radial-gradient(900px 500px at 100% 0%, rgba(249,115,22,0.05), transparent 55%),
                        #07101A;
    --surface-1:        #0C1822;
    --surface-2:        #122231;
    --surface-hover:    #15293A;
    --border:           #1B2E3F;
    --border-strong:    #2A3F54;
    --divider:          #15273A;

    --text:             #ECF1F5;
    --text-secondary:   #B8C5CF;
    --text-muted:       #7E909C;
    --text-dim:         #4E5E6B;

    --positive:         #34D399;
    --positive-soft:    #0F3A2C;
    --negative:         #F87171;
    --negative-soft:    #3E1F1F;
    --warning:          #FBBF24;
    --warning-soft:     #3B2D0A;
    --info:             #60A5FA;
    --info-soft:        #0F2740;

    --c1: #2DD4BF; --c2: #F97316; --c3: #60A5FA;
    --c4: #A78BFA; --c5: #FBBF24; --c6: #F472B6;

    --topbar-bg: rgba(7,16,26,0.85);
    --grid-line: rgba(255,255,255,0.012);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px -2px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 16px 32px -8px rgba(0,0,0,0.6), 0 4px 8px rgba(0,0,0,0.3);
    --shadow-glow-teal: 0 0 0 1px rgba(45,212,191,0.25), 0 8px 24px -8px rgba(45,212,191,0.35);
  }

  html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
  body {
    background: var(--bg-grad);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.005em;
    min-height: 100vh;
    overflow-x: hidden;
  }
  body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
      linear-gradient(var(--grid-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
  }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

  a { color: inherit; text-decoration: none; }

  .wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-8); position: relative; z-index: 1; }

  /* ─── TOPBAR ─── */
  .topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar-inner {
    max-width: 1240px; margin: 0 auto;
    padding: var(--s-3) var(--s-8);
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s-6);
  }
  .brand-row { display: flex; align-items: center; gap: var(--s-3); }
  .brand-mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-sunset) 100%);
    display: grid; place-items: center;
    font-family: var(--font-sans); font-weight: 700; font-size: 11px;
    color: #FFFFFF; letter-spacing: 0.04em;
  }
  .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
  .brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
  .brand-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.02em; }

  .nav-links {
    display: flex; gap: var(--s-6);
    font-size: 13px; color: var(--text-secondary);
  }
  .nav-links a { transition: color .15s; }
  .nav-links a:hover { color: var(--brand-teal); }

  .nav-right { display: flex; align-items: center; gap: var(--s-3); }

  /* Theme toggle */
  .theme-toggle {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
  }
  .theme-toggle button {
    background: transparent; border: none;
    width: 26px; height: 26px;
    border-radius: 999px;
    display: grid; place-items: center;
    color: var(--text-muted); cursor: pointer;
    transition: background .15s, color .15s;
  }
  .theme-toggle button.active {
    background: var(--surface-1);
    color: var(--brand-teal);
    box-shadow: var(--shadow-sm);
  }
  .theme-toggle button:hover:not(.active) { color: var(--text); }
  .theme-toggle svg { width: 13px; height: 13px; }

  /* Buttons */
  .btn {
    font-family: var(--font-sans); font-weight: 500; font-size: 13px;
    padding: 9px 16px; border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s, border-color .15s, color .15s, transform .05s, filter .15s;
    text-decoration: none;
    letter-spacing: -0.005em;
    white-space: nowrap;
  }
  .btn:active { transform: translateY(1px); }
  .btn-primary {
    background: var(--brand-teal); color: var(--brand-primary-fg);
    box-shadow: var(--shadow-glow-teal);
  }
  .btn-primary:hover { filter: brightness(1.08); }
  .btn-secondary {
    background: var(--surface-1); color: var(--text);
    border-color: var(--border-strong);
  }
  .btn-secondary:hover { background: var(--surface-hover); }
  .btn-ghost { background: transparent; color: var(--text-secondary); }
  .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
  .btn-lg { padding: 12px 20px; font-size: 14px; }

  /* ─── HERO ─── */
  .hero {
    position: relative;
    padding: var(--s-24) 0 var(--s-20);
    overflow: hidden;
    border-bottom: 1px solid var(--divider);
  }
  .hero-bg {
    position: absolute; inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.18;
  }
  [data-theme="dark"] .hero-bg { opacity: 0.22; }
  .hero-bg svg { width: 100%; height: 100%; display: block; }

  .hero-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start;
    max-width: 980px;
  }
  .hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 8px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    margin-bottom: var(--s-8);
    box-shadow: var(--shadow-sm);
  }
  .hero-eyebrow .status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--positive);
    box-shadow: 0 0 8px var(--positive);
    position: relative;
  }
  .hero-eyebrow .status-dot::after {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%;
    background: var(--positive);
    opacity: 0.3;
    animation: pulse 2.4s ease-in-out infinite;
  }
  @keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.6); opacity: 0; }
  }
  .hero-eyebrow .sep { color: var(--text-dim); }

  h1.hero-title {
    font-size: clamp(44px, 6.5vw, 84px);
    font-weight: 500;
    line-height: 1.0;
    letter-spacing: -0.04em;
    margin-bottom: var(--s-6);
    max-width: 920px;
  }
  h1.hero-title em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--brand-teal);
    letter-spacing: -0.025em;
    font-size: 1.04em;
  }

  .hero-deck {
    font-size: clamp(16px, 1.4vw, 18px);
    color: var(--text-secondary);
    max-width: 580px;
    font-weight: 400;
    line-height: 1.55;
    margin-bottom: var(--s-10);
  }
  .hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-16); }

  .ticker {
    width: 100%;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--s-2);
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
  }
  .ticker::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(13,148,136,0.04) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 8s linear infinite;
    pointer-events: none;
  }
  [data-theme="dark"] .ticker::before {
    background: linear-gradient(90deg, transparent 0%, rgba(45,212,191,0.06) 50%, transparent 100%);
    background-size: 200% 100%;
  }
  @keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
  }
  .ticker-cell {
    padding: var(--s-4) var(--s-5);
    background: var(--surface-1);
    border-radius: 8px;
    display: flex; flex-direction: column; gap: 4px;
    position: relative;
  }
  .ticker-cell + .ticker-cell { box-shadow: -1px 0 0 var(--border); }
  .ticker-label {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .ticker-val {
    font-family: var(--font-mono); font-size: clamp(20px, 2vw, 26px);
    font-weight: 500; color: var(--text);
    font-feature-settings: 'tnum' on, 'lnum' on;
    letter-spacing: -0.01em;
  }
  .ticker-sub {
    font-size: 11px; display: flex; align-items: center; gap: 4px;
  }
  .ticker-sub.pos { color: var(--positive); }
  .ticker-sub.neg { color: var(--negative); }

  /* ─── SECTION primitive ─── */
  section.block { padding: var(--s-20) 0; border-bottom: 1px solid var(--divider); position: relative; }
  .section-head {
    display: flex; align-items: end; justify-content: space-between;
    gap: var(--s-6); margin-bottom: var(--s-12);
    flex-wrap: wrap;
  }
  .section-head .left { max-width: 640px; }
  .section-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--brand-teal);
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: var(--s-3);
    display: flex; align-items: center; gap: var(--s-2);
  }
  .section-eyebrow::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-teal);
    box-shadow: 0 0 8px var(--brand-teal);
  }
  .section-title {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 600; line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: var(--s-3);
  }
  .section-title em {
    font-family: var(--font-serif);
    font-style: italic; font-weight: 400;
    color: var(--brand-teal);
    letter-spacing: -0.02em;
  }
  .section-sub {
    color: var(--text-secondary); font-size: 16px;
    line-height: 1.55;
  }
  .section-side {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-bottom: 6px;
  }

  /* ─── FEATURED WORK ─── */
  .work-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
  }
  .work-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s, border-color .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
  }
  .work-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-teal);
  }
  .work-card-chrome {
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-muted);
  }
  .work-card-chrome .dots { display: flex; gap: 5px; }
  .work-card-chrome .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
  .work-card-chrome .url { letter-spacing: 0.01em; }

  .work-card-viz {
    padding: var(--s-5);
    background: var(--surface-1);
    border-bottom: 1px solid var(--divider);
    flex: 1;
    display: flex; flex-direction: column; gap: var(--s-4);
  }
  .work-card-kpis {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--s-3);
  }
  .wc-kpi { display: flex; flex-direction: column; gap: 4px; }
  .wc-kpi-label {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .wc-kpi-val {
    font-family: var(--font-mono); font-size: 22px;
    font-weight: 500; color: var(--text);
    font-feature-settings: 'tnum' on, 'lnum' on;
    letter-spacing: -0.01em;
  }
  .wc-kpi-delta { font-size: 11px; }
  .wc-kpi-delta.pos { color: var(--positive); }
  .wc-kpi-delta.neg { color: var(--negative); }
  .wc-kpi-delta.warn { color: var(--warning); }

  .work-card-info {
    padding: var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-3);
  }
  .work-card-info h3 {
    font-size: 18px; font-weight: 600;
    letter-spacing: -0.015em; line-height: 1.25;
  }
  .work-card-info p {
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.55;
  }
  .work-card-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: var(--s-1);
  }
  .tag-chip {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted);
    padding: 3px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    letter-spacing: 0.005em;
  }
  .work-card-cta {
    padding: 12px var(--s-5);
    border-top: 1px solid var(--divider);
    background: var(--surface-1);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: var(--brand-teal);
    font-weight: 500;
    transition: background .15s;
  }
  .work-card:hover .work-card-cta { background: var(--brand-teal-soft); }
  .work-card-cta .arrow {
    transition: transform .2s;
  }
  .work-card:hover .work-card-cta .arrow { transform: translateX(3px); }

  /* Shared chart bits */
  .axis-line { stroke: var(--border); stroke-width: 1; }
  .gridline { stroke: var(--divider); stroke-width: 1; stroke-dasharray: 2 3; }
  .axis-label { fill: var(--text-dim); font-family: var(--font-mono); font-size: 9px; }

  /* ─── ABOUT ─── */
  .about-grid {
    display: grid; grid-template-columns: 1.4fr 1fr;
    gap: var(--s-12); align-items: start;
  }
  .about-bio { display: flex; flex-direction: column; gap: var(--s-6); }
  .about-bio p {
    font-size: 18px; line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 400;
  }
  .about-bio p strong { color: var(--text); font-weight: 600; }
  .about-bio p em.serif {
    font-family: var(--font-serif); font-style: italic;
    color: var(--brand-teal); font-weight: 400;
    font-size: 1.04em;
  }

  .about-side {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-4);
  }
  .headshot {
    aspect-ratio: 1/1;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--brand-teal-soft) 0%, var(--brand-sunset-soft) 100%);
    border: 1px solid var(--border);
    display: grid; place-items: center;
    color: var(--text-muted);
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.04em;
    overflow: hidden;
    position: relative;
    text-align: center;
  }
  .headshot::before {
    content: '';
    position: absolute; inset: 0;
    background:
      repeating-linear-gradient(45deg, transparent 0, transparent 12px,
      rgba(13,148,136,0.06) 12px, rgba(13,148,136,0.06) 13px);
  }
  [data-theme="dark"] .headshot::before {
    background:
      repeating-linear-gradient(45deg, transparent 0, transparent 12px,
      rgba(45,212,191,0.06) 12px, rgba(45,212,191,0.06) 13px);
  }
  .headshot span { position: relative; z-index: 1; padding: 0 var(--s-3); }

  .fact-list { display: flex; flex-direction: column; }
  .fact-row {
    display: grid; grid-template-columns: 80px 1fr;
    gap: var(--s-3); align-items: baseline;
    padding: 8px 0;
    border-top: 1px solid var(--divider);
    font-size: 13px;
  }
  .fact-row:first-child { border-top: none; padding-top: 0; }
  .fact-key {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .fact-val { color: var(--text); }
  .fact-val .accent { color: var(--brand-teal); font-weight: 500; }

  /* ─── STACK ─── */
  .stack-rows {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--border);
  }
  .stack-row {
    display: grid; grid-template-columns: 180px 1fr;
    gap: var(--s-6); align-items: center;
    padding: var(--s-5) 0;
    border-bottom: 1px solid var(--border);
  }
  .stack-key {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .stack-tools {
    display: flex; flex-wrap: wrap; gap: var(--s-2);
  }
  .stack-tool {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text);
    transition: border-color .15s, background .15s, color .15s;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .stack-tool:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
    background: var(--brand-teal-soft);
  }
  .stack-tool .glyph {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-teal);
    opacity: 0.6;
  }

  /* ─── CONTACT ─── */
  .contact-block {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-2xl);
    padding: var(--s-16) var(--s-12);
    display: grid; grid-template-columns: 1fr auto;
    gap: var(--s-10); align-items: end;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
  }
  .contact-block::before {
    content: '';
    position: absolute;
    right: -160px; top: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--brand-teal-soft) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
  }
  .contact-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: var(--s-4);
    max-width: 520px;
  }
  .contact-content h2 {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 600; line-height: 1.15;
    letter-spacing: -0.02em;
  }
  .contact-content h2 em {
    font-family: var(--font-serif); font-style: italic;
    color: var(--brand-teal); font-weight: 400;
  }
  .contact-content p {
    font-size: 16px; color: var(--text-secondary);
    line-height: 1.6;
  }
  .contact-actions {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: var(--s-2);
  }
  .contact-link {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 18px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text);
    min-width: 220px;
    transition: border-color .15s, background .15s, transform .05s;
  }
  .contact-link:hover { border-color: var(--brand-teal); background: var(--brand-teal-soft); }
  .contact-link .ico { color: var(--brand-teal); width: 16px; height: 16px; flex-shrink: 0; }
  .contact-link .meta { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
  .contact-link .meta .key {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .contact-link.primary {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: var(--brand-primary-fg);
    box-shadow: var(--shadow-glow-teal);
  }
  .contact-link.primary:hover { background: var(--brand-teal); filter: brightness(1.08); }
  .contact-link.primary .ico { color: var(--brand-primary-fg); }
  .contact-link.primary .meta .key { color: rgba(255,255,255,0.7); }
  [data-theme="dark"] .contact-link.primary .meta .key { color: rgba(7,16,26,0.7); }

  /* ─── FOOTER ─── */
  footer {
    padding: var(--s-12) 0 var(--s-16);
    display: grid; grid-template-columns: 1fr auto;
    gap: var(--s-6); align-items: center;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    color: var(--text-muted);
  }
  footer .foot-brand { display: flex; align-items: center; gap: var(--s-3); }
  footer .foot-brand .brand-text { gap: 1px; }
  footer .foot-brand .brand-name { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
  footer .foot-brand .brand-sub { font-size: 10px; }
  footer .foot-meta {
    display: flex; gap: var(--s-5);
    font-family: var(--font-mono); font-size: 11px;
  }

  /* ─── HERO ANIMATED CHART ─── */
  @keyframes drawLine {
    0% { stroke-dashoffset: 1400; opacity: 0; }
    8% { opacity: 0.85; }
    50% { stroke-dashoffset: 0; opacity: 0.85; }
    92% { opacity: 0.85; }
    100% { stroke-dashoffset: 0; opacity: 0; }
  }
  @keyframes drawArea {
    0% { opacity: 0; transform: scaleY(0); }
    15% { opacity: 0.4; transform: scaleY(0.4); }
    50% { opacity: 0.65; transform: scaleY(1); }
    92% { opacity: 0.65; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(1); }
  }
  @keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
  .hero-bg .anim-line {
    fill: none;
    stroke-width: 1.5;
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: drawLine 14s ease-in-out infinite;
  }
  .hero-bg .anim-line.teal { stroke: var(--brand-teal); animation-delay: 0s; }
  .hero-bg .anim-line.sunset { stroke: var(--brand-sunset); animation-delay: 1.5s; }
  .hero-bg .anim-area {
    transform-origin: bottom;
    animation: drawArea 14s ease-in-out infinite;
  }
  .hero-bg .anim-area.teal { animation-delay: 0s; }
  .hero-bg .anim-area.sunset { animation-delay: 1.5s; }
  .hero-bg .anim-dot {
    animation: floatY 6s ease-in-out infinite;
  }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 960px) {
    .topbar-inner { padding: var(--s-3) var(--s-5); gap: var(--s-3); }
    .nav-links { display: none; }
    .wrap { padding: 0 var(--s-5); }
    .hero { padding: var(--s-16) 0 var(--s-12); }
    h1.hero-title { font-size: 44px; }
    .ticker { grid-template-columns: 1fr 1fr; }
    .ticker-cell + .ticker-cell:nth-child(3) { box-shadow: 0 -1px 0 var(--border); }
    .work-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; gap: var(--s-8); }
    .contact-block { grid-template-columns: 1fr; padding: var(--s-10) var(--s-8); }
    .stack-row { grid-template-columns: 1fr; gap: var(--s-3); }
    section.block { padding: var(--s-16) 0; }
    footer { grid-template-columns: 1fr; text-align: center; }
    footer .foot-brand { justify-content: center; }
    footer .foot-meta { justify-content: center; }
  }

  /* ─────────────────────────────────────────────────────────
     DASHBOARD COMPONENTS  (additions for saas-metrics.html etc.)
     ───────────────────────────────────────────────────────── */

  /* Page chrome */
  .dash-page {
    padding: var(--s-12) 0;
    position: relative; z-index: 1;
  }
  .dash-header {
    display: flex; flex-direction: column; gap: var(--s-4);
    margin-bottom: var(--s-8);
  }
  .dash-header .breadcrumb {
    display: flex; align-items: center; gap: var(--s-2);
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .dash-header .breadcrumb a { color: var(--brand-teal); transition: color .15s; }
  .dash-header .breadcrumb a:hover { color: var(--brand-teal-deep); }
  .dash-header .breadcrumb .sep { color: var(--text-dim); }
  .dash-header h1 {
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 600; line-height: 1.1;
    letter-spacing: -0.025em;
  }
  .dash-header h1 em {
    font-family: var(--font-serif); font-style: italic;
    color: var(--brand-teal); font-weight: 400;
  }
  .dash-header .dash-meta {
    display: flex; gap: var(--s-4); flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-muted); letter-spacing: 0.02em;
  }
  .dash-header .dash-meta .live-dot {
    display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--positive);
    box-shadow: 0 0 6px var(--positive);
    margin-right: 5px; vertical-align: middle;
  }

  /* Filter rail */
  .filter-rail {
    display: flex; flex-wrap: wrap; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-6);
    align-items: center;
  }
  .filter-group {
    display: flex; align-items: center; gap: var(--s-2);
  }
  .filter-label {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .filter-chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px; color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
  }
  .filter-chip:hover { background: var(--surface-hover); color: var(--text); }
  .filter-chip.active {
    background: var(--brand-teal-soft);
    border-color: var(--brand-teal);
    color: var(--brand-teal-deep);
    font-weight: 500;
  }
  [data-theme="dark"] .filter-chip.active {
    color: var(--brand-teal);
  }

  /* KPI strip — bigger than work-card-kpis */
  .kpi-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-3); margin-bottom: var(--s-6);
  }
  .kpi-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-1);
    transition: border-color .15s, transform .1s;
  }
  .kpi-tile.clickable { cursor: pointer; }
  .kpi-tile.clickable:hover { border-color: var(--brand-teal); transform: translateY(-1px); }
  .kpi-tile-label {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .kpi-tile-val {
    font-family: var(--font-mono); font-size: clamp(20px, 1.8vw, 26px);
    font-weight: 500; color: var(--text);
    font-feature-settings: 'tnum' on, 'lnum' on;
    letter-spacing: -0.01em; line-height: 1.1;
  }
  .kpi-tile-sub {
    font-size: 11px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
  }
  .kpi-tile-sub.pos { color: var(--positive); }
  .kpi-tile-sub.neg { color: var(--negative); }
  .kpi-tile-sub.warn { color: var(--warning); }
  
  .var-pos { color: var(--positive); font-size: 11px; }
  .var-neg { color: var(--negative); font-size: 11px; }
  .var-warn { color: var(--warning); font-size: 11px; }

  /* Chart card */
  .chart-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    margin-bottom: var(--s-4);
  }
  .chart-card-header {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: var(--s-4); margin-bottom: var(--s-4);
  }
  .chart-card-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    letter-spacing: -0.005em;
  }
  .chart-card-meta {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .chart-canvas-wrap {
    position: relative; width: 100%; min-height: 240px;
  }

  /* Grid layout for dashboard body */
  .dash-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4);
  }
  .dash-grid .full { grid-column: 1 / -1; }
  @media (max-width: 960px) {
    .dash-grid { grid-template-columns: 1fr; }
  }

  /* Cohort heatmap */
  .heatmap {
    display: grid;
    gap: 2px;
    font-family: var(--font-mono); font-size: 10px;
  }
  .heatmap-row { display: contents; }
  .heatmap-label {
    padding: 4px 8px; text-align: right;
    color: var(--text-muted);
    background: transparent;
    align-self: center;
  }
  .heatmap-cell {
    padding: 6px 4px; text-align: center;
    color: var(--text); font-weight: 500;
    border-radius: 3px;
    transition: transform .1s, box-shadow .1s;
    cursor: default;
    font-feature-settings: 'tnum' on, 'lnum' on;
  }
  .heatmap-cell:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-sm);
    z-index: 2; position: relative;
  }
  .heatmap-cell.empty { background: var(--surface-2); color: var(--text-dim); }

  /* Tooltip */
  .tooltip {
    position: absolute;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--s-2) var(--s-3);
    font-size: 12px; color: var(--text);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    z-index: 100;
    min-width: 140px;
    opacity: 0; transition: opacity .15s;
  }
  .tooltip.visible { opacity: 1; }
  .tooltip-title {
    font-weight: 600; margin-bottom: 4px;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 4px;
  }
  .tooltip-row {
    display: flex; justify-content: space-between; gap: var(--s-3);
    line-height: 1.5;
  }
  .tooltip-key { color: var(--text-muted); }
  .tooltip-val {
    font-family: var(--font-mono); font-feature-settings: 'tnum' on, 'lnum' on;
  }

  /* Drawer (drill-down) */
  .drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200; opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  .drawer-overlay.open { opacity: 1; pointer-events: auto; }
  .drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(540px, 90vw);
    background: var(--surface-1);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .drawer.open { transform: translateX(0); }
  .drawer-header {
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
  }
  .drawer-title {
    font-size: 15px; font-weight: 600;
  }
  .drawer-close {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 20px; line-height: 1;
    padding: 4px; border-radius: 4px;
  }
  .drawer-close:hover { background: var(--surface-2); color: var(--text); }
  .drawer-body {
    padding: var(--s-5);
    overflow-y: auto; flex: 1;
  }

  /* Data table (used in detail drawer + segment table) */
  .data-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px;
  }
  .data-table th {
    text-align: left; padding: var(--s-2) var(--s-3);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.04em;
    text-transform: uppercase; font-weight: 500;
  }
  .data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .data-table td {
    padding: var(--s-2) var(--s-3);
    border-bottom: 1px solid var(--divider);
    color: var(--text);
  }
  .data-table tr:last-child td { border-bottom: none; }
  .data-table tr:hover td { background: var(--surface-2); }

  /* Pill badges for status (health_score, etc.) */
  .pill {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px;
    font-family: var(--font-mono); font-size: 10px;
    font-weight: 500; letter-spacing: 0.02em;
  }
  .pill.green  { background: var(--positive-soft); color: var(--positive); }
  .pill.yellow { background: var(--warning-soft);  color: var(--warning); }
  .pill.red    { background: var(--negative-soft); color: var(--negative); }
