 /* Base resets */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Plus Jakarta Sans', sans-serif;
    }

    body {
      background-color: #222831;
      color: #f2f2f2;
      overflow-x: hidden;
      min-height: 100vh;
    }

    /* =========================================================
       Loading overlay
       Sits above everything (the cursor layers are at 9999) and clears
       itself as soon as the page has genuinely finished loading.
       ========================================================= */
    #loader {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      /* Inherits --bg-color from body, so it matches the active theme */
      background: var(--bg-color);
      transition: opacity 0.45s ease, visibility 0.45s ease;
      /* Failsafe. If script.js never runs — blocked, failed to parse, or
         the network died mid-fetch — nothing would ever remove the
         overlay and the site would be permanently unusable. This force-
         hides it after 8s with no JS involved at all. During the delay
         the base style still applies, so the loader behaves normally
         whenever the scripts do load. */
      animation: loader-failsafe 0s 8s forwards;
    }

    #loader.loaded {
      opacity: 0;
      visibility: hidden;   /* also removes it from hit-testing */
    }

    @keyframes loader-failsafe {
      to { opacity: 0; visibility: hidden; }
    }

    .loader-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 18px;
    }

    .loader-title {
      font-size: 1.05rem;
      font-weight: 800;
      letter-spacing: 5px;
      text-transform: uppercase;
      color: var(--text-color);
      opacity: 0.8;
    }

    .loader-track {
      width: min(220px, 50vw);
      height: 3px;
      border-radius: 999px;
      background: rgba(128, 128, 128, 0.25);
      overflow: hidden;
    }

    .loader-bar {
      height: 100%;
      width: 0;
      border-radius: inherit;
      background: #0b65e3;                 /* brand accent */
      transition: width 0.35s ease;
      /* Creeps toward the end while the real load happens, then JS snaps
         it home. Worth being clear about: this is an indication that work
         is in progress, not a measurement of bytes downloaded. A genuine
         percentage would mean tracking every subresource by hand.

         1.8s is tuned to the overlay's minimum display time in script.js
         (MIN_DISPLAY_MS) so the bar is already near 88% by the time the
         load finishes, making the final snap to 100% a small step rather
         than a visible jump from a barely-started bar. */
      animation: loader-creep 1.8s ease-out forwards;
    }

    /* JS adds this on window.load. Cancelling the animation is what lets
       the width below take effect — a running animation with fill-mode
       forwards outranks both this rule and any inline style. */
    #loader.bar-full .loader-bar {
      animation: none;
      width: 100%;
    }

    @keyframes loader-creep {
      from { width: 0; }
      to   { width: 88%; }
    }

    @media (prefers-reduced-motion: reduce) {
      #loader { transition: none; }
      .loader-bar { animation: none; width: 100%; }
    }

    /* Floating particles background effect */
    .bg-particles {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      z-index: 1;
      pointer-events: none;
    }

    .particle {
      position: absolute;
      background: rgba(242, 242, 242, 0.2);
      border-radius: 1px;
      animation: float 12s infinite linear;
    }

    .p1 { width: 6px; height: 6px; top: 25%; left: 8%; animation-delay: 0s; }
    .p2 { width: 8px; height: 8px; top: 65%; left: 82%; animation-delay: -3s; }
    .p3 { width: 4px; height: 4px; top: 15%; left: 75%; animation-delay: -5s; }
    .p4 { width: 5px; height: 5px; top: 80%; left: 20%; animation-delay: -2s; }
    .p5 { width: 7px; height: 7px; top: 40%; left: 90%; animation-delay: -7s; }

    @keyframes float {
      0% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
      50% { transform: translateY(-20px) rotate(45deg); opacity: 0.6; }
      100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
    }

    /* Navigation Header */
    header {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 24px 60px;
      z-index: 100;
      /* Was rgba(10, 10, 10, 0.8) + backdrop-filter: blur(12px).
         A backdrop blur over the animated canvas can never be cached:
         the pixels behind the header change every frame, so the browser
         re-blurred the full width of the screen ~60x a second, forever.
         A slightly more opaque solid is near-identical over the hero. */
      background: rgba(34, 40, 49, 0.92);
    }

    .logo {
      font-size: 1.25rem;
      font-weight: 800;
      letter-spacing: -0.5px;
      /* Pinned rather than inherited. The header keeps its dark fill in both
         themes, so letting this fall through to --text-color made the wordmark
         near-black on a near-black bar as soon as light mode was enabled. */
      color: #f2f2f2;
    }

    nav {
      display: flex;
      align-items: center;
      gap: 32px;
      /* Push the nav group to the far right of the fixed header. On the
         home page there is no logo, so without this the links and toggle
         sit flush left; the auto margin pulls them across. Harmless on the
         anatomy page, where space-between already does this. */
      margin-left: auto;
    }

    nav a {
      color: #a1a1aa;
      text-decoration: none;
      font-size: 0.9rem;
      font-weight: 500;
      transition: color 0.2s ease;
    }

    nav a:hover {
      color: #f2f2f2;
    }

    /* Hero Section */
    .hero {
      position: relative;
      min-height: 100vh;
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: left;
      padding: 0 20px;
    }

    .hero-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding-top: 60px;
}

    .hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

    .hero-globe {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

    #heroGlobe {
  width: min(420px, 78vw);
  height: min(420px, 78vw);
  overflow: hidden;
  cursor: grab;
}

    #heroGlobe:active {
  cursor: grabbing;
}

    .globe-caption {
  color: var(--text-color);
  opacity: 0.6;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

    .tagline {
  color: #a1a1aa;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  z-index: 10;
}

    .main-title {
  position: static; /* Restores standard spacing flow */
  transform: none;
  /* Sized so the longer tagline headline wraps gracefully instead of
     overflowing the viewport. */
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  /* Was a hard-coded #ffffff, which is invisible against the white body in
     light mode. Tracks the theme instead, so it is white on dark and
     #121212 on light. */
  color: var(--text-color);
  z-index: 10;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  margin: 0;
  /* Matches the 0.3s background/colour transition on body so the heading
     fades with the rest of the palette rather than snapping. */
  transition: color 0.3s;
}

    .container-3d {
  position: absolute;
  left: 2%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  /* The float animation lives on this parent so the filtered child below
     stays a static raster. Translating a finished layer is nearly free,
     whereas animating the filtered element itself forced the browser to
     re-run the drop-shadow blur on every frame of the float. */
  will-change: transform;
  animation: gentle-float 6s ease-in-out infinite;
  pointer-events: none; 
}

    .object-3d {
  width: clamp(200px, 22vw, 320px);
  height: auto;
  /* Trimmed from a 30px blur. This is rasterised once and then cached,
     but a tighter shadow still reads as depth and costs less to build. */
  filter: drop-shadow(0 20px 22px rgba(0, 0, 0, 0.7));
}

    /* Matrix rain backdrop for the Hero section */
    .matrix-3d-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Soft fade at the top/bottom so the rain blends into the page */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 82%, transparent 100%);
}

    #matrix3DCanvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  /* Deliberately no CSS filter here. drop-shadow() on a canvas that
     repaints at 60fps is a second full-screen blur pass stacked on top of
     the glow the canvas already paints per glyph — and since the pixels
     change every frame it can never be cached. The bloom is now produced
     once, inside the canvas, by the head glyph's shadowBlur. */
}

    body.light-mode #matrix3DCanvas {
  opacity: 0.55;
}

    /* Keeps this element's translateY(-50%) centring and floats around it */
    @keyframes gentle-float {
      0%, 100% { transform: translateY(-50%); }
      50% { transform: translateY(calc(-50% - 15px)); }
    }

    .description {
  max-width: 550px;
  color: #d4d4d8;
  font-size: 1.05rem;
  line-height: 1.6;
  z-index: 10;
  margin: 0;
}

    /* CTA Buttons */
    .cta-group {
  display: flex;
  gap: 16px;
  z-index: 10;
  margin-top: 10px;
}
    .btn {
      padding: 12px 24px;
      border-radius: 8px;
      font-size: 0.95rem;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.2s ease;
      cursor: pointer;
    }

    .btn-primary {
      background-color: #0b65e3;
      color: #f2f2f2;
      border: none;
    }

    .btn-primary:hover {
      background-color: rgba(11, 101, 227, 0.85);
      transform: translateY(-2px);
    }

    .btn-secondary {
      /* Blur removed: this button sits in the middle of the hero, directly
         over the animating canvas, so the blur could never be cached. The
         slightly stronger fill reads the same against the rain. */
      background-color: rgba(242, 242, 242, 0.08);
      color: #f2f2f2;
      border: 1px solid rgba(242, 242, 242, 0.1);
    }

    .btn-secondary:hover {
      background-color: rgba(242, 242, 242, 0.15);
      border-color: rgba(242, 242, 242, 0.2);
      transform: translateY(-2px);
    }

    /* NEW: About Section */
    .about-section {
      position: relative;
      padding: 100px 24px;
      max-width: 1000px;
      margin: 0 auto;
      z-index: 10;
    }

    .about-card {
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      padding: 48px;
      /* No backdrop-filter. The card sits on a flat page background, so
         blurring it produced an identical flat colour — pure cost for zero
         visual difference. The floating particles behind it also kept the
         blur from ever being cached. */
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    }

    .section-label {
      display: inline-block;
      color: #0b65e3;
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 2px;
      margin-bottom: 16px;
    }

    .about-title {
      font-size: clamp(2rem, 4vw, 3rem);
      font-weight: 800;
      margin-bottom: 24px;
      line-height: 1.2;
    }

    .about-text {
      color: #a1a1aa;
      font-size: 1.1rem;
      line-height: 1.8;
      margin-bottom: 32px;
    }

    .about-text strong {
      color: #f2f2f2;
      font-weight: 600;
    }

    .badge-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      border-top: 1px solid rgba(242, 242, 242, 0.08);
      padding-top: 32px;
    }

    .badge-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .badge-number {
      font-size: 1.5rem;
      font-weight: 800;
      color: #0b65e3;
    }

    .badge-label {
      font-size: 0.9rem;
      color: #a1a1aa;
    }
    
    /* Default Dark Mode */
