/* =============================================================
   styles.css — custom styles that complement Tailwind v4
   Organized by:
     1. Base / tokens
     2. Background grid
     3. Section primitives (.section-title, .tag, etc.)
     4. Timeline (Work History)
     5. Skill bars
     6. Form fields
     7. Network nav (the centerpiece)
     8. Scroll-reveal animation
     9. Reduced-motion overrides
   ============================================================= */


/* ----------------------------------------------------
   1. Base / tokens
   ---------------------------------------------------- */
:root {
  --color-brand-400: #22d3ee;
  --color-brand-300: #67e8f9;
  --color-accent:    #34d399;
}

html { color-scheme: dark; }

/* Smooth scroll already enabled via the html class, but make it
   honor reduced-motion (the html class can't do that). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------------
   1b. Presentation mode — Desk (default) vs Floor
       data-mode is set before paint in head-boot.
       CSS defaults to Desk so no-JS still looks clean.
       Legacy aliases: briefing/site → desk, operator → floor.
   ---------------------------------------------------- */

/* Brand mark swap — Floor handle hidden unless mode=floor */
.brand-mark--floor { display: none; }
html[data-mode="floor"] .brand-mark--floor { display: inline; }
html[data-mode="floor"] .brand-mark--desk { display: none; }

/* Floor status strip (System Online + clock) — Floor only */
.floor-status { display: none !important; }
html[data-mode="floor"] .floor-status {
  display: flex !important;
}

/* Desk primary links — desktop only; mobile uses the hamburger */
.desk-nav { display: none; }
@media (min-width: 768px) {
  html:not([data-mode="floor"]) .desk-nav { display: flex; }
}

/* Segmented Desk | Floor switch — both options always visible */
.mode-switch {
  display: inline-flex;
  align-items: stretch;
  height: 2.5rem; /* match mobile icon buttons (h-10) */
  padding: 2px;
  border-radius: 0.4rem;
  border: 1px solid rgb(51 65 85); /* slate-700 */
  background: rgba(2, 6, 23, 0.65);
  gap: 2px;
}
.mode-switch__btn {
  appearance: none;
  margin: 0;
  border: 0;
  border-radius: 0.3rem;
  padding: 0 0.55rem;
  min-width: 2.75rem; /* comfortable thumb target */
  background: transparent;
  color: rgb(148 163 184); /* slate-400 */
  font-family: var(--font-mono, "JetBrains Mono"), ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mode-switch__btn:hover { color: rgb(226 232 240); }
.mode-switch__btn:focus-visible {
  outline: 2px solid var(--color-brand-400);
  outline-offset: 1px;
}
.mode-switch__btn[aria-pressed="true"] {
  background: rgba(34, 211, 238, 0.14);
  color: var(--color-brand-300);
}
html[data-mode="floor"] .mode-switch {
  border-color: rgba(34, 211, 238, 0.35);
}

/* First-visit cue: soft pulse on Floor (JS adds .is-hinting once) */
@keyframes mode-floor-hint {
  0%, 100% {
    background: transparent;
    color: rgb(148 163 184);
    box-shadow: inset 0 0 0 0 transparent;
  }
  35%, 65% {
    background: rgba(34, 211, 238, 0.16);
    color: var(--color-brand-300);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.4);
  }
}
.mode-switch__btn.is-hinting {
  animation: mode-floor-hint 1.15s ease-in-out 2;
}
@media (prefers-reduced-motion: reduce) {
  .mode-switch__btn.is-hinting { animation: none; }
}

/* Phones: reclaim horizontal space so Desk|Floor + search + nav fit */
@media (max-width: 639px) {
  /* Floor handle without @edge — keeps the plant-floor cue without crowding */
  html[data-mode="floor"] .brand-mark__host { display: none; }

  /* Telemetry stays findable via the green dot; drop the Online word */
  .floor-status__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .floor-status #sys-status {
    padding: 0.55rem; /* enlarge hit area around the dot */
    margin: -0.55rem;
  }

  .mode-switch__btn {
    padding: 0 0.45rem;
    letter-spacing: 0.04em;
  }
}
@media (min-width: 640px) {
  .mode-switch { height: 2.25rem; }
  .mode-switch__btn {
    padding: 0 0.65rem;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    min-width: 0;
  }
}

/* Desk: hide the Ignition tag browser on desktop; keep overlay for mobile */
@media (min-width: 1024px) {
  html:not([data-mode="floor"]) .tag-nav { display: none; }
  html:not([data-mode="floor"]) .lg\:pl-64 { padding-left: 0; }
}

/* Desk: quieter plant-floor atmosphere */
html:not([data-mode="floor"]) .grid-bg { opacity: 0.18; }

/* Desk: hide floor-only toys (still wired; discoverable once flipped) */
html:not([data-mode="floor"]) .estop,
html:not([data-mode="floor"]) .tag-nav__legend,
html:not([data-mode="floor"]) .tag-nav__caption { display: none; }
html:not([data-mode="floor"]) .qv-badge { display: none; }



/* ----------------------------------------------------
   2. Decorative background grid
   ---------------------------------------------------- */
.grid-bg {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}


/* ----------------------------------------------------
   3. Section primitives
   ---------------------------------------------------- */

/* Alternating section band — a slightly raised "panel zone" (HMI-style)
   that breaks the page's uniform darkness. Applied to experience + skills. */
.section-band {
  background: rgba(15, 23, 42, 0.35);
  border-top: 1px solid rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
}

.section-eyebrow {
  font-family: var(--font-mono, "JetBrains Mono"), ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-brand-400);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgb(241 245 249); /* slate-100 */
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.08);
  color: #a5f3fc;
  border: 1px solid rgba(34, 211, 238, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ----------------------------------------------------
   4. Timeline (Work History)
   ---------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    rgba(34, 211, 238, 0.4) 10%,
    rgba(34, 211, 238, 0.4) 90%,
    transparent
  );
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 2.5rem;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: 4px;
  top: 1.4rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0f172a;          /* slate-900 */
  border: 2px solid var(--color-brand-400);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}
.timeline-marker::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-brand-400);
  opacity: 0.4;
  animation: pulse-dot 2.2s ease-in-out infinite;
}

/* Current role (first item) pulses emerald — live, like the ACTIVE badge */
.timeline-item:first-child .timeline-marker {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
}
.timeline-item:first-child .timeline-marker::after {
  background: var(--color-accent);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(0.6); opacity: 0.3; }
  50%      { transform: scale(1);   opacity: 0.9; }
}

.timeline-card {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);     /* slate-900/45 */
  border: 1px solid rgb(30 41 59);        /* slate-800 */
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.timeline-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(15, 23, 42, 0.65);
  transform: translateY(-1px);
}

/* Education re-uses similar card style */
.edu-card {
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgb(30 41 59);
  transition: border-color .2s ease, transform .2s ease;
}
.edu-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}


/* ----------------------------------------------------
   5. Skills — chips live inside the Toolbelt layers (see 7d)
   ---------------------------------------------------- */

.skill-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  color: rgb(148 163 184);
  background: transparent;
  border: 1px solid rgb(30 41 59);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.skill-chip:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.6);
  outline-offset: 2px;
}
.skill-chip:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: rgb(226 232 240);
  background: rgba(34, 211, 238, 0.05);
}
.skill-chip[aria-expanded="true"] {
  border-color: rgba(34, 211, 238, 0.65);
  color: rgb(241 245 249);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2);
}
/* Icon added by diagram.js from SKILL_META */
.skill-chip__icon {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  color: rgba(34, 211, 238, 0.7);
  transition: color .15s ease;
}
.skill-chip__icon.is-brand { fill: currentColor; }
.skill-chip:hover .skill-chip__icon,
.skill-chip[aria-expanded="true"] .skill-chip__icon { color: var(--color-brand-300); }

/* Spoken languages — lives in About aside, stacked like other bio facts */
.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(226 232 240);
}


/* ----------------------------------------------------
   6. Form fields
   ---------------------------------------------------- */
.field { display: grid; gap: 0.4rem; }

/* Honeypot wrapper — off-screen (not display:none, which bots skip) so naive
   bots still fill it while humans and assistive tech never reach it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field__label {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgb(148 163 184);
}
.field__input {
  width: 100%;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgb(30 41 59);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  color: rgb(241 245 249);
  font-size: 0.95rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field__input:focus {
  outline: none;
  border-color: var(--color-brand-400);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* Field-level fault state (rose = failure tier, like the error status).
   :user-invalid only matches after real user interaction, so fields don't
   scream red before anyone has typed. */
.field__input:user-invalid {
  border-color: rgba(251, 113, 133, 0.55);
}
.field__input:user-invalid:focus {
  border-color: rgb(251 113 133);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.15);
}


/* ----------------------------------------------------
   7. Tag-browser navigation (Ignition-style sidebar)

      Layout:
        - mobile: hidden off-screen by default, slides in from the
          left when .is-open is added (with backdrop dimming the page)
        - lg+:    permanently visible, fixed below the top bar
   ---------------------------------------------------- */

.tag-nav {
  position: fixed;
  top: 3.5rem;           /* below the 56px top bar */
  left: 0;
  bottom: 0;
  width: 16rem;          /* 256px — matches lg:pl-64 on <main> */
  z-index: 40;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tag-nav__panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(2, 6, 23, 0.92);
  border-right: 1px solid rgba(34, 211, 238, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 0.75rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}

/* --- Rail (collapsed) state -------------------------------------------
   Desktop only: the panel shrinks to a dot strip and the page reclaims the
   width. Hovering it expands the panel OVER the content rather than pushing
   it, so nothing reflows while you're pointing at a tag. The nav-rail class
   is set on <html> before paint, so there is no expanded-then-collapsed flash.
   ---------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .tag-nav { transition: width .24s cubic-bezier(0.22, 1, 0.36, 1); }
  .nav-rail .tag-nav { width: 3.25rem; }
  .nav-rail .tag-nav:hover,
  .nav-rail .tag-nav:focus-within { width: 16rem; }

  /* Content offset follows the rail (beats the lg:pl-64 utility on specificity) */
  .nav-rail .lg\:pl-64 { padding-left: 3.25rem; }
  .lg\:pl-64 { transition: padding-left .24s cubic-bezier(0.22, 1, 0.36, 1); }

  /* Everything except the dots and the chevron folds away while railed */
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__brand,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__caption,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__filter,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__legend,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__footer,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__name,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .qv-badge,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__group-count {
    display: none;
  }
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__panel { padding: 1rem 0.4rem; }
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__item,
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__group > summary {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.4rem 0;
  }
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__group > ul {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  /* The chevron is the only affordance left — point it at "expand" */
  .nav-rail .tag-nav:not(:hover):not(:focus-within) .tag-nav__header .tag-nav__chev {
    transform: rotate(-90deg);
  }
}

/* The brand row doubles as the collapse control */
.tag-nav__collapse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.tag-nav__collapse:hover .tag-nav__brand { color: var(--color-brand-300); }
.tag-nav__header .tag-nav__chev { transition: transform .2s ease; }

/* Filter field */
.tag-nav__filter { padding: 0 0.25rem 0.25rem; }
.tag-nav__filter input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.7rem;
  color: rgb(226 232 240);
}
.tag-nav__filter input::placeholder { color: rgb(148 163 184); }
.tag-nav__filter input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(15, 23, 42, 0.9);
}
.tag-nav__empty {
  padding: 0.5rem;
  font-size: 0.7rem;
  color: rgb(148 163 184);
}
/* While filtering, the dashed child rail reads as clutter */
.tag-nav__tree.is-filtered .tag-nav__group > ul { border-left-color: transparent; }

