/* ---- assets/css/tokens.css ---- */
/* ==========================================================================
   bytejuggler.com — Design tokens
   Derived from NewSiteLookGfx (logo, banner, wordmark).
   Light = brand default. Dark = "Lab" theme (AI experiments) and user toggle.
   ========================================================================== */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-var.woff2") format("woff2-variations"),
       url("../fonts/outfit-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2-variations"),
       url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-italic.woff2") format("woff2-variations"),
       url("../fonts/inter-var-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2-variations"),
       url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  /* ---- Brand palette (raw) -------------------------------------------- */
  --bj-ink:          #14171c;  /* wordmark "bytejuggler", logo blocks      */
  --bj-graphite-800: #1f2329;
  --bj-graphite-700: #2a2e33;  /* logo block mid-tone                      */
  --bj-graphite-500: #5e6470;  /* tagline grey                             */
  --bj-graphite-300: #a3a8b1;
  --bj-line:         #e2e4e8;
  --bj-mist:         #f3f4f6;  /* banner background tone                   */
  --bj-paper:        #ffffff;

  --bj-blue-700:     #0047d4;
  --bj-blue-600:     #0057f7;  /* ".com" dark end, cube shadow side        */
  --bj-blue-500:     #0a82fe;  /* ".com" light end                         */
  --bj-cyan-400:     #10b8f8;  /* cube top face                            */
  --bj-blue-100:     #e6f0ff;

  /* AI provenance (from AIBadges/): "Made by AI" = brand blue, "Made with AI" = teal */
  --bj-teal-300:     #2ee6e6;  /* "with AI" light end                     */
  --bj-teal-500:     #00b8c8;
  --bj-teal-700:     #007a88;  /* text-safe teal on white (5.1:1)         */
  --bj-teal-100:     #e3fafa;
  --ai-by-gradient:   linear-gradient(135deg, #10b8f8, #0057f7);
  --ai-with-gradient: linear-gradient(135deg, #2ee6e6, #0098a8);

  --bj-cube-gradient: linear-gradient(135deg, var(--bj-cyan-400) 0%, var(--bj-blue-500) 45%, var(--bj-blue-600) 100%);
  --bj-wordmark-gradient: linear-gradient(90deg, var(--bj-blue-600), var(--bj-blue-500));

  /* Lab palette (shared with the Space Travel explainers) */
  --lab-bg:     #07070d;
  --lab-panel:  #0e1022;
  --lab-line:   #262b4f;
  --lab-text:   #d8dbea;
  --lab-dim:    #9aa0c0;
  --lab-cyan:   #4fd9ff;
  --lab-pink:   #ff8fd2;
  --lab-violet: #a58bff;
  --lab-gold:   #ffcf7a;
  --lab-gradient: linear-gradient(90deg, #ff5fc8, #8a7dff 50%, #4fd9ff);

  /* ---- Typography ------------------------------------------------------- */
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Major third scale (1.25) on 16px */
  --fs-xs:  0.875rem;  /* 14 */
  --fs-sm:  0.9375rem; /* 15 */
  --fs-md:  1rem;      /* 16 */
  --fs-lg:  1.25rem;   /* 20 */
  --fs-xl:  1.5625rem; /* 25 */
  --fs-2xl: 1.9375rem; /* 31 */
  --fs-3xl: 2.4375rem; /* 39 */
  --fs-4xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.0625rem); /* 36 → 49 */

  --lh-tight: 1.15;
  --lh-snug:  1.35;
  --lh-body:  1.65;

  --tracking-kicker: 0.28em;

  /* ---- Spacing (4px grid) ---------------------------------------------- */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem;  --sp-6: 1.5rem;  --sp-8: 2rem;    --sp-10: 2.5rem;
  --sp-12: 3rem;    --sp-16: 4rem;   --sp-20: 5rem;   --sp-24: 6rem;

  /* ---- Shape, depth, motion -------------------------------------------- */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-pill: 999px;
  --border-w: 1px;

  --shadow-1: 0 1px 2px rgba(20, 23, 28, .06), 0 1px 1px rgba(20, 23, 28, .04);
  --shadow-2: 0 6px 18px -6px rgba(20, 23, 28, .18), 0 2px 4px rgba(20, 23, 28, .06);
  --shadow-3: 0 18px 40px -12px rgba(20, 23, 28, .28);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;

  /* ---- Layout ----------------------------------------------------------- */
  --container: 72rem;      /* 1152px */
  --container-narrow: 46rem;
  --header-h: 4.25rem;
  --gutter: clamp(1rem, 0.5rem + 2vw, 2rem);

  color-scheme: light;
}

:root,
[data-theme="light"],
.theme-light {
  /* ---- Semantic (light) ------------------------------------------------
     Also applied by .theme-light to force light colours on a nested element
     (e.g. a white logo tile inside a dark page). */
  --c-bg:          var(--bj-paper);
  --c-bg-alt:      var(--bj-mist);
  --c-surface:     var(--bj-paper);
  --c-text:        var(--bj-ink);
  --c-text-muted:  var(--bj-graphite-500);
  --c-heading:     var(--bj-ink);
  --c-border:      var(--bj-line);
  --c-accent:      var(--bj-blue-600);
  --c-accent-hover:var(--bj-blue-700);
  --c-accent-soft: var(--bj-blue-100);
  --c-on-accent:   #ffffff;
  --c-link:        var(--bj-blue-600);
  --c-code-bg:     #f6f7f9;
  --c-focus:       var(--bj-blue-500);
  --c-slab-dark:   var(--bj-graphite-800);
  --c-slab-mid:    #c9ccd2;
  --c-slab-light:  #eceef1;
  --c-warning:     #b45309;
  --c-warning-bg:  #fff7e6;
  --c-success:     #047857;
  --c-success-bg:  #e7f8f1;
  --c-ai-by:       var(--bj-blue-600);
  --c-ai-by-bg:    var(--bj-blue-100);
  --c-ai-with:     var(--bj-teal-700);
  --c-ai-with-bg:  var(--bj-teal-100);
  --c-tld-gradient:  var(--bj-wordmark-gradient);   /* ".com" in the wordmark */
  --c-mark-gradient: var(--bj-cube-gradient);       /* kicker diamond, accent bar */
  color-scheme: light;
}

/* ---- Dark / Lab theme --------------------------------------------------- */
[data-theme="dark"],
.theme-lab {
  --c-bg:          var(--lab-bg);
  --c-bg-alt:      #0b0c18;
  --c-surface:     var(--lab-panel);
  --c-text:        var(--lab-text);
  --c-text-muted:  var(--lab-dim);
  --c-heading:     #ffffff;
  --c-border:      var(--lab-line);
  --c-accent:      var(--lab-cyan);
  --c-accent-hover:#8be6ff;
  --c-accent-soft: rgba(79, 217, 255, .12);
  --c-on-accent:   #04121a;
  --c-link:        var(--lab-cyan);
  --c-code-bg:     #0a0b18;
  --c-focus:       var(--lab-cyan);
  --c-slab-dark:   #000000;
  --c-slab-mid:    #1a1d38;
  --c-slab-light:  #12142a;
  --c-warning:     var(--lab-gold);
  --c-warning-bg:  rgba(255, 207, 122, .1);
  --c-success:     #6ee7b7;
  --c-success-bg:  rgba(110, 231, 183, .1);
  --c-ai-by:       #5aa9ff;
  --c-ai-by-bg:    rgba(10, 130, 254, .14);
  --c-ai-with:     var(--bj-teal-300);
  --c-ai-with-bg:  rgba(46, 230, 230, .12);
  --c-tld-gradient:  linear-gradient(var(--lab-cyan), var(--lab-cyan));
  --c-mark-gradient: var(--lab-gradient);
  --shadow-1: 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 8px 24px -8px rgba(0,0,0,.7);
  --shadow-3: 0 20px 48px -12px rgba(0,0,0,.8);
  color-scheme: dark;
}

.theme-light, .theme-lab { color: var(--c-text); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; }
}