:root {
  --bg-color: #222831;
  --text-color: #f2f2f2;
  --card-bg: #393e46;
  --border-color: rgba(242, 242, 242, 0.08);
}

/* Light Mode Overrides */
body.light-mode {
  --bg-color: #f2f2f2;
  --text-color: #222831;
  --card-bg: rgba(34, 40, 49, 0.05);
  /* A white-alpha border is invisible on white, so light mode uses dark ink.
     Anything borrowed from --card-bg or --border-color therefore themes
     itself; only the hard-coded rgba() values elsewhere need overrides. */
  --border-color: rgba(0, 0, 0, 0.09);
}

/* The title's shadow is tuned for light text over the dark hero. Around dark
   text on a white body the same 30px black blur reads as a grey smudge, so it
   is removed rather than re-tuned. Higher specificity than .main-title, so
   the declaration above still stands for dark mode. */
body.light-mode .main-title {
  text-shadow: none;
}

/* Muted/secondary text is tuned for the dark theme; on the light body it
   must be darkened or it washes out to near-invisible grey. These selectors
   cover the page-content text only — the always-dark header (nav, switch
   labels) and the demo/anatomy pages keep their own colours. */
body.light-mode .description,
body.light-mode .works-subtitle,
body.light-mode .work-desc,
body.light-mode .work-tags li,
body.light-mode .about-text,
body.light-mode .badge-label,
body.light-mode .contact-text,
body.light-mode .contact-item-hint {
  color: #4a4b52;
}