/* Right-click context menu */
.tag-ctx {
  position: fixed;
  z-index: 60;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(2, 6, 23, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.7);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}
.tag-ctx__path {
  margin: 0 0 0.3rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  color: rgb(148 163 184);
  border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-ctx button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.7rem;
  color: rgb(203 213 225);
  cursor: pointer;
}
.tag-ctx button:hover {
  background: rgba(34, 211, 238, 0.1);
  color: rgb(241 245 249);
}

/* Tag-path breadcrumb in the top bar */
.tag-path {
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: rgb(148 163 184);
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: none;                 /* too cramped below md */
}
@media (min-width: 768px) {
  html[data-mode="floor"] .tag-path { display: block; }
}
.tag-path__sep { color: rgba(148, 163, 184, 0.4); padding: 0 0.15rem; }
.tag-path__leaf { color: rgb(148 163 184); }

/* Backdrop on mobile when the nav is open */
.tag-nav::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: -1;
}
.tag-nav.is-open {
  transform: none;
}
.tag-nav.is-open::before {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .tag-nav { transform: none; }
  .tag-nav::before { display: none; }
}

/* Header — collapsible "▼ samdonche" brand row */
.tag-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
}
.tag-nav__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgb(226 232 240);
}
.tag-nav__chev {
  color: var(--color-brand-400);
  font-size: 0.7rem;
}
.tag-nav__brand { font-weight: 500; }

.tag-nav__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 4px;
  border: 1px solid rgb(30 41 59);
  color: rgb(148 163 184);
}
/* Desktop: the sidebar is permanent, so there is nothing to close.
   (This must live here — the display above would otherwise override
   the lg:hidden utility, since styles.css loads after tailwind.css.) */
@media (min-width: 64rem) {
  .tag-nav__close { display: none; }
}
.tag-nav__close:hover {
  color: rgb(241 245 249);
  border-color: rgba(34, 211, 238, 0.4);
}

/* Caption */
.tag-nav__caption {
  margin: 0.75rem 0.5rem 0.25rem;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

/* Tree — flex grows to fill, then footer pins to bottom */
.tag-nav__tree {
  flex: 1;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}
.tag-nav__tree::-webkit-scrollbar { width: 6px; }
.tag-nav__tree::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.18);
  border-radius: 3px;
}

/* Tree item — anchor row */
.tag-nav__item {
  display: grid;
  grid-template-columns: 1rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: rgb(148 163 184);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
}
.tag-nav__item:hover {
  background: rgba(34, 211, 238, 0.06);
  color: rgb(226 232 240);
}
.tag-nav__item:focus-visible {
  outline: none;
  background: rgba(34, 211, 238, 0.08);
  color: rgb(241 245 249);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35);
}
/* Page nodes navigate off the home page — mark them with a small ↗ */
/* A long label (case-study / article slugs) must yield to the QV badge
   instead of shoving it out of the panel. */
.tag-nav__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-nav__item--page .tag-nav__name::after {
  content: " \2197";
  color: rgba(148, 163, 184, 0.55);
  font-size: 0.85em;
}

/* Quality-value dot (left column) */
.qv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(71 85 105);            /* default — slate-600 */
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8);
  flex-shrink: 0;
  justify-self: center;
  transition: background .25s ease, box-shadow .25s ease;
}

/* Quality-value badge (right column) */
.qv-badge {
  font-size: 0.5625rem;          /* 9px */
  letter-spacing: 0.12em;
  color: rgb(148 163 184);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.5);
}

/* QV status: STALE — unvisited */
.tag-nav__item[data-qv="stale"] .qv-dot   { background: rgb(234 179 8); }   /* amber-500 */
.tag-nav__item[data-qv="stale"] .qv-badge {
  color: rgb(234 179 8);
  border-color: rgba(234, 179, 8, 0.25);
}

/* QV status: GOOD — visited at least once.
   Color semantics site-wide: cyan = data/machine side, emerald = live/now. */
.tag-nav__item[data-qv="good"] .qv-dot   { background: var(--color-brand-400); }
.tag-nav__item[data-qv="good"] .qv-badge {
  color: var(--color-brand-400);
  border-color: rgba(34, 211, 238, 0.25);
}

/* QV status: LIVE — currently in view (overrides above); emerald = "online now",
   same signal as the System: Online dot and the profile card's ACTIVE state */
.tag-nav__item[data-qv="live"] {
  background: rgba(52, 211, 153, 0.07);
  color: rgb(241 245 249);
  box-shadow: inset 2px 0 0 0 var(--color-accent);
}
.tag-nav__item[data-qv="live"] .qv-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), 0 0 8px rgba(52, 211, 153, 0.7);
  animation: qv-pulse 1.6s ease-in-out infinite;
}
.tag-nav__item[data-qv="live"] .qv-badge {
  color: rgb(110 231 183);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

/* A group row can be the live one as well (its own section is in view, or it
   is the page you're on). It has no dot/badge, so the row itself carries it. */
.tag-nav__group > summary[data-qv="live"] {
  background: rgba(52, 211, 153, 0.07);
  color: rgb(241 245 249);
  box-shadow: inset 2px 0 0 0 var(--color-accent);
}
.tag-nav__group > summary[data-qv="live"] .tag-nav__chev,
.tag-nav__group > summary[data-qv="live"] .tag-nav__group-count {
  color: rgb(110 231 183);
}

@keyframes qv-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.25); opacity: 0.8; }
}

/* Group (collapsible parent — uses native <details>/<summary>) */
.tag-nav__group {
  margin: 0;
}
.tag-nav__group > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: rgb(203 213 225);
  transition: background .15s ease, color .15s ease;
}
.tag-nav__group > summary::-webkit-details-marker { display: none; }
.tag-nav__group > summary:hover {
  background: rgba(34, 211, 238, 0.06);
  color: rgb(241 245 249);
}
.tag-nav__group > summary .tag-nav__chev {
  display: inline-block;
  font-size: 0.65rem;
  text-align: center;
  transition: transform .2s ease;
  color: rgb(148 163 184);
}
.tag-nav__group:not([open]) > summary .tag-nav__chev {
  transform: rotate(-90deg);
}
.tag-nav__group-count {
  font-size: 0.5625rem;
  color: rgb(148 163 184);
  letter-spacing: 0.05em;
}

/* Children list — indented under summary */
.tag-nav__group > ul {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.4rem 0.85rem;
  border-left: 1px dashed rgba(148, 163, 184, 0.15);
  margin-left: 0.45rem;
}
.tag-nav__group > ul .tag-nav__item {
  font-size: 0.73rem;
}

/* Footer — Cmd+K hint */
/* QV quality legend — a real tag browser would have one. Teaches the
   STALE/GOOD/LIVE mechanic to visitors who don't speak Ignition. */
.tag-nav__legend {
  padding: 0.75rem 0.25rem 0.25rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: rgb(148 163 184);
}
.tag-nav__legend p { margin: 0; display: flex; align-items: center; gap: 0.45rem; }
.tag-nav__legend .legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--stale { background: rgb(234 179 8); }
.legend-dot--good  { background: var(--color-brand-400); }
.legend-dot--live  { background: var(--color-accent); }

.tag-nav__footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.12);
}
.tag-nav__cmdk {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgb(30 41 59);
  background: rgba(15, 23, 42, 0.5);
  color: rgb(148 163 184);
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tag-nav__cmdk:hover {
  color: rgb(241 245 249);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(15, 23, 42, 0.8);
}
.tag-nav__cmdk-keys { display: inline-flex; gap: 0.15rem; }
/* On touch devices the ⌘K chord is noise — the label is enough */
@media (hover: none) {
  .tag-nav__cmdk-keys { display: none; }
}
.tag-nav__cmdk kbd,
.cmdk kbd {
  font-family: inherit;
  font-size: 0.625rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--color-brand-300);
  border: 1px solid rgba(34, 211, 238, 0.2);
}


/* ----------------------------------------------------
   7b. Command Palette (⌘K)
   ---------------------------------------------------- */

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  padding-left: 1rem;
  padding-right: 1rem;
}
.cmdk[hidden] { display: none; }

.cmdk__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cmdk-fade .12s ease;
}

.cmdk__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 10px;
  box-shadow: 0 25px 60px -10px rgba(0,0,0,0.7),
              0 0 0 1px rgba(34, 211, 238, 0.08),
              0 0 40px -10px rgba(34, 211, 238, 0.3);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  overflow: hidden;
  animation: cmdk-rise .18s cubic-bezier(0.22, 1, 0.36, 1);
}

.cmdk__input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg,
    rgba(34, 211, 238, 0.04),
    transparent);
}
.cmdk__prompt {
  color: var(--color-brand-400);
  font-weight: 600;
}
.cmdk__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: rgb(241 245 249);
  font: inherit;
  font-size: 0.9rem;
  padding: 0;
}
.cmdk__input::placeholder {
  color: rgb(71 85 105);
}
.cmdk__esc {
  /* uses .cmdk kbd from above */
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.cmdk__results {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}
.cmdk__results::-webkit-scrollbar { width: 6px; }
.cmdk__results::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.18);
  border-radius: 3px;
}

.cmdk__item {
  display: grid;
  grid-template-columns: 0.8rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 5px;
  color: rgb(148 163 184);
  cursor: pointer;
  font-size: 0.78rem;
  transition: background .1s ease;
}
.cmdk__item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgb(71 85 105);
  justify-self: center;
}
.cmdk__item-path {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}
.cmdk__item-path b {
  color: var(--color-brand-300);
  font-weight: 600;
  background: rgba(34, 211, 238, 0.08);
  border-radius: 2px;
  padding: 0 1px;
}
.cmdk__item-desc {
  font-size: 0.6875rem;
  color: rgb(148 163 184);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cmdk__item.is-selected {
  background: rgba(34, 211, 238, 0.08);
  color: rgb(241 245 249);
  box-shadow: inset 2px 0 0 0 var(--color-brand-400);
}
.cmdk__item.is-selected .cmdk__item-dot {
  background: var(--color-brand-400);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.6);
}