/* ---- assets/css/base.css ---- */
/* ==========================================================================
   bytejuggler.com — Base: reset, typography, layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
main { flex: 1 0 auto; }

img, svg, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---- Headings ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--c-heading);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5, h6 { font-size: var(--fs-md); }

p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 var(--sp-4); }
p { text-wrap: pretty; }

a {
  color: var(--c-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-1) var(--ease);
}
a:hover { color: var(--c-accent-hover); text-decoration-thickness: 2px; }

strong, b { font-weight: 600; color: var(--c-heading); }
small { font-size: var(--fs-xs); }
hr { border: 0; border-top: var(--border-w) solid var(--c-border); margin: var(--sp-10) 0; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--c-code-bg);
  border: var(--border-w) solid var(--c-border);
  border-radius: var(--radius-1);
  padding: 0.08em 0.35em;
}
kbd {
  border: var(--border-w) solid var(--c-border);
  border-bottom-width: 2px;
  border-radius: var(--radius-2);
  padding: 0.05em 0.4em;
  background: var(--c-surface);
}

::selection { background: var(--bj-blue-500); color: #fff; }

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-1);
}

/* ---- Tables -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: var(--border-w) solid var(--c-border); vertical-align: top; }
th { font-family: var(--font-display); font-weight: 600; color: var(--c-heading); }

/* ---- Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

.section { padding-block: clamp(var(--sp-12), 6vw, var(--sp-20)); }
.section--alt { background: var(--c-bg-alt); }
.section--tight { padding-block: var(--sp-10); }
.section__head { margin-bottom: var(--sp-8); max-width: 44rem; }

.stack > * + * { margin-top: var(--stack-gap, var(--sp-4)); }
.stack > * { margin-bottom: 0; }

.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--sp-3)); align-items: center; }

.grid {
  display: grid;
  gap: var(--grid-gap, var(--sp-6));
  grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min, 18rem), 100%), 1fr));
}
.grid--2 { --grid-min: 22rem; }
.grid--4 { --grid-min: 13rem; }

.split {
  display: grid;
  gap: var(--sp-10);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 52rem) { .split { grid-template-columns: 1.1fr 0.9fr; } }

/* ---- Utilities ----------------------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  background: var(--c-accent); color: var(--c-on-accent);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-2); text-decoration: none;
}
.skip-link:focus { top: var(--sp-4); }

.text-muted { color: var(--c-text-muted); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ---- assets/css/components.css ---- */
/* ==========================================================================
   bytejuggler.com — Components
   ========================================================================== */