/* Apply Variables to Elements */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s; /* Smooth transition */
}

/* =========================================================
   Anchor scrolling
   The header is position: fixed, so it floats over the top of whatever
   section is scrolled to. scroll-margin-top reserves the header's height
   as dead space above each target, otherwise the "ABOUT ME" label lands
   underneath the header bar and looks cut off.
   ========================================================= */
html {
  scroll-behavior: smooth;
}

#works,
#contact {
  /* 24px header padding + ~48px of content height, plus breathing room */
  scroll-margin-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
  /* A long animated scroll is exactly the kind of motion this preference
     is asking to avoid; jumping instantly is the accessible behaviour. */
  html { scroll-behavior: auto; }
}

/* =========================================================
   Works section
   Reuses the dark card idiom from .about-card, but via --card-bg and
   --border-color so it flips with the theme instead of staying
   near-white-on-white in light mode.
   ========================================================= */
.works-section {
  position: relative;
  padding: 20px 24px 100px;
  max-width: 1000px;
  margin: 0 auto;
  z-index: 10;
}

.works-header {
  margin-bottom: 40px;
}

.works-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.works-subtitle {
  color: #a1a1aa;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 560px;
}

.works-grid {
  display: grid;
  /* auto-fit + minmax means one column on phones, two at tablet width and
     three on desktop with no media queries at all. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* clips the thumb to the rounded corners */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  /* These two lines are what let the same class serve both an <a> (a card
     that links somewhere) and an <article> (one that doesn't). Without them
     an anchor card would render underlined and in link-blue. */
  color: inherit;
  text-decoration: none;
  /* Only compositor-friendly properties are animated here — transform and
     colours. Animating width/height/padding would relayout the whole grid
     on every frame of the hover. */
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: #0b65e3;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* Focus ring for the anchor cards. :focus-visible rather than :focus, so a
   mouse click does not leave a ring behind — only keyboard tabbing shows it. */
.work-card:focus-visible {
  outline: 2px solid #0b65e3;
  outline-offset: 4px;
}

.work-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  /* Brand-tinted rather than a fixed grey, so the same rule reads as a glow
     on the dark card and a light wash on the white one. */
  color: #0b65e3;
  background:
    linear-gradient(135deg, rgba(11, 101, 227, 0.16), rgba(11, 101, 227, 0.02));
  border-bottom: 1px solid var(--border-color);
}

.work-body {
  display: flex;
  flex-direction: column;
  flex: 1;                       /* equal-height cards across the row */
  padding: 22px;
}

.work-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.work-desc {
  color: #a1a1aa;
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 18px;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  /* margin-top: auto pins the tags to the bottom, so they line up across
     cards whose descriptions differ in length. */
  margin-top: auto;
}