.cmdk__empty {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  /* Failed query = mini warning state — amber, like a STALE tag */
  color: rgb(234 179 8);
}

.cmdk__footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.625rem;
  color: rgb(148 163 184);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(2, 6, 23, 0.4);
}

@keyframes cmdk-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cmdk-rise {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}


/* ----------------------------------------------------
   7c. Diagram panel — shared chrome (header, live badge, scroll,
   caption) for the Experience "Career historian" chart.
   ---------------------------------------------------- */

.stack-diagram {
  margin: 2.5rem auto 0;
  max-width: none;                 /* fill the section, matching the skill-box grid below */
  padding: 1.5rem 1.5rem 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgb(30 41 59);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* Subtle inner glow at top to suggest "active panel" */
.stack-diagram::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(34, 211, 238, 0.05), transparent 50%);
  pointer-events: none;
}

.stack-diagram__header {
  display: flex;
  flex-wrap: wrap;              /* caption + live badge collide on narrow screens otherwise */
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
}

/* On phones the full diagram would render illegibly small — keep a legible
   minimum width and let it scroll horizontally inside the card instead. */
.stack-diagram__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 43rem) {
  .stack-diagram__scroll svg {
    min-width: 40rem;
    height: auto;
  }
}
.stack-diagram__caption { color: rgb(148 163 184); }
.stack-diagram__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent);
}
.stack-diagram__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
  animation: stack-dot-pulse 1.6s ease-in-out infinite;
}
.stack-diagram__cap {
  margin: 1rem auto 0;
  max-width: 520px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(148 163 184);
  line-height: 1.55;
}
.stack-diagram__hint {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: rgba(34, 211, 238, 0.7);
}

/* Mobile-only "swipe" affordance for the horizontally-scrolling diagram */
.stack-diagram__swipe {
  display: none;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(34, 211, 238, 0.7);
}
@media (max-width: 43rem) {
  .stack-diagram__swipe { display: block; margin-bottom: 0.4rem; text-align: right; }
}
/* Touch devices have no hover — don't imply an interaction that won't fire */
@media (hover: none) {
  .stack-diagram__hint { display: none; }
}


/* ----------------------------------------------------
   7d. Toolbelt — layered reference architecture (Skills)
   Five bands on a platform base. The Unified Namespace is the
   hub; every software band taps its bus spine both ways (not
   the ISA-95 pyramid). Chips live inside their band, so the
   diagram doubles as the index.
   ---------------------------------------------------- */

/* margin lives here (not a Tailwind utility): this rule loads after
   tailwind.css and would silently zero out an mt-* class. */
.stack-layers {
  margin: 2.5rem 0 0;
  padding: 1.5rem 1.5rem 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgb(30 41 59);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
/* Subtle inner glow at top to suggest "active panel" */
.stack-layers::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(34, 211, 238, 0.05), transparent 50%);
  pointer-events: none;
}

.stack-layers__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
}
@media (max-width: 30rem) {
  .stack-layers { padding: 1.1rem 0.9rem 1rem; }
  .stack-layers__flow { --tap: 1.25rem; }
  .stack-base { margin-left: 1.25rem; }
}
.stack-layers__caption { color: rgb(148 163 184); }
.stack-layers__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-accent);
}
.stack-layers__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
  animation: stack-dot-pulse 1.6s ease-in-out infinite;
}

/* ---- Bus spine: the Unified Namespace extended as a vertical bus down the
   left edge. Each software band taps into it with a two-way link (pub/sub),
   so the picture reads as a hub, not the ISA-95 pyramid's level-by-level
   handoff. Field has no tap: it's reached through the edge band. ---- */
.stack-layers__flow {
  position: relative;
  --tap: 2rem;              /* spine → band link length */
  padding-left: var(--tap);
}

/* ---- Bands ---- */
.stack-layers__bands {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.stack-band {
  position: relative;
  display: grid;
  gap: 0.6rem 1.5rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgb(30 41 59);
  border-radius: 8px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
@media (min-width: 48rem) {
  .stack-band { grid-template-columns: 14rem minmax(0, 1fr); }
}
.stack-band:hover { border-color: rgb(51 65 85); }
/* spine segment per connected band; segments meet mid-gap (the extra 1px
   covers the band border, since absolute offsets start inside it) */
.stack-band:not(.stack-band--field)::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tap));
  top: calc(-0.25rem - 1px);
  bottom: calc(-0.25rem - 1px);
  width: 2px;
  margin-left: -1px;
  background: rgba(34, 211, 238, 0.4);
}
.stack-band:first-child::after { top: 50%; }
.stack-band:nth-last-child(2)::after { bottom: 50%; }   /* edge: last band on the bus */
/* link from the spine into the band */
.stack-band::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tap));
  top: 50%;
  width: var(--tap);
  height: 1px;
  background: rgba(34, 211, 238, 0.3);
}
/* Field hangs off the edge band instead of the bus */
.stack-band--field::before {
  left: 2rem;
  top: -0.5rem;
  width: 1px;
  height: 0.5rem;
  background: rgba(100, 116, 139, 0.6);
}
/* two-way traffic on each link: one dot publishes in, one subscribes out */
.stack-band__tap {
  position: absolute;
  left: calc(-1 * var(--tap));
  top: 50%;
  width: var(--tap);
  height: 0;
  pointer-events: none;
}
.stack-band__tap i {
  position: absolute;
  top: -2.5px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-brand-400);
  box-shadow: 0 0 5px rgba(34, 211, 238, 0.8);
  opacity: 0;
  animation: stack-pub 2.4s ease-in-out infinite;
}
.stack-band__tap i:nth-child(2) {
  background: var(--color-accent);
  box-shadow: 0 0 5px rgba(52, 211, 153, 0.8);
  animation-name: stack-sub;
  animation-delay: -1.2s;
}
.stack-band:nth-child(2) .stack-band__tap i { animation-delay: -0.8s; }
.stack-band:nth-child(2) .stack-band__tap i:nth-child(2) { animation-delay: -2s; }
.stack-band:nth-child(4) .stack-band__tap i { animation-delay: -1.6s; }
.stack-band:nth-child(4) .stack-band__tap i:nth-child(2) { animation-delay: -0.4s; }
/* pub: band → spine; sub: spine → band */
@keyframes stack-pub {
  0%   { left: calc(100% - 5px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 0; opacity: 0; }
}
@keyframes stack-sub {
  0%   { left: 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

.stack-band__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(226 232 240);
}
.stack-band__role {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgb(100 116 139);
}
.stack-band__things {
  margin: 0;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgb(100 116 139);
}
/* Field is physical OT — hatched, not a software layer */
.stack-band--field {
  background:
    repeating-linear-gradient(135deg, rgba(51, 65, 85, 0.18) 0 6px, transparent 6px 12px),
    rgba(15, 23, 42, 0.4);
  border-style: dashed;
}

/* The Unified Namespace is the bus — the one band that glows */
.stack-band--bus {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.08), rgba(34, 211, 238, 0.02));
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.06), 0 0 24px -8px rgba(34, 211, 238, 0.35);
}
.stack-band--bus:hover { border-color: rgba(34, 211, 238, 0.6); }
/* the hub's own joint onto the spine is solid: the spine *is* the bus */
.stack-band--bus::before { height: 2px; margin-top: -0.5px; background: rgba(34, 211, 238, 0.7); }
.stack-band--bus::after { background: rgba(34, 211, 238, 0.55); }
.stack-band--bus .stack-band__name { color: var(--color-brand-300); }
/* messages streaming along the bus */
.stack-band__bus {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: -1px;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(34, 211, 238, 0.8) 0 10px, transparent 10px 26px);
  background-size: 26px 2px;
  opacity: 0.6;
  animation: stack-bus 1.2s linear infinite;
  pointer-events: none;
}
@keyframes stack-bus { to { background-position: 26px 0; } }

/* MQTT egg: a small broker indicator inside the bus band */
.stack-broker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand-300);
  background: transparent;
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.stack-broker:hover { border-color: rgba(34, 211, 238, 0.7); background: rgba(34, 211, 238, 0.06); }
.stack-broker:focus-visible { outline: 2px solid rgba(34, 211, 238, 0.6); outline-offset: 2px; }
.stack-broker__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand-400);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.8);
  animation: stack-dot-pulse 1.6s ease-in-out infinite;
}

/* ---- Platform base: what every layer runs on, and how it ships ---- */
.stack-base {
  margin: 0.75rem 0 0 2rem;
  padding: 0.75rem 1rem;
  border: 1px dashed rgb(51 65 85);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.35);
  display: grid;
  gap: 0.6rem;
}
.stack-base__row {
  display: grid;
  gap: 0.4rem 1.5rem;
  align-items: center;
}
@media (min-width: 48rem) {
  .stack-base__row { grid-template-columns: 14rem minmax(0, 1fr); }
}
.stack-base__label {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}
.stack-base__label::before { content: "// "; color: rgba(34, 211, 238, 0.5); }

.stack-layers__cap {
  margin: 1.1rem auto 0;
  max-width: 520px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(148 163 184);
  line-height: 1.55;
}
.stack-layers__hint {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: rgba(34, 211, 238, 0.7);
}

/* MQTT egg: the broker "publishes" — bus glows, links speed up */
.stack-layers.is-publishing .stack-band--bus {
  animation: mqtt-flash 1.4s ease-out;
}
.stack-layers.is-publishing .stack-band__bus { opacity: 1; animation-duration: 0.3s; }
.stack-layers.is-publishing .stack-band__tap i { animation-duration: 0.8s; }
@keyframes mqtt-flash {
  0%   { box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.06), 0 0 24px -8px rgba(34, 211, 238, 0.35); }
  18%  { box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.6), 0 0 36px -4px rgba(34, 211, 238, 0.8); }
  100% { box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.06), 0 0 24px -8px rgba(34, 211, 238, 0.35); }
}