/* ---- Site header --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: var(--border-w) solid var(--c-border);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--sp-6);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  text-decoration: none; color: var(--c-heading);
  margin-right: auto;
}
.brand:hover { color: var(--c-heading); }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.375rem;
  letter-spacing: -0.015em;
}
.brand__tld {
  background: var(--c-tld-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__tagline {
  font-size: 0.6875rem; color: var(--c-text-muted); letter-spacing: 0.02em; margin-top: 4px;
}
@media (max-width: 30rem) { .brand__tagline { display: none; } }

.site-nav ul { display: flex; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-display); font-weight: 500; font-size: var(--fs-md);
  color: var(--c-text); text-decoration: none; border-radius: var(--radius-2);
  position: relative;
}
.site-nav a:hover { color: var(--c-accent); }
.site-nav a[aria-current="page"],
.site-nav a[aria-current="true"] { color: var(--c-accent); }
.site-nav a[aria-current]::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 2px;
  height: 2px; background: var(--bj-cube-gradient);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem; padding: 0;
  background: transparent; border: var(--border-w) solid var(--c-border);
  border-radius: var(--radius-2); color: var(--c-text);
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.icon-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.icon-btn svg { width: 1.125rem; height: 1.125rem; }

.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }
@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--c-bg); border-bottom: var(--border-w) solid var(--c-border);
    box-shadow: var(--shadow-2);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: var(--sp-2) var(--gutter) var(--sp-4); }
  .site-nav a { padding: var(--sp-3) 0; font-size: var(--fs-lg); }
  .site-nav a[aria-current]::after { left: 0; right: auto; width: 2rem; }
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: var(--border-w) solid var(--c-border);
  background: var(--c-bg-alt);
  padding-block: var(--sp-10) var(--sp-8);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}
.site-footer__grid {
  display: grid; gap: var(--sp-8);
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.site-footer h2 {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-kicker);
  color: var(--c-text-muted); margin-bottom: var(--sp-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: var(--sp-2); }
.site-footer a { color: var(--c-text); text-decoration: none; }
.site-footer a:hover { color: var(--c-accent); }
.site-footer__bottom {
  margin-top: var(--sp-8); padding-top: var(--sp-6);
  border-top: var(--border-w) solid var(--c-border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3);
}

/* ---- Kicker / lead / accent bar --------------------------------------- */
.kicker {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.75rem; letter-spacing: var(--tracking-kicker); text-transform: uppercase;
  color: var(--c-accent); margin-bottom: var(--sp-3);
}
.kicker::before {
  content: ""; width: 0.6em; height: 0.6em; background: var(--c-mark-gradient);
  transform: rotate(45deg); flex: none;
}
.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--c-text-muted); max-width: 40rem; }
.accent-bar { height: 3px; width: 8rem; background: var(--c-mark-gradient); margin: var(--sp-4) 0 var(--sp-6); border: 0; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 2.75rem; padding: 0 var(--sp-5);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); line-height: 1;
  text-decoration: none; white-space: nowrap;
  border: var(--border-w) solid transparent; border-radius: var(--radius-2);
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn--primary:hover { background: var(--c-accent-hover); color: var(--c-on-accent); text-decoration: none; }
.btn--dark { background: var(--bj-ink); color: #fff; }
.btn--dark:hover { background: var(--bj-graphite-700); color: #fff; }
[data-theme="dark"] .btn--dark, .theme-lab .btn--dark { border-color: var(--c-border); }
.btn--ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-accent); color: var(--c-accent); }
.btn--sm { min-height: 2.25rem; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---- Badges & tags ------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-display); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.3em 0.7em; border-radius: var(--radius-1);
  background: var(--c-accent-soft); color: var(--c-accent);
  white-space: nowrap;
}
.badge--archive { background: var(--c-bg-alt); color: var(--c-text-muted); border: var(--border-w) solid var(--c-border); }
.badge--lab { background: var(--lab-bg); color: var(--lab-cyan); border: 1px solid var(--lab-line); }
.badge--new { background: var(--bj-cube-gradient); color: #fff; }
.badge--warn { background: var(--c-warning-bg); color: var(--c-warning); }

.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin: 0; }
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.15em 0.55em; border-radius: var(--radius-1);
  border: var(--border-w) solid var(--c-border); color: var(--c-text-muted);
}