.work-tags li {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a1a1aa;
  background: rgba(128, 128, 128, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
}

/* Only present on cards that link somewhere. The arrow nudges on hover as a
   second, non-colour cue that the card is clickable — colour alone would be
   invisible to anyone who cannot distinguish the orange. */
.work-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #0b65e3;
}

.work-cta span {
  transition: transform 0.25s ease;
}

.work-card:hover .work-cta span {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .work-card { transition: none; }
  .work-card:hover { transform: none; }
  .work-cta span { transition: none; }
  .work-card:hover .work-cta span { transform: none; }
}

  /* =========================================================
     Contact section
     Reuses the card idiom from .about-card but via --card-bg and
     --border-color, so it flips with the theme like the works cards.
     ========================================================= */
  .contact-section {
    position: relative;
    padding: 20px 24px 120px;
    max-width: 1000px;
    margin: 0 auto;
    z-index: 10;
  }

  .contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  }

  .contact-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
  }

  .contact-text {
    color: #a1a1aa;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 560px;
    margin-bottom: 40px;
  }

  .contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
  }

  .contact-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    background: rgba(128, 128, 128, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }

  .contact-item:hover {
    transform: translateY(-4px);
    border-color: rgba(11, 101, 227, 0.55);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }

  .contact-item:focus-visible {
    outline: 2px solid #0b65e3;
    outline-offset: 4px;
  }

  .contact-item-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #0b65e3;
  }

  .contact-item-value {
    font-size: 1.05rem;
    font-weight: 600;
  }

  .contact-item-hint {
    color: #a1a1aa;
    font-size: 0.85rem;
    line-height: 1.5;
  }

  @media (prefers-reduced-motion: reduce) {
    .contact-item { transition: none; }
    .contact-item:hover { transform: none; }
  }

    /* Responsive styles */
    @media (max-width: 768px) {
      header {
        padding: 20px 24px;
      }
      .main-title {
        font-size: 3.5rem;
      }
      .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
      }
      .about-card {
        padding: 28px;
      }
      .contact-card {
        padding: 28px;
      }
      #matrix3DCanvas {
        opacity: 0.6;
      }
    }
  /* =========================================================
     Theme switch — DARK ( o) LIGHT
     Two labels either side of a pill track, with the knob sliding
     between them. The <button> wraps the whole row, so the tap
     target is the full control and not just the small track.
     ========================================================= */
  .theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px;          /* enlarges the hit area, no visible box */
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  /* Both labels are always rendered; the inactive one just recedes.
     Leaving it in the layout means the row never reflows on toggle. */
  .theme-switch .theme-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #a1a1aa;
    opacity: 0.5;
    transition: color 0.3s ease, opacity 0.3s ease;
  }

  /* The knob position and the brightened label are both derived from the
     same body class the rest of the palette uses, so there is no second
     source of truth to keep in sync. */
  body:not(.light-mode) .theme-label-dark,
  body.light-mode .theme-label-light {
    color: #f2f2f2;
    opacity: 1;
  }

  .switch-track {
    position: relative;
    flex: none;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(242, 242, 242, 0.10);
    border: 1px solid rgba(242, 242, 242, 0.22);
    transition: background 0.3s ease, border-color 0.3s ease;
  }

  .switch-knob {
    position: absolute;
    top: 50%;
    left: 3px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: #f2f2f2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    /* Decelerating curve, so the knob settles into place instead of
       stopping dead at the end of a linear slide. */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* The track is 42px wide with a 1px border, so the knob's left:3px sits it
     4px in from the outer edge. Matching that same 4px gap on the far side
     means travelling 42 - 14 - 4 - 4 = 20px, which keeps the knob visually
     centred in the track at both ends of the slide rather than 2px short. */
  body.light-mode .switch-knob {
    transform: translateX(20px);
  }

  .theme-switch:hover .switch-track {
    background: rgba(242, 242, 242, 0.16);
    border-color: rgba(242, 242, 242, 0.38);
  }

  /* Keyboard users get a visible ring; the default outline is suppressed
     only when it is not needed, via :focus-visible rather than :focus. */
  .theme-switch:focus-visible {
    outline: 2px solid #0b65e3;
    outline-offset: 6px;
    border-radius: 999px;
  }

  /* Declared after .switch-knob on purpose: the reduced-motion block near the
     loader appears earlier in the file, so an equal-specificity rule there
     would lose to the transition above. */
  @media (prefers-reduced-motion: reduce) {
    .switch-knob { transition: none; }
  }

  /* Lives here rather than in the responsive block further up the file so the
     whole control is defined in one place. The header row (logo + three links
     + this switch) is the widest thing on the page, so the labels are the
     first thing to go; the knob position still reads as the state without
     them, and the aria-label keeps the control named for screen readers. */
  @media (max-width: 768px) {
    .theme-switch .theme-label { display: none; }
  }

    /* =========================================================
       Custom cursor — a dot at the centre of a circle
       Hidden by default so touch devices never see the layers;
       only enabled for precise pointers with a real hover state.
       ========================================================= */
    .cursor-dot,
    .cursor-ring {
      display: none;
    }

    @media (hover: hover) and (pointer: fine) {
      /* Hide the native arrow everywhere while the custom one is active */
      body.custom-cursor,
      body.custom-cursor * {
        cursor: none !important;
      }

      .cursor-dot,
      .cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;          /* above the fixed header (100) */
        pointer-events: none;   /* never blocks links or buttons */
        border-radius: 50%;
        opacity: 0;
        will-change: transform;
        transition: opacity 0.25s ease, width 0.22s ease, height 0.22s ease,
                    margin 0.22s ease, background-color 0.22s ease,
                    border-color 0.22s ease, box-shadow 0.22s ease, scale 0.12s ease;
      }

      /* Bright dot sitting exactly under the pointer */
      .cursor-dot {
        width: 7px;
        height: 7px;
        margin: -3.5px 0 0 -3.5px;
        background: #f2f2f2;
        box-shadow: 0 0 10px rgba(242, 242, 242, 0.9);
      }

      /* Light ring centred on the dot (JS gives both the same coords) */
      .cursor-ring {
        width: 34px;
        height: 34px;
        margin: -17px 0 0 -17px;
        border: 1.5px solid rgba(242, 242, 242, 0.65);
        box-shadow: 0 0 14px rgba(242, 242, 242, 0.35),
                    inset 0 0 10px rgba(242, 242, 242, 0.15);
      }

      body.cursor-active .cursor-dot,
      body.cursor-active .cursor-ring {
        opacity: 1;
      }

      /* Grow + shift to the brand orange over anything clickable */
      body.cursor-hover .cursor-ring {
        width: 56px;
        height: 56px;
        margin: -28px 0 0 -28px;
        border-color: #0b65e3;
        background: rgba(11, 101, 227, 0.08);
        box-shadow: 0 0 22px rgba(11, 101, 227, 0.45);
      }

      body.cursor-hover .cursor-dot {
        background: #0b65e3;
        box-shadow: 0 0 12px #0b65e3;
      }

      /* Press feedback */
      body.cursor-down .cursor-ring {
        scale: 0.82;
      }

      /* Light theme: darker ink so it stays visible on white */
      body.light-mode .cursor-dot {
        background: #222831;
        box-shadow: 0 0 8px rgba(34, 40, 49, 0.55);
      }

      body.light-mode .cursor-ring {
        border-color: rgba(34, 40, 49, 0.7);
        box-shadow: 0 0 12px rgba(34, 40, 49, 0.25);
      }

      body.light-mode.cursor-hover .cursor-ring {
        border-color: #0b65e3;
        background: rgba(11, 101, 227, 0.07);
        box-shadow: 0 0 20px rgba(11, 101, 227, 0.3);
      }

      body.light-mode.cursor-hover .cursor-dot {
        background: #0b65e3;
        box-shadow: 0 0 10px rgba(11, 101, 227, 0.7);
      }
    }