@keyframes stack-dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%      { opacity: 0.6; transform: scale(0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .stack-band__tap i,
  .stack-band__bus,
  .stack-layers__pulse,
  .stack-broker__dot { animation: none; }
  .stack-band__tap i { display: none; }
}

/* ---- Skill popover (click a chip → what it is + on-brand icon) ---- */
.skill-popover {
  position: absolute;
  z-index: 50;
  width: 260px;
  max-width: calc(100vw - 20px);
  padding: 0.85rem 0.95rem;
  background: rgba(9, 14, 26, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(34, 211, 238, 0.06);
  backdrop-filter: blur(4px);
  animation: skill-pop-in 0.14s ease-out;
}
.skill-popover[hidden] { display: none; }
.skill-popover__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}
.skill-popover__glyph {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--color-brand-400);
}
.skill-popover__glyph.is-brand { fill: currentColor; }   /* brand glyph recoloured to site cyan */
.skill-popover__name {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgb(226 232 240);
}
.skill-popover__full {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--color-brand-300);
}
.skill-popover__desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgb(148 163 184);
}
/* Little cyan pointer nub, flipping with the popover */
.skill-popover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  background: rgba(9, 14, 26, 0.97);
  border-left: 1px solid rgba(34, 211, 238, 0.35);
  border-top: 1px solid rgba(34, 211, 238, 0.35);
  transform: rotate(45deg);
}
.skill-popover.is-above::before {
  top: auto;
  bottom: -5px;
  border-left: none;
  border-top: none;
  border-right: 1px solid rgba(34, 211, 238, 0.35);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
}
@keyframes skill-pop-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .skill-popover { animation: none; }
}

/* ---- Career historian trend (Experience section) ---- */
#career-svg {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.career-svg__gridline {
  stroke: rgba(148, 163, 184, 0.09);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.career-svg__axis-label,
.career-svg__lane-label,
.career-svg__now-label {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.career-svg__axis-label { fill: rgb(148 163 184); text-anchor: middle; }
.career-svg__lane-label { fill: rgb(148 163 184); text-anchor: end; }
.career-svg__now-label  { fill: var(--color-accent); font-weight: 600; }
.career-svg__lane { cursor: pointer; }
.career-svg__lane:hover .career-svg__lane-label { fill: rgb(203 213 225); }
.career-svg__bar {
  fill: rgba(34, 211, 238, 0.16);
  stroke: rgba(34, 211, 238, 0.55);
  stroke-width: 1.25;
  transition: fill .15s ease;
}
.career-svg__lane:hover .career-svg__bar { fill: rgba(34, 211, 238, 0.3); }
.career-svg__bar--live {
  fill: rgba(52, 211, 153, 0.18);
  stroke: rgba(52, 211, 153, 0.7);
}
.career-svg__lane:hover .career-svg__bar--live { fill: rgba(52, 211, 153, 0.32); }
.career-svg__bar--edu {
  fill: rgba(148, 163, 184, 0.1);
  stroke: rgba(148, 163, 184, 0.35);
}
.career-svg__lane:hover .career-svg__bar--edu { fill: rgba(148, 163, 184, 0.2); }
.career-svg__now-line {
  stroke: rgba(52, 211, 153, 0.4);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.career-svg__now-dot {
  fill: var(--color-accent);
  transform-origin: center;
  transform-box: fill-box;
  animation: qv-pulse 1.6s ease-in-out infinite;
}
/* Full-width row hit area — bigger click target, and the row tint makes
   "this is interactive" legible before you find the cursor change */
.career-svg__hit { fill: transparent; }
.career-svg__lane:hover .career-svg__hit { fill: rgba(148, 163, 184, 0.06); }
.career-svg__lane.is-selected .career-svg__hit { fill: rgba(34, 211, 238, 0.07); }

.career-svg__lane.is-selected .career-svg__lane-label { fill: rgb(241 245 249); }
.career-svg__lane.is-selected .career-svg__bar {
  fill: rgba(34, 211, 238, 0.38);
  stroke-width: 1.75;
}
.career-svg__lane.is-selected .career-svg__bar--live {
  fill: rgba(52, 211, 153, 0.4);
}
.career-svg__lane.is-selected .career-svg__bar--edu {
  fill: rgba(148, 163, 184, 0.32);
}

/* Trend legend — what the bar colors mean (experience / current / education) */
.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  justify-content: center;
  margin-top: 0.9rem;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}
.trend-legend > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.trend-legend .legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend-dot--exp { background: rgba(34, 211, 238, 0.55); }
.legend-dot--now { background: var(--color-accent); }
.legend-dot--edu { background: rgba(148, 163, 184, 0.4); }

/* Hover popover over the trend chart */
.trend-tip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgb(226 232 240);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.trend-tip.is-visible { opacity: 1; }
.trend-tip__meta { display: block; margin-top: 2px; color: rgb(148 163 184); }

/* Inspector mode: the chart selects which single role card shows below.
   All cards remain in the DOM (SEO / print / no-JS show everything). */
/* margin lives here (not a Tailwind utility) — this rule loads after
   tailwind.css and would silently zero out an mt-* class.
   max-width + radius match the chart panel above so their edges align. */
.role-detail { list-style: none; margin: 2rem auto 0; padding: 0; max-width: 880px; }
.role-detail .timeline-card { border-radius: 12px; }
.role-detail .timeline-marker { display: none; }
.role-detail .timeline-item { padding-left: 0; margin-bottom: 1.25rem; }
.js .role-detail .timeline-item { display: none; }
.js .role-detail .timeline-item.is-selected { display: block; }



/* ----------------------------------------------------
   8. Scroll-reveal
   ---------------------------------------------------- */
/* Hidden state applies ONLY when JS is active (html.js is set by an inline
   script in <head>). Without JS the observer never runs, so content must
   stay visible — no-JS visitors see everything. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Above-the-fold hero: a CSS-only entrance (no scroll-observer), so it never
   paints blank waiting for deferred JS. Transform-only keeps the text visible
   from the first frame — good for LCP and no flash of empty hero. */
.hero-enter { animation: hero-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes hero-in { from { transform: translateY(14px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-enter { animation: none; }
}


/* ----------------------------------------------------
   Misc: slow bounce, animations from Tailwind extras
   ---------------------------------------------------- */
/* Hero scroll hint — pulses like an instrument reading, not a bouncing toy */
.scroll-hint {
  animation: scroll-hint-pulse 2.4s ease-in-out infinite;
}
@keyframes scroll-hint-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}


/* ----------------------------------------------------
   9. Reduced motion — disable non-essential motion
   ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .js .reveal { opacity: 1; transform: none; }
}


/* ----------------------------------------------------
   10. Print — the same URL doubles as a clean CV.
       White paper, dark text, chrome hidden, link
       targets surfaced for the publications.
   ---------------------------------------------------- */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }
  body { background: #fff !important; font-size: 11pt; }

  /* Chrome with no meaning on paper */
  body > header,                    /* fixed top bar */
  body > div[aria-hidden="true"],   /* fixed background grid */
  .tag-nav,
  #cmdk,
  .scroll-hint,
  .stack-diagram,                   /* cyan-on-white SVG would be unreadable */
  .stack-layers__live,              /* Toolbelt prints, minus its screen-only bits */
  .stack-broker,
  .stack-layers__hint,
  .stack-band__bus,
  #contact-form,
  p:has([data-email-reveal]),
  #hero a[href="#experience"],      /* hero buttons */
  #hero a[href="#contact"],
  .estop,
  .egg-toast,
  .egg-discover,
  .telemetry,
  .line-banner,
  .scada-alarm,
  .boot-seq,
  .capstone-fx,
  footer { display: none !important; }

  /* beforeprint also flips data-mode to desk; keep main flush either way */
  main { padding-left: 0 !important; }
  main > section { padding: 0.75rem 0 !important; min-height: 0 !important; }
  .section-band { border: 0 !important; }

  /* Scroll-reveal must never hide content on paper */
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }

  .timeline-item, .edu-card, .stack-band { break-inside: avoid; }
  h2 { break-after: avoid; }

  /* Inspector shows one card on screen — paper gets the full history */
  .role-detail .timeline-item { display: block !important; margin-bottom: 1rem; }

  /* Surface link targets (DOIs, company site) */
  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #555 !important;
  }
}

/* ============================================================
   EASTER EGGS — for the curious. All optional, all on-theme.
     · Konami (↑↑↓↓←→←→BA) → "night shift" amber HMI mode + SCADA alarm
     · ⌘K secret commands → HMI status toast
     · ?boot / samdonche.boot() → edge-gateway cold-start sequence
   ============================================================ */

/* Night shift: re-tint the cyan/emerald accents to amber phosphor. Tailwind v4
   utilities all read these vars, so overriding them here cascades site-wide. */
html.hmi-night {
  --color-brand-400: #ffb000;
  --color-brand-300: #ffc860;
  --color-brand-200: #ffe0a3;
  --color-brand-100: #fff4da;
  --color-accent:    #ff9e2c;
}
/* CRT scanlines + warm amber vignette wash (non-interactive) */
html.hmi-night body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 176, 0, 0.045) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 52%, rgba(120, 60, 0, 0.22) 100%);
}
@media (prefers-reduced-motion: no-preference) {
  html.hmi-night body::after { animation: hmi-flicker 7s steps(1) infinite; }
}
@keyframes hmi-flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: 0.82; } }