/* ---- Cube bullet list ------------------------------------------------- */
.cube-list { list-style: none; padding: 0; }
.cube-list li { position: relative; padding-left: 1.6em; }
.cube-list li + li { margin-top: var(--sp-2); }
.cube-list li::before {
  content: ""; position: absolute; left: 0.25em; top: 0.62em;
  width: 0.5em; height: 0.5em; background: var(--bj-cube-gradient);
  transform: rotate(45deg); border-radius: 1px;
}

/* ---- Cards -------------------------------------------------------------- */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--c-surface);
  border: var(--border-w) solid var(--c-border);
  border-radius: var(--radius-2);
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.card__media { aspect-ratio: 16 / 9; background: var(--c-bg-alt); overflow: hidden; }
.card__media picture, .hero__bg picture, .media-frame picture { display: block; width: 100%; height: 100%; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-2) var(--ease); }
.card__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--c-text-muted); }
.card__title { font-size: var(--fs-lg); margin: 0; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* whole-card click target */
.card__text { color: var(--c-text-muted); font-size: var(--fs-sm); margin: 0; }
.card__foot { margin-top: auto; padding-top: var(--sp-3); }
/* Equal-height card rows: cards stretch to the tallest one, and the bottom
   block (optional "Under the hood" + buttons) is pushed down so it lines up. */
.grid--equal { align-items: stretch; }
.grid--equal > .card { height: 100%; }
.card__details { margin: auto 0 0; }
.card__details + .card__foot { margin-top: 0; }
.card:has(.card__title a):hover {
  transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--c-accent);
}
.card:has(.card__title a):hover .card__media img { transform: scale(1.03); }
.card:focus-within { border-color: var(--c-accent); }
/* blue corner cube on hover */
.card::before {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0; z-index: 1;
  border-style: solid; border-width: 0 1.25rem 1.25rem 0;
  border-color: transparent var(--c-accent) transparent transparent;
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.card:has(.card__title a):hover::before { opacity: 1; }

.card--lab { background: var(--lab-panel); border-color: var(--lab-line); color: var(--lab-text); }
.card--lab .card__title { color: #fff; }
.card--lab .card__text, .card--lab .card__meta { color: var(--lab-dim); }
.card--lab:hover { border-color: var(--lab-violet) !important; }

/* ---- Hero ------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding-block: clamp(var(--sp-16), 10vw, 8rem);
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg-alt) 100%);
}
.hero__decor { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero__inner { position: relative; max-width: 42rem; }
.hero__inner--center { margin-inline: auto; text-align: center; }
.hero__inner--center .lead { margin-inline: auto; }
.hero h1 { margin-bottom: var(--sp-4); }
.hero__actions { margin-top: var(--sp-8); }
.hero__logo { width: clamp(4.5rem, 10vw, 6.5rem); margin-bottom: var(--sp-6); }
.hero__inner--center .hero__logo { margin-inline: auto; }
.theme-lab.hero, .hero.theme-lab {
  background: radial-gradient(ellipse at 80% 0%, #15102a 0%, var(--lab-bg) 60%);
  color: var(--lab-text);
}

/* Isometric slab decoration (inline SVG, colors come from tokens) */
.slabs .s-dark  { fill: var(--c-slab-dark); }
.slabs .s-mid   { fill: var(--c-slab-mid); }
.slabs .s-light { fill: var(--c-slab-light); }
.slabs .s-blue  { fill: url(#bj-slab-blue); }
.slabs .s-line  { stroke: var(--c-slab-mid); stroke-width: 1; fill: none; }
.slabs .s-fade  { opacity: .55; }
@media (max-width: 40rem) { .slabs .s-hide-sm { display: none; } }

/* Section divider: thin slab band */
.slab-divider { display: block; width: 100%; height: 28px; color: var(--c-slab-dark); }
.slab-divider .a { fill: var(--c-slab-light); }
.slab-divider .b { fill: var(--c-slab-mid); }
.slab-divider .c { fill: var(--c-accent); }

/* ---- Breadcrumb -------------------------------------------------------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin: 0 0 var(--sp-6); font-size: var(--fs-sm); color: var(--c-text-muted); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: var(--sp-2); color: var(--c-border); }
.breadcrumb a { color: var(--c-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb [aria-current] { color: var(--c-text); }

/* ---- Page header (inner pages) ---------------------------------------- */
.page-head { padding-block: var(--sp-12) var(--sp-8); border-bottom: var(--border-w) solid var(--c-border); background: var(--c-bg-alt); position: relative; overflow: hidden; isolation: isolate; }
.page-head h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-3); }
.page-head .lead { margin-bottom: 0; }
.page-head__meta { margin-top: var(--sp-4); }

/* ---- Callouts --------------------------------------------------------- */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: var(--border-w) solid var(--c-border); border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-2); background: var(--c-accent-soft);
  font-size: var(--fs-sm);
}
.callout > :last-child { margin-bottom: 0; }
.callout__icon { width: 1.25rem; height: 1.25rem; color: var(--c-accent); margin-top: 0.15em; }
.callout__title { font-family: var(--font-display); font-weight: 600; color: var(--c-heading); margin: 0 0 var(--sp-1); }
.callout p:last-child { margin-bottom: 0; }
.callout--warning { border-left-color: var(--c-warning); background: var(--c-warning-bg); }
.callout--warning .callout__icon { color: var(--c-warning); }
.callout--archive { border-left-color: var(--bj-graphite-300); background: var(--c-bg-alt); }
.callout--archive .callout__icon { color: var(--c-text-muted); }