/* =========================================================
   Page styles
   Every page links this one stylesheet. The rules from here down used to
   live in per-page <style> blocks; they are appended in the same order
   those blocks followed the <link>, so the cascade is unchanged — only
   the location of the rules moved.
   ========================================================= */

/* ---- cursor-demo.html ---------------------------------- */

/* Page-specific styling only. The theme palette, buttons, header and the
   cursor itself all come from the rest of this file. */
.demo-main {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  /* Top padding clears the fixed header (about 70px tall) */
  padding: 140px 24px 90px;
  z-index: 10;
}

.demo-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 18px;
}

.demo-lead {
  color: #a1a1aa;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: 14px;
}

/* Shown only where there is no fine pointer, so a phone visitor is told
   why the page looks empty rather than assuming it is broken. */
.demo-touch-note {
  display: none;
  color: #a1a1aa;
  font-size: 0.95rem;
  line-height: 1.6;
  border-left: 3px solid #0b65e3;
  padding: 4px 0 4px 14px;
  margin-bottom: 34px;
}

@media (hover: none), (pointer: coarse) {
  .demo-touch-note { display: block; }
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 34px;
}

.demo-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 26px;
}

.demo-panel h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.demo-panel p {
  color: #a1a1aa;
  font-size: 0.95rem;
  line-height: 1.65;
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* No other rule in the site styles form controls, so the input needs its
   own. border/background come from the theme variables rather than a fixed
   grey, so it flips with the theme like the panels do. */
.demo-input {
  flex: 1;
  min-width: 160px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text-color);
  background: rgba(128, 128, 128, 0.12);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 11px 14px;
}