/* SCADA alarm banner — slides down from the top, self-clears */
.scada-alarm {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0b0b0b;
  background: #ffb000;
  box-shadow: 0 0 30px rgba(255, 176, 0, 0.5);
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.scada-alarm.is-visible { transform: translateY(0); }
.scada-alarm--ok { background: #34d399; }
.scada-alarm b { font-weight: 700; }
.scada-alarm__dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: #7a1a00;
  flex-shrink: 0;
  animation: scada-blink 0.6s steps(1) infinite;
}
.scada-alarm__dot--ok { background: #0b3b1e; animation: none; }
@keyframes scada-blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .scada-alarm__dot { animation: none; } }

/* HMI status toast — ⌘K secret-command feedback */
.egg-toast {
  position: fixed;
  left: 50%; bottom: 2rem;
  transform: translate(-50%, 1rem);
  z-index: 70;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-brand-400);
  background: rgba(2, 6, 23, 0.92);
  color: var(--color-brand-300);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.8rem;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.egg-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Secret commands look distinct from tag rows in the palette */
.cmdk__item--cmd .cmdk__item-path::before {
  content: "\203a  ";
  color: var(--color-brand-400);
}

/* Edge-gateway cold-boot sequence overlay */
.boot-seq {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: #020617;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.boot-seq.is-visible { opacity: 1; }
.boot-seq.is-leaving { opacity: 0; }
.boot-seq__log {
  margin: 0;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: clamp(0.72rem, 2.6vw, 0.9rem);
  line-height: 1.9;
  color: var(--color-brand-300);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
  min-width: min(90vw, 34rem);
  white-space: pre-wrap;
}
.boot-seq__hint {
  margin: 0;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.boot-seq__hint.is-ready { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .boot-seq__hint.is-ready { animation: boot-hint 1.4s ease-in-out infinite; }
}
@keyframes boot-hint { 50% { opacity: 0.4; } }

/* ============================================================
   EASTER EGGS — round 2: E-STOP, telemetry, MQTT publish,
   discovery toast, and the Operator Log page (/log/).
   ============================================================ */

/* ---- Emergency Stop: hidden red mushroom button ---- */
.estop {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 55;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 3px solid #7f1d1d;
  background: radial-gradient(circle at 50% 36%, #f05252, #b91c1c 72%);
  color: #fff;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5),
              inset 0 2px 3px rgba(255, 255, 255, 0.35),
              inset 0 -3px 6px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.estop:hover { opacity: 1; }
.estop:active { transform: translateY(1px) scale(0.96); }
.estop.is-active {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35),
              0 0 26px rgba(239, 68, 68, 0.7),
              inset 0 -3px 6px rgba(0, 0, 0, 0.45);
}
.estop__label { pointer-events: none; }
/* Touch devices have no hover — keep the mushroom slightly more visible */
@media (hover: none) {
  .estop { opacity: 0.55; }
}

/* Line stopped: freeze every animation/transition on the page */
html.line-stopped *,
html.line-stopped *::before,
html.line-stopped *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

.line-banner {
  position: fixed;
  left: 50%; bottom: 5rem;
  transform: translate(-50%, 1rem);
  z-index: 56;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fecaca;
  background: rgba(30, 0, 0, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
  opacity: 0;
}
.line-banner.is-visible { opacity: 1; transform: translate(-50%, 0); }
.line-banner__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #ef4444; }

/* ---- Telemetry panel (click SYSTEM: ONLINE) ---- */
.telemetry {
  position: fixed;
  top: 3.4rem; right: 1rem;
  z-index: 45;
  min-width: 15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-brand-400);
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.telemetry.is-visible { opacity: 1; transform: translateY(0); }
.telemetry__title { margin: 0 0 0.5rem; font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-brand-400); }
.telemetry__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; font-size: 0.72rem; color: #94a3b8; }
.telemetry__row b { color: #e2e8f0; font-weight: 600; }

/* ---- Discovery toast (bottom-right, links to the log) ---- */
.egg-discover {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4.25rem));
  z-index: 72;
  display: flex; align-items: center; gap: 0.6rem;
  max-width: 18rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-brand-400);
  background: rgba(2, 6, 23, 0.96);
  color: #e2e8f0;
  text-decoration: none;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.egg-discover.is-visible { opacity: 1; transform: translateY(0); }
.egg-discover:hover { border-color: var(--color-brand-300); }
.egg-discover__star { color: var(--color-brand-400); font-size: 1.1rem; line-height: 1; }
.egg-discover__body { font-size: 0.74rem; line-height: 1.3; }
.egg-discover__body b { color: var(--color-brand-300); }
.egg-discover__meta { display: block; color: #94a3b8; font-size: 0.66rem; margin-top: 2px; }

/* ---- Operator Log page (/log/) ---- */
.oplog-meta {
  margin-top: 2rem;
  display: grid; gap: 1rem;
  grid-template-columns: auto 1fr;
  align-items: center;
}
@media (max-width: 40rem) { .oplog-meta { grid-template-columns: 1fr; } }
.oplog-rank {
  border: 1px solid var(--color-brand-400);
  border-radius: 0.6rem;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}
.oplog-rank__label { display: block; font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; color: #94a3b8; }
.oplog-rank__value { color: var(--color-brand-300); font-size: 1rem; font-weight: 600; }
.oplog-progress { font-family: var(--font-mono, "JetBrains Mono"), monospace; }
.oplog-progress__head { display: flex; justify-content: space-between; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: #94a3b8; margin-bottom: 0.4rem; }
.oplog-progress__count { color: #cbd5e1; }
.oplog-progress__bar { height: 8px; border-radius: 99px; background: rgba(148, 163, 184, 0.15); overflow: hidden; }
.oplog-progress__bar span { display: block; height: 100%; width: var(--pct, 0%); background: linear-gradient(90deg, var(--color-accent), var(--color-brand-400)); transition: width 0.5s ease; }
.oplog-list { list-style: none; margin: 2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.oplog-item {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.35);
}
.oplog-item.is-found { border-color: rgba(34, 211, 238, 0.35); }
.oplog-item__mark { font-family: var(--font-mono, "JetBrains Mono"), monospace; flex-shrink: 0; margin-top: 0.1rem; }
.oplog-item.is-found .oplog-item__mark { color: var(--color-brand-400); }
.oplog-item.is-locked .oplog-item__mark { color: #64748b; }
.oplog-item__name { margin: 0; font-size: 0.92rem; color: #e2e8f0; }
.oplog-item.is-locked .oplog-item__name { color: #94a3b8; font-family: var(--font-mono, "JetBrains Mono"), monospace; letter-spacing: 0.05em; }
.oplog-item__how { margin: 0.2rem 0 0; font-size: 0.78rem; color: #94a3b8; }
.oplog-item.is-locked .oplog-item__how { color: #94a3b8; font-style: italic; }
.oplog-foot { margin-top: 2rem; }
.oplog-reset {
  font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #94a3b8; background: none; border: 1px solid rgba(148, 163, 184, 0.15); border-radius: 0.4rem;
  padding: 0.4rem 0.7rem; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.oplog-reset:hover { color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); }

/* ============================================================
   EASTER EGGS — capstone (9/9 completion reward)
   ============================================================ */

/* Site celebration overlay — fires when the final egg is found */
.capstone-fx {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at center, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.93));
  opacity: 0; transition: opacity 0.4s ease;
}
.capstone-fx.is-visible { opacity: 1; }
.capstone-fx__card {
  text-align: center;
  max-width: 26rem;
  padding: 2rem 2rem 1.75rem;
  border-radius: 1rem;
  border: 1px solid var(--color-accent);
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 20px 70px -20px rgba(52, 211, 153, 0.5);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.capstone-fx.is-visible .capstone-fx__card { transform: none; }
.capstone-fx__seal {
  width: 3.6rem; height: 3.6rem; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  font-size: 1.4rem;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .capstone-fx.is-visible .capstone-fx__seal { animation: capstone-seal 2.4s ease-in-out infinite; }
}
@keyframes capstone-seal { 50% { box-shadow: 0 0 36px rgba(52, 211, 153, 0.9); } }
.capstone-fx__kicker { margin: 0; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-accent); }
.capstone-fx__rank { margin: 0.4rem 0 0; font-size: 1.6rem; font-weight: 700; color: #e2e8f0; letter-spacing: -0.01em; }
.capstone-fx__sub { margin: 0.4rem 0 1.25rem; font-size: 0.85rem; color: #94a3b8; }
.capstone-fx__cta {
  display: inline-block;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  background: var(--color-accent); color: #04121a;
  padding: 0.55rem 1rem; border-radius: 0.5rem; text-decoration: none;
  transition: filter 0.15s ease;
}
.capstone-fx__cta:hover { filter: brightness(1.08); }

/* /log/ completion panel — shown at 9/9 */
.oplog-capstone {
  margin-top: 2rem;
  display: flex; gap: 1.25rem; align-items: flex-start;
  padding: 1.5rem;
  border-radius: 0.8rem;
  border: 1px solid var(--color-accent);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), rgba(15, 23, 42, 0.4));
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 18px 50px -22px rgba(52, 211, 153, 0.4);
}
.oplog-capstone__seal {
  flex-shrink: 0; width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid var(--color-accent);
  color: var(--color-accent); font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}
.oplog-capstone__kicker { margin: 0; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-accent); }
.oplog-capstone__title { margin: 0.25rem 0 0.5rem; font-size: 1.4rem; font-weight: 700; color: #e2e8f0; }
.oplog-capstone__note { margin: 0 0 0.5rem; font-size: 0.88rem; line-height: 1.6; color: #cbd5e1; max-width: 46ch; }
.oplog-capstone__sign { margin: 0 0 1.15rem; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 0.82rem; color: #94a3b8; }
.oplog-capstone__cta {
  display: inline-block;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  background: var(--color-accent); color: #04121a;
  padding: 0.5rem 0.9rem; border-radius: 0.45rem; text-decoration: none;
  transition: filter 0.15s ease;
}
.oplog-capstone__cta:hover { filter: brightness(1.08); }
@media (max-width: 34rem) { .oplog-capstone { flex-direction: column; } }

/* ============================================================
   NOTES — long-form article prose (/notes/*)
   ============================================================ */
.note-prose { color: #cbd5e1; }
.note-prose > p { margin: 0 0 1.15rem; line-height: 1.75; }
.note-prose > h2 {
  margin: 2.1rem 0 0.7rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #e8edf5;
}
.note-prose > ul {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
  line-height: 1.7;
  list-style: disc;
}
.note-prose > ul li { margin: 0.25rem 0; }
.note-prose > ul li::marker { color: var(--color-brand-400); }
.note-prose strong { color: #e8edf5; font-weight: 600; }
.note-prose a {
  color: var(--color-brand-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.note-prose a:hover { color: var(--color-brand-200); }

/* "Try it" callout: a note hands the reader to the matching spot in the plant demo */
.note-prose a.note-try {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 0.375rem;
  background: rgba(34, 211, 238, 0.05);
  color: #cbd5e1;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.note-prose a.note-try:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.09);
  color: #e2e8f0;
}
.note-try__label {
  flex: none;
  font-family: var(--font-mono, "JetBrains Mono"), ui-monospace, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand-300);
}
.note-try__text { flex: 1; font-size: 0.9rem; line-height: 1.55; }
.note-try__arrow { flex: none; color: var(--color-brand-300); }
/* Abbreviations: instant custom tooltip (no native ~1s delay, no dotted line).
   Cue is a subtle solid underline in a slate tone so it never reads as a link. */
.note-prose abbr {
  position: relative;
  cursor: help;
  text-decoration: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}
.note-prose abbr::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  z-index: 5;
  white-space: nowrap;
  max-width: min(80vw, 22rem);
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
  background: #0b1220;
  border: 1px solid var(--color-brand-400);
  color: #e8edf5;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.note-prose abbr:hover::after,
.note-prose abbr:focus-visible::after { opacity: 1; }

/* HMI instrument tiles — a scannable component readout at the top of each section */
.note-prose .hmi-tile {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-left: 3px solid var(--color-brand-400);
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.5);
}
.hmi-tile__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--color-brand-400);
  margin-top: 0.15rem;
}
.hmi-tile__body { flex: 1 1 auto; min-width: 0; }
.hmi-tile__name {
  margin: 0 0 0.15rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brand-300);
}
.hmi-tile__q {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: #e8edf5;
  line-height: 1.3;
}
.hmi-tile__row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  margin: 0.12rem 0;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}
.hmi-tile__row b {
  flex-shrink: 0;
  width: 3.9rem;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hmi-tile__row span { color: #cbd5e1; }

/* Signal-viz — small animated "live instrument" per component (cool, not educational) */
.note-prose .sig-viz {
  position: relative;
  margin: 0 0 1.5rem;
  height: 108px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 0.55rem;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(34, 211, 238, 0.08), transparent 70%),
    rgba(2, 6, 23, 0.65);
  overflow: hidden;
}
.sig-viz__svg { display: block; width: 100%; height: 100%; }
.sig-viz__grid line { stroke: rgba(148, 163, 184, 0.12); stroke-width: 1; }
.sig-viz__wave {
  fill: none;
  stroke: var(--color-brand-400);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.65));
}
.sig-viz__tag {
  position: absolute;
  top: 8px;
  right: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brand-300);
}
.sig-viz__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .sig-viz__dot { animation: sig-pulse 1.5s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .sig-viz__svg animate,
  .sig-viz__svg animateTransform { display: none; }
}
@keyframes sig-pulse { 50% { opacity: 0.3; } }

/* Historian — scrolling "recorded" bars */
.sig-viz__bars { filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.4)); }
.sig-viz__bars rect { fill: var(--color-brand-400); opacity: 0.85; }
/* MES — work orders flowing through stages */
.sig-viz__track { fill: none; stroke: rgba(148, 163, 184, 0.28); stroke-width: 2; stroke-dasharray: 3 6; }
.sig-viz__stages rect { fill: rgba(34, 211, 238, 0.06); stroke: var(--color-brand-400); stroke-width: 1.4; }
.sig-viz__tokens circle { fill: var(--color-brand-300); filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.7)); }

/* SCADA mimic — tank / pump / valve with live flow */
.scada-eq { fill: none; stroke: var(--color-brand-400); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.scada-fluid { fill: rgba(34, 211, 238, 0.3); }
.scada-pipe { fill: none; stroke: rgba(34, 211, 238, 0.6); stroke-width: 3; stroke-dasharray: 6 8; }
.scada-run { fill: var(--color-accent); }
@media (prefers-reduced-motion: no-preference) {
  .scada-pipe { animation: scada-flow 0.7s linear infinite; }
  .scada-run { animation: sig-pulse 1s ease-in-out infinite; }
}
@keyframes scada-flow { to { stroke-dashoffset: -14; } }

/* Historian — three strip-chart trends written at a fixed NOW line */
.hist-lane { fill: none; stroke: var(--color-brand-400); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.5)); }
.hist-now { stroke: var(--color-accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.hist-now-label { fill: var(--color-accent); font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 10px; letter-spacing: 1.5px; }

/* MES — a work order moving through named stages */
.mes-stage { fill: rgba(34, 211, 238, 0.05); stroke: rgba(34, 211, 238, 0.5); stroke-width: 1.6; }
.mes-arrow { fill: none; stroke: rgba(148, 163, 184, 0.45); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mes-label { fill: #7b8698; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; text-anchor: middle; }
.mes-order rect { fill: var(--color-accent); }
.mes-order text { fill: #04121a; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 11px; font-weight: 700; text-anchor: middle; }
.mes-zone { fill: rgba(34, 211, 238, 0.04); stroke: rgba(148, 163, 184, 0.16); stroke-width: 1; }
.mes-zone--run { fill: rgba(52, 211, 153, 0.06); stroke: rgba(52, 211, 153, 0.25); }

/* Historian channel baselines — makes the three traces read as separate charts */
.hist-base { stroke: rgba(148, 163, 184, 0.2); stroke-width: 1; stroke-dasharray: 2 3; }

/* Automation pyramid (How they fit together) */
.note-prose .pyr { margin: 0.5rem 0 1.75rem; }
.pyr svg { display: block; width: 100%; height: auto; }
.pyr-tier { fill: rgba(34, 211, 238, 0.06); stroke: rgba(148, 163, 184, 0.35); stroke-width: 1.2; stroke-linejoin: round; }
.pyr-tier--hl { fill: rgba(34, 211, 238, 0.2); stroke: var(--color-brand-400); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.35)); }
.pyr-name { fill: #94a3b8; font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 13px; font-weight: 600; }
.pyr-name--hl { fill: var(--color-brand-300); }
.pyr-sub { fill: #64748b; font-family: var(--font-sans, system-ui), sans-serif; font-size: 10px; }
.pyr-lead { stroke: rgba(148, 163, 184, 0.28); stroke-width: 1; }
.pyr-hist { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linejoin: round; }
.pyr-hist-label { fill: var(--color-accent); font-family: var(--font-mono, "JetBrains Mono"), monospace; font-size: 11px; letter-spacing: 1px; }

/* Inline code — mono chips inside note prose (topics, message types, tag paths) */
.note-prose code {
  padding: 0.08em 0.35em;
  border-radius: 0.3rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: #a5f3fc;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.85em;
  white-space: nowrap;
}

/* Sparkplug topic breakdown — a parsed topic string with a caption per segment */
.note-prose .sp-topic {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.15rem 0.1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-left: 3px solid var(--color-brand-400);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.55);
  overflow-x: auto;
}
.sp-seg { display: flex; flex-direction: column; align-items: center; padding: 0 0.15rem; }
.sp-seg code {
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--color-brand-300);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}
.sp-seg--var code { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); color: var(--color-accent); }
.sp-seg--opt code { background: rgba(148, 163, 184, 0.07); border-color: rgba(148, 163, 184, 0.25); color: #94a3b8; }
.sp-seg span {
  margin-top: 0.4rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
}
.sp-sep {
  padding: 0.1rem 0.1rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.82rem;
  font-style: normal;
  color: #475569;
}

/* Polling viz — a scan cursor walking a tag list, almost all reads unchanged */
.poll-box { fill: rgba(34, 211, 238, 0.05); stroke: rgba(34, 211, 238, 0.45); stroke-width: 1.4; }
.poll-cell { fill: rgba(148, 163, 184, 0.07); stroke: rgba(148, 163, 184, 0.22); stroke-width: 1; }
.poll-cell--chg { fill: rgba(52, 211, 153, 0.16); stroke: rgba(52, 211, 153, 0.55); stroke-width: 1.4; }
.poll-scan { fill: rgba(34, 211, 238, 0.16); stroke: var(--color-brand-400); stroke-width: 1.4; }
.poll-text {
  fill: #7b8698;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-anchor: middle;
}
.poll-text--hl { fill: var(--color-accent); }
.poll-link { fill: none; stroke: rgba(34, 211, 238, 0.35); stroke-width: 1.4; stroke-dasharray: 3 5; }

/* Report-by-exception viz — quiet cells, one event finding its way to the broker */
.rbe-cell { fill: rgba(148, 163, 184, 0.05); stroke: rgba(148, 163, 184, 0.16); stroke-width: 1; }
.rbe-broker { fill: rgba(34, 211, 238, 0.08); stroke: var(--color-brand-400); stroke-width: 1.6; }
.rbe-route { fill: none; stroke: rgba(148, 163, 184, 0.16); stroke-width: 1.2; }
.rbe-pulse { fill: var(--color-accent); filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.8)); }
.rbe-sub { fill: none; stroke: rgba(34, 211, 238, 0.5); stroke-width: 1.4; }

/* Sparkplug session viz — birth, a stream of data, then the broker's death certificate */
.sp-axis { stroke: rgba(148, 163, 184, 0.2); stroke-width: 1; stroke-dasharray: 2 4; }
.sp-birth { fill: rgba(34, 211, 238, 0.18); stroke: var(--color-brand-400); stroke-width: 1.5; }
.sp-data { fill: rgba(52, 211, 153, 0.22); stroke: rgba(52, 211, 153, 0.6); stroke-width: 1.2; }
.sp-death { fill: rgba(248, 113, 113, 0.16); stroke: rgba(248, 113, 113, 0.65); stroke-width: 1.5; }
.sp-cut { stroke: rgba(248, 113, 113, 0.6); stroke-width: 1.4; stroke-dasharray: 3 3; }
.sp-cap {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 9px;
  letter-spacing: 1px;
  text-anchor: middle;
  fill: #7b8698;
}
.sp-cap--birth { fill: var(--color-brand-300); }
.sp-cap--death { fill: #f87171; }

/* Reduced motion: the path-following pulses have no meaningful resting position, so drop them.
   (The other visuals fall back to their static attribute values, which read fine.) */
@media (prefers-reduced-motion: reduce) {
  .sig-viz__svg animateMotion { display: none; }
  .rbe-pulse { display: none; }
}

/* ============================================================
   Note figures — adapted from the Mustry modules sales kit,
   restyled for this site's cyan/slate IIoT tokens.
   ============================================================ */

.note-prose .note-fig {
  margin: 0 0 1.5rem;
  padding: 1rem 1.05rem 0.95rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 0.55rem;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(34, 211, 238, 0.07), transparent 70%),
    rgba(2, 6, 23, 0.7);
}
.note-fig__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7b8698;
}
.note-fig__note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #94a3b8;
}
.note-fig__note strong { color: #e2e8f0; font-weight: 600; }

.note-tech {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  vertical-align: -0.1rem;
}
.note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.note-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.note-chip .note-tech { color: #94a3b8; }
.note-chip--accent {
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--color-brand-300);
}
.note-chip--accent .note-tech { color: var(--color-brand-300); }
.note-chip--free {
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--color-accent);
}

.note-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.55rem 0;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
}
.note-arrow::before,
.note-arrow::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.35), transparent);
}
.note-arrow__glyph { color: var(--color-brand-400); }