/* ---- Code block -------------------------------------------------------- */
.codeblock { position: relative; margin: 0 0 var(--sp-6); border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-code-bg); overflow: hidden; }
.codeblock__bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) var(--sp-4); border-bottom: var(--border-w) solid var(--c-border);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--c-text-muted);
}
.codeblock pre { margin: 0; padding: var(--sp-4); overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; tab-size: 4; }
.copy-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--c-text-muted); }
.copy-btn:hover { color: var(--c-accent); }

/* ---- Downloads -------------------------------------------------------- */
.dl-list { list-style: none; padding: 0; margin: 0 0 var(--sp-6); border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-surface); }
.dl-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); }
.dl-item + .dl-item { border-top: var(--border-w) solid var(--c-border); }
.dl-item__icon { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: var(--radius-2); background: var(--c-accent-soft); color: var(--c-accent); }
.dl-item__icon svg { width: 1.1rem; height: 1.1rem; }
.dl-item__name { font-family: var(--font-display); font-weight: 600; color: var(--c-heading); }
.dl-item__meta { font-size: var(--fs-xs); color: var(--c-text-muted); font-family: var(--font-mono); }
.dl-item--featured { background: linear-gradient(90deg, var(--c-accent-soft), transparent 70%); }
@media (max-width: 34rem) {
  .dl-item { grid-template-columns: 1fr auto; }
  .dl-item__icon { display: none; }
}

details.disclosure { border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-surface); margin-bottom: var(--sp-6); }
details.disclosure > summary {
  cursor: pointer; list-style: none; padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-display); font-weight: 600; color: var(--c-heading);
  display: flex; justify-content: space-between; align-items: center;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-family: var(--font-mono); color: var(--c-accent); font-size: 1.25rem; line-height: 1; }
details.disclosure[open] > summary::after { content: "–"; }
details.disclosure > .disclosure__body { padding: 0 var(--sp-5) var(--sp-4); }
details.disclosure .dl-list { border: 0; margin: 0; }
details.disclosure .dl-item { padding-inline: 0; }

/* ---- Gallery + lightbox ---------------------------------------------- */
.gallery { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); list-style: none; padding: 0; margin: 0 0 var(--sp-6); }
.gallery__item { margin: 0; }
.gallery__link { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-2); border: var(--border-w) solid var(--c-border); background: var(--c-bg-alt); }
.gallery__link img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-2) var(--ease); }
.gallery__link:hover img { transform: scale(1.04); }
.gallery__item figcaption { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: var(--sp-2); }
.gallery__item figcaption strong { display: block; font-family: var(--font-display); font-size: var(--fs-sm); }