.demo-input::placeholder { color: #a1a1aa; }

.demo-input:focus {
  outline: 2px solid #0b65e3;
  outline-offset: 2px;
}

/* role="button" element, to prove the cursor reacts to the ARIA role and
   not only to real <a> / <button> tags — see the INTERACTIVE selector in
   script.js. */
.demo-fake {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  background: rgba(128, 128, 128, 0.12);
  border: 1px dashed var(--border-color);
}

.demo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.demo-list li {
  color: #a1a1aa;
  font-size: 0.95rem;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}

.demo-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0b65e3;
}

.demo-list strong { color: var(--text-color); }

.demo-back {
  color: #a1a1aa;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.demo-back:hover { color: #f2f2f2; }

/* ---- webpage-anatomy.html ------------------------------- */

/* Page shell
   Page-specific only. Everything visual about the miniature site is
   scoped under .mock-page so it can look like a different website
   without inheriting the portfolio's own styling. */

.anatomy-main {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  /* Top padding clears the fixed header (about 70px tall) */
  padding: 132px 24px 100px;
  z-index: 10;
}

.anatomy-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 18px;
}

.anatomy-lead {
  color: #a1a1aa;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 660px;
}

.anatomy-back {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

/* Beats the shared `nav a:hover { color: #ffffff }`, which would otherwise
   leave this link white-on-white in light mode. */
.anatomy-back:hover { color: var(--text-color); }

/* Toolbar ------------------------------------------------- */
.anatomy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 30px 0 22px;
}

.anatomy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.anatomy-toggle:hover { border-color: #0b65e3; }

.anatomy-toggle .toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0b65e3;
  opacity: 0.3;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.anatomy-toggle[aria-pressed="true"] .toggle-dot {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(11, 101, 227, 0.2);
}

.anatomy-hint {
  color: #a1a1aa;
  font-size: 0.88rem;
}

.anatomy-hint-touch { display: none; }

@media (hover: none), (pointer: coarse) {
  .anatomy-hint-pointer { display: none; }
  .anatomy-hint-touch { display: inline; }
}

/* Layout: the diagram, plus a sticky inspector beside it ---------- */
.anatomy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
}

.anatomy-side { position: relative; }

.anatomy-readout {
  position: sticky;
  /* Clears the fixed header */
  top: 98px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
}

.readout-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.readout-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #0b65e3;
  color: #f2f2f2;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.readout-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #0b65e3;
  background: rgba(11, 101, 227, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
  overflow-wrap: anywhere;
}

.readout-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
}

.readout-desc {
  color: #a1a1aa;
  font-size: 0.9rem;
  line-height: 1.7;
}

.readout-path {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 0.74rem;
  line-height: 1.7;
  color: #a1a1aa;
}

.readout-path span { color: #0b65e3; }

/* The diagram --------------------------------------------- */
.anatomy-stage {
  position: relative;
  min-width: 0;
}

.mock-frame {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px 10px 12px;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.3);
}

/* Browser chrome ------------------------------------------------ */
.mock-chrome {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 2px 4px 10px;
}

.mock-dots {
  display: flex;
  gap: 5px;
  padding-bottom: 8px;
  margin-right: 4px;
}

.mock-dots i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.35);
}

.mock-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted-fixed);
  background: var(--chrome-surface);
  border: 1px solid var(--border-color);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  padding: 6px 12px 7px;
  white-space: nowrap;
}

.mock-favicon {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #0b65e3;
}

.mock-url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.68rem;
  color: var(--muted-fixed);
  background: var(--chrome-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 13px;
}

.mock-url span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A colour that reads on both themes, since the chrome sits on the frame
   (which follows --card-bg) rather than on the mock page. */
:root { --muted-fixed: #8b8b96; --chrome-surface: rgba(128, 128, 128, 0.12); }
body.light-mode { --muted-fixed: #6b6b76; }

/* The miniature website -----------------------------------
   Its own palette, so it can be a "real" page inside the portfolio
   without inheriting the portfolio's colours. */
.mock-page {
  --m-bg: #222831;
  --m-surface: #393e46;
  --m-surface-2: rgba(242, 242, 242, 0.06);
  --m-border: rgba(242, 242, 242, 0.09);
  --m-text: #f2f2f2;
  --m-muted: #8b8b96;

  position: relative;
  isolation: isolate;   /* keeps the mock's z-indexes inside itself */
  overflow: hidden;      /* clips the bands to the rounded corners */
  border: 1px solid var(--m-border);
  border-radius: 10px;
  background: var(--m-bg);
  color: var(--m-text);
  font-size: 12px;
  line-height: 1.5;
}

body.light-mode .mock-page {
  --m-bg: #f2f2f2;
  --m-surface: rgba(34, 40, 49, 0.05);
  --m-surface-2: rgba(34, 40, 49, 0.1);
  --m-border: rgba(0, 0, 0, 0.1);
  --m-text: #222831;
  --m-muted: #6b6b76;
}

/* Bands --------------------------------------------------------- */
.m-announce {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 15px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #f2f2f2;
  background: #0b65e3;
}

.m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
}

.m-logo {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.m-nav {
  display: flex;
  gap: 14px;
}

.m-link {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--m-muted);
  white-space: nowrap;
}

.m-nav-cta {
  flex: none;
  font-size: 0.66rem;
  font-weight: 700;
  color: #f2f2f2;
  background: #0b65e3;
  border-radius: 6px;
  padding: 5px 11px;
  white-space: nowrap;
}

.m-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 26px 18px;
  background:
    radial-gradient(120% 130% at 10% 0%, rgba(11, 101, 227, 0.16), transparent 58%),
    var(--m-bg);
}