.note-node {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #94a3b8;
}
.note-node b {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #e2e8f0;
}
.note-node--key {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}
.note-node--key b { color: var(--color-brand-300); }
.note-node--out { border-style: dashed; }
.note-node--center { text-align: center; }
.note-node__marks {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: #7b8698;
  min-height: 0.95rem;
}
.note-node--center .note-node__marks { justify-content: center; }

.note-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 560px) {
  .note-row { grid-template-columns: 1fr; }
}

.note-bars { display: flex; flex-direction: column; gap: 0.7rem; }
.note-bar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.note-bar__val { color: var(--color-brand-300); font-weight: 700; }
.note-bar__track {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.note-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-brand-400), var(--color-accent));
}
.note-bar__fill--muted {
  background: rgba(148, 163, 184, 0.35);
}
.note-compare {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.note-compare__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.62rem;
  color: #7b8698;
}
.note-compare__row b { color: #94a3b8; }

/* Orbit — one gateway, the modules around it */
.note-orbit-wrap {
  margin: 0 0 1.5rem;
  padding: 1rem 0.5rem 0.75rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 0.55rem;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(34, 211, 238, 0.1), transparent 55%),
    rgba(2, 6, 23, 0.65);
  overflow: hidden;
}
.note-orbit {
  position: relative;
  width: min(100%, 34rem);
  height: clamp(16rem, 52vw, 21rem);
  margin: 0.25rem auto 0.5rem;
}
.note-orbit__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72%, 17rem);
  height: min(72%, 17rem);
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: 999px;
}
.note-orbit__core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 999px;
  border: 1.5px solid rgba(34, 211, 238, 0.55);
  background: rgba(2, 6, 23, 0.92);
  text-align: center;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}
