    :root {
      --bg: #05040a;
      --border: #1d1c2c;
      --green: #5dff7a;
      --red: #ff4b4b;
      --text: #f5f5f5;
      --dim: #9a9ab0;
      --btn-bg: #151422;
      --btn-border: #34324a;
      --hero-left: #000;
      --hero-right: #fff;
      --lens: currentColor;
      --reflect: currentColor;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }

    body {
      min-height: 100vh;
      font-family: "Rationale", sans-serif;
      background: var(--bg);
      color: var(--text);
      overflow-x: hidden;
      margin: 0;
    }

    #binaryRain {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      pointer-events: none;
      z-index: 0;
      opacity: 0.08;
    }

    .top-nav {
      position: fixed;
      top: 0; left: 0; right: 0;
      display: flex;
      justify-content: center;
      padding: 0.75rem 1rem;
      z-index: 100;
      pointer-events: none;      /* only the pill itself is clickable */
    }
    /* Dark pill behind the links — readable over black, white, green or the rain */
    .nav-pill {
      display: flex;
      flex-wrap: wrap;           /* wraps inside the pill rather than overflowing on tiny screens */
      justify-content: center;
      gap: clamp(0.25rem, 2vw, 1.5rem);
      padding: 0.3rem clamp(0.5rem, 2vw, 1rem);
      border-radius: 999px;
      background: rgba(5,4,10,0.78);
      border: 1px solid rgba(255,255,255,0.08);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      box-shadow: 0 4px 20px rgba(0,0,0,0.35);
      pointer-events: auto;
    }

    .top-nav a {
      text-decoration: none;
      color: var(--dim);
      font-size: clamp(0.7rem, 3vw, 1.2rem);
      text-transform: lowercase;
      padding: 0.35rem 0.5rem;
      transition: all 0.3s ease;
      font-family: "JetBrains Mono", monospace;
    }

    .top-nav a:hover {
      color: var(--green);
      text-shadow: 0 0 8px var(--green);
      letter-spacing: 0.12rem;
    }

    .hero {
      height: 100vh;
      height: 100svh;                     /* mobile: excludes browser toolbars */
      min-height: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding: 0;
      overflow: hidden;
      z-index: 1;
      position: relative;
    }

    .hero-inner {
      width: 100%;
      max-width: 960px;
      text-align: center;
      padding: 0 1.5rem;
    }

    #logo-container {
      width: 100vw;                       /* full screen width, not parent width */
      margin-left: calc(50% - 50vw);      /* pulls it out to the left screen edge */
      height: 100vh;                      /* full screen — the logo no longer shrinks */
      height: 100svh;
      overflow: hidden;
      background: var(--hero-left, #000);
      display: grid;
      place-items: center;
      position: relative;
    }

    /* The white right half — a real element so it can slide in */
    .hero-white {
      position: absolute;
      top: 0; right: 0;
      width: 50%; height: 100%;
      background: var(--hero-right, #fff);
    }

    #logo-container svg {
      width: min(700px, 80%);    /* keeps the logo from blowing up to full width */
      height: auto;
      display: block;
      position: relative;        /* sits above the white panel */
      z-index: 1;
    }

    /* Intro text (quote + credit) — only shown when the animation runs */
    .hero-intro { display: none; }
    .hero-anim .hero-intro {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 0 1.5rem;
      z-index: 2;
      pointer-events: none;
    }
    .hero-quote,
    .hero-credit {
      grid-area: 1 / 1;          /* stack both in the same centred spot */
      text-align: center;
      font-size: clamp(1.6rem, 5vw, 3rem);
      line-height: 1.35;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text);
    }
    .hero-quote { max-width: 22ch; }

    /* "invent it..." — own box so it can move, glitch and fade independently */
    .q-invent { display: inline-block; position: relative; }
    .q-glitch {
      display: inline-block;
    }
    .q-underline {
      position: absolute;
      left: 0; right: 0;
      bottom: -0.12em;
      height: 3px;
      background: var(--green);
      box-shadow: 0 0 10px rgba(93,255,122,0.8);
      transform-origin: left center;
    }

    /* "Designed by..." + TylerRTDev */
    .hero-credit { white-space: nowrap; }
    .credit-line { font-size: 0.6em; }
    .tw-cursor { color: var(--green); animation: tw-blink 1s steps(1) infinite; }
    @keyframes tw-blink { 50% { opacity: 0; } }
    .credit-name {
      display: inline-grid;      /* hidden copy holds the width while it decodes */
      margin-top: 0.3em;
      text-transform: none;      /* keep TylerRTDev's casing */
      color: var(--green);
    }
    .name-size, .name-text { grid-area: 1 / 1; }
    .name-size { visibility: hidden; }

    /* Split-flap cells for TylerRTDev: hidden final letter holds each cell's width */
    .flap { display: inline-grid; perspective: 400px; }
    .flap-size, .flap-char { grid-area: 1 / 1; text-align: center; }
    .flap-size { visibility: hidden; }
    .flap-char { transform-origin: 50% 50%; backface-visibility: hidden; }

    /* LDN: an invisible copy holds the width, so the title never shifts while scrambling */
    .hero-ldn { display: inline-grid; }
    .ldn-size, .ldn-text { grid-area: 1 / 1; text-align: center; }
    .ldn-size { visibility: hidden; }

    /* Start state of the scroll animation (only when .hero-anim is set) */
    .hero-anim #logo-container { background: transparent; }
    .hero-anim .top-nav,
    .hero-anim .hero-white,
    .hero-anim .hero-black,
    .hero-anim .hero-quote,
    .hero-anim .hero-credit,
    .hero-anim #logo-container svg,
    .hero-anim .hero-title,
    .hero-anim .hero-tagline { visibility: hidden; }

    .hero-title {
      font-size: clamp(2rem, 6vw, 3.5rem);
      font-family: "Rationale", sans-serif;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      line-height: 1.3;
      margin-bottom: 1.2rem;
    }

    .hero-dev { color: var(--text); }
    .hero-path { color: var(--green); }

    .hero-tagline {
      max-width: 48rem;
      margin: 0 auto 2.4rem;
      text-transform: uppercase;
      font-size: clamp(0.85rem, 1.2vw, 1rem);
      letter-spacing: 0.12em;
      line-height: 1.7;
      color: var(--dim);
    }

    .scroll-hint {
      position: absolute;
      bottom: 2rem;
      left: 50%;
      transform: translateX(-50%);
      color: var(--green);
      font-size: clamp(1rem, 1.8vw, 1.3rem);
      letter-spacing: 0.15em;
      text-shadow: 0 0 10px rgba(93,255,122,0.45);
      z-index: 2;
      white-space: nowrap;
      animation: pulse-hint 2s ease-in-out infinite;
    }

    /* Skip button: top right, only while the intro is playing */
    .skip-btn { display: none; }
    .hero-anim .skip-btn {
      display: block;
      position: fixed;
      top: calc(0.9rem + env(safe-area-inset-top, 0px));
      right: 1rem;
      z-index: 101;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.8rem, 1.6vw, 1rem);
      letter-spacing: 0.08em;
      color: var(--green);
      background: rgba(5,4,10,0.78);
      border: 1px solid rgba(93,255,122,0.35);
      border-radius: 999px;
      padding: 0.35rem 0.9rem;
      cursor: pointer;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      visibility: hidden;          /* GSAP fades it in */
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .skip-btn:hover,
    .skip-btn:focus-visible {
      outline: none;
      border-color: var(--green);
      box-shadow: 0 0 16px rgba(93,255,122,0.35);
    }

    @keyframes pulse-hint {
      0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
      50% { opacity: 1; transform: translateX(-50%) translateY(-6px); }
    }

    /* Hologram-style glow on the hero quote, the credit, DEV[LDN] and the tagline */
    .hero-quote, .hero-credit, .hero-title, .hero-tagline {
      text-shadow: 0 0 10px rgba(93,255,122,0.45), 0 0 26px rgba(93,255,122,0.2);
    }

    /* projection glow under DEV[LDN] + tagline (same pad as under the Why I DEV window) */
    .title-holo {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-bottom: 3rem;
    }
    .title-pad {                 /* fixed width, centred under the tagline */
      position: absolute;
      bottom: 0.4rem;
      left: 50%;
      font-size: clamp(1rem, 2.4vw, 1.4rem);   /* same as the tagline, so 18em ≈ its longest line */
      width: 18em;
      max-width: 90vw;
      margin-left: max(-9em, -45vw);       /* half its width, so it's centred */
      height: 28px;
    }
    .title-pad .holo-base { left: 0; right: 0; bottom: 0; }
    /* the tagline starts unpowered (dim, no glow); during the switch-on flicker both go dim on the "off" beats */
    .hero-anim .title-holo:not(.lit) .hero-tagline,
    .hero-anim .title-holo.blink .hero-title,
    .hero-anim .title-holo.blink .hero-tagline {
      text-shadow: none;
      filter: brightness(0.5);
    }

    /* DEV[LDN] title — its own full-screen section */
    section.title-section {
      height: 100vh;
      height: 100svh;
      min-height: 0;
      padding: 0 1.5rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .title-section .hero-title { white-space: nowrap; text-transform: none; }

    /* Typing caret inside the title (zero width, so moving it never shifts the text) */
    .tt-caret {
      display: inline-block;
      width: 0;
      height: 1em;
      vertical-align: -0.1em;
      position: relative;
    }
    .tt-caret::after {
      content: '';
      position: absolute;
      left: 0.02em; top: 0; bottom: 0;
      width: 0.07em;
      background: var(--green);
      box-shadow: 0 0 8px rgba(93,255,122,0.6);
      animation: tw-blink 1s steps(1) infinite;
    }
    .tt-measure {                /* off-screen ruler used to size the title */
      position: absolute;
      left: -9999px; top: 0;
      visibility: hidden;
      white-space: nowrap;
      font-family: "Rationale", sans-serif;
      font-size: 100px;
      text-transform: none;
    }
    .title-section .hero-tagline {
      margin-bottom: 0;
      text-transform: none;      /* keep "I DEV, therefore I am" casing */
      font-size: clamp(1rem, 2.4vw, 1.4rem);
      color: var(--text);
    }
    .hero-anim .title-section .hero-tagline { white-space: nowrap; }
    .tag-bracket { color: var(--green); }
    @media (prefers-reduced-motion: reduce) { .tw-cursor { animation: none; } }

    section {
      min-height: 80vh;
      padding: 5rem 1.5rem 3rem;
      position: relative;
      z-index: 1;
    }

    .section-inner {
      max-width: 860px;
      margin: 0 auto;
    }

    /* ── Section labels ── */
    /* Section divider: ── 03 ─ // projects ────── */
    .ascii-rule {
      display: flex;
      align-items: center;
      gap: 0.6em;
      margin: 2.5rem 0 1.5rem;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.85rem, 1.6vw, 1.05rem);
      font-weight: normal;
      color: var(--dim);
      white-space: nowrap;
      overflow: hidden;
      text-align: left;
    }
    #about .ascii-rule { margin-top: 0; }
    .rule-num { color: var(--text); }
    .rule-label { color: var(--green); letter-spacing: 0.12em; text-shadow: 0 0 10px rgba(93,255,122,0.4); }
    .rule-fill { flex: 1; overflow: hidden; transform-origin: left center; }

    /* HUD: which section you're in (bottom-left) */
    .hud {
      position: fixed;
      left: 1rem;
      bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.35rem 0.75rem;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.7rem, 1.2vw, 0.85rem);
      letter-spacing: 0.1em;
      color: var(--dim);
      background: rgba(5,4,10,0.78);
      border: 1px solid rgba(93,255,122,0.25);
      border-radius: 999px;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.4s;
    }
    .hud.is-on { opacity: 1; }
    .hud-bar { display: flex; gap: 3px; }
    .hud-bar i { width: 10px; height: 6px; background: rgba(93,255,122,0.15); transition: background 0.3s, box-shadow 0.3s; }
    .hud-bar i.on { background: var(--green); box-shadow: 0 0 6px rgba(93,255,122,0.7); }
    .hud-num { color: var(--text); }
    .hud-label { color: var(--green); min-width: 11ch; }

    .section-label {
      display: inline-block;
      color: var(--green);
      font-family: "JetBrains Mono", monospace;
      font-size: 0.75rem;
      margin-bottom: 0.5rem;
      opacity: 0.6;
    }

    .section-title {
      font-family: "Rationale", sans-serif;
      font-size: clamp(1.5rem, 4vw, 2.5rem);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      margin-bottom: 1.5rem;
    }

    .section-text {
      color: var(--text);
      font-size: clamp(0.9rem, 1.2vw, 1.05rem);
      line-height: 1.8;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 1.5rem;
    }

    /* About + Projects read as one continuous terminal session */
    #about { min-height: 0; padding-bottom: 1.25rem; }
    #projects { padding-top: 0; }

    /* ── Projects: loader + tiles ── */
    .load-box { display: none; }
    .hero-anim .load-box {
      display: block;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.78rem, 1.4vw, 0.95rem);
      max-width: 34rem;
      margin-top: 0.75rem;
      padding: 0.75rem 1rem;
      border: 1px solid var(--btn-border);
      border-radius: 6px;
      background: rgba(5,4,10,0.88);
    }
    .load-head { color: var(--text); margin-bottom: 0.4rem; }
    .load-bar { color: var(--green); white-space: pre; }
    .load-status { color: var(--dim); margin-top: 0.4rem; }
    .load-box.is-error .load-bar,
    .load-box.is-error .load-status { color: var(--red); }

    .proj-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
      gap: 1rem;
      margin-top: 2.5rem;
    }
    .proj-tile {                 /* the box itself is drawn in text by layoutAscii() */
      display: block;
      color: var(--dim);
      text-decoration: none;
      border-radius: 4px;
      outline: none;
    }
    /* raised "game button" hover: GSAP moves the tile up-right, CSS only fades in the shadow it leaves behind */
    .proj-tile { display: block; }
    .proj-tile.is-raised .ascii { color: var(--text); }                 /* box lines brighten */
    .proj-tile:focus-visible { box-shadow: 0 0 0 2px var(--green); }
    .ascii {
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.72rem, 1.2vw, 0.85rem);
      line-height: 1.15;         /* tight enough for the │ sides to join up */
      white-space: pre;
      position: relative;
      z-index: 0;                /* keeps the fill/shadow layers below the text */
    }
    .ascii .bx { display: inline-block; width: var(--cw, 1ch); }   /* box chars can come from a fallback font — pin them to the text's character width */
    /* the box's border lines run through the middle of its first/last character cells */
    .ascii::before,
    .ascii::after {
      content: '';
      position: absolute;
      top: calc(1.15em / 2); bottom: calc(1.15em / 2);
      left: calc(var(--cw, 1ch) / 2); right: calc(var(--cw, 1ch) / 2);
      pointer-events: none;
    }
    /* tile face: solid fill; its side faces (--side, stacked 1px steps) are built in JS as it lifts */
    .ascii::before { background: var(--bg); z-index: -1; box-shadow: var(--side, none); }
    /* the slot the tile rises out of: stays at the tile's original spot, a little larger, lit faintly from inside */
    .ascii::after {
      z-index: -2;
      top: calc(1.15em / 2 - 3px); bottom: calc(1.15em / 2 - 3px);
      left: calc(var(--cw, 1ch) / 2 - 3px); right: calc(var(--cw, 1ch) / 2 - 3px);
      transform: translate(calc(var(--d, 0) * -1px), calc(var(--d, 0) * 1px));   /* cancels the tile's lift */
      background: rgba(0,0,0,0.7);
      border: 1px solid rgba(93,255,122, calc(0.15 + 0.4 * var(--glow, 0)));
      box-shadow:
        inset 0 0 10px rgba(0,0,0,0.9),
        0 0 calc(4px + 16px * var(--glow, 0)) rgba(93,255,122, calc(0.4 * var(--glow, 0)));
      opacity: calc(var(--d, 0) / var(--tile-raise-n, 6));
    }
    .ascii-name { color: var(--green); font-weight: 700; }
    .ascii-desc { color: var(--text); }
    .ascii-meta { color: var(--dim); }
    .sr-only {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .proj-error {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.85rem;
      color: var(--dim);
    }
    .proj-error a { color: var(--green); }

    /* ── Contact: isekai status window (uses the same hologram styles as Why I DEV) ── */
    .contact-term { margin-bottom: 0.5rem; }
    .status-win { font-size: clamp(0.82rem, 1.5vw, 0.98rem); }
    .sw-body { padding: 1.1rem 1.25rem 1.4rem; }
    .sw-system {
      color: var(--text);
      margin-bottom: 1.1rem;
      padding: 0.5rem 0.75rem;
      border: 1px solid rgba(93,255,122,0.25);
      background: rgba(93,255,122,0.06);
    }
    .sw-tag { color: var(--green); font-weight: 700; }
    .sw-who {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: baseline;
      gap: 0.25rem 1rem;
      padding-bottom: 0.7rem;
      margin-bottom: 0.7rem;
      border-bottom: 1px solid rgba(93,255,122,0.2);
    }
    .sw-name {
      font-family: "Rationale", sans-serif;
      font-size: clamp(1.4rem, 3vw, 2rem);
      letter-spacing: 0.06em;
      color: var(--text);
      text-shadow: 0 0 12px rgba(93,255,122,0.35);
    }
    .sw-class { color: var(--green); }
    .sw-stats { display: grid; gap: 0.45rem; margin-bottom: 1.1rem; }
    .sw-row { display: grid; grid-template-columns: 8.5em 1fr; gap: 0.75rem; align-items: center; }
    .sw-row dt { color: var(--dim); }
    .sw-row dd { color: var(--text); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
    .sw-dot {
      width: 0.6em; height: 0.6em; border-radius: 50%;
      background: var(--green);
      box-shadow: 0 0 8px var(--green);
      animation: sw-pulse 1.6s ease-in-out infinite;
    }
    .sw-id { display: flex; flex-direction: column; gap: 0.15rem; }
    .sw-email { color: var(--dim); text-decoration: none; font-size: 0.9em; }
    .sw-email:hover,
    .sw-email:focus-visible { outline: none; color: var(--green); text-shadow: 0 0 8px rgba(93,255,122,0.5); }
    .sw-cv-link { color: var(--green); text-decoration: none; font-family: "JetBrains Mono", monospace; font-size: 0.85em; letter-spacing: 0.04em; }
    .sw-cv-link:hover,
    .sw-cv-link:focus-visible { outline: none; color: var(--text); text-shadow: 0 0 8px rgba(93,255,122,0.5); }
    .sw-cv-arrow { display: inline-block; transition: transform 0.2s ease; }
    .sw-cv-link:hover .sw-cv-arrow,
    .sw-cv-link:focus-visible .sw-cv-arrow { transform: translateX(4px); }
    @keyframes sw-pulse { 50% { opacity: 0.35; } }
    .sw-bar {
      width: 7em; height: 0.55em;
      border: 1px solid rgba(93,255,122,0.45);
      padding: 1px;
    }
    .sw-bar i {
      display: block; height: 100%; width: 85%;           /* how full the reply-time bar is */
      background: var(--green);
      box-shadow: 0 0 8px rgba(93,255,122,0.6);
      transform-origin: left center;
    }
    .sw-quest {
      margin-bottom: 1rem;
      padding: 0.55rem 0.75rem;
      border: 1px dashed rgba(93,255,122,0.4);
      color: var(--text);
    }
    .sw-quest-tag {
      display: inline-block;
      margin-right: 0.5rem;
      padding: 0 0.4em;
      background: rgba(93,255,122,0.9);
      color: var(--bg);
      font-weight: 700;
      text-transform: uppercase;
      font-size: 0.85em;
    }
    .sw-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
    .sw-slot {
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
      aspect-ratio: 1 / 0.8;
      border: 1px solid rgba(93,255,122,0.35);
      background: rgba(93,255,122,0.05);
      color: var(--text);
      text-decoration: none;
      transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;   /* GSAP handles movement */
    }
    .sw-ini {
      font-family: "Rationale", sans-serif;
      font-size: clamp(1.4rem, 3vw, 2rem);
      font-weight: 700;
      color: var(--green);
      text-shadow: 0 0 10px rgba(93,255,122,0.5);
    }
    .sw-label { font-size: 0.85em; color: var(--text); }
    .sw-slot:hover, .sw-slot:focus-visible {
      outline: none;
      border-color: var(--green);
      background: rgba(93,255,122,0.14);
      box-shadow: 0 0 18px rgba(93,255,122,0.35), inset 0 0 14px rgba(93,255,122,0.15);
    }
    @media (max-width: 600px) {
      .sw-slots { grid-template-columns: repeat(2, 1fr); }
      .sw-row { grid-template-columns: 6.5em 1fr; }
      .sw-body { padding: 1rem; }
    }
    @media (prefers-reduced-motion: reduce) { .sw-dot { animation: none; } }

    /* Touch screens: flatten the Contact window's 3D. There's no tilt on touch anyway, and some mobile
       browsers (iOS Safari especially) mis-place taps inside 3D-transformed layers, so links can't be tapped. */
    @media (hover: none), (pointer: coarse) {
      .status-stage .holo-float, .status-stage .holo-tilt, .status-stage .status-win { transform-style: flat; }
      .status-stage .status-win > * { transform: none !important; }
      .status-stage .status-win::before, .status-stage .status-win::after { transform: none; }
    }

    /* ── About: terminal + nano editor ── */
    .term {
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.78rem, 1.6vw, 0.95rem);
      line-height: 1.8;
      margin-bottom: 1.25rem;
    }
    .term-line { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
    .term-user { color: var(--green); }
    .term-path { color: #6cb6ff; }
    .term-sym  { color: var(--dim); }

    /* ── "Why I DEV" as a floating 3D hologram window (isekai status-screen style) ── */
    .holo-stage {
      position: relative;
      perspective: 1100px;
      perspective-origin: 50% 35%;
      padding: 0.75rem 0 3rem;
    }
    .holo-float, .holo-tilt { transform-style: preserve-3d; pointer-events: none; }
    .holo-tilt > .nano { pointer-events: auto; }   /* wrappers let the mouse through, so a tilted window's links stay clickable */
    .nano {
      position: relative;
      transform-style: preserve-3d;          /* lets the layers inside sit at different depths */
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.78rem, 1.4vw, 0.95rem);
      border: 1px solid rgba(93,255,122,0.45);
      border-radius: 6px;
      background:
        linear-gradient(160deg, rgba(93,255,122,0.10), rgba(5,4,10,0.86) 38%, rgba(5,4,10,0.92));
      box-shadow:
        0 0 0 1px rgba(93,255,122,0.06),
        0 0 26px rgba(93,255,122,0.16),
        inset 0 0 34px rgba(93,255,122,0.07),
        0 40px 60px -20px rgba(0,0,0,0.7);
      transition: border-color 0.3s, box-shadow 0.3s;
    }
    /* depth: each layer floats a different distance in front of the panel */
    .nano-head { transform: translateZ(22px); }
    .nano-title { transform: translateZ(48px); }
    .nano-text { transform: translateZ(26px); }
    .nano-foot { transform: translateZ(18px); }

    /* corner brackets */
    .nano::before, .nano::after, .holo-corners::before, .holo-corners::after {
      content: '';
      position: absolute;
      width: 18px; height: 18px;
      border: 2px solid var(--green);
      filter: drop-shadow(0 0 4px rgba(93,255,122,0.8));
      transform: translateZ(34px);
      pointer-events: none;
    }
    .nano::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
    .nano::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
    .holo-corners { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
    .holo-corners::before { top: -7px; right: -7px; border-left: 0; border-bottom: 0; }
    .holo-corners::after { bottom: -7px; left: -7px; border-right: 0; border-top: 0; }

    /* scanlines drifting down the glass */
    .holo-scan {
      position: absolute; inset: 0;
      border-radius: inherit;
      pointer-events: none;
      background: repeating-linear-gradient(to bottom, rgba(93,255,122,0.06) 0 1px, transparent 1px 4px);
      animation: holo-scan 8s linear infinite;
      transform: translateZ(2px);
    }
    @keyframes holo-scan { to { background-position: 0 64px; } }

    /* light sweep across the glass */
    .holo-sheen {
      position: absolute; inset: 0;
      border-radius: inherit;
      overflow: hidden;
      pointer-events: none;
      transform: translateZ(4px);
    }
    .holo-sheen-bar {
      position: absolute;
      top: -20%; bottom: -20%; left: -40%;
      width: 30%;
      background: linear-gradient(100deg, transparent, rgba(93,255,122,0.2), transparent);
      transform: skewX(-15deg);
      opacity: 0;
    }

    /* glowing projection pad under the window */
    .holo-base {
      position: absolute;
      left: 12%; right: 12%; bottom: 0.6rem;
      height: 28px;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(93,255,122,0.38), rgba(93,255,122,0.08) 45%, transparent 70%);
      filter: blur(4px);
      pointer-events: none;
    }

    .nano-head {                 /* inverse title bar, file name centred */
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 1rem;
      background: rgba(93,255,122,0.9);
      color: var(--bg);
      border-radius: 5px 5px 0 0;
      padding: 0.2rem 0.75rem;
      font-weight: 700;
    }
    .nano-body { padding: 1.25rem 1rem 2rem; }
    .nano-title {
      font-size: clamp(1.1rem, 2.6vw, 1.6rem);
      font-weight: 700;
      color: var(--text);
      margin-bottom: 1rem;
      text-shadow: 0 0 12px rgba(93,255,122,0.35);
    }
    .nano-hash { color: var(--green); opacity: 0.7; }
    .nano-text + .nano-title { margin-top: 1.6rem; }   /* space above the second heading */
    .nano-text { color: var(--text); opacity: 0.85; line-height: 1.8; }
    .nano-foot {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem 1.25rem;
      padding: 0.5rem 0.75rem;
      border-top: 1px solid rgba(93,255,122,0.2);
      color: var(--dim);
      font-size: 0.85em;
    }
    .nano-foot kbd {
      font-family: inherit;
      background: rgba(93,255,122,0.85);
      color: var(--bg);
      padding: 0 0.25em;
      margin-right: 0.4em;
    }
    @media (prefers-reduced-motion: reduce) { .holo-scan { animation: none; } }

    /* typing layers: a hidden full copy reserves the space so nothing jumps */
    .nano-type { display: inline-grid; }
    .nano-text.typable { display: grid; }
    .nano-size, .nano-live { grid-area: 1 / 1; }
    .nano-text.typable { white-space: pre-line; }   /* shows the <br> line breaks while typing (only once typing is set up) */
    .nano-size { visibility: hidden; }

    .timeline {
      position: relative;
      padding: 2rem 0;
    }

    .timeline::before {
      content: '';
      position: absolute;
      left: 2rem;
      top: 0;
      bottom: 0;
      width: 2px;
      background: var(--green);
      opacity: 0.3;
    }

    .timeline-item {
      padding-left: 4rem;
      margin-bottom: 2.5rem;
    }

    .timeline-item .year {
      display: inline-block;
      color: var(--green);
      font-family: "JetBrains Mono", monospace;
      font-size: 0.85rem;
      margin-bottom: 0.3rem;
    }

    .timeline-item h3 {
      font-family: "Rationale", sans-serif;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 1.1rem;
      color: var(--text);
    }

    .timeline-item p {
      color: var(--dim);
      font-size: 0.85rem;
      line-height: 1.6;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .timeline-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.5rem;
    }

    .timeline-tags span {
      display: inline-block;
      padding: 0.15rem 0.6rem;
      border: 1px solid var(--btn-border);
      border-radius: 4px;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.65rem;
      color: var(--dim);
    }

    .contact-links {
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 1rem;
      margin-top: 2rem;
    }

    .contact-links a {
      padding: 0.7rem 1.3rem;
      border: 2px solid var(--btn-border);
      border-radius: 8px;
      background: var(--btn-bg);
      text-decoration: none;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.75rem;
      text-transform: lowercase;
      letter-spacing: 0.04em;
      color: var(--text);
      transition: all 0.2s ease;
    }

    .contact-links a:hover {
      background: #1f1d33;
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(0,0,0,0.6);
    }

    footer {
      text-align: center;
      padding: 2rem 1.5rem;
      color: var(--dim);
      font-size: 0.75rem;
      font-family: "JetBrains Mono", monospace;
    }

    .footer-green { color: var(--green); }
    .text-dim { color: var(--dim); }

    /* ── Logo theme (60:30:10): background halves · lenses · reflection ── */
    #logo-container { transition: background-color 0.2s ease; }
    .hero-white { transition: background-color 0.2s ease; }
    .hero-black {
      position: absolute; inset: 0;
      background: var(--hero-left, #000);
      transition: background-color 0.2s ease;
    }
    /* lenses only change once a palette is picked */
    html.themed #Vector_28_3, html.themed #Vector_28_3 *,
    html.themed #Vector_28_4, html.themed #Vector_28_4 *,
    html.themed #Vector_34 {
      fill: var(--lens) !important;
      transition: fill 0.2s ease;
    }
    /* glasses + nose bridge — use background colours for shadow effect */
    html.themed #Vector_23, html.themed #Vector_23_3,
    html.themed #Vector_27, html.themed #Vector_27_3,
    html.themed #Vector_25, html.themed #Vector_25_3,
    html.themed [id="Right Eyebrow"], html.themed [id="Right Eyebrow"] *,
    html.themed [id="Left Eyebrow_2"], html.themed [id="Left Eyebrow_2"] * {
      fill: var(--hero-left) !important;
      transition: fill 0.2s ease;
    }
    /* eyebrow mask paths must stay white */
    html.themed [id="Right Eyebrow"] mask path,
    html.themed [id="Left Eyebrow_2"] mask path { fill: white !important; }
    html.themed #Vector_44 {
      fill: var(--hero-right);
      stroke: var(--hero-right);
    }
    html.themed #Vector_36 { fill: var(--hero-right); }
    html.themed #Vector_22_3, html.themed #Vector_6_2 { fill: var(--hero-right); }
    html.themed #Vector_21_3 { fill: var(--hero-left); }
    html.themed #Vector_39, html.themed #Vector_41 { fill: var(--reflect); }
    html.themed #Vector_42 { stroke: var(--reflect); }
    /* logo circle strokes */
    html.themed #Vector_19_4,
    html.themed #Vector_3_2 { stroke: var(--hero-right); }
    html.themed #Vector_19,
    html.themed #Vector_3_3 { stroke: var(--hero-left); }
    html.themed #Vector_23_2, html.themed #Vector_23_4,
    html.themed #Vector_27_2, html.themed #Vector_27_4,
    html.themed #Vector_25_2, html.themed #Vector_25_4,
    html.themed [id="Left Eyebrow"], html.themed [id="Left Eyebrow"] *,
    html.themed [id="Right Eyebrow_2"], html.themed [id="Right Eyebrow_2"] * {
      fill: var(--hero-right) !important;
      transition: fill 0.2s ease;
    }
    /* eyebrow mask paths must stay white */
    html.themed [id="Left Eyebrow"] mask path,
    html.themed [id="Right Eyebrow_2"] mask path { fill: white !important; }
    /* reflection at rest */
    html.themed #Vector_29_3, html.themed #Vector_30_3,
    html.themed #Vector_29_4, html.themed #Vector_30_4 { fill: var(--reflect); }
    .theme-ui {
      position: fixed;
      right: 1rem;
      bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
      z-index: 100;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.72rem, 1.2vw, 0.85rem);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.4s, visibility 0.4s;
    }
    .theme-ui.is-on { opacity: 1; visibility: visible; }
    .theme-btn {
      font: inherit;
      letter-spacing: 0.1em;
      color: var(--green);
      background: rgba(5,4,10,0.78);
      border: 1px solid rgba(93,255,122,0.35);
      border-radius: 999px;
      padding: 0.35rem 0.85rem;
      cursor: pointer;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: flex; align-items: center; gap: 0.5rem;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .theme-btn:hover, .theme-btn:focus-visible, .theme-btn[aria-expanded="true"] {
      outline: none;
      border-color: var(--green);
      box-shadow: 0 0 14px rgba(93,255,122,0.3);
    }
    .theme-chip { display: flex; width: 2.2em; height: 0.7em; border-radius: 2px; overflow: hidden; }
    .theme-chip i { display: block; height: 100%; }
    .theme-panel {
      position: absolute;
      right: 0;
      bottom: calc(100% + 0.6rem);
      width: min(19rem, calc(100vw - 2rem));
      max-height: min(70vh, 34rem);
      overflow-y: auto;
      padding: 0.75rem;
      background: rgba(5,4,10,0.92);
      border: 1px solid rgba(93,255,122,0.35);
      border-radius: 6px;
      box-shadow: 0 0 24px rgba(93,255,122,0.15), 0 20px 40px rgba(0,0,0,0.5);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .theme-panel[hidden] { display: none; }
    .theme-head { display: flex; justify-content: space-between; color: var(--dim); margin-bottom: 0.6rem; }
    .theme-head b { color: var(--green); font-weight: normal; }
    .theme-list { display: grid; gap: 0.35rem; }
    .theme-opt {
      font: inherit;
      display: grid;
      grid-template-columns: 4.5rem 1fr;
      align-items: center;
      gap: 0.6rem;
      width: 100%;
      padding: 0.35rem 0.45rem;
      text-align: left;
      color: var(--text);
      background: transparent;
      border: 1px solid transparent;
      border-radius: 4px;
      cursor: pointer;
    }
    .theme-opt:hover, .theme-opt:focus-visible { outline: none; border-color: rgba(93,255,122,0.35); background: rgba(93,255,122,0.06); }
    .theme-opt[aria-pressed="true"] { border-color: var(--green); background: rgba(93,255,122,0.1); }
    .theme-bar { display: flex; height: 1.1rem; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
    .theme-bar i { display: block; height: 100%; }
    .theme-bar i:nth-child(1) { width: 60%; }
    .theme-bar i:nth-child(2) { width: 30%; }
    .theme-bar i:nth-child(3) { width: 10%; }
    .theme-gen { color: var(--green); }
    .theme-copy {
      font: inherit;
      margin-top: 0.6rem;
      width: 100%;
      padding: 0.35rem;
      color: var(--dim);
      background: transparent;
      border: 1px dashed rgba(93,255,122,0.3);
      border-radius: 4px;
      cursor: pointer;
    }
    .theme-copy:hover, .theme-copy:focus-visible { outline: none; color: var(--green); border-color: var(--green); }

    /* ── Blog (subsection inside Projects) ── */
    #blog { padding-top: 1.5rem; }
    #blog .ascii-rule { margin-bottom: 0.25rem; }
    /* #blog .ascii-rule .rule-label { font-size: 0.85em; opacity: 0.8; } */
    #blog .term { margin-bottom: 0.5rem; }
    .blog-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
      gap: 1rem;
    }
    .blog-empty {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--dim);
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.82rem, 1.2vw, 0.92rem);
    }
    .blog-empty-msg { color: var(--dim); letter-spacing: 0.08em; }
    /* Blog tile — populated from backend API */
    .blog-tile {
      display: block;
      color: var(--dim);
      text-decoration: none;
      border: 1px solid rgba(93,255,122,0.25);
      border-radius: 4px;
      padding: 1rem 1.1rem;
      background: rgba(5,4,10,0.85);
      transition: border-color 0.2s, background-color 0.2s;
    }
    .blog-tile:hover,
    .blog-tile:focus-visible {
      outline: none;
      border-color: var(--green);
      background: rgba(93,255,122,0.06);
    }
    .blog-tile-tag {
      display: inline-block;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.7rem;
      color: var(--dim);
      letter-spacing: 0.06em;
      margin-bottom: 0.3rem;
      opacity: 0.6;
    }
    .blog-tile-title {
      font-family: "Rationale", sans-serif;
      font-size: clamp(1rem, 1.8vw, 1.2rem);
      color: var(--text);
      line-height: 1.3;
      margin-bottom: 0.3rem;
    }
    .blog-tile-meta {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.7rem;
      color: var(--dim);
      display: flex;
      gap: 0.5rem;
    }
    .blog-tile-meta .blog-tile-date { color: var(--dim); }
    .blog-tile-meta .blog-tile-read { color: var(--green); opacity: 0.6; }

    @media (hover: none), (pointer: coarse) {
      .blog-modal-stage, .blog-modal-win { transform: none !important; }
    }

    /* ── Blog: show-more button ── */
    .blog-more {
      display: block;
      margin: 1.5rem auto 0.5rem;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.75rem, 1.2vw, 0.85rem);
      color: var(--green);
      background: transparent;
      border: 1px solid rgba(93,255,122,0.3);
      border-radius: 999px;
      padding: 0.4rem 1rem;
      cursor: pointer;
      letter-spacing: 0.06em;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .blog-more:hover,
    .blog-more:focus-visible {
      outline: none;
      border-color: var(--green);
      box-shadow: 0 0 12px rgba(93,255,122,0.3);
    }

    /* ── Blog post modal ── */
    .blog-modal {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: grid;
      place-items: center;
      padding: 1rem;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s, visibility 0.3s;
    }
    .blog-modal.is-open { opacity: 1; visibility: visible; }
    .blog-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(5,4,10,0.88);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }
    .blog-modal-stage {
      position: relative;
      perspective: 900px;
    }
    .blog-modal-win {
      position: relative;
      max-width: 680px;
      width: calc(100vw - 2rem);
      max-height: min(85vh, 600px);
      overflow-y: auto;
      border: 1px solid rgba(93,255,122,0.45);
      border-radius: 6px;
      background:
        linear-gradient(160deg, rgba(93,255,122,0.08), rgba(5,4,10,0.92) 38%, rgba(5,4,10,0.95));
      box-shadow:
        0 0 0 1px rgba(93,255,122,0.06),
        0 0 26px rgba(93,255,122,0.16),
        0 40px 60px -20px rgba(0,0,0,0.7);
    }
    .blog-modal-head {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 1rem;
      padding: 0.3rem 0.75rem;
      background: rgba(93,255,122,0.85);
      color: var(--bg);
      border-radius: 5px 5px 0 0;
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.7rem, 1.2vw, 0.85rem);
      letter-spacing: 0.08em;
    }
    .blog-modal-close {
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.7rem, 1.2vw, 0.85rem);
      background: transparent;
      border: none;
      color: var(--bg);
      cursor: pointer;
      padding: 0.1rem 0.4rem;
      transition: color 0.2s;
    }
    .blog-modal-close:hover,
    .blog-modal-close:focus-visible { color: #000; outline: none; }
    .blog-modal-body { padding: 1.25rem 1rem 2rem; }
    .blog-modal-title {
      font-family: "Rationale", sans-serif;
      font-size: clamp(1.3rem, 3vw, 1.8rem);
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.5rem;
      text-shadow: 0 0 10px rgba(93,255,122,0.3);
    }
    .blog-modal-meta {
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.72rem, 1.1vw, 0.82rem);
      color: var(--dim);
      margin-bottom: 1rem;
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .blog-modal-content {
      color: var(--text);
      font-family: "Rationale", sans-serif;
      font-size: clamp(0.92rem, 1.3vw, 1.05rem);
      line-height: 1.75;
    }
    .blog-modal-content h2,
    .blog-modal-content h3 { font-family: "Rationale", sans-serif; color: var(--text); margin: 1.2rem 0 0.4rem; }
    .blog-modal-content p { margin-bottom: 0.8rem; }
    .blog-modal-content code {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.88em;
      background: rgba(93,255,122,0.08);
      padding: 0.1em 0.3em;
      border-radius: 2px;
    }
    .blog-modal-content pre {
      font-family: "JetBrains Mono", monospace;
      font-size: clamp(0.75rem, 1.1vw, 0.85rem);
      padding: 0.6rem 0.8rem;
      border: 1px solid rgba(93,255,122,0.2);
      border-radius: 4px;
      overflow-x: auto;
      background: rgba(5,4,10,0.88);
    }
    .blog-modal-content strong { color: var(--green); }
    .blog-modal-content em { color: var(--text); }

    @media (prefers-reduced-motion: reduce) {
      .scroll-hint { display: none; }
      .timeline-item { visibility: visible; opacity: 1; transform: none; }
    }

    @media (max-width: 600px) {
      .timeline-item { padding-left: 2.5rem; }
      .top-nav { padding: 0.6rem 0.5rem; }
      .top-nav a { padding: 0.3rem 0.25rem; }
    }