.m-eyebrow {
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0b65e3;
  margin-bottom: 9px;
}

.m-h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 9px;
}

.m-sub {
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--m-muted);
  margin-bottom: 15px;
  max-width: 34ch;
}

.m-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-btn {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 7px;
  padding: 7px 14px;
  white-space: nowrap;
}

.m-btn-p { background: #0b65e3; color: #f2f2f2; }

.m-btn-s {
  color: var(--m-text);
  border: 1px solid var(--m-border);
  background: var(--m-surface-2);
}

.m-visual {
  height: 104px;
  border-radius: 12px;
  border: 1px solid var(--m-border);
  background:
    linear-gradient(140deg, rgba(11, 101, 227, 0.32), rgba(57, 62, 70, 0.2) 62%, transparent),
    var(--m-surface-2);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: rgba(242, 242, 242, 0.55);
}

body.light-mode .m-visual { color: rgba(0, 0, 0, 0.28); }

.m-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px 0;
  font-size: 0.6rem;
  color: var(--m-muted);
}

.m-crumb-cur { color: var(--m-text); font-weight: 700; }

.m-section {
  padding: 22px 18px;
  border-top: 1px solid var(--m-border);
}

.m-h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

.m-p {
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--m-muted);
  max-width: 52ch;
}

/* Cards --------------------------------------------------------- */
.m-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 15px;
}

.m-card {
  overflow: hidden;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 10px;
}

.m-thumb {
  height: 54px;
  background: linear-gradient(120deg, rgba(11, 101, 227, 0.34), rgba(57, 62, 70, 0.2));
}

.m-card:nth-child(2) .m-thumb {
  background: linear-gradient(120deg, rgba(57, 62, 70, 0.28), rgba(57, 62, 70, 0.22));
}

.m-card-body { padding: 11px; }

.m-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.m-card-text {
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--m-muted);
}

.m-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  list-style: none;
  margin-top: 9px;
}

.m-tags li {
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--m-muted);
  border: 1px solid var(--m-border);
  border-radius: 999px;
  padding: 2px 7px;
}

/* Form band ----------------------------------------------------- */
.m-form-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 18px;
  border-top: 1px solid var(--m-border);
  background: var(--m-surface);
}

.m-field {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--m-muted);
  margin-bottom: 5px;
}

/* These are inert stand-ins, not real controls — the whole mock is a
   picture of a page, so nothing inside it should be focusable. */
.m-input {
  display: block;
  font-size: 0.68rem;
  color: var(--m-muted);
  background: var(--m-bg);
  border: 1px solid var(--m-border);
  border-radius: 7px;
  padding: 9px 11px;
  margin-bottom: 9px;
}

.m-submit {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  color: #f2f2f2;
  background: #0b65e3;
  border-radius: 7px;
  padding: 9px 11px;
}

/* Table --------------------------------------------------------- */
.m-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.64rem;
}

.m-table th,
.m-table td {
  text-align: left;
  padding: 8px 9px;
  border-bottom: 1px solid var(--m-border);
}

.m-table th {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--m-muted);
}

.m-table td { color: var(--m-muted); }
.m-table td:last-child { color: var(--m-text); }

/* Pagination ---------------------------------------------------- */
.m-pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 18px;
  border-top: 1px solid var(--m-border);
}

.m-pager span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--m-muted);
  border: 1px solid var(--m-border);
  border-radius: 6px;
}

.m-pager span.on {
  color: #f2f2f2;
  background: #0b65e3;
  border-color: #0b65e3;
}

/* Alert --------------------------------------------------------- */
.m-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(11, 101, 227, 0.1);
  border: 1px solid rgba(11, 101, 227, 0.35);
}

.m-alert-mark {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b65e3;
  color: #f2f2f2;
  font-size: 0.6rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.m-alert strong {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0b65e3;
  margin-bottom: 3px;
}

.m-alert div > div {
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--m-muted);
}