.note-orbit__core b {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}
.note-orbit__core span {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  max-width: 6.5rem;
  line-height: 1.35;
}
.note-orbit__node {
  position: absolute;
  white-space: nowrap;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  padding: 0.28rem 0.7rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.45);
}
.note-orbit__node--free {
  border-color: rgba(52, 211, 153, 0.55);
  color: var(--color-accent);
}
.note-orbit__tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brand-300);
}
.note-orbit__tag .sig-viz__dot { margin: 0; }

/* Screenshot / clip gallery */
.note-prose .note-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}
@media (max-width: 640px) {
  .note-prose .note-gallery { grid-template-columns: 1fr; }
}
.note-gallery__card {
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.75);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.note-gallery__card:hover,
.note-gallery__card:focus-within {
  border-color: rgba(34, 211, 238, 0.55);
  transform: translateY(-2px);
}
.note-gallery__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0b1220;
  overflow: hidden;
}
.note-gallery__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.note-gallery__card.has-clip .note-gallery__clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .note-gallery__card.has-clip:hover .note-gallery__clip,
  .note-gallery__card.has-clip:focus-within .note-gallery__clip {
    opacity: 1;
  }
}
.note-gallery__badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0.4rem;
  background: rgba(34, 211, 238, 0.92);
  color: #04121a;
  font-size: 0.65rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.note-gallery__card.has-clip .note-gallery__badge { opacity: 1; }
.note-gallery__cap {
  padding: 0.5rem 0.65rem 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.note-gallery__cap b {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}
.note-gallery__cap span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.note-gallery__cap .note-tech { color: #94a3b8; width: 0.7rem; height: 0.7rem; }

/* Before / after Designer pair */
.note-prose .note-shot {
  margin: 0 0 1.5rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.65);
  overflow: hidden;
}
.note-shot__frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(34, 211, 238, 0.18);
}
@media (max-width: 560px) {
  .note-shot__frame { grid-template-columns: 1fr; }
}
.note-shot__cell { margin: 0; background: rgba(2, 6, 23, 0.9); }
.note-shot__cell img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}
.note-shot__cap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7b8698;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.note-shot__cap--on { color: var(--color-accent); }
.note-shot__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.note-shot__credit {
  margin: 0;
  padding: 0.55rem 0.85rem 0.7rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .note-gallery__card { transition: none; }
  .note-gallery__card:hover { transform: none; }
}


/* ============================================================
   VISUAL REFRESH — glass hero card, live-tag strip, work-card
   thumbnails, floor-mode typed eyebrows, contact TX → ACK link,
   phone menu mode switch.
   ============================================================ */

/* ---------- Glass panel ----------
   Translucent fill + backdrop blur, a 1px gradient rim (masked ::before)
   and a faint top highlight. Used for the hero profile card + tag strip. */
.glass-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.35) 55%, rgba(2, 6, 23, 0.45));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 60px -28px rgba(0, 0, 0, 0.8);
  transition: box-shadow .3s ease;
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(103, 232, 249, 0.55), rgba(103, 232, 249, 0) 32%, rgba(52, 211, 153, 0) 68%, rgba(52, 211, 153, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.glass-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 24px 60px -24px rgba(34, 211, 238, 0.22);
}

/* Soft light behind the profile card — gives the blur something to catch */
.hero-orbs {
  position: absolute;
  inset: -2.5rem;
  z-index: -1;
  pointer-events: none;
}
.hero-orbs span {
  position: absolute;
  border-radius: 9999px;
  filter: blur(48px);
  animation: hero-orb-drift 14s ease-in-out infinite alternate;
}
.hero-orbs span:first-child {
  top: 0; right: 0;
  width: 13rem; height: 13rem;
  background: rgba(34, 211, 238, 0.26);
}
.hero-orbs span:last-child {
  bottom: 0; left: 0;
  width: 11rem; height: 11rem;
  background: rgba(52, 211, 153, 0.16);
  animation-delay: -7s;
}
@keyframes hero-orb-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(-1.5rem, 1.25rem); }
}

/* ---------- Hero namespace strip ----------
   Final state = a Unified Namespace tree (root → area columns → leaf tags).
   JS (buildNamespaceStrip) FLIPs each leaf out to a scattered "raw" tag, then a
   scan line picks them up one by one and they fly home, renamed. Connector
   lines are pseudo-elements that draw in while .is-undrawn is removed. */
.ns-panel { padding: 0.6rem; }
.ns-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0.4rem 0.6rem;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}
/* padding/negative margin: room for the status dot's pulse ring inside overflow:hidden */
.ns-head__cap { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; white-space: nowrap; overflow: hidden; padding: 6px; margin: -6px; }
.ns-head__cap b { font-weight: 500; color: rgb(226 232 240); }
.ns-head__site > span { text-transform: none; letter-spacing: 0.02em; color: rgb(203 213 225); }
.ns-head__dot {
  width: 6px; height: 6px;
  border-radius: 9999px;
  flex-shrink: 0;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: ns-dot 1.8s infinite;
  transition: background-color .3s ease;
}
.ns-panel[data-phase="raw"] .ns-head__dot { background: #fbbf24; animation: none; }
@keyframes ns-dot { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.ns-head__actions { display: inline-flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.ns-head__btn {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: rgb(148 163 184);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease;
}
.ns-head__btn:hover { color: var(--color-brand-300); }
.ns-head__btn:focus-visible { outline: 2px solid var(--color-brand-400); outline-offset: 3px; border-radius: 2px; }
.ns-head__btn[disabled] { opacity: 0.4; cursor: default; }

.ns-tree {
  --ns-line: rgba(103, 232, 249, 0.38);
  --ns-gap: 16px;
  position: relative;
  overflow: hidden;
  padding: 14px 14px 16px;
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.6875rem;
}
:where(.ns-tree) ul { list-style: none; margin: 0; padding: 0; }  /* zero specificity: must not beat .ns-areas / .ns-leaves spacing */
.ns-root {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--color-brand-300);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 18px -6px rgba(34, 211, 238, 0.6);
}
.ns-areas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ns-gap);
  margin-top: 14px;
  padding-top: 14px;
}
/* root → bus drop, and the bus itself (first column to last column) */
.ns-areas::after,
.ns-areas::before,
.ns-area::before,
.ns-leaves::before,
.ns-leaf::before {
  content: "";
  position: absolute;
  background: var(--ns-line);
  transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1), opacity .3s ease;
}
.ns-areas::after { top: -14px; left: 8px; width: 1px; height: 14px; transform-origin: top; }
.ns-areas::before {
  top: 0;
  left: 8px;
  right: calc((100% - 4 * var(--ns-gap)) / 5 - 8px);
  height: 1px;
  transform-origin: left;
  transition-delay: .12s;
}
.ns-area { position: relative; min-width: 0; }
.ns-area::before {
  top: -14px; left: 8px; width: 1px; height: 14px;
  transform-origin: top;
  transition-delay: calc(.3s + var(--i) * .07s);
}
.ns-area__name {
  display: block;
  height: 18px;
  line-height: 18px;
  font-weight: 500;
  color: rgb(203 213 225);
  transition: opacity .35s ease calc(.35s + var(--i) * .07s);
}
.ns-leaves { position: relative; display: grid; gap: 8px; margin-top: 6px; padding-left: 18px; }
.ns-leaves::before {
  left: 8px; top: -6px; bottom: 28px; width: 1px;
  transform-origin: top;
  transition-delay: calc(.45s + var(--i) * .07s);
}
.ns-leaf {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 36px;
}
.ns-leaf::before {
  left: -10px; top: 8px; width: 8px; height: 1px;
  transform-origin: left;
  transition-delay: calc(.55s + var(--i) * .07s);
}
.ns-leaf__path { display: flex; min-width: 0; line-height: 16px; color: rgb(148 163 184); }
.ns-leaf__pre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-leaf__path b { flex-shrink: 0; font-weight: 500; color: rgb(241 245 249); }
.ns-leaf__read { display: flex; align-items: center; gap: 5px; line-height: 18px; }
.ns-leaf__v { color: rgb(226 232 240); font-variant-numeric: tabular-nums; transition: color .5s ease; }
.ns-leaf__v.is-flash { color: var(--color-brand-300); transition-duration: 0s; }
.ns-leaf__unit { color: rgb(148 163 184); font-size: 0.625rem; }
.ns-q {
  margin-left: auto;
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  padding: 1px 4px;
  border-radius: 3px;
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  transition: opacity .25s ease, transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Hover a tag to see what it was called before the namespace */
.ns-leaf[data-raw]:not(.is-raw):hover::after {
  content: "was " attr(data-raw) " · " attr(data-src);
  position: absolute;
  z-index: 3;
  left: 0;
  bottom: calc(100% + 4px);
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.625rem;
  color: rgb(203 213 225);
  background: #020617;
  border: 1px solid rgb(51 65 85);
  pointer-events: none;
}

/* Raw tag look — every source names things its own way */
.ns-leaf__raw {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  color: rgb(148 163 184);
  background: rgba(2, 6, 23, 0.75);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  animation: ns-bob 2.6s ease-in-out infinite alternate;
  animation-delay: var(--bob, 0s);
  transition: color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.ns-leaf__raw.is-file { font-family: var(--font-sans, "Inter"), sans-serif; font-style: italic; font-size: 0.72rem; }
.ns-leaf__raw.is-plc  { letter-spacing: 0.05em; }
.ns-leaf__raw.is-sql  { color: rgb(148 163 184); }
.ns-src {
  font-style: normal;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  color: rgb(203 213 225);
  background: rgba(148, 163, 184, 0.12);
}
.ns-flag {
  font-style: normal;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  color: rgb(148 163 184);
  border: 1px solid rgb(51 65 85);
}
.ns-flag--stale { color: #fcd34d; border-color: rgba(251, 191, 36, 0.45); }
.ns-flag--bad   { color: #fda4af; border-color: rgba(251, 113, 133, 0.45); }
@keyframes ns-bob { to { transform: translateY(-3px); } }

.ns-leaf.is-raw { width: max-content; z-index: 2; }
.ns-leaf.is-raw .ns-leaf__raw { display: inline-flex; }
.ns-leaf.is-raw .ns-leaf__path,
.ns-leaf.is-raw .ns-leaf__read { display: none; }
.ns-leaf.is-raw::before { opacity: 0; transition: none; }
.ns-leaf.is-caught .ns-leaf__raw {
  color: var(--color-brand-200, #a5f3fc);
  border-color: rgba(34, 211, 238, 0.8);
  border-style: solid;
  box-shadow: 0 0 16px -2px rgba(34, 211, 238, 0.55);
  animation: none;
}
.ns-leaf.is-waiting { opacity: 0; }
.ns-leaf { transition: opacity .3s ease; }
.ns-leaf.is-flying { transition: transform .85s cubic-bezier(0.65, 0, 0.35, 1), opacity .3s ease; }

/* Before JS takes over: hide the tree so the finished state never flashes */
.js .ns-tree:not(.is-ready) > * { visibility: hidden; }
/* Undrawn: connectors collapsed, root + area names faded, badges off */
.ns-tree.is-undrawn .ns-areas::after,
.ns-tree.is-undrawn .ns-area::before,
.ns-tree.is-undrawn .ns-leaves::before { transform: scaleY(0); transition-delay: 0s; transition-duration: 0s; }
.ns-tree.is-undrawn .ns-areas::before,
.ns-tree.is-undrawn .ns-leaf::before { transform: scaleX(0); transition-delay: 0s; transition-duration: 0s; }
.ns-tree.is-undrawn .ns-root,
.ns-tree.is-undrawn .ns-area__name { opacity: 0; transition-delay: 0s; transition-duration: 0s; }
.ns-root { transition: opacity .35s ease; }
.ns-tree.is-assembling .ns-leaf:not(.is-good) .ns-q { opacity: 0; transform: scale(0.6); }

/* Scan line */
.ns-scan {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--color-brand-300) 20%, var(--color-brand-300) 80%, transparent);
  box-shadow: 0 0 18px 3px rgba(34, 211, 238, 0.45);
}
.ns-scan::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 2px;
  width: 80px;
  background: linear-gradient(to left, rgba(34, 211, 238, 0.12), transparent);
}
.ns-scan.is-vertical { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 2px; background: linear-gradient(to right, transparent, var(--color-brand-300) 20%, var(--color-brand-300) 80%, transparent); }
.ns-scan.is-vertical::after { top: auto; left: 0; right: 0; bottom: 2px; width: auto; height: 60px; background: linear-gradient(to top, rgba(34, 211, 238, 0.12), transparent); }

@media (max-width: 1023px) {
  .ns-tree { --ns-gap: 12px; }
}
/* Desk (calm reading view): six core tags, no wobble, no replay, no tooltips.
   The full twelve-tag version with scan + decode is Floor's. */
html:not([data-mode="floor"]) .ns-leaf:not([data-core]) { display: none; }
html:not([data-mode="floor"]) .ns-leaf__raw { animation: none; }
html:not([data-mode="floor"]) #ns-replay { display: none; }
html:not([data-mode="floor"]) .ns-leaf[data-raw]:not(.is-raw):hover::after { content: none; }

/* Phones: one column tree, core tags only, one line per tag */
@media (max-width: 639px) {
  .ns-head__site,
  .ns-head__hmi,
  .ns-head__label { display: none; }
  .ns-head__btn { font-size: 0.8rem; }
  .ns-tree { padding: 12px 12px 14px; }
  .ns-areas {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-top: 8px;
    padding-top: 6px;
    padding-left: 18px;
  }
  .ns-areas::after { top: -8px; height: 8px; }
  .ns-areas::before { display: none; }
  .ns-area::before { left: -10px; top: -6px; height: calc(100% + 6px); }
  .ns-area:last-child::before { height: 15px; }
  .ns-area__name::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 9px;
    width: 8px;
    height: 1px;
    background: var(--ns-line);
  }
  .ns-leaf:not([data-core]) { display: none; }
  .ns-leaves { gap: 4px; margin-top: 4px; }
  .ns-leaves::before { bottom: 11px; top: -4px; }
  .ns-leaf { display: flex; align-items: center; gap: 8px; min-height: 22px; }
  .ns-leaf::before { top: 50%; }
  .ns-leaf__path { flex: 1; }
  .ns-leaf__read { flex-shrink: 0; }
  .ns-leaf.is-raw { display: block; }
}

/* ---------- Work cards with thumbnails ---------- */
.work-card {
  display: grid;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgb(30 41 59);
  background: rgba(15, 23, 42, 0.4);
  transition: border-color .2s ease, box-shadow .3s ease;
}
.work-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 20px 44px -24px rgba(34, 211, 238, 0.3);
}
.work-card:focus-visible { outline: 2px solid var(--color-brand-400); outline-offset: 2px; }
.work-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020617;
  border-bottom: 1px solid rgb(30 41 59);
}
.work-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .6s cubic-bezier(0.22, 1, 0.36, 1);
}
.work-card:hover .work-card__media img { transform: scale(1.05); }
/* Fade the image into the card so it reads as one panel */
.work-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.55), transparent 45%);
  pointer-events: none;
}
.work-card__badge {
  position: absolute;
  z-index: 1;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6ee7b7;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.work-card__badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 9999px;
  background: var(--color-accent);
}
.work-card__body { padding: 1.25rem; min-width: 0; }
@media (min-width: 640px) {
  .work-card { grid-template-columns: 16rem minmax(0, 1fr); }
  .work-card__media {
    aspect-ratio: auto;
    min-height: 100%;
    border-bottom: 0;
    border-right: 1px solid rgb(30 41 59);
  }
  .work-card__media img { position: absolute; inset: 0; }
  .work-card__media::after { background: linear-gradient(to left, rgba(2, 6, 23, 0.5), transparent 40%); }
  .work-card__body { padding: 1.5rem; }
}
@media (min-width: 1024px) {
  .work-card { grid-template-columns: 20rem minmax(0, 1fr); }
}