.lightbox {
  border: 0; padding: 0; margin: auto; max-width: min(96vw, 1400px); max-height: 94vh;
  background: transparent; color: #fff; overflow: visible;
}
.lightbox::backdrop { background: rgba(7, 7, 13, .92); backdrop-filter: blur(4px); }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.lightbox__img { max-width: min(96vw, 1400px); max-height: 80vh; object-fit: contain; border-radius: var(--radius-2); box-shadow: var(--shadow-3); background: #000; }
.lightbox__caption { font-size: var(--fs-sm); color: #d8dbea; text-align: center; max-width: 60ch; }
.lightbox__caption strong { color: #fff; }
.lightbox__btn {
  position: fixed; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-2);
}
.lightbox__btn:hover { background: var(--bj-blue-600); border-color: var(--bj-blue-600); }
.lightbox__btn svg { width: 1.25rem; height: 1.25rem; }
.lightbox__close { top: var(--sp-4); right: var(--sp-4); }
.lightbox__prev { left: var(--sp-4); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--sp-4); top: 50%; transform: translateY(-50%); }

/* ---- Media frame (video / iframe / canvas) ------------------------------ */
.media-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-2); overflow: hidden; background: #000; border: var(--border-w) solid var(--c-border); margin-bottom: var(--sp-6); }
.media-frame > iframe, .media-frame > video, .media-frame > canvas, .media-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }

/* Click-to-load video: a button that becomes a YouTube iframe on click */
.video-facade {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: radial-gradient(ellipse at 70% 20%, #1b1640 0%, #07070d 70%);
  font: inherit;
}
.video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; transition: opacity var(--dur-2) var(--ease); }
.video-facade:hover img, .video-facade:focus-visible img { opacity: .95; }
.video-facade__play {
  position: relative; display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: rgba(7, 7, 13, .7); border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.video-facade__play svg { width: 1.75rem; height: 1.75rem; margin-left: 4px; }
.video-facade:hover .video-facade__play { transform: scale(1.08); background: var(--bj-blue-600); }
.video-facade__label {
  position: absolute; left: var(--sp-4); bottom: var(--sp-3); right: var(--sp-4); text-align: left;
  font-size: var(--fs-xs); color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.video-facade__title {
  position: absolute; left: var(--sp-5); top: var(--sp-4); font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-2xl); letter-spacing: -0.02em; text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

/* Prompt quote */
.prompt {
  margin: 0 0 var(--sp-6); padding: var(--sp-5) var(--sp-6); border: var(--border-w) solid var(--c-border);
  border-left: 3px solid var(--c-accent); border-radius: var(--radius-2); background: var(--c-code-bg);
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.7; white-space: pre-line; color: var(--c-text);
}
.prompt-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--c-text-muted); margin-bottom: var(--sp-2); }

/* Placeholder slot for content not public yet (rendered only when enabled) */
.slot-placeholder {
  display: grid; place-items: center; text-align: center; gap: var(--sp-2);
  aspect-ratio: 16 / 9; border: 1px dashed var(--c-border); border-radius: var(--radius-2);
  color: var(--c-text-muted); font-size: var(--fs-sm); background: var(--c-bg-alt);
  margin-bottom: var(--sp-6);
}

/* ---- Feature / spec list ---------------------------------------------- */
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-6); font-size: var(--fs-sm); margin: 0 0 var(--sp-6); }
.spec-list dt { color: var(--c-text-muted); font-family: var(--font-display); }
.spec-list dd { margin: 0; color: var(--c-text); }

/* ---- Prose (long-form content) ---------------------------------------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: var(--sp-12); }
.prose h3 { margin-top: var(--sp-8); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--sp-1); }
.prose blockquote { margin-left: 0; padding-left: var(--sp-5); border-left: 3px solid var(--c-accent); color: var(--c-text-muted); font-style: italic; }
.prose img { border-radius: var(--radius-2); }

/* ---- Panel ---------------------------------------------------------------- */
.panel { padding: var(--sp-6); border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-surface); }
.panel > :last-child { margin-bottom: 0; }
.panel--media { display: flex; gap: var(--sp-6); align-items: center; }
@media (max-width: 34rem) { .panel--media { flex-direction: column; align-items: flex-start; } }

