    /* ═══════════════════════════════════
       DESIGN TOKENS
    ═══════════════════════════════════ */
    :root {
      --bg:        #080c10;
      --surface:   #0d1117;
      --surface-2: #111820;
      --border:    rgba(0,230,160,0.12);
      --border-h:  rgba(0,230,160,0.32);
      --accent:    #00e6a0;
      --accent-2:  #00c8ff;
      --text:      #e8edf4;
      --text-2:    #a0b0c4;
      --text-3:    #5a7090;
      --mono:      'JetBrains Mono', monospace;
      --sans:      'DM Sans', sans-serif;
      --band-tint: #0c1219;
      --r:         12px;
      --r-lg:      20px;
    }
    .light {
      --bg:        #f7f8fa;
      --surface:   #ffffff;
      --surface-2: #eef1f5;
      --border:    rgba(30,80,160,0.10);
      --border-h:  rgba(30,80,160,0.28);
      --accent:    #1a56db;
      --accent-2:  #0891b2;
      --text:      #0f172a;
      --text-2:    #334155;
      --text-3:    #64748b;
      --band-tint: #eef1f5;
    }

    /* ═══════════════════════════════════
       RESET
    ═══════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 16px; }
    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--sans);
      line-height: 1.7;
      overflow-x: hidden;
      transition: background .4s, color .4s;
    }
    ::selection { background: rgba(0,230,160,.25); color: var(--accent); }
    .light ::selection { background: rgba(26,86,219,.15); color: var(--accent); }
    a { color: inherit; text-decoration: none; }
    img { display: block; max-width: 100%; }
    ::-webkit-scrollbar { width: 5px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--accent); }

    /* ═══════════════════════════════════
       GRAIN + SCANLINES (dark only)
    ═══════════════════════════════════ */
    body::before {
      content: '';
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background-image: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(0,230,160,.012) 2px, rgba(0,230,160,.012) 4px
      );
      transition: opacity .4s;
    }
    .light body::before { opacity: 0; }
    body::after {
      content: ''; position: fixed; inset: -200%; z-index: 0;
      pointer-events: none; opacity: .025; width: 400%; height: 400%;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      animation: grain .8s steps(2) infinite;
    }
    .light body::after { opacity: 0; }
    @keyframes grain {
      0%   { transform: translate(0,0); }
      25%  { transform: translate(-2%,-3%); }
      50%  { transform: translate(3%,1%); }
      75%  { transform: translate(-1%,2%); }
      100% { transform: translate(2%,-1%); }
    }

    /* Ambient radial glow */
    .glow-bg {
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,230,160,.055) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,200,255,.04) 0%, transparent 70%);
      transition: opacity .4s;
    }
    .light .glow-bg { opacity: 0; }

    /* ═══════════════════════════════════
       LAYOUT
    ═══════════════════════════════════ */
    .wrapper {
      position: relative; z-index: 1;
      max-width: 1120px; margin: 0 auto; padding: 0 24px;
    }

    /* ═══════════════════════════════════
       NAV
    ═══════════════════════════════════ */
    .nav-wrap {
      position: fixed; top: 0; left: 0; right: 0; z-index: 100;
      transition: background .3s, border-color .3s;
      /* The bar is opaque from the start. It overlays a near-black hero
         band, so a transparent bar would put light-mode dark text on a
         dark background and make the nav unreadable at the top. */
      background: rgba(8,12,16,.92);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom: 1px solid var(--border);
    }
    .light .nav-wrap { background: rgba(247,248,250,.94); }
    .nav-wrap.scrolled { background: rgba(8,12,16,.97); }
    .light .nav-wrap.scrolled { background: rgba(247,248,250,.97); }
    .nav-inner {
      max-width: 1120px; margin: 0 auto; padding: 0 28px;
      display: flex; align-items: center; justify-content: space-between;
      height: 64px;
    }

    /* Logo — animated circuit monogram */
    .nav-logo {
      display: flex; align-items: center; gap: 12px;
      text-decoration: none; flex-shrink: 0;
    }
    .nav-logo-badge {
      width: 44px; height: 44px; flex-shrink: 0;
      position: relative;
    }
    .nav-logo-badge svg { width: 100%; height: 100%; }
    .nav-logo-name {
      font-family: var(--mono); font-size: .7rem; font-weight: 500;
      color: var(--text-3); letter-spacing: .06em;
      display: none; white-space: nowrap;
    }
    @media (min-width: 900px) { .nav-logo-name { display: block; } }

    .nav-links { display: flex; align-items: center; gap: 30px; list-style: none; }
    @media (max-width: 700px) { .nav-links { display: none; } }
    .nav-links a {
      font-family: var(--sans); font-size: .84rem; font-weight: 400;
      color: var(--text-2); letter-spacing: .01em;
      transition: color .18s;
    }
    .nav-links a:hover { color: var(--text); }
    .nav-links a.nav-lab-link {
      color: var(--accent); font-weight: 500;
      display: inline-flex; align-items: center; gap: 5px;
    }
    .nav-links a.nav-lab-link::before {
      content: ''; width: 6px; height: 6px; border-radius: 50%;
      background: var(--accent); box-shadow: 0 0 8px var(--accent);
    }
    .nav-links a.nav-lab-link:hover { color: var(--accent); opacity: .8; }

    .nav-right { display: flex; align-items: center; gap: 10px; }
    .nav-contact-btn {
      font-family: var(--sans); font-size: .82rem; font-weight: 500;
      color: var(--text); border: 1px solid var(--text-3);
      border-radius: 100px; padding: 7px 20px;
      transition: color .18s, border-color .18s;
      text-decoration: none; white-space: nowrap;
    }
    .nav-contact-btn:hover { border-color: var(--accent); color: var(--accent); }
    .theme-btn {
      font-size: .82rem; color: var(--text-3);
      background: transparent; border: none;
      padding: 6px 8px; cursor: pointer;
      transition: color .18s; font-family: var(--mono);
    }
    .theme-btn:hover { color: var(--accent); }

    /* ═══════════════════════════════════
       HERO
    ═══════════════════════════════════ */
    .hero {
      position: relative;
      min-height: 100vh;
      display: flex; flex-direction: column; justify-content: center;
      padding: 100px 0 80px;
      overflow: hidden;
    }

    /* ── Canvas background ── */
    #hero-canvas {
      position: absolute; inset: 0; z-index: 0;
      pointer-events: none; width: 100%; height: 100%;
    }

    .hero-inner { position: relative; z-index: 1; }

    /* Location line */
    .hero-location {
      display: flex; align-items: center; gap: 8px;
      font-family: var(--mono); font-size: .7rem; font-weight: 500;
      color: var(--text-3); letter-spacing: .16em; text-transform: uppercase;
      margin-bottom: 24px;
    }
    .hero-location-dot {
      width: 6px; height: 6px; border-radius: 50%;
      background: var(--accent);
      animation: blink 2.4s ease-in-out infinite;
      flex-shrink: 0;
    }
    @keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.3;transform:scale(.6)} }

    /* Two-column hero: identity + demo card */
    .hero-top {
      display: grid;
      grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
      gap: 56px;
      align-items: center;
    }
    @media (max-width: 900px) { .hero-top { grid-template-columns: 1fr; gap: 40px; } }

    /* Big editorial name */
    .hero-name {
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-size: clamp(2.9rem, 5.6vw, 4.6rem);
      font-weight: 400;
      font-style: italic;
      line-height: 1.02;
      letter-spacing: -.02em;
      color: var(--text);
      margin-bottom: 14px;
    }
    .hero-role {
      font-family: var(--mono);
      font-size: clamp(.86rem, 1.5vw, 1.02rem);
      font-weight: 700;
      color: var(--accent);
      letter-spacing: .01em;
      margin-bottom: 22px;
    }

    .hero-sub {
      font-size: 1.02rem; color: var(--text-2); line-height: 1.75;
      margin-bottom: 28px;
    }
    .hero-sub strong { color: var(--text); font-weight: 500; }

    /* ── Capability terminal ── */
    .hero-term {
      background: var(--surface);
      border: 1px solid var(--border-h);
      border-radius: var(--r-lg);
      overflow: hidden;
      transition: border-color .22s, box-shadow .22s;
    }
    .hero-term:hover {
      box-shadow: 0 0 26px rgba(0,230,160,.08), 0 14px 34px rgba(0,0,0,.22);
    }
    .light .hero-term:hover { box-shadow: 0 2px 10px rgba(26,86,219,.08), 0 14px 30px rgba(15,23,42,.08); }

    .hero-term-bar {
      display: flex; align-items: center; gap: 7px;
      padding: 11px 16px;
      background: var(--surface-2);
      border-bottom: 1px solid var(--border);
    }
    .hero-term-dot {
      width: 9px; height: 9px; border-radius: 50%;
      background: var(--text-3); opacity: .45; flex-shrink: 0;
    }
    .hero-term-dot:first-child { background: var(--accent); opacity: .7; }
    .hero-term-title {
      font-family: var(--mono); font-size: .66rem; color: var(--text-3);
      margin-left: 8px; letter-spacing: .04em;
    }

    .hero-term-body { padding: 18px 20px 20px; }
    .hero-term-cmd {
      font-family: var(--mono); font-size: .74rem; color: var(--text-2);
      margin-bottom: 14px; letter-spacing: .02em;
    }
    .hero-term-cmd--second { margin-top: 20px; }
    .hero-term-prompt { color: var(--accent); font-weight: 700; margin-right: 7px; }

    .hero-term-rows { display: flex; flex-direction: column; gap: 11px; }
    .hero-term-row {
      display: grid; grid-template-columns: 76px 1fr; gap: 12px;
      align-items: baseline;
    }
    @media (max-width: 420px) { .hero-term-row { grid-template-columns: 1fr; gap: 2px; } }
    .hero-term-key {
      font-family: var(--mono); font-size: .63rem; font-weight: 700;
      letter-spacing: .1em; color: var(--accent);
    }
    .hero-term-val {
      font-family: var(--mono); font-size: .72rem; color: var(--text-2);
      line-height: 1.55;
    }

    .hero-term-status {
      display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
      font-family: var(--mono); font-size: .72rem; color: var(--text);
    }
    .hero-term-live {
      width: 7px; height: 7px; border-radius: 50%;
      background: var(--accent); flex-shrink: 0;
      box-shadow: 0 0 8px var(--accent);
      animation: blink 2.4s ease-in-out infinite;
    }
    .hero-term-caret {
      display: inline-block; width: 7px; height: 14px;
      background: var(--accent); opacity: .8;
      animation: caret 1.1s steps(2) infinite;
    }
    @keyframes caret { 0%,49% { opacity:.8 } 50%,100% { opacity:0 } }

    /* ── Credentials strip ── */
    .hero-strip {
      display: grid; grid-template-columns: repeat(4, 1fr);
      border: 1px solid var(--border); border-radius: var(--r-lg);
      margin-top: clamp(26px, 2.4vw, 42px); overflow: hidden;
    }
    @media (max-width: 900px) { .hero-strip { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 520px) { .hero-strip { grid-template-columns: 1fr; } }
    .hero-strip-cell {
      display: flex; flex-direction: column; gap: 4px;
      padding: 18px 20px;
      border-right: 1px solid var(--border);
    }
    .hero-strip-cell:last-child { border-right: none; }
    @media (max-width: 900px) {
      .hero-strip-cell:nth-child(2n) { border-right: none; }
      .hero-strip-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    }
    @media (max-width: 520px) {
      .hero-strip-cell { border-right: none; border-bottom: 1px solid var(--border); }
      .hero-strip-cell:last-child { border-bottom: none; }
    }
    .hero-strip-key {
      font-family: var(--mono); font-size: .6rem; font-weight: 700;
      letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
    }
    .hero-strip-val { font-size: .92rem; font-weight: 600; color: var(--text); line-height: 1.35; }
    .hero-strip-sub { font-size: .78rem; color: var(--text-3); line-height: 1.45; }

    .hero-meta {
      font-family: var(--mono); font-size: .7rem;
      color: var(--text-3); letter-spacing: .04em;
      display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px;
    }
    .hero-meta span::before { content: '·'; margin-right: 16px; }
    .hero-meta span:first-child::before { content: none; }

    .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
    .btn {
      display: inline-flex; align-items: center; gap: 7px;
      font-family: var(--sans); font-size: .88rem; font-weight: 500;
      letter-spacing: .01em; border-radius: 100px; padding: 12px 28px;
      transition: all .2s; cursor: pointer; border: none; text-decoration: none;
    }
    .btn-primary { background: var(--text); color: var(--bg); }
    .btn-primary:hover { opacity: .82; transform: translateY(-1px); }
    .btn-ghost {
      background: transparent; color: var(--text-2); border: 1px solid var(--text-3);
    }
    .btn-ghost:hover { color: var(--text); border-color: var(--text); transform: translateY(-1px); }

    .hero-socials { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px; }
    .hero-socials a {
      display: inline-flex; align-items: center; gap: 7px;
      font-family: var(--mono); font-size: .72rem; font-weight: 500;
      color: var(--text-3); transition: color .2s;
      text-decoration: underline; text-underline-offset: 3px;
      text-decoration-color: transparent;
    }
    .hero-socials a:hover { color: var(--accent); text-decoration-color: var(--accent); }

    .hero-portrait { display: none; }

    /* Hero load-in animations */
    .hero-location, .hero-name, .hero-role,
    .hero-sub, .hero-actions, .hero-socials,
    .hero-term, .hero-strip {
      opacity: 0; transform: translateY(18px);
      animation: fadeUp .7s cubic-bezier(.22,1,.36,1) forwards;
    }
    .hero-location { animation-delay: .06s; }
    .hero-name     { animation-delay: .14s; }
    .hero-role     { animation-delay: .22s; }
    .hero-sub      { animation-delay: .30s; }
    .hero-actions  { animation-delay: .38s; }
    .hero-socials  { animation-delay: .44s; }
    .hero-term     { animation-delay: .34s; }
    .hero-strip    { animation-delay: .50s; }
    @keyframes fadeUp { to { opacity:1; transform:none; } }

    /* ═══════════════════════════════════
       DIVIDER
    ═══════════════════════════════════ */
    .divider {
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--border-h), transparent);
    }

    /* ═══════════════════════════════════
       SECTIONS
    ═══════════════════════════════════ */
    section { padding: 64px 0; }

    .section-label {
      font-family: var(--mono); font-size: .72rem; font-weight: 600;
      color: var(--accent); letter-spacing: .13em; text-transform: uppercase;
      display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
    }
    .section-label::before { content: ''; display: block; width: 22px; height: 1px; background: var(--accent); }
    .section-title {
      font-family: var(--mono);
      font-size: clamp(1.45rem,2.8vw,1.9rem);
      font-weight: 700; color: var(--text);
      letter-spacing: -.02em; line-height: 1.2;
    }

    /* ═══════════════════════════════════
       CARDS
    ═══════════════════════════════════ */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 26px;
      transition: border-color .25s, box-shadow .25s, transform .25s;
    }
    .card:hover {
      border-color: var(--border-h);
      box-shadow: 0 0 28px rgba(0,230,160,.07), 0 12px 36px rgba(0,0,0,.2);
      transform: translateY(-2px);
    }
    .light .card {
      box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.04);
    }
    .light .card:hover {
      box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 8px 28px rgba(15,23,42,.08);
    }

    /* ═══════════════════════════════════
       WHAT I DO — three pillars
    ═══════════════════════════════════ */
    .pillar-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px;
    }
    .pillar-card {
      display: flex; flex-direction: column;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-lg);
      padding: 24px 24px 20px;
      position: relative; overflow: hidden;
      transition: border-color .22s, box-shadow .22s, transform .22s;
    }
    .pillar-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left; transition: transform .28s;
    }
    .pillar-card:hover::before { transform: scaleX(1); }
    .pillar-card:hover {
      border-color: var(--border-h); transform: translateY(-3px);
      box-shadow: 0 0 22px rgba(0,230,160,.07), 0 12px 30px rgba(0,0,0,.2);
    }
    .light .pillar-card:hover { box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 12px 28px rgba(15,23,42,.08); }
    .pillar-num {
      font-family: var(--mono); font-size: .72rem; font-weight: 700;
      color: var(--accent); letter-spacing: .1em; margin-bottom: 14px;
    }
    .pillar-title {
      font-family: var(--mono); font-size: 1rem; font-weight: 700;
      color: var(--text); line-height: 1.3; margin-bottom: 10px;
    }
    .pillar-desc {
      font-size: .89rem; color: var(--text-2); line-height: 1.75;
      flex: 1; margin-bottom: 18px;
    }
    .pillar-tags {
      font-family: var(--mono); font-size: .68rem; color: var(--text-3);
      line-height: 1.6; padding-top: 14px;
      border-top: 1px solid var(--border);
    }

    /* ═══════════════════════════════════
       ABOUT
    ═══════════════════════════════════ */
    .about-heading {
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-size: clamp(2.8rem, 6vw, 5rem);
      font-weight: 400;
      color: var(--text);
      letter-spacing: -.02em;
      line-height: 1.05;
      margin-bottom: 52px;
    }

    .about-layout {
      display: grid;
      grid-template-columns: 340px 1fr;
      gap: 64px;
      align-items: start;
    }
    @media (max-width: 800px) {
      .about-layout { grid-template-columns: 1fr; gap: 36px; }
      .about-photo  { max-width: 280px; }
    }

    /* Photo */
    .about-photo {
      position: relative;
    }
    .about-photo img {
      width: 100%;
      aspect-ratio: 3/4;
      object-fit: cover;
      object-position: center top;
      display: block;
      filter: grayscale(12%) contrast(1.04);
      border-radius: 4px;
      transition: filter .4s;
    }
    .about-photo:hover img { filter: grayscale(0%) contrast(1.07); }
    /* Subtle accent border on hover */
    .about-photo::after {
      content: '';
      position: absolute; inset: 0;
      border-radius: 4px;
      box-shadow: inset 0 0 0 1px var(--border);
      pointer-events: none;
      transition: box-shadow .3s;
    }
    .about-photo:hover::after { box-shadow: inset 0 0 0 1px var(--border-h); }

    /* Text column */
    .about-text { display: flex; flex-direction: column; gap: 20px; }

    /* Opening italic paragraph with drop cap */
    .about-opener {
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-style: italic;
      font-size: clamp(1.1rem, 2vw, 1.3rem);
      color: var(--text-2);
      line-height: 1.75;
      position: relative;
      padding-left: 26px;
    }
    .about-opener::before {
      /* Large drop-cap "I" */
      content: 'I';
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-size: 4.2rem;
      font-weight: 300;
      font-style: italic;
      color: var(--text);
      line-height: 0.75;
      float: left;
      margin-right: 6px;
      margin-top: 8px;
    }

    .about-para {
      font-size: .97rem;
      color: var(--text-2);
      line-height: 1.85;
    }
    .about-para strong { color: var(--text); font-weight: 500; }

    /* Blockquote */
    .about-quote {
      border-left: 3px solid var(--border-h);
      padding: 6px 0 6px 22px;
      margin-top: 8px;
    }
    .about-quote-mark {
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-size: clamp(2rem, 4vw, 3rem);
      font-weight: 300;
      color: var(--text);
      line-height: 1;
      display: block;
      margin-bottom: -8px;
    }
    .about-quote-text {
      font-family: 'Cormorant Garamond', Georgia, serif;
      font-style: italic;
      font-size: clamp(1rem, 1.8vw, 1.2rem);
      color: var(--text-2);
      line-height: 1.7;
    }
    .about-quote-attr {
      display: block;
      margin-top: 10px;
      font-family: var(--mono);
      font-size: .7rem;
      color: var(--text-3);
      letter-spacing: .06em;
    }

    /* ═══════════════════════════════════
       SKILLS
    ═══════════════════════════════════ */
    .skills-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; }
    .skill-card { position: relative; overflow: hidden; }
    .skill-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left; transition: transform .3s;
    }
    .skill-card:hover::before { transform: scaleX(1); }
    .skill-card h3 {
      font-family: var(--mono); font-size: .82rem; font-weight: 700;
      letter-spacing: .07em; text-transform: uppercase;
      color: var(--text); margin-bottom: 10px;
    }
    .skill-card p { font-size: .88rem; color: var(--text-2); line-height: 1.75; }
    .tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
    .tag {
      font-family: var(--mono); font-size: .7rem; font-weight: 500;
      color: var(--text-3); background: var(--surface-2);
      border: 1px solid var(--border); border-radius: 4px; padding: 4px 9px;
      transition: border-color .2s, color .2s;
    }
    .light .tag { background: #f1f5f9; color: #1e3a5f; border-color: rgba(30,80,160,.13); }
    .card:hover .tag { border-color: rgba(0,230,160,.18); }

    /* ═══════════════════════════════════
       PROJECTS
    ═══════════════════════════════════ */

    /* Filter tabs */
    .proj-filters {
      display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px;
    }
    .proj-filter-btn {
      font-family: var(--mono); font-size: .72rem; font-weight: 600;
      letter-spacing: .07em; text-transform: uppercase;
      padding: 7px 16px; border-radius: 100px; cursor: pointer;
      border: 1px solid var(--border);
      background: transparent; color: var(--text-2);
      transition: all .2s;
    }
    .proj-filter-btn:hover,
    .proj-filter-btn.active {
      background: var(--accent); color: #040a07;
      border-color: var(--accent);
      box-shadow: 0 0 14px rgba(0,230,160,.25);
    }
    .light .proj-filter-btn:hover,
    .light .proj-filter-btn.active {
      color: #fff; box-shadow: 0 4px 12px rgba(26,86,219,.22);
    }

    /* Card grid */
    .projects-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
      gap: 16px;
    }
    .proj-card {
      display: flex; flex-direction: column;
      cursor: pointer;
      transition: border-color .2s, box-shadow .2s, transform .2s, opacity .3s;
    }
    .proj-card.hidden { display: none; }
    .proj-card:hover {
      border-color: var(--border-h);
      box-shadow: 0 0 24px rgba(0,230,160,.07), 0 10px 30px rgba(0,0,0,.18);
      transform: translateY(-3px);
    }
    .light .proj-card:hover {
      box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 10px 26px rgba(15,23,42,.08);
    }
    .proj-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left; transition: transform .28s;
      border-radius: var(--r-lg) var(--r-lg) 0 0;
    }
    .proj-card:hover::before { transform: scaleX(1); }

    /* Card meta row */
    .proj-meta {
      display: flex; align-items: center; justify-content: space-between;
      gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
    }
    /* modal meta keeps the inline dot layout */
    .proj-modal-meta { justify-content: flex-start; }
    .proj-category {
      font-family: var(--mono); font-size: .62rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      background: rgba(0,230,160,.09); border: 1px solid rgba(0,230,160,.22);
      border-radius: 100px; padding: 4px 11px; color: var(--accent);
    }
    .light .proj-category {
      background: rgba(26,86,219,.07); border-color: rgba(26,86,219,.2); color: var(--accent);
    }
    .proj-year {
      font-family: var(--mono); font-size: .7rem; color: var(--text-3); letter-spacing: .04em;
    }
    .proj-dot { color: var(--text-3); font-size: .6rem; }

    .proj-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
    .proj-tag-more {
      font-family: var(--mono); font-size: .7rem; font-weight: 500;
      color: var(--text-3); align-self: center; padding-left: 2px;
    }

    .status-pill {
      display: inline-block; font-family: var(--mono); font-size: .63rem;
      font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
      padding: 3px 9px; border-radius: 4px; flex-shrink: 0;
    }
    .pill-done    { color: var(--accent); background: rgba(0,230,160,.09); border: 1px solid rgba(0,230,160,.22); }
    .pill-ongoing { color: #ffb347; background: rgba(255,179,71,.09); border: 1px solid rgba(255,179,71,.22); }
    .light .pill-done    { color: #0f766e; background: rgba(20,184,166,.08); border-color: rgba(20,184,166,.22); }
    .light .pill-ongoing { color: #b45309; background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.22); }

    .proj-card h3 {
      font-family: var(--mono); font-size: .95rem; font-weight: 700;
      color: var(--text); line-height: 1.3; margin-bottom: 10px;
      transition: color .2s;
    }
    .proj-card:hover h3 { color: var(--accent); }
    .light .proj-card:hover h3 { color: var(--accent); }

    .proj-desc {
      font-size: .89rem; color: var(--text-2); line-height: 1.78;
      flex: 1; margin-bottom: 16px;
    }

    /* View project link */
    .proj-view-link {
      display: inline-flex; align-items: center; gap: 6px;
      font-family: var(--mono); font-size: .72rem; font-weight: 600;
      letter-spacing: .03em;
      color: var(--accent);
      border-top: 1px solid var(--border);
      padding-top: 14px; margin-top: auto;
      transition: gap .18s, opacity .18s; cursor: pointer;
      width: 100%; text-align: left;
    }
    .proj-card:hover .proj-view-link { gap: 10px; }
    .proj-view-link:hover { opacity: .8; }

    /* ── MODAL ── */
    .proj-modal-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,.55);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      display: flex; align-items: center; justify-content: center;
      padding: 24px;
      opacity: 0; pointer-events: none;
      transition: opacity .25s;
    }
    .proj-modal-overlay.open {
      opacity: 1; pointer-events: auto;
    }
    .proj-modal {
      background: var(--surface);
      border: 1px solid var(--border-h);
      border-radius: var(--r-lg);
      padding: 36px 40px;
      max-width: 560px; width: 100%;
      max-height: 88vh; overflow-y: auto;
      position: relative;
      transform: translateY(20px);
      transition: transform .25s cubic-bezier(.22,1,.36,1);
      box-shadow: 0 24px 64px rgba(0,0,0,.4);
    }
    .proj-modal-overlay.open .proj-modal { transform: none; }
    @media (max-width: 600px) { .proj-modal { padding: 28px 22px; } }

    .proj-modal-close {
      position: absolute; top: 16px; right: 18px;
      background: none; border: none; cursor: pointer;
      font-size: 1.1rem; color: var(--text-3);
      width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
      border-radius: 6px; transition: background .15s, color .15s;
    }
    .proj-modal-close:hover { background: var(--surface-2); color: var(--text); }

    .proj-modal-meta {
      display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
      margin-bottom: 14px;
    }
    .proj-modal h2 {
      font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
      color: var(--text); letter-spacing: -.02em; margin-bottom: 12px; line-height: 1.2;
    }
    .proj-modal-short {
      font-size: .93rem; color: var(--text-2); line-height: 1.78;
      padding-bottom: 16px; border-bottom: 1px solid var(--border);
      margin-bottom: 16px;
    }
    .proj-modal-body {
      font-size: .9rem; color: var(--text-2); line-height: 1.85;
      margin-bottom: 20px;
    }

    /* Role / contribution callout inside modal */
    .proj-modal-role {
      display: inline-flex; align-items: center; gap: 6px;
      font-family: var(--mono); font-size: .68rem; font-weight: 700;
      letter-spacing: .07em; text-transform: uppercase;
      color: var(--accent-2); background: rgba(0,200,255,.07);
      border: 1px solid rgba(0,200,255,.2); border-radius: 5px;
      padding: 5px 11px; margin-bottom: 10px;
    }
    .light .proj-modal-role { background: rgba(8,145,178,.07); border-color: rgba(8,145,178,.18); }
    .proj-modal-contrib {
      padding: 12px 14px; border-left: 2px solid var(--accent-2);
      background: rgba(0,200,255,.05); border-radius: 0 7px 7px 0;
      margin-bottom: 18px; font-size: .88rem; color: var(--text-2); line-height: 1.75;
    }
    .proj-modal-contrib strong { color: var(--accent-2); font-weight: 600; }
    .light .proj-modal-contrib { background: rgba(8,145,178,.05); }

    /* Skills gained */
    .proj-modal-skills-label {
      font-family: var(--mono); font-size: .7rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      color: var(--text-3); margin-bottom: 10px;
    }
    .proj-modal-tags {
      display: flex; flex-wrap: wrap; gap: 7px;
    }
    .proj-modal-tags .tag {
      font-family: var(--mono); font-size: .71rem; color: var(--text-2);
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 4px; padding: 4px 10px;
    }
    .light .proj-modal-tags .tag { background: #f1f5f9; color: #1e3a5f; border-color: rgba(30,80,160,.13); }

    /* ═══════════════════════════════════
       EXPERIENCE — timeline with bullets
    ═══════════════════════════════════ */
    .timeline { position: relative; display: flex; flex-direction: column; padding-left: 30px; }
    .timeline::before {
      content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
      width: 1px;
      background: linear-gradient(to bottom, var(--accent), rgba(0,200,255,.3), transparent);
    }
    .tl-item { position: relative; padding: 0 0 34px 26px; }
    .tl-item:last-child { padding-bottom: 0; }
    .tl-dot {
      position: absolute; left: -23px; top: 7px;
      width: 10px; height: 10px; border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 10px rgba(0,230,160,.5);
      border: 2px solid var(--bg);
    }
    .tl-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r); padding: 20px 22px;
      transition: border-color .25s, box-shadow .25s;
    }
    .tl-card:hover { border-color: var(--border-h); box-shadow: 0 0 18px rgba(0,230,160,.05), 0 8px 26px rgba(0,0,0,.18); }
    .light .tl-card { box-shadow: 0 1px 3px rgba(15,23,42,.04); }
    .light .tl-card:hover { box-shadow: 0 2px 8px rgba(26,86,219,.07), 0 8px 24px rgba(15,23,42,.07); }
    .tl-role { font-family: var(--mono); font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
    .tl-company { font-size: .83rem; color: var(--accent); font-weight: 500; margin-bottom: 4px; }
    .light .tl-company { color: var(--accent); }
    .tl-date { font-family: var(--mono); font-size: .68rem; color: var(--text-3); letter-spacing: .07em; margin-bottom: 14px; }

    /* Responsibility list */
    .resp-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
    .resp-list li {
      display: flex; align-items: baseline; gap: 10px;
      font-size: .9rem; color: var(--text-2); line-height: 1.65;
    }
    .resp-list li::before {
      content: '—'; font-family: var(--mono); font-size: .72rem;
      color: var(--accent); font-weight: 600; flex-shrink: 0;
    }
    .light .resp-list li::before { color: var(--accent); }
    .tl-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

    /* ═══════════════════════════════════
       CREDENTIALS
    ═══════════════════════════════════ */
    .creds-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
    .creds-two-col { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }

    .edu-timeline { display: flex; flex-direction: column; }
    .edu-entry { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
    .edu-entry:last-child { border-bottom: none; }

    /* University logo container */
    .edu-logo {
      flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      margin-top: 4px;
    }
    /* Plymouth — wide horizontal lockup */
    .edu-logo-ply { width: 130px; height: 28px; }
    .edu-logo-img-ply {
      width: 100%; height: 100%;
      object-fit: contain; object-position: left center;
      filter: none;
      transition: filter .3s, background .3s;
      border-radius: 4px;
    }
    /* Dark mode: Plymouth logo has dark text — give it a white pill background */
    body:not(.light) .edu-logo-ply {
      background: rgba(255,255,255,0.92);
      border-radius: 6px;
      padding: 3px 6px;
    }
    /* Royal College — square navy badge */
    .edu-logo-rc { width: 40px; height: 40px; }
    .edu-logo-img-rc {
      width: 100%; height: 100%;
      object-fit: contain; border-radius: 8px;
      /* Already looks great in dark; in light mode add slight shadow */
      filter: none; transition: filter .3s;
    }
    .light .edu-logo-img-rc {
      filter: drop-shadow(0 1px 4px rgba(0,0,0,.25));
    }
    .edu-icon {
      width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; font-size: .8rem; margin-top: 2px;
    }
    .edu-icon-a { background: rgba(0,230,160,.08); border: 1px solid rgba(0,230,160,.18); color: var(--accent); }
    .edu-icon-b { background: rgba(0,200,255,.08); border: 1px solid rgba(0,200,255,.2); color: var(--accent-2); }
    .edu-icon-c { background: rgba(120,80,255,.08); border: 1px solid rgba(120,80,255,.18); color: #a78bfa; }
    .light .edu-icon-a { background: rgba(26,86,219,.07); border-color: rgba(26,86,219,.18); color: var(--accent); }
    .light .edu-icon-b { background: rgba(8,145,178,.07); border-color: rgba(8,145,178,.2); color: var(--accent-2); }
    .light .edu-icon-c { background: rgba(109,40,217,.06); border-color: rgba(109,40,217,.16); color: #7c3aed; }
    .edu-degree { font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
    .edu-school { font-size: .82rem; color: var(--text-2); }
    .edu-year { font-family: var(--mono); font-size: .67rem; color: var(--accent); letter-spacing: .07em; margin-top: 3px; }
    .edu-year-b { color: var(--accent-2); }
    .edu-year-c { color: #a78bfa; }
    .light .edu-year-c { color: #7c3aed; }

    .cert-list { display: flex; flex-direction: column; }
    .cert-item { display: flex; align-items: flex-start; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--border); }
    .cert-item:last-child { border-bottom: none; }
    .cert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; margin-top: 6px; }
    .cert-name { font-family: var(--mono); font-size: .81rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
    .cert-org { font-size: .8rem; color: var(--text-2); }

    /* ═══════════════════════════════════
       CERTIFICATION BADGE CARDS — single row
    ═══════════════════════════════════ */
    .cert-cards-row {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      gap: 12px;
      align-items: start;
    }
    @media (max-width: 1100px) { .cert-cards-row { grid-template-columns: repeat(4,1fr); } }
    @media (max-width: 640px)  { .cert-cards-row { grid-template-columns: repeat(2,1fr); } }

    .cert-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-lg);
      padding: 16px 12px 14px;
      display: flex; flex-direction: column; align-items: center;
      text-align: center; gap: 10px;
      transition: border-color .25s, transform .25s, box-shadow .25s;
      position: relative; overflow: hidden;
    }
    .cert-card::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left;
      transition: transform .3s ease;
    }
    .cert-card:hover::before { transform: scaleX(1); }
    .cert-card:hover {
      border-color: var(--border-h);
      transform: translateY(-3px);
      box-shadow: 0 0 22px rgba(0,230,160,.08), 0 10px 28px rgba(0,0,0,.18);
    }
    .light .cert-card:hover {
      box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 10px 26px rgba(15,23,42,.08);
    }

    /* Badge image container — fixed square, badge centred */
    .cert-img-wrap {
      width: 90px; height: 90px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      border-radius: 10px;
      background: rgba(255,255,255,0.06);   /* subtle dark-mode tint */
      padding: 6px;
      transition: background .4s;
    }
    .light .cert-img-wrap {
      background: rgba(0,0,0,0.03);         /* near-invisible on light */
    }
    .cert-img-wrap.cert-img-wide {
      width: 120px; height: 72px;
    }
    .cert-badge-img {
      max-width: 100%; max-height: 100%;
      object-fit: contain;
      border-radius: 4px;
      /* Invert near-white badges slightly in dark mode so they pop */
      filter: none;
      transition: filter .4s;
    }
    /* Dark mode: badges that are very light (ISO SkillFront, CISM) need a tiny brightness lift */
    body:not(.light) .cert-badge-img {
      filter: brightness(1.05) drop-shadow(0 2px 8px rgba(0,0,0,.4));
    }
    .light .cert-badge-img {
      filter: drop-shadow(0 2px 6px rgba(0,0,0,.12));
    }

    .cert-card-name {
      font-family: var(--mono); font-size: .68rem; font-weight: 700;
      color: var(--text); line-height: 1.4;
    }
    .cert-card-org {
      font-size: .68rem; color: var(--text-3);
    }
    .cert-card-verified {
      font-family: var(--mono); font-size: .64rem; font-weight: 600;
      color: var(--accent); letter-spacing: .04em;
      display: flex; align-items: center; gap: 4px;
      text-decoration: none;
    }
    .cert-card-verified i { font-size: .7rem; }

    /* ═══════════════════════════════════
       EXTRAS
    ═══════════════════════════════════ */
    .extras-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 10px; }
    .extra-item {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      font-size: .9rem; color: var(--text-2);
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r); padding: 13px 18px;
      transition: border-color .2s, color .2s;
    }
    .extra-item:hover { border-color: var(--border-h); color: var(--text); }
    .extra-year { font-family: var(--mono); font-size: .68rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

    /* ═══════════════════════════════════
       CONTACT
    ═══════════════════════════════════ */
    .contact-block {
      position: relative; overflow: hidden;
      background: var(--surface); border: 1px solid var(--border-h);
      border-radius: 22px; padding: 50px 46px; text-align: center;
    }
    @media (max-width: 600px) { .contact-block { padding: 38px 22px; } }
    .contact-block::before {
      content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
      width: 380px; height: 380px; border-radius: 50%;
      background: radial-gradient(circle, rgba(0,230,160,.08) 0%, transparent 70%);
      pointer-events: none;
    }
    .light .contact-block::before { background: radial-gradient(circle, rgba(26,86,219,.06) 0%, transparent 70%); }
    .contact-block h2 {
      font-family: var(--mono); font-size: clamp(1.5rem,3.5vw,2.2rem);
      font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-bottom: 12px;
    }
    .contact-block p { font-size: .96rem; color: var(--text-2); max-width: 460px; margin: 0 auto 14px; line-height: 1.8; }
    .contact-location {
      font-family: var(--mono); font-size: .78rem !important;
      color: var(--text-3) !important; margin-bottom: 28px !important;
    }
    .contact-cta {
      display: flex; flex-direction: column; align-items: center; gap: 12px;
      margin-bottom: 26px;
    }
    .contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .contact-link {
      display: inline-flex; align-items: center; gap: 8px;
      font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .05em;
      color: var(--text-2); border: 1px solid var(--border); border-radius: 100px;
      padding: 10px 22px; transition: all .22s; text-decoration: none;
    }
    .contact-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(0,230,160,.07); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,230,160,.12); }
    .light .contact-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(26,86,219,.05); box-shadow: 0 6px 18px rgba(26,86,219,.12); }

    /* ═══════════════════════════════════
       FOOTER
    ═══════════════════════════════════ */

    /* ═══════════════════════════════════
       FOOTER
    ═══════════════════════════════════ */
    footer {
      padding: 18px 0;
      border-top: 1px solid var(--border);
    }
    .footer-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }
    .footer-left {
      display: flex; align-items: center; gap: 10px;
    }
    .footer-logo-badge {
      width: 36px; height: 36px; flex-shrink: 0;
    }
    .footer-logo-badge svg { width: 100%; height: 100%; }
    .footer-copy {
      font-family: var(--sans);
      font-size: .82rem;
      color: var(--text-3);
    }
    .footer-nav {
      display: flex;
      align-items: center;
      gap: 24px;
    }
    .footer-nav-link {
      font-family: var(--sans);
      font-size: .82rem;
      color: var(--text-3);
      text-decoration: none;
      transition: color .18s;
    }
    .footer-nav-link:hover { color: var(--text); }


    /* ═══════════════════════════════════
       ANIMATIONS
    ═══════════════════════════════════ */
    .reveal {
      opacity: 0; transform: translateY(24px);
      transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
    }
    .reveal.visible { opacity: 1; transform: none; }
    .stagger > * {
      opacity: 0; transform: translateY(18px);
      transition: opacity .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1);
    }
    .stagger.visible > * { opacity: 1; transform: none; }
    .stagger.visible > *:nth-child(1) { transition-delay: .04s; }
    .stagger.visible > *:nth-child(2) { transition-delay: .10s; }
    .stagger.visible > *:nth-child(3) { transition-delay: .16s; }
    .stagger.visible > *:nth-child(4) { transition-delay: .22s; }
    .stagger.visible > *:nth-child(5) { transition-delay: .28s; }
    .stagger.visible > *:nth-child(6) { transition-delay: .34s; }

    @media (max-width: 600px) { section { padding: 48px 0; } .card { padding: 20px; } }



    /* ═══════════════════════════════════
       CREDENTIALS — badge row
    ═══════════════════════════════════ */
    .cred-badge-row {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      gap: 12px;
    }
    @media (max-width: 1100px) { .cred-badge-row { grid-template-columns: repeat(4,1fr); } }
    @media (max-width: 600px)  { .cred-badge-row { grid-template-columns: repeat(2,1fr); } }

    .cred-badge-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-lg);
      padding: 14px 10px 12px;
      display: flex; flex-direction: column; align-items: center;
      text-align: center; gap: 8px;
      transition: border-color .22s, box-shadow .22s, transform .22s;
      position: relative; overflow: hidden;
    }
    .cred-badge-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left; transition: transform .28s;
    }
    .cred-badge-card:hover::before { transform: scaleX(1); }
    .cred-badge-card:hover {
      border-color: var(--border-h);
      transform: translateY(-3px);
      box-shadow: 0 0 20px rgba(0,230,160,.07), 0 10px 28px rgba(0,0,0,.18);
    }
    .light .cred-badge-card:hover {
      box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 10px 24px rgba(15,23,42,.08);
    }
    .cred-badge-img-wrap {
      width: 80px; height: 80px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 8px;
      background: rgba(255,255,255,.04);
      padding: 4px; transition: background .3s;
    }
    .cred-badge-img-wrap--wide { width: 100px; height: 60px; }
    .light .cred-badge-img-wrap { background: rgba(0,0,0,.03); }
    body:not(.light) .cred-badge-img { filter: brightness(1.05) drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
    .cred-badge-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; }
    .cred-badge-card-name {
      font-family: var(--mono); font-size: .68rem; font-weight: 700;
      color: var(--text); line-height: 1.35;
    }
    .cred-badge-card-org { font-size: .68rem; color: var(--text-3); }
    .cred-badge-verified {
      font-family: var(--mono); font-size: .63rem; font-weight: 600;
      color: var(--accent); display: inline-flex; align-items: center;
      gap: 4px; text-decoration: none;
    }

    /* ═══════════════════════════════════
       QUALIFICATIONS — 3-column
    ═══════════════════════════════════ */
    .qual-master-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0 52px;
      align-items: start;
    }
    @media (max-width: 1000px) { .qual-master-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
    @media (max-width: 640px)  { .qual-master-grid { grid-template-columns: 1fr; gap: 36px; } }

    .qual-col { display: flex; flex-direction: column; }
    .qual-col-title {
      font-size: .82rem; font-weight: 700; color: var(--text);
      letter-spacing: -.01em; padding-bottom: 10px; margin-bottom: 0;
      border-bottom: 1px solid var(--border);
    }
    .qual-list { display: flex; flex-direction: column; }

    /* Education rows */
    .qual-item {
      display: flex; align-items: center; gap: 12px;
      padding: 13px 0; border-bottom: 1px solid var(--border);
    }
    .qual-item:last-child { border-bottom: none; }
    .qual-item--research { align-items: flex-start; }
    .qual-item--research .qual-item-body { padding: 2px 0; }

    .qual-logo { flex-shrink: 0; }
    .qual-logo-ply {
      width: 72px; height: 20px;
      background: transparent; border-radius: 4px; padding: 2px 3px;
      transition: background .3s;
    }
    body:not(.light) .qual-logo-ply { background: rgba(255,255,255,.88); border-radius: 5px; padding: 3px 5px; }
    .qual-logo-rc { width: 34px; height: 34px; }
    .qual-uni-img-ply { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
    .qual-uni-img-rc  { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

    .qual-degree { font-size: .87rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 2px; }
    .qual-school { font-size: .78rem; color: var(--text-3); line-height: 1.5; }
    .qual-year   { font-family: var(--mono); font-size: .67rem; color: var(--accent); margin-top: 2px; letter-spacing: .04em; }

    /* Certification rows */
    .qual-cert-row {
      padding: 10px 0; border-bottom: 1px solid var(--border);
    }
    .qual-cert-row:last-child { border-bottom: none; }
    .qual-cert-name { font-size: .85rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 3px; }
    .qual-cert-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .qual-cert-org  { font-size: .76rem; color: var(--text-3); }
    .qual-cert-year {
      font-family: var(--mono); font-size: .66rem; color: var(--accent);
      letter-spacing: .04em; white-space: nowrap; flex-shrink: 0;
    }

    /* Skills */
    .qual-skills { display: flex; flex-direction: column; gap: 16px; margin-top: 2px; }
    .qual-skill-group {}
    .qual-skill-label {
      font-family: var(--mono); font-size: .67rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      color: var(--text-3); margin-bottom: 7px;
    }
    .qual-skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
    .qt-tag {
      font-family: var(--mono); font-size: .68rem;
      color: var(--text-3); background: var(--surface);
      border: 1px solid var(--border); border-radius: 100px;
      padding: 3px 10px; transition: border-color .18s;
    }
    .qt-tag--hl {
      color: #e8edf4;
      border-color: #00e6a0;
      background: var(--bg);
    }
    .light .qt-tag--hl {
      color: #0f172a;
      border-color: #1a56db;
      background: var(--bg);
    }

    /* ═══════════════════════════════════
       LAB — Threshold Tuning Explorer
    ═══════════════════════════════════ */
    .lab-page { padding: 40px 0 30px; }
    .lab-topbar {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 32px;
    }
    .lab-back {
      font-family: var(--mono); font-size: .8rem; color: var(--text-2);
      transition: color .18s;
    }
    .lab-back:hover { color: var(--accent); }
    .lab-title {
      font-family: var(--mono); font-weight: 700;
      font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.02em;
      color: var(--text); margin: 6px 0 16px;
    }
    .lab-intro {
      font-size: .96rem; color: var(--text-2); line-height: 1.8;
      max-width: 760px; margin-bottom: 30px;
    }
    .lab-intro strong { color: var(--text); font-weight: 600; }

    .lab-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 20px;
    }
    .lab-card-head {
      display: flex; align-items: center; justify-content: space-between;
      flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
      font-family: var(--mono); font-size: .82rem; font-weight: 700;
      color: var(--text); letter-spacing: .02em;
    }
    .lab-mini { font-weight: 500; color: var(--text-3); font-size: .74rem; }
    .lab-legend {
      display: flex; flex-wrap: wrap; gap: 14px;
      font-family: var(--mono); font-size: .68rem; font-weight: 500;
      color: var(--text-2); letter-spacing: 0;
    }
    .lab-legend span { display: inline-flex; align-items: center; gap: 6px; }
    .lab-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

    .lab-hist {
      width: 100%; height: auto; display: block;
      touch-action: none; cursor: ew-resize; user-select: none;
    }
    .lab-axtx  { font-family: var(--mono); font-size: 11px; fill: var(--text-3); }
    .lab-axlbl { font-family: var(--mono); font-size: 11px; fill: var(--text-3); }
    .lab-thlbl { font-family: var(--mono); font-size: 13px; font-weight: 700; }

    .lab-slider-row {
      display: flex; align-items: center; gap: 14px; margin-top: 18px;
    }
    .lab-slider-cap {
      font-family: var(--mono); font-size: .74rem; font-weight: 600;
      color: var(--text-2); white-space: nowrap;
    }
    .lab-range { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
    .lab-slider-val {
      font-family: var(--mono); font-size: .9rem; font-weight: 700;
      color: var(--accent); min-width: 42px; text-align: right;
    }

    .lab-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
    .lab-preset {
      font-family: var(--mono); font-size: .7rem; font-weight: 600;
      letter-spacing: .03em; padding: 7px 14px; border-radius: 100px;
      border: 1px solid var(--border); background: transparent;
      color: var(--text-2); cursor: pointer; transition: all .18s;
    }
    .lab-preset:hover { border-color: var(--border-h); color: var(--text); }
    .lab-preset.active {
      background: var(--accent); color: #040a07; border-color: var(--accent);
      box-shadow: 0 0 14px rgba(0,230,160,.22);
    }
    .light .lab-preset.active { color: #fff; }
    .lab-preset.star { border-color: rgba(0,230,160,.35); }
    .lab-preset-star { opacity: .8; }

    .lab-lower { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
    @media (max-width: 820px) { .lab-lower { grid-template-columns: 1fr; } }

    /* confusion matrix */
    .lab-cm {
      display: grid;
      grid-template-columns: auto 1fr 1fr;
      gap: 6px; margin-bottom: 18px;
    }
    .lab-cm-corner {}
    .lab-cm-phead {
      font-family: var(--mono); font-size: .66rem; font-weight: 700;
      color: var(--text-3); text-align: center; align-self: end;
      padding-bottom: 4px; letter-spacing: .04em;
    }
    .lab-cm-ahead {
      font-family: var(--mono); font-size: .66rem; font-weight: 700;
      color: var(--text-3); display: flex; align-items: center;
      padding-right: 8px; letter-spacing: .04em; text-align: right;
      justify-content: flex-end;
    }
    .lab-cm-cell {
      border-radius: 10px; padding: 14px 10px; text-align: center;
      border: 1px solid var(--border);
    }
    .lab-cm-cell span {
      display: block; font-family: var(--mono); font-size: 1.25rem;
      font-weight: 700; color: var(--text); line-height: 1.1;
    }
    .lab-cm-cell label {
      font-family: var(--mono); font-size: .6rem; color: var(--text-3);
      letter-spacing: .04em;
    }
    .lab-cm-cell.good { background: rgba(0,230,160,.07); border-color: rgba(0,230,160,.2); }
    .lab-cm-cell.fp   { background: rgba(255,84,112,.1);  border-color: rgba(255,84,112,.32); }
    .lab-cm-cell.fp span { color: #ff5470; }
    .lab-cm-cell.fn   { background: rgba(255,179,71,.09); border-color: rgba(255,179,71,.28); }
    .lab-cm-cell.fn span { color: #ffb347; }

    .lab-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; }
    .lab-tile { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
    .lab-tile label {
      display: block; font-family: var(--mono); font-size: .62rem;
      color: var(--text-3); letter-spacing: .03em; margin-bottom: 5px;
    }
    .lab-tile span { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--text); }

    .lab-roc { width: 100%; height: auto; display: block; max-width: 320px; margin: 0 auto; }
    .lab-roc-note {
      font-size: .82rem; color: var(--text-3); line-height: 1.7; margin-top: 12px;
    }

    .lab-footer {
      display: flex; align-items: center; justify-content: space-between;
      flex-wrap: wrap; gap: 10px; margin-top: 30px; padding-top: 20px;
      border-top: 1px solid var(--border);
    }

    /* Lab index — tool card grid */
    .lab-tool-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 16px; margin-bottom: 10px;
    }
    .lab-tool-card {
      position: relative; overflow: hidden; display: flex; flex-direction: column;
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 22px 22px 20px;
      transition: border-color .22s, box-shadow .22s, transform .22s;
    }
    .lab-tool-card::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transform: scaleX(0); transform-origin: left; transition: transform .28s;
    }
    .lab-tool-card--live { cursor: pointer; }
    .lab-tool-card--live:hover {
      border-color: var(--border-h); transform: translateY(-3px);
      box-shadow: 0 0 22px rgba(0,230,160,.08), 0 12px 30px rgba(0,0,0,.2);
    }
    .lab-tool-card--live:hover::before { transform: scaleX(1); }
    .light .lab-tool-card--live:hover { box-shadow: 0 2px 8px rgba(26,86,219,.08), 0 12px 28px rgba(15,23,42,.08); }
    .lab-tool-card--soon { opacity: .62; }

    .lab-tool-head {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 12px;
    }
    .lab-ch {
      font-family: var(--mono); font-size: .68rem; font-weight: 700;
      letter-spacing: .12em; color: var(--text-3);
    }
    .lab-status {
      font-family: var(--mono); font-size: .62rem; font-weight: 700;
      letter-spacing: .06em; text-transform: uppercase;
      padding: 3px 9px; border-radius: 100px;
    }
    .lab-status--live { color: var(--accent); background: rgba(0,230,160,.09); border: 1px solid rgba(0,230,160,.24); }
    .lab-status--soon { color: var(--text-3); border: 1px solid var(--border); }

    .lab-tool-title {
      font-family: var(--mono); font-size: 1rem; font-weight: 700;
      color: var(--text); line-height: 1.3; margin-bottom: 10px;
    }
    .lab-tool-card--live:hover .lab-tool-title { color: var(--accent); }
    .lab-tool-desc {
      font-size: .88rem; color: var(--text-2); line-height: 1.7;
      flex: 1; margin-bottom: 14px;
    }
    .lab-tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
    .lab-tool-action {
      font-family: var(--mono); font-size: .7rem; font-weight: 600;
      letter-spacing: .06em; text-transform: uppercase;
      color: var(--text-3); border-top: 1px solid var(--border);
      padding-top: 13px; margin-top: auto;
    }
    .lab-tool-card--live .lab-tool-action { color: var(--accent); }

    /* ═══════════════════════════════════
       CASE STUDY — /work/[slug]
    ═══════════════════════════════════ */
    .cs-page { padding: 40px 0 30px; }
    .cs-title {
      font-family: var(--mono); font-weight: 700;
      font-size: clamp(1.7rem, 4.5vw, 2.6rem); letter-spacing: -.02em;
      color: var(--text); line-height: 1.15; margin: 8px 0 14px; max-width: 900px;
    }
    .cs-subtitle {
      font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-2);
      line-height: 1.6; max-width: 720px; margin-bottom: 18px;
    }
    .cs-meta {
      display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
      font-family: var(--mono); font-size: .74rem; color: var(--text-3);
      letter-spacing: .04em; padding-bottom: 28px;
      border-bottom: 1px solid var(--border); margin-bottom: 32px;
    }
    .cs-status-done    { color: var(--accent); }
    .cs-status-ongoing { color: #ffb347; }

    .cs-layout {
      display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start;
    }
    @media (max-width: 820px) { .cs-layout { grid-template-columns: 1fr; gap: 32px; } }

    .cs-body { font-size: 1rem; color: var(--text-2); line-height: 1.9; }
    .cs-body + .cs-body { margin-top: 18px; }

    .cs-h2 {
      font-family: var(--mono); font-size: 1.05rem; font-weight: 700;
      color: var(--text); margin: 34px 0 16px;
    }
    .cs-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
    .cs-list li {
      position: relative; padding-left: 22px;
      font-size: .96rem; color: var(--text-2); line-height: 1.75;
    }
    .cs-list li::before {
      content: ''; position: absolute; left: 3px; top: 10px;
      width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
    }
    .cs-list li strong { color: var(--text); font-weight: 600; }

    .cs-role {
      display: inline-flex; align-items: center; gap: 6px;
      font-family: var(--mono); font-size: .7rem; font-weight: 700;
      letter-spacing: .06em; text-transform: uppercase;
      color: var(--accent-2); background: rgba(0,200,255,.07);
      border: 1px solid rgba(0,200,255,.2); border-radius: 5px;
      padding: 6px 12px; margin: 26px 0 12px;
    }
    .light .cs-role { background: rgba(8,145,178,.07); border-color: rgba(8,145,178,.18); }
    .cs-contrib {
      padding: 14px 16px; border-left: 2px solid var(--accent-2);
      background: rgba(0,200,255,.05); border-radius: 0 8px 8px 0;
      font-size: .92rem; color: var(--text-2); line-height: 1.75;
    }
    .light .cs-contrib { background: rgba(8,145,178,.05); }

    .cs-side {
      position: sticky; top: 90px;
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r-lg); padding: 20px 22px;
    }
    @media (max-width: 820px) { .cs-side { position: static; } }
    .cs-stack-title {
      font-family: var(--mono); font-size: .82rem; font-weight: 700;
      color: var(--text); margin-bottom: 14px;
    }
    .cs-stack-tags { display: flex; flex-wrap: wrap; gap: 7px; }
    .cs-cta {
      display: block; text-align: center; margin-top: 20px;
      font-family: var(--mono); font-size: .78rem; font-weight: 700;
      color: #040a07; background: var(--accent);
      border-radius: 100px; padding: 12px 18px;
      transition: opacity .18s, transform .18s;
    }
    .light .cs-cta { color: #fff; }
    .cs-cta:hover { opacity: .9; transform: translateY(-1px); }
    .cs-cta--ghost {
      margin-top: 10px; background: transparent; color: var(--accent);
      border: 1px solid var(--border-h);
    }
    .light .cs-cta--ghost { color: var(--accent); }
    /* ═══════════════════════════════════
       CREDENTIALS — always dark
       Certification badges are authored for dark surfaces, so this
       section keeps the dark palette regardless of the site theme.
       Redefining the tokens locally means every child (labels, cards,
       borders, accents) follows without further overrides.
    ═══════════════════════════════════ */

    /* Badge plates and imagery keep the dark-mode treatment in both themes */
    #credentials .cred-badge-img-wrap { background: rgba(255,255,255,.04); }
    #credentials .cred-badge-img {
      filter: brightness(1.05) drop-shadow(0 1px 4px rgba(0,0,0,.4));
    }
    #credentials .cred-badge-card { background: var(--surface); border-color: var(--border); }
    #credentials .cred-badge-card:hover {
      border-color: var(--border-h);
      box-shadow: 0 0 20px rgba(0,230,160,.07), 0 10px 28px rgba(0,0,0,.18);
    }

    /* ═══════════════════════════════════
       SECTION HEADERS — label row + lead
    ═══════════════════════════════════ */
    .section-head-row {
      display: flex; align-items: center; justify-content: space-between;
      gap: 14px; flex-wrap: wrap;
    }
    .section-count {
      font-family: var(--mono); font-size: .64rem; font-weight: 700;
      letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
      border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px;
    }
    .section-lead {
      font-size: .98rem; color: var(--text-2); line-height: 1.8;
      max-width: 620px; margin-bottom: 30px;
    }
    .section-lead strong { color: var(--text); font-weight: 500; }

    /* ── Pillar cards gain a trailing arrow ── */
    .pillar-foot {
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px; padding-top: 14px; margin-top: auto;
      border-top: 1px solid var(--border);
    }
    .pillar-foot .pillar-tags { padding-top: 0; border-top: none; flex: 1; }
    .pillar-arrow {
      font-family: var(--mono); font-size: .95rem; color: var(--text-3);
      flex-shrink: 0; transition: color .2s, transform .2s;
    }
    .pillar-card:hover .pillar-arrow { color: var(--accent); transform: translateX(3px); }

    /* ── Project card meta: category · status, then year ── */
    .proj-meta-left {
      display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
    }
    .proj-status {
      font-family: var(--mono); font-size: .6rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
    }
    .proj-status--done    { color: var(--text-3); }
    .proj-status--ongoing { color: #ffb347; }
    .light .proj-status--ongoing { color: #b45309; }
    .proj-meta-sep { color: var(--text-3); font-size: .6rem; }

    /* ═══════════════════════════════════
       SCROLL REVEALS — disabled
       Content is present as soon as the section is reached, rather
       than fading in on scroll. The hero keeps its one-time load-in.
       To restore scroll reveals, delete this block.
    ═══════════════════════════════════ */
    .reveal,
    .stagger > * {
      opacity: 1;
      transform: none;
      transition: none;
    }
    .stagger.visible > *:nth-child(n) { transition-delay: 0s; }

    /* ═══════════════════════════════════
       DISCIPLINE VISUALISATIONS
       One diagram per pillar, each drawn from my own work:
       ISO 27001 control coverage, web-app payload testing, and the
       decision-threshold sweep from the MSc dissertation.
       CSS-only, and stilled for prefers-reduced-motion.
    ═══════════════════════════════════ */
    .pillar-card { padding-bottom: 0; }
    .pillar-viz {
      margin: 16px -24px 0;
      border-top: 1px solid var(--border);
      background: rgba(0,0,0,.16);
      height: 142px; padding: 14px 18px;
      overflow: hidden; position: relative;
      border-radius: 0 0 var(--r-lg) var(--r-lg);
      display: flex; flex-direction: column;
    }
    /* keep the caption pinned and centre the diagram in what's left,
       so the panel reads the same at any card width */
    .viz-grid, .viz-req, .viz-thr { margin: auto 0; }
    .light .pillar-viz { background: rgba(15,23,42,.035); }
    @media (min-width: 1920px) { .pillar-viz { margin-left: -30px; margin-right: -30px; } }
    @media (min-width: 2400px) { .pillar-viz { margin-left: -34px; margin-right: -34px; height: 168px; } }

    .viz-cap {
      font-family: var(--mono); font-size: .56rem; letter-spacing: .14em;
      text-transform: uppercase; color: var(--text-3);
      display: flex; justify-content: space-between; margin-bottom: 9px;
    }
    .viz-cap b { color: var(--accent); font-weight: 700; }

    /* ── 01 · ISO 27001 control coverage ── */
    .viz-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(13px, 1fr));
      grid-auto-rows: 11px;
      gap: 3px;
    }
    .viz-cell {
      border-radius: 1.5px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      animation: vizFill 9s ease-in-out infinite;
    }
    @keyframes vizFill {
      0%, 4%   { background: var(--surface-2); border-color: var(--border); }
      12%, 62% { background: rgba(0,230,160,.55); border-color: var(--accent); }
      74%,100% { background: var(--surface-2); border-color: var(--border); }
    }
    .viz-cell--gap { animation-name: vizGap; }
    @keyframes vizGap {
      0%, 40%  { background: var(--surface-2); border-color: var(--border); }
      52%, 62% { background: rgba(255,179,71,.5); border-color: #ffb347; }
      74%,100% { background: var(--surface-2); border-color: var(--border); }
    }

    /* ── 02 · findings ranked by severity, then remediated ── */
    .viz-bars { display: flex; flex-direction: column; gap: 6px; }
    .viz-bar-row {
      display: grid; grid-template-columns: 46px 1fr 34px;
      align-items: center; gap: 10px;
      font-family: var(--mono); font-size: .57rem; letter-spacing: .06em;
    }
    .viz-bar-label { color: var(--text-2); }
    .viz-bar-track {
      height: 6px; border-radius: 3px; overflow: hidden;
      background: var(--surface-2); border: 1px solid var(--border);
    }
    .viz-bar-fill {
      display: block; height: 100%; width: 0; border-radius: 3px;
      background: var(--c);
      animation: vizBar 8s ease-in-out infinite;
      animation-delay: var(--d);
    }
    @keyframes vizBar {
      0%   { width: 0;        background: var(--c) }
      16%  { width: var(--w); background: var(--c) }
      56%  { width: var(--w); background: var(--c) }
      70%  { width: var(--w); background: var(--accent) }
      94%  { width: var(--w); background: var(--accent) }
      100% { width: 0;        background: var(--c) }
    }
    .viz-bar-sev {
      text-align: right; font-weight: 700; letter-spacing: .08em;
      animation: vizSev 8s ease-in-out infinite;
    }
    .viz-bar-sev--high { color: #ff5470; }
    .viz-bar-sev--med  { color: #ffb347; }
    .viz-bar-sev--low  { color: var(--text-3); }
    @keyframes vizSev { 0%, 60% { opacity: 1 } 74%, 100% { opacity: .3 } }

    /* ── 03 · decision-threshold sweep (MemSift) ── */
    .viz-thr { width: 100%; height: 78px; display: block; }
    .viz-sweep { animation: vizSweep 7s ease-in-out infinite; }
    @keyframes vizSweep {
      0%, 100% { transform: translateX(112px) }
      50%      { transform: translateX(178px) }
    }
    .viz-thr-label {
      font-family: var(--mono); font-size: 7.5px; letter-spacing: .1em;
    }

    @media (prefers-reduced-motion: reduce) {
      .viz-cell, .viz-bar-fill, .viz-bar-sev, .viz-sweep { animation: none !important; }
      .viz-bar-fill { width: var(--w) }
    }

    /* ═══════════════════════════════════
       FEATURED PROJECT CAROUSEL
       One project at a time with its own diagram, rotating on a
       timer; the grid below still lists everything.
    ═══════════════════════════════════ */
    .feat {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-lg);
      padding: 34px 36px 22px;
      margin-bottom: 20px;
    }
    @media (max-width: 700px) { .feat { padding: 24px 20px 18px; } }

    .feat-slide { display: none; }
    .feat-slide.active {
      display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
      animation: featIn .45s cubic-bezier(.22,1,.36,1);
    }
    @media (max-width: 860px) { .feat-slide.active { grid-template-columns: 1fr; gap: 26px; } }
    @keyframes featIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

    .feat-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
    .feat-badge {
      font-family: var(--mono); font-size: .6rem; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase;
      color: var(--accent); background: rgba(0,230,160,.09);
      border: 1px solid rgba(0,230,160,.24); border-radius: 4px; padding: 5px 11px;
    }
    .light .feat-badge { background: rgba(26,86,219,.07); border-color: rgba(26,86,219,.2); }
    .feat-year { font-family: var(--mono); font-size: .7rem; color: var(--text-3); }
    .feat-title {
      font-family: var(--mono); font-weight: 700;
      font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.02em;
      color: var(--text); line-height: 1.15; margin-bottom: 12px;
    }
    .feat-desc { font-size: .98rem; color: var(--text-2); line-height: 1.75; margin-bottom: 20px; max-width: 44ch; }
    .feat-cta {
      font-family: var(--mono); font-size: .76rem; font-weight: 600;
      color: var(--accent); display: inline-flex; align-items: center; gap: 7px;
      transition: gap .18s;
    }
    .feat-cta:hover { gap: 11px; }

    .feat-viz {
      background: rgba(0,0,0,.22); border: 1px solid var(--border);
      border-radius: 10px; padding: 14px 16px; height: 186px;
      display: flex; flex-direction: column;
    }
    .light .feat-viz { background: rgba(15,23,42,.04); }
    .feat-viz-cap {
      font-family: var(--mono); font-size: .58rem; letter-spacing: .1em;
      color: var(--text-3); margin-bottom: 10px; flex-shrink: 0;
    }
    .feat-viz-body { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
    .feat-viz-body svg { width: 100%; height: 100%; display: block; }
    .feat-caption {
      font-family: var(--mono); font-size: .6rem; color: var(--text-3);
      line-height: 1.6; margin-top: 11px;
    }

    .feat-foot {
      display: flex; align-items: center; gap: 20px;
      margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border);
    }
    .feat-dots { display: flex; gap: 8px; flex-shrink: 0; }
    .feat-dot {
      width: 7px; height: 7px; border-radius: 50%; padding: 0;
      background: var(--text-3); opacity: .3; border: none; cursor: pointer;
      transition: opacity .2s, background .2s;
    }
    .feat-dot:hover { opacity: .7; }
    .feat-dot.active { background: var(--accent); opacity: 1; }
    .feat-bar { flex: 1; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
    .feat-bar-fill {
      display: block; height: 100%; width: 0; background: var(--accent);
      animation: featBar 7s linear forwards;
    }
    @keyframes featBar { from { width: 0 } to { width: 100% } }
    .feat-count { font-family: var(--mono); font-size: .68rem; color: var(--text-3); flex-shrink: 0; }

    /* diagram primitives shared by the four project visuals */
    .fv-label { font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; }
    .fv-num   { font-family: var(--mono); font-size: 13px; font-weight: 700; }
    .fv-pulse { animation: fvPulse 2.6s ease-in-out infinite; }
    @keyframes fvPulse { 0%,100% { opacity:.35 } 50% { opacity:1 } }
    .fv-sweep { animation: fvSweep 3.4s linear infinite; transform-origin: 160px 60px; }
    @keyframes fvSweep { to { transform: rotate(360deg) } }
    .fv-hop { animation: fvHop 4s ease-in-out infinite; }
    @keyframes fvHop {
      0%,8%    { transform: translateX(0) }
      25%,33%  { transform: translateX(78px) }
      50%,58%  { transform: translateX(156px) }
      75%,100% { transform: translateX(234px) }
    }
    .fv-bit { animation: fvBit 2.2s steps(1) infinite; }
    @keyframes fvBit { 0%,50% { opacity:.25 } 51%,100% { opacity:1 } }

    @media (prefers-reduced-motion: reduce) {
      .fv-pulse, .fv-sweep, .fv-hop, .fv-bit,
      .feat-slide.active { animation: none !important; }
    }

    /* ═══════════════════════════════════
       HERO BAND
       Full-bleed dark panel with a meta rail, a side index and an
       outro strip. Stays dark in both themes, like #credentials.
    ═══════════════════════════════════ */
    #home {
      --bg:        #080c10;
      --surface:   #0d1117;
      --surface-2: #111820;
      --border:    rgba(0,230,160,0.12);
      --border-h:  rgba(0,230,160,0.32);
      --accent:    #00e6a0;
      --accent-2:  #00c8ff;
      --text:      #e8edf4;
      --text-2:    #a0b0c4;
      --text-3:    #5a7090;

      background: #080c10;
      color: var(--text);
      position: relative;
      /* The section sits outside .wrapper, so it is already full width.
         No 100vw trick, which would overflow by the scrollbar width. */
      padding: 0;
      overflow: hidden;
    }
    .hero-band-inner {
      max-width: 1120px; margin: 0 auto;
      padding: 86px 24px 44px;
      position: relative; z-index: 1;
    }

    /* meta rail across the top of the band */
    .hero-topbar {
      display: flex; align-items: center; justify-content: space-between;
      gap: 16px; flex-wrap: wrap;
      font-family: var(--mono); font-size: .64rem; font-weight: 500;
      letter-spacing: .15em; text-transform: uppercase; color: var(--text-3);
      padding-bottom: 13px; border-bottom: 1px solid var(--border);
      margin-bottom: clamp(24px, 3.2vw, 54px);
    }
    .hero-topbar-left { display: inline-flex; align-items: center; gap: 9px; }
    .hero-sig { color: var(--text-3); }
    .hero-sig b { color: var(--accent); font-weight: 500; }

    /* rule before the role line */
    .hero-role { display: flex; align-items: center; gap: 13px; }
    .hero-role::before {
      content: ''; display: block; width: 34px; height: 1px;
      background: var(--accent); flex-shrink: 0;
    }


    /* outro strip at the foot of the band */
    .hero-outro {
      display: flex; align-items: center; justify-content: space-between;
      gap: 16px; flex-wrap: wrap;
      margin-top: clamp(12px, 1.3vw, 22px);
      padding-top: 12px; border-top: 1px solid var(--border);
      font-family: var(--mono); font-size: .68rem;
    }
    .hero-outro-cta {
      color: var(--accent); font-weight: 600; display: inline-flex;
      align-items: center; gap: 8px; transition: gap .18s;
    }
    .hero-outro-cta:hover { gap: 12px; }
    .hero-outro-scroll {
      color: var(--text-3); letter-spacing: .15em; text-transform: uppercase;
      display: inline-flex; align-items: center; gap: 8px; font-size: .6rem;
    }

    /* the band supplies its own rhythm, so drop the old hero paddings */
    .hero { min-height: 0; padding: 0; }

    /* ═══════════════════════════════════
       SECTION BANDS
       Sections run full width; the reading column is constrained by
       .section-inner. Alternating tints give the page its rhythm,
       with two near-black bands (hero, credentials) as punctuation.
    ═══════════════════════════════════ */
    .section-inner {
      max-width: 1120px; margin: 0 auto; padding: 0 24px;
    }
    .band { background: var(--bg); transition: background .4s; }
    .band--tint { background: var(--band-tint); }
    .band--dark {
      --bg:        #080c10;
      --surface:   #0d1117;
      --surface-2: #111820;
      --border:    rgba(0,230,160,0.12);
      --border-h:  rgba(0,230,160,0.32);
      --accent:    #00e6a0;
      --accent-2:  #00c8ff;
      --text:      #e8edf4;
      --text-2:    #a0b0c4;
      --text-3:    #5a7090;
      background: #080c10;
      color: var(--text);
    }

    /* ═══════════════════════════════════
       RESPONSIVE SCALE
       One fluid system instead of discrete jumps, so the layout is
       correct at every resolution from small phones through HD,
       QHD, ultrawide, 4K and 5K rather than only at tested widths.

       - Root font-size scales fluidly, so every rem value follows.
       - The reading column grows with the viewport but stays capped
         so line length never becomes unreadable on huge displays.
       - Section and card padding scale with vw, floored and ceilinged.
    ═══════════════════════════════════ */
    html {
      font-size: clamp(16px, 0.6vw + 7.4px, 30px);
    }

    .wrapper, .nav-inner, .hero-band-inner, .section-inner {
      width: 100%;
      max-width: clamp(1120px, 76vw, 2200px);
      margin-left: auto; margin-right: auto;
      padding-left: clamp(18px, 2.6vw, 60px);
      padding-right: clamp(18px, 2.6vw, 60px);
    }

    section { padding: clamp(46px, 4.6vw, 132px) 0; }
    .nav-inner { height: clamp(60px, 4.2vw, 104px); }
    .hero-band-inner { padding-top: clamp(74px, 5.2vw, 142px); padding-bottom: clamp(16px, 1.2vw, 34px); }

    .card, .lab-tool-card, .lab-card { padding: clamp(20px, 1.5vw, 40px); }
    .pillar-card { padding: clamp(20px, 1.5vw, 40px); padding-bottom: 0; }
    .contact-block { padding: clamp(34px, 3.4vw, 90px) clamp(22px, 3vw, 80px); }
    .tl-card { padding: clamp(18px, 1.4vw, 38px) clamp(18px, 1.5vw, 40px); }

    /* Prose should not stretch into unreadable line lengths on wide screens */
    .about-text { max-width: 78ch; }
    .cs-body, .lab-intro, .section-lead, .hero-sub { max-width: 72ch; }

    /* Denser grids once there is genuinely more room */
    @media (min-width: 2200px) {
      .projects-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
      .pillar-grid   { grid-template-columns: repeat(auto-fit,  minmax(320px, 1fr)); }
      .lab-tool-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
      .extras-grid   { grid-template-columns: repeat(auto-fit,  minmax(320px, 1fr)); }
      .cred-badge-row{ grid-template-columns: repeat(8, 1fr); }
    }

    /* Hairlines stay hairlines however far the type scales up */
    @media (min-width: 1800px) {
      .card, .tl-card, .pillar-card, .lab-tool-card,
      .hero-term, .hero-strip, .cs-side, .lab-card,
      .band, .band--tint { border-width: 1px; }
      .divider { height: 1px; }
    }

    /* Small screens */
    @media (max-width: 700px) {
      .hero-band-inner { padding-top: 78px; }
      .section-inner { padding-left: 18px; padding-right: 18px; }
    }
    @media (max-width: 380px) {
      .hero-actions .btn { padding: 11px 18px; font-size: .82rem; }
      .section-inner { padding-left: 14px; padding-right: 14px; }
    }