/* Text-only list cards (notes index) share the work-card surface + hover */
.list-card {
  border-radius: 0.75rem;
  border: 1px solid rgb(30 41 59);
  background: rgba(15, 23, 42, 0.4);
  transition: border-color .2s ease, box-shadow .3s ease;
}
.list-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 20px 44px -24px rgba(34, 211, 238, 0.3);
}
.list-card:focus-visible { outline: 2px solid var(--color-brand-400); outline-offset: 2px; }

/* Case-study schematic (inline SVG) */
.work-card__media--diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background-color: #030a1c;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
}
.work-card__media--diagram::after { display: none; }
.wk-svg { display: block; width: 100%; height: auto; max-height: 100%; transition: transform .6s cubic-bezier(0.22, 1, 0.36, 1); }
.work-card:hover .wk-svg { transform: scale(1.04); }
.wk-svg text {
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  text-anchor: middle;
}
.wk-site rect { fill: rgba(15, 23, 42, 0.95); stroke: rgb(51 65 85); }
.wk-site text { font-size: 7px; letter-spacing: 0.06em; fill: rgb(148 163 184); }
.wk-hub rect { fill: rgba(34, 211, 238, 0.1); stroke: rgba(34, 211, 238, 0.65); }
.wk-hub text { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; fill: var(--color-brand-300); }
.wk-hub .wk-sub { font-size: 6px; font-weight: 400; letter-spacing: 0.04em; fill: rgb(148 163 184); }
.wk-store rect { fill: rgba(52, 211, 153, 0.08); stroke: rgba(52, 211, 153, 0.5); }
.wk-store text { font-size: 7px; letter-spacing: 0.08em; fill: #6ee7b7; }
.wk-link { fill: none; stroke: rgba(34, 211, 238, 0.4); stroke-width: 1.2; }
.wk-flow { stroke-dasharray: 2 6; animation: wk-flow 1.6s linear infinite; }
.wk-flow--out { stroke: rgba(52, 211, 153, 0.5); }
@keyframes wk-flow { to { stroke-dashoffset: -16; } }

/* ---------- Floor mode: section eyebrows type themselves out ----------
   JS sets --chars and .is-typeable (skipped with reduced motion), then
   .is-typing once the eyebrow scrolls into view. Desk mode is untouched. */
html[data-mode="floor"] .section-eyebrow.is-typeable {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: top;
  width: 0;
  padding-right: 0.15em;
  border-right: 2px solid transparent;
}
html[data-mode="floor"] .section-eyebrow.is-typeable.is-typing {
  width: calc(var(--chars) * (1ch + 0.25em) + 0.3em);
  animation:
    eyebrow-type 0.9s steps(var(--chars), end) both,
    eyebrow-caret 0.55s step-end 5;
}
@keyframes eyebrow-type { from { width: 0; } }
@keyframes eyebrow-caret {
  0%, 100% { border-right-color: var(--color-brand-400); }
  50%      { border-right-color: transparent; }
}

/* ---------- Contact: TX → ACK link ---------- */
.tx-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  color: rgb(148 163 184);
  transition: opacity .3s ease, max-height .3s ease;
}
form[data-tx] .tx-link { max-height: 2rem; opacity: 1; }
.tx-link__node {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgb(51 65 85);
  transition: color .3s ease .55s, border-color .3s ease .55s, box-shadow .3s ease .55s;
}
.tx-link__wire {
  position: relative;
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(34, 211, 238, 0.55), rgba(34, 211, 238, 0.15));
  transition: background .3s ease .55s;
}
.tx-link__packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 2px;
  background: var(--color-brand-400);
  box-shadow: 0 0 10px 2px rgba(34, 211, 238, 0.6);
  opacity: 0;
}
.tx-link__nak { display: none; }
form[data-tx="pending"] .tx-link__packet { animation: tx-fly 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite; }
form[data-tx="ok"] .tx-link__packet { animation: tx-land 0.6s ease-in both; }
form[data-tx="ok"] .tx-link__wire { background: rgba(52, 211, 153, 0.6); }
form[data-tx="ok"] .tx-link__node--end {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 12px -2px rgba(52, 211, 153, 0.6);
}
form[data-tx="err"] .tx-link__wire { background: rgba(251, 113, 133, 0.5); transition-delay: 0s; }
form[data-tx="err"] .tx-link__node--end { color: #fda4af; border-color: rgba(251, 113, 133, 0.6); transition-delay: 0s; }
form[data-tx="err"] .tx-link__ack { display: none; }
form[data-tx="err"] .tx-link__nak { display: inline; }
@keyframes tx-fly {
  0%   { left: 0; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}
@keyframes tx-land {
  0%   { left: 0; opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

/* ---------- Phones: Desk | Floor moves into the slide-in menu ---------- */
.tag-nav__mode { display: none; }
@media (max-width: 639px) {
  header:has(#nav-toggle) .mode-switch { display: none; }
  .tag-nav__mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
  }
  .tag-nav__mode-label {
    font-family: var(--font-mono, "JetBrains Mono"), monospace;
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgb(148 163 184);
  }
}

@media print {
  .ns-panel,
  .hero-orbs,
  .tx-link,
  .work-card__media { display: none !important; }
  .work-card { display: block; border: 0; }
  .work-card__body { padding: 0; }
  html[data-mode="floor"] .section-eyebrow.is-typeable { width: auto !important; }
}