/* ---- Card cover (projects without a screenshot) ------------------------ */
.card__cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end; padding: var(--sp-5);
  background: linear-gradient(160deg, var(--c-bg-alt), var(--c-surface));
  border-bottom: var(--border-w) solid var(--c-border);
}
.card__cover-label {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  letter-spacing: -0.03em; line-height: 1; color: var(--c-heading);
}
.card__cover-label small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--c-text-muted); margin-top: var(--sp-2); }
/* isometric block in the corner, echoing the logo */
.card__cover::before, .card__cover::after { content: ""; position: absolute; z-index: -1; }
/* diagonal graphite slab + a light slab beside it (30° like the banner) */
.card__cover::before {
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 58%, var(--c-slab-mid) 58% 66%, var(--c-slab-dark) 66% 84%, transparent 84%);
  opacity: .9;
}
.card__cover::after {
  right: 10%; top: 16%; width: 8%; aspect-ratio: 1;
  background: var(--bj-cube-gradient); transform: rotate(45deg); border-radius: 2px;
  box-shadow: 0 6px 14px rgba(0, 87, 247, .3);
}
.card__cover--teal::after { background: var(--ai-with-gradient); }
.card__cover--graphite::after { background: var(--bj-graphite-300); }

/* ---- Image hero (Lab) ----------------------------------------------------- */
.hero--image { background: var(--lab-bg); color: var(--lab-text); }
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero--image::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(7,7,13,.94) 0%, rgba(7,7,13,.78) 42%, rgba(7,7,13,.25) 100%),
              linear-gradient(0deg, rgba(7,7,13,.9) 0%, rgba(7,7,13,0) 35%);
}
.hero--image .lead { color: var(--lab-text); }

/* ---- Filmstrip (scene thumbnails) ---------------------------------------- */
.filmstrip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(11rem, 1fr);
  gap: var(--sp-3); overflow-x: auto; list-style: none; padding: 0 0 var(--sp-3); margin: 0 0 var(--sp-6);
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.filmstrip li { scroll-snap-align: start; }
.filmstrip a { display: block; color: inherit; text-decoration: none; }
.filmstrip a img { transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.filmstrip a:hover img, .filmstrip a:focus-visible img { border-color: var(--lab-violet); transform: translateY(-2px); }
.filmstrip a:hover figcaption { color: var(--c-text); }
.filmstrip figure { margin: 0; }
.filmstrip img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: var(--radius-2); border: var(--border-w) solid var(--c-border); }
.filmstrip figcaption { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: var(--sp-2); }
.filmstrip figcaption b { font-family: var(--font-display); color: var(--lab-pink); letter-spacing: .15em; margin-right: .4em; font-weight: 600; }

/* ---- Steps (how it works) ----------------------------------------------- */
.steps { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { position: relative; padding: var(--sp-6) var(--sp-5) var(--sp-5); border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-surface); counter-increment: step; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.8125rem; letter-spacing: .2em;
  color: var(--c-accent); margin-bottom: var(--sp-2);
}
.theme-lab .steps > li::before { color: var(--lab-pink); }
.steps h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.steps p { font-size: var(--fs-sm); color: var(--c-text-muted); margin: 0; }

/* ---- Stats row ------------------------------------------------------------ */
.stats { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin: var(--sp-8) 0 0; padding: 0; list-style: none; }
.stats li { border-left: 2px solid var(--c-accent); padding-left: var(--sp-3); }
.stats b { display: block; font-family: var(--font-display); font-size: var(--fs-2xl); line-height: 1.1; color: var(--c-heading); font-weight: 600; }
.stats span { font-size: var(--fs-xs); color: var(--c-text-muted); }
.theme-lab .stats li, .hero--image .stats li { border-left-color: var(--lab-cyan); }

/* ---- Timeline (about) ---------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0 0 var(--sp-6); border-left: 2px solid var(--c-border); }
.timeline li { position: relative; padding: 0 0 var(--sp-6) var(--sp-6); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.45em; width: 12px; height: 12px; background: var(--bj-cube-gradient); transform: rotate(45deg); }
.timeline time { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--c-accent); }
.timeline h3 { font-size: var(--fs-lg); margin: var(--sp-1) 0 var(--sp-1); }
.timeline p { margin: 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
/* A stretch of time without a milestone: no bullet, dashed line */
.timeline li.timeline__gap {
  margin-left: -2px; border-left: 2px dashed var(--c-border);
  background: var(--c-bg); background-clip: border-box;
  padding-top: var(--sp-2); padding-bottom: var(--sp-8);
  padding-left: calc(var(--sp-6) + 2px);
}
.timeline li.timeline__gap::before { display: none; }
.timeline__gap p { font-style: italic; }
.timeline .timeline__gap-title { font-family: var(--font-display); font-style: normal; font-weight: 500; color: var(--c-text); font-size: var(--fs-md); margin-bottom: var(--sp-1); }