/* Footer -------------------------------------------------------- */
.m-footer {
  padding: 22px 18px 16px;
  border-top: 1px solid var(--m-border);
  background: var(--m-surface);
}

.m-footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
}

.m-foot-head {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--m-muted);
  margin-bottom: 8px;
}

.m-foot-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-foot-links li {
  font-size: 0.64rem;
  color: var(--m-muted);
}

.m-social {
  list-style: none;
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.m-social li {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  border: 1px solid var(--m-border);
  display: grid;
  place-items: center;
  font-size: 0.53rem;
  font-weight: 700;
  color: var(--m-muted);
}

.m-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--m-border);
  font-size: 0.6rem;
  color: var(--m-muted);
}

.m-top-btn {
  position: absolute;
  right: 13px;
  bottom: 60px;
  z-index: 6;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #0b65e3;
  color: #f2f2f2;
  font-size: 0.7rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

/* Labelling ------------------------------------------------
   Two layers. The floating probe is one element owned by the stage, so a
   label can never be clipped by the mock page's rounded frame and never
   fights a sibling for space. The numbered chips below are the "show
   every label" mode, drawn as pseudo-elements so they cost nothing to add
   or remove. */
.probe-label {
  position: absolute;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 7px;
  background: #0b65e3;
  color: #f2f2f2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(11, 101, 227, 0.35);
}

.probe-label.is-on { display: inline-flex; }

.probe-num {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 800;
}

.probe-size {
  opacity: 0.8;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Chip shown for every part in "show all labels" mode ------------- */
.labels-on .part::after {
  content: attr(data-num) " · " attr(data-label);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  padding: 2px 6px;
  border-radius: 0 0 5px 0;
  background: rgba(11, 101, 227, 0.92);
  color: #f2f2f2;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

/* Containers put their chip along the bottom edge instead. A card and its
   own thumbnail both start at the same top-left corner, so two chips would
   land on exactly the same pixels; splitting top and bottom keeps every
   label legible. */
.labels-on .part:has(.part)::after {
  top: auto;
  bottom: 0;
  border-radius: 0 5px 0 0;
}

/* …and the page itself would collide with its last child (the footer,
   which ends exactly where the page does). */
.labels-on #mockPage::after { display: none; }

.labels-on .part:hover::after { opacity: 1; }

/* Selection states ------------------------------------------------ */
.part { position: relative; }

/* inset ring: draws inside the element, so it can never be clipped and
   never shifts a single pixel of layout */
.part.is-ancestor {
  box-shadow: inset 0 0 0 1px rgba(11, 101, 227, 0.4);
}

.part.is-active {
  z-index: 20;
  outline: 2px solid #0b65e3;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 999px rgba(11, 101, 227, 0.1);
}

/* Index of parts ------------------------------------------ */
.anatomy-legend { margin-top: 44px; }

.anatomy-legend-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.anatomy-legend-sub {
  color: #a1a1aa;
  font-size: 0.92rem;
  line-height: 1.6;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  color: #a1a1aa;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.legend-item:hover,
.legend-item.is-active {
  color: var(--text-color);
  border-color: #0b65e3;
  background: rgba(11, 101, 227, 0.08);
}

.legend-item:focus-visible {
  outline: 2px solid #0b65e3;
  outline-offset: 2px;
}

.legend-num {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-color);
  background: rgba(128, 128, 128, 0.16);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.legend-item:hover .legend-num,
.legend-item.is-active .legend-num {
  color: #f2f2f2;
  background: #0b65e3;
}

/* Closing panels -------------------------------------------------- */
.anatomy-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.anatomy-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
}

.anatomy-panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 11px;
}

.anatomy-panel p {
  color: #a1a1aa;
  font-size: 0.92rem;
  line-height: 1.7;
}

.anatomy-panel code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: #0b65e3;
}

.anatomy-noscript {
  margin-top: 26px;
  padding: 14px 16px;
  border-left: 3px solid #0b65e3;
  color: #a1a1aa;
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Narrow screens ------------------------------------------
   The mock is a fixed-cast page, so below the fold of a phone the
   single-column bands inside it stack too. The inspector moves above the
   diagram: hovering is impossible there, and tapping a region at the top
   of a tall page should not update a panel a screen away. */
@media (max-width: 980px) {
  .anatomy-layout { grid-template-columns: minmax(0, 1fr); }
  .anatomy-side { order: -1; }
  .anatomy-readout { position: static; }
}

@media (max-width: 640px) {
  .anatomy-main { padding: 116px 18px 80px; }
  .m-hero { grid-template-columns: 1fr; }
  .m-form-band { grid-template-columns: 1fr; }
  .m-grid { grid-template-columns: 1fr; }
  .m-footer-cols { grid-template-columns: 1fr 1fr; }
  .m-tab-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .part.is-active { transition: none; }
}