/* ---- FX applet boxes (Lab 03) ------------------------------------------ */
.fx-box { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; align-items: start; padding: var(--sp-6); border: var(--border-w) solid var(--c-border); border-radius: var(--radius-2); background: var(--c-surface); scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }
@media (min-width: 44rem) { .fx-box { grid-template-columns: minmax(0, 22.5rem) 1fr; } }
.fx-canvas { display: block; width: 100%; max-width: 22.5rem; aspect-ratio: 1; height: auto; background: #000; border: 1px solid var(--c-border); border-radius: var(--radius-2); image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: crosshair; }
.fx-box h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.fx-box .controls { margin-top: var(--sp-4); }
.fx-box [aria-pressed="true"] { border-color: var(--c-accent); color: var(--c-accent); }
.fx-stack > * + * { margin-top: var(--sp-6); }
.code-compare { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.code-compare .codeblock { margin: 0; }

/* ---- AI provenance badges ------------------------------------------------
   Two levels, from AIBadges/:
     Made by AI   - content/code produced by AI under human direction (blue)
     Made with AI - human-made, AI-assisted (teal)
   .ai-corner : page-level hex badge, top-right of <main> (set `ai:` in front matter)
   .ai-badge  : hex badge image placed manually (sections, demo pages)
   .ai-chip   : compact text pill for cards, lists, section heads
   ------------------------------------------------------------------------- */
main { position: relative; }

.ai-badge { display: inline-block; flex: none; line-height: 0; text-decoration: none;
  filter: drop-shadow(0 6px 14px rgba(20, 23, 28, .18));
  transition: transform var(--dur-2) var(--ease), filter var(--dur-2) var(--ease); }
.ai-badge img { width: 100%; height: auto; }
a.ai-badge:hover { transform: translateY(-2px) rotate(-3deg); filter: drop-shadow(0 10px 20px rgba(20, 23, 28, .26)); }
.ai-badge--sm { width: 4rem; }
.ai-badge--md { width: 6rem; }
.ai-badge--lg { width: 9rem; }
.theme-lab .ai-badge, [data-theme="dark"] .ai-badge:not(.theme-light *) { filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6)); }

.ai-corner {
  position: absolute; z-index: 5;
  top: var(--sp-5); right: var(--gutter);
  width: clamp(4.25rem, 3rem + 4vw, 6.5rem);
}
/* keep page titles clear of the corner badge */
@media (min-width: 48rem) {
  main:has(> .ai-corner) > :is(.hero, .page-head):first-of-type > .container {
    padding-right: calc(var(--gutter) + clamp(4.25rem, 3rem + 4vw, 6.5rem) + var(--sp-4));
  }
}
@media (max-width: 47.99rem) {
  .ai-corner { top: var(--sp-3); }
  main:has(> .ai-corner) > :is(.hero, .page-head):first-of-type { padding-top: 6.5rem; }
}

.ai-chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  line-height: 1; white-space: nowrap; text-decoration: none;
  padding: 0.35em 0.65em 0.35em 0.5em; border-radius: var(--radius-1);
  color: var(--c-ai-by); background: var(--c-ai-by-bg);
}
.ai-chip svg { width: 1.05em; height: 1.05em; flex: none; }
.ai-chip b { color: inherit; font-weight: 700; }
.ai-chip--with { color: var(--c-ai-with); background: var(--c-ai-with-bg); }
a.ai-chip:hover { filter: brightness(1.08); text-decoration: underline; }
.card--lab .ai-chip:not(.ai-chip--with), .bj-labbar .ai-chip:not(.ai-chip--with) { color: #5aa9ff; background: rgba(10, 130, 254, .14); }
.card--lab .ai-chip--with, .bj-labbar .ai-chip--with { color: #2ee6e6; background: rgba(46, 230, 230, .12); }

/* ---- Lab top bar (injected into Space Travel explainer pages) ----------- */
.bj-labbar {
  position: sticky; top: 0; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 16px;
  background: rgba(7,7,13,.92); border-bottom: 1px solid #262b4f;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 500 14px/1 "Outfit", "Segoe UI", system-ui, sans-serif; color: #d8dbea;
}
.bj-labbar img { width: 26px; height: 26px; }
.bj-labbar a { color: #d8dbea; text-decoration: none; }
.bj-labbar a:hover { color: #4fd9ff; }
.bj-labbar .sep { color: #4a4f78; }
.bj-labbar .tld { color: #4fd9ff; }
.bj-labbar .spacer { flex: 1; }
