/* ===========================================================
   v2 — Scale-up refinements
   Loaded AFTER css/style.css. Overrides + new sections only.
   Sections covered: About, System Pulse (was Tech Marquee),
   Stack, Projects (case-study tier + list), Contact, Footer,
   Process artifact refinements.
   =========================================================== */

:root {
  --hairline:        rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.10);
  --ink:             #f5f3ef;     /* warm white used sparingly */
  --tint-warm:       rgba(196, 120, 58, 0.06);
  --tint-cobalt:     rgba(232, 70, 55, 0.05);
}

/* ── Shared refinements ────────────────────────────────────── */
.section-title em { color: var(--cobalt-bright); }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow .dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
  margin-right: 8px;
  vertical-align: middle;
}

/* ===========================================================
   1 · ABOUT — Editorial double-spread
   Portrait gets technical chrome (contact-sheet metadata).
   Arc timeline is replaced by a vertical engineering log.
   =========================================================== */
.about { background: var(--bg-2); position: relative; overflow: hidden; }

.about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: start;
  position: relative;
}

.about-copy .section-num { margin-bottom: 18px; }
.about-copy .section-title {
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.about-pullquote {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  color: var(--text);
  margin: 28px 0 28px;
  padding-left: 20px;
  border-left: 1px solid var(--cobalt-bright);
}

.about-copy .body-text {
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 52ch;
}

/* Field log — replaces about-arc */
.about-log {
  margin-top: 40px;
  padding: 20px 0 0;
  border-top: 1px solid var(--hairline);
}
.about-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}
.about-log-head .log-id { color: var(--cobalt-bright); }

.log-entries { display: flex; flex-direction: column; gap: 14px; }
.log-entry {
  display: grid;
  grid-template-columns: 80px 14px 1fr;
  gap: 16px;
  align-items: baseline;
  position: relative;
}
.log-entry::before {
  content: "";
  position: absolute;
  left: 87px; top: 22px; bottom: -14px;
  width: 1px;
  background: var(--hairline);
}
.log-entry:last-child::before { display: none; }

.log-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.log-marker {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--text-3);
  background: var(--bg-2);
  position: relative;
  z-index: 1;
}
.log-entry.is-current .log-marker {
  border-color: var(--cobalt-bright);
  background: var(--cobalt-bright);
  box-shadow: 0 0 0 4px var(--cobalt-dim);
}
.log-body { padding-bottom: 2px; }
.log-title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.log-meta {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

/* Portrait — contact-sheet chrome */
.about-portrait {
  position: relative;
  display: block;
  max-width: none;
  padding: 0;
}
.portrait-shell {
  position: relative;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  padding: 18px 18px 16px;
}
.portrait-shell::before,
.portrait-shell::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--cobalt-bright);
}
.portrait-shell::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.portrait-shell::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.portrait-marks {
  position: absolute;
  inset: 18px 18px auto 18px;
  top: 18px;
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
.portrait-marks .pm-id { color: var(--cobalt-bright); }

.portrait-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
  border-radius: 0;
  border: 1px solid var(--hairline);
  background: var(--bg-3);
  box-shadow: none;
}
.portrait-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.18) contrast(1.04);
  transition: filter 0.6s var(--ease), transform 0.8s var(--ease);
}
.portrait-frame:hover .portrait-img {
  filter: grayscale(0) contrast(1);
  transform: scale(1.02);
}

.portrait-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.portrait-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--hairline);
}
.portrait-meta-cell:first-child { padding-left: 0; }
.portrait-meta-cell:last-child  { border-right: none; padding-right: 0; }
.pm-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pm-value {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.pm-value.is-live { color: var(--cobalt-bright); display: inline-flex; align-items: center; gap: 6px; }
.pm-value.is-live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
  animation: about-blink 2s infinite;
}
@keyframes about-blink { 50% { opacity: 0.35; } }

.portrait-caption {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.portrait-caption .caption-name { color: var(--text-2); }
.portrait-caption .caption-location { color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }

@media (max-width: 900px) {
  .about .about-grid { grid-template-columns: 1fr; gap: 56px; }
}

/* ===========================================================
   2 · SYSTEM PULSE — replaces tech marquee
   Quiet ops ticker on the left, tech chips on the right.
   =========================================================== */
.tech-marquee { display: none; }   /* hide original */

.pulse-bar {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  position: relative;
}
.pulse-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.pulse-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.pulse-label .pl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
  animation: pulse-dot 2.6s infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.6; }
}

.pulse-ticker {
  position: relative;
  height: 18px;
  overflow: hidden;
  min-width: 0;
}
.pulse-ticker-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.7s var(--ease);
  will-change: transform;
}
.pulse-line {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 18px;
  flex-shrink: 0;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse-line .pk { color: var(--text-3); }
.pulse-line .pv { color: var(--text); }
.pulse-line .pa { color: var(--cobalt-bright); }
.pulse-line .ps {
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pulse-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.pulse-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: rgba(255,255,255,0.015);
  transition: border-color 0.3s, color 0.3s;
}
.pulse-chip:hover { color: var(--text); border-color: var(--border-hover); }
.pulse-chip-mark {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-3);
}
.pulse-chip.is-active .pulse-chip-mark { background: var(--cobalt-bright); }

@media (max-width: 900px) {
  .pulse-inner { grid-template-columns: 1fr; gap: 14px; padding: 16px 24px; }
  .pulse-chips { flex-wrap: wrap; }
}

/* ===========================================================
   3 · STACK — Architecture stack diagram + principles
   =========================================================== */
.stack .section-num { margin-bottom: 16px; }
.stack .section-title {
  font-size: clamp(40px, 4.4vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.stack .section-header { margin-bottom: 64px; }
.stack-grid-v2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 80px;
  align-items: start;
}

/* Layered stack diagram */
.stack-diagram {
  position: relative;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent);
}

.layer {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.3s;
}
.layer:last-child { border-bottom: none; }
.layer:hover { background: rgba(255,255,255,0.012); }

.layer-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cobalt-bright);
}
.layer-name {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.01em;
}
.layer-name em { color: var(--cobalt-bright); }
.layer-role {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.layer-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  justify-content: flex-end;
  max-width: 280px;
}
.layer-tech span {
  display: inline-block;
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  border-right: 1px solid var(--hairline);
  line-height: 1.2;
}
.layer-tech span:last-child { border-right: none; }

.layer-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cobalt-bright);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.layer:hover .layer-bar { transform: scaleY(1); }

/* Principles — opposite column */
.stack-principles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stack-principles .philosophy-quote {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.32;
  color: var(--text);
  margin: 0 0 36px;
  padding: 0;
  border: none;
  position: relative;
}
.stack-principles .philosophy-quote::before {
  content: "“";
  position: absolute;
  top: -18px; left: -20px;
  font-size: 60px;
  color: var(--cobalt-bright);
  line-height: 1;
  opacity: 0.7;
}

.principle {
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 18px;
  align-items: start;
}
.principle:last-child { border-bottom: 1px solid var(--hairline); }
.principle-n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-3);
  padding-top: 2px;
}
.principle-name {
  font-family: var(--display);
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.principle-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 48ch;
}

@media (max-width: 1000px) {
  .stack-grid-v2 { grid-template-columns: 1fr; gap: 56px; }
}
@media (max-width: 600px) {
  .layer { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .layer-tech { justify-content: flex-start; max-width: none; }
}

/* ===========================================================
   4 · PROJECTS — Case-study tier + tight list
   =========================================================== */
.projects .section-num { margin-bottom: 16px; }
.projects .section-title {
  font-size: clamp(40px, 4.4vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.projects .section-header { margin-bottom: 56px; }

.projects-lede {
  max-width: 56ch;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 64px;
}

/* ── Flagship case-study spread ── */
.case-study {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.4s var(--ease);
}
.case-study:hover {
  border-color: var(--border-hover);
}
.case-study-mirror { grid-template-columns: 1fr 1.1fr; }

.cs-body {
  padding: 48px 56px 44px;
  position: relative;
}
.case-study-mirror .cs-body { order: 2; }

.cs-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.cs-category {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cobalt-bright);
}
.cs-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-3);
}

.cs-title {
  font-family: var(--display);
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}
.cs-title em { color: var(--cobalt-bright); }

.cs-tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text-2);
  margin-bottom: 28px;
  max-width: 42ch;
}

.cs-desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 52ch;
  margin-bottom: 32px;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin: 0 0 32px;
}
.cs-stat {
  padding: 16px 18px;
  border-right: 1px solid var(--hairline);
}
.cs-stat:last-child { border-right: none; }
.cs-stat-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
  margin-bottom: 8px;
}
.cs-stat-value {
  font-family: var(--display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cs-stat-value em { color: var(--cobalt-bright); }

.cs-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 36px;
}
.cs-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.cs-metrics span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.012);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  border-radius: 0;
  line-height: 1.3;
}
.cs-stack-row span {
  display: inline-block;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  border-right: 1px solid var(--hairline);
  line-height: 1.4;
}
.cs-stack-row span:first-child { padding-left: 0; }
.cs-stack-row span:last-child { border-right: none; }

.cs-actions {
  display: flex;
  gap: 28px;
  align-items: center;
}
.cs-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  padding: 14px 22px;
  border: 1px solid var(--cobalt-bright);
  background: var(--cobalt-dim);
  transition: background 0.3s, transform 0.3s var(--ease);
}
.cs-cta:hover {
  background: var(--cobalt);
  color: #fff;
  transform: translateY(-1px);
}
.cs-cta .arr { transition: transform 0.3s var(--ease); }
.cs-cta:hover .arr { transform: translate(3px, -1px); }
.cs-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.cs-cta-secondary:hover { color: var(--text); border-color: var(--cobalt-bright); }

/* Private repo CTA — non-interactive, mirrors the in-list lock pattern */
.cs-cta-private {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.018);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: default;
}
.cs-cta-private svg { color: var(--text-3); }

/* Closed-loop feedback line (Orion case study) */
.cs-loop {
  stroke-dasharray: 5 5;
  animation: edge-flow 3s linear infinite;
  opacity: 0.85;
}

/* Orion diagram refinements */
.cs-diagram-orion {
  position: absolute;
  inset: 56px 28px 44px 28px;
  width: calc(100% - 56px);
  height: calc(100% - 100px);
}
.cs-node-hero {
  stroke: var(--cobalt-bright);
  stroke-width: 1.2;
  filter: drop-shadow(0 0 14px rgba(232,70,55,0.15));
}
.cs-hero-label {
  fill: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-anchor: middle;
  dominant-baseline: middle;
  font-weight: 500;
}
.cs-node-chip {
  fill: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.cs-row-tag {
  fill: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-anchor: start;
}
.cs-row-tag-inside {
  fill: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-anchor: middle;
}
.cs-pipe-label {
  fill: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-anchor: middle;
}
.cs-node-baseline {
  fill: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-anchor: middle;
  text-transform: uppercase;
}
.cs-loop-tag {
  fill: var(--cobalt-bright);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Visual side of the case study (architecture diagram surface) */
.cs-visual {
  position: relative;
  background: var(--bg-3);
  min-height: 480px;
  border-left: 1px solid var(--border-subtle);
  overflow: hidden;
}
.case-study-mirror .cs-visual {
  border-left: none;
  border-right: 1px solid var(--hairline);
  order: 1;
}
.cs-visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 80%);
}
.cs-visual-corners > span {
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--text-3);
}
.cs-visual-corners > span:nth-child(1) { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.cs-visual-corners > span:nth-child(2) { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.cs-visual-corners > span:nth-child(3) { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.cs-visual-corners > span:nth-child(4) { bottom: 14px; right: 14px; border-left: none; border-top: none; }
.cs-visual-label {
  position: absolute;
  top: 20px; left: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cs-visual-trace {
  position: absolute;
  bottom: 20px; right: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.cs-visual-trace .live {
  color: var(--cobalt-bright);
  margin-right: 8px;
}

/* SVG diagram inside cs-visual */
.cs-diagram {
  position: absolute;
  inset: 60px 32px 60px;
  width: calc(100% - 64px);
  height: calc(100% - 120px);
}
.cs-node {
  fill: var(--bg-2);
  stroke: var(--border);
  stroke-width: 1;
}
.cs-node-accent {
  fill: var(--cobalt-dim);
  stroke: var(--cobalt-bright);
}
.cs-node-label {
  fill: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.cs-node-sub {
  fill: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-anchor: middle;
  text-transform: uppercase;
}
.cs-edge {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.cs-edge-active {
  stroke: var(--cobalt-bright);
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px var(--cobalt-glow));
  animation: edge-flow 2.4s linear infinite;
  stroke-dasharray: 4 6;
}
@keyframes edge-flow {
  to { stroke-dashoffset: -20; }
}
.cs-arrow {
  fill: var(--text-3);
}
.cs-arrow-active { fill: var(--cobalt-bright); }

/* ── Compact list (rest of projects) ── */
.projects-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 88px 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.projects-list-head {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.projects-list-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.proj-list { display: flex; flex-direction: column; }
.proj-row {
  display: grid;
  grid-template-columns: 48px 1.4fr 1fr 1.2fr 90px 24px;
  gap: 24px;
  align-items: center;
  padding: 22px 8px;
  border-bottom: 1px solid var(--hairline);
  position: relative;
  transition: background 0.3s, padding 0.3s;
  color: inherit;
}
.proj-row:hover {
  background: rgba(255,255,255,0.012);
  padding-left: 16px;
}
.proj-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cobalt-bright);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.proj-row:hover::before { transform: scaleY(1); }

.proj-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-3);
}
.proj-name {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.proj-name .priv-lock {
  width: 11px; height: 11px;
  color: var(--text-3);
}
.proj-cat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.proj-stack {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.proj-stack span::after { content: " · "; color: var(--text-3); opacity: 0.5; }
.proj-stack span:last-child::after { content: ""; }
.proj-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.proj-status::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}
.proj-status.is-live::before { background: var(--cobalt-bright); box-shadow: 0 0 6px var(--cobalt-glow); }
.proj-status.is-active::before { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.proj-status.is-private::before { background: var(--text-3); }
.proj-arr {
  text-align: right;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 14px;
  transition: transform 0.3s var(--ease), color 0.3s;
}
.proj-row:hover .proj-arr { color: var(--cobalt-bright); transform: translateX(4px); }
.proj-row[aria-disabled="true"] { pointer-events: none; }
.proj-row[aria-disabled="true"]:hover { padding-left: 8px; background: transparent; }
.proj-row[aria-disabled="true"]:hover::before { transform: scaleY(0); }

@media (max-width: 980px) {
  .case-study { grid-template-columns: 1fr; }
  .case-study-mirror { grid-template-columns: 1fr; }
  .case-study-mirror .cs-body { order: 2; }
  .case-study-mirror .cs-visual { order: 1; border-right: none; border-bottom: 1px solid var(--hairline); }
  .cs-visual { border-left: none; border-bottom: 1px solid var(--hairline); min-height: 360px; }
  .cs-body { padding: 32px 28px; }
  .proj-row { grid-template-columns: 36px 1.6fr 1fr 60px 20px; }
  .proj-stack { display: none; }
}
@media (max-width: 640px) {
  .proj-row { grid-template-columns: 32px 1fr auto; gap: 16px; }
  .proj-cat, .proj-stack, .proj-status { display: none; }
}

/* Hide all original project cards we're replacing */
.projects .projects-grid,
.projects .project-strip,
.projects .project-strip-flagship { display: none; }

/* ===========================================================
   5 · CONTACT — Project intake terminal (dual pane)
   =========================================================== */
.contact { position: relative; overflow: hidden; }

.contact-v2 {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-head {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}
.contact-head .section-num { margin-bottom: 16px; }
.contact-head .contact-heading {
  font-family: var(--display);
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 20px;
}
.contact-head .contact-heading em { color: var(--cobalt-bright); }
.contact-head .contact-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 56ch;
}

/* Form column */
.intake-v2 {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent 30%);
  padding: 32px 32px 28px;
  position: relative;
}

.intake-v2 .intake-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.intake-v2 .intake-field label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.intake-v2 .intake-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.intake-v2 input,
.intake-v2 select,
.intake-v2 textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 8px 0 10px;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s;
  resize: vertical;
}
.intake-v2 select {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%238a8a8a' stroke-width='1.4' stroke-linecap='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") right center no-repeat;
  background-size: 10px 6px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 18px;
}
.intake-v2 select option { background: var(--bg-3); color: var(--text); }
.intake-v2 textarea {
  border: 1px solid var(--hairline);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 110px;
}
.intake-v2 input::placeholder,
.intake-v2 textarea::placeholder { color: var(--text-3); }
.intake-v2 input:focus,
.intake-v2 select:focus,
.intake-v2 textarea:focus { border-color: var(--cobalt-bright); }

.intake-v2 .intake-submit {
  align-self: flex-start;
  margin-top: 4px;
}
.intake-v2 .intake-success,
.intake-v2 .intake-error {
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 4px;
}
.intake-v2 .intake-success { color: var(--green); }
.intake-v2 .intake-error { color: var(--cobalt-bright); }

/* Live preview column */
.intake-preview {
  position: sticky;
  top: 96px;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, var(--bg-3), var(--bg-2));
  display: flex;
  flex-direction: column;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(0,0,0,0.3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.preview-head .ph-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
}
.preview-head .ph-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
  animation: pulse-dot 2.4s infinite;
}
.preview-body {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--text-2);
}
.preview-body .pk { color: var(--text-3); }
.preview-body .pv { color: var(--text); }
.preview-body .pv.is-empty { color: var(--text-3); font-style: italic; }
.preview-body .pc { color: var(--cobalt-bright); }
.preview-body .pcomment { color: var(--text-3); }

.preview-footer {
  border-top: 1px solid var(--hairline);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.preview-footer .pf-id { color: var(--text-2); }

/* "What happens next" steps */
.contact-flow {
  grid-column: 1 / -1;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.contact-step {
  padding: 0 28px 0 0;
  border-right: 1px solid var(--hairline);
  padding-left: 0;
}
.contact-step:first-child { padding-left: 0; }
.contact-step:last-child { border-right: none; padding-right: 0; }
.contact-step + .contact-step { padding-left: 28px; }
.cs-step-n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cobalt-bright);
  margin-bottom: 14px;
}
.cs-step-name {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}
.cs-step-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* Social row — refined */
.contact-v2 .contact-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 56px 0 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.contact-v2 .contact-divider::before,
.contact-v2 .contact-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.contact-v2 .contact-divider span { padding: 0; }
.contact-v2 .social-links {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
}
.contact-v2 .social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-right: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  background: transparent;
  transition: background 0.3s, color 0.3s;
  position: relative;
  border-radius: 0;
}
.contact-v2 .social-link:last-child { border-right: none; }
.contact-v2 .social-link:hover { color: var(--text); background: rgba(255,255,255,0.015); }
.contact-v2 .social-link svg { transition: color 0.3s; }
.contact-v2 .social-link:hover svg { color: var(--cobalt-bright); }

@media (max-width: 980px) {
  .contact-v2 { grid-template-columns: 1fr; gap: 32px; }
  .intake-preview { position: static; }
  .contact-flow { grid-template-columns: 1fr 1fr; gap: 24px 0; }
  .contact-step { padding: 0 20px; border-bottom: 1px solid var(--hairline); border-right: none; padding-bottom: 24px; }
  .contact-step:nth-child(odd) { border-right: 1px solid var(--hairline); }
  .contact-v2 .social-links { grid-template-columns: 1fr 1fr; }
  .contact-v2 .social-link:nth-child(2) { border-right: none; }
  .contact-v2 .social-link:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
}

/* ===========================================================
   6 · FOOTER — Editorial sign-off
   =========================================================== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--hairline);
  padding: 96px 0 32px;
  overflow: hidden;
}
.footer .footer-inner {
  display: block;
  padding: 0;
}
.footer-name {
  font-family: var(--display);
  font-size: clamp(80px, 14vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
  position: relative;
  margin-bottom: 64px;
}
.footer-name em {
  color: var(--cobalt-bright);
  font-style: normal;
}
.footer-name .fn-period {
  color: var(--cobalt-bright);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
  margin-bottom: 56px;
}
.footer-col-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}
.footer-mission {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 36ch;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  transition: color 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-col a:hover { color: var(--cobalt-bright); }
.footer-col a .ext { color: var(--text-3); transition: color 0.25s; }
.footer-col a:hover .ext { color: var(--cobalt-bright); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-bottom .fb-left { display: inline-flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-bottom .fb-build { color: var(--text-2); }
.footer-bottom .fb-build .fb-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  box-shadow: 0 0 6px rgba(34,197,94,0.4);
  vertical-align: middle;
}
.footer-bottom .fb-right { color: var(--text-3); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-mission { grid-column: 1 / -1; }
}

/* ===========================================================
   7 · PROCESS — light polish only (NOT a redesign)
   Keeps original 3-col phase structure + colors intact.
   =========================================================== */
.process .phase {
  position: relative;
  transition: background 0.25s, padding 0.3s var(--ease);
}
.process .phase::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cobalt-bright);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.4s var(--ease);
  pointer-events: none;
}
.process .phase:hover::after { transform: scaleY(1); }

/* ── Reveal — replace generic translateY fade with a directional
   reveal that respects the phase's anatomy (meta · body · artifact).
   Trace bar draws top→bottom, body fades up, artifact slides in
   from the side. */
.process .phase.reveal {
  opacity: 1 !important;
  transform: none !important;
}
.process .phase.reveal::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 2px;
  height: 100%;
  background: var(--cobalt-bright);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.9s var(--ease) 0.05s;
  opacity: 0.35;
  pointer-events: none;
}
.process .phase.reveal.visible::before { transform: scaleY(1); }

.process .phase.reveal > .phase-meta,
.process .phase.reveal > .phase-body,
.process .phase.reveal > .phase-artifact {
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.process .phase.reveal > .phase-meta     { transform: translateY(14px); transition-delay: 0.10s, 0.10s; }
.process .phase.reveal > .phase-body     { transform: translateY(14px); transition-delay: 0.20s, 0.20s; }
.process .phase.reveal > .phase-artifact { transform: translateX(24px); transition-delay: 0.32s, 0.32s; }

.process .phase.reveal.visible > .phase-meta,
.process .phase.reveal.visible > .phase-body { opacity: 1; transform: translateY(0); }
.process .phase.reveal.visible > .phase-artifact { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .process .phase.reveal > .phase-meta,
  .process .phase.reveal > .phase-body,
  .process .phase.reveal > .phase-artifact {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .process .phase.reveal::before { transform: scaleY(1); transition: none; }
}

.process .phase-title {
  font-size: clamp(28px, 2.6vw, 34px) !important;
  letter-spacing: -0.022em !important;
  line-height: 1.06 !important;
}

.process .phase-philosophy {
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: var(--text-2) !important;
}

.process .phase-artifact {
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.process .phase:hover .phase-artifact {
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px -20px rgba(0,0,0,0.6);
}

/* Engagement banner — slightly more refined */
.engagement-banner {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 16px !important;
  border: 1px solid var(--border-subtle) !important;
  background: var(--bg-2) !important;
  border-radius: var(--radius) !important;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.engagement-banner .eb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
}
.engagement-banner .eb-label { color: var(--cobalt-bright); }
.engagement-banner .eb-meta { color: var(--text-2); }
.engagement-banner .eb-sep { color: var(--text-3); }

/* ===========================================================
   General polish
   =========================================================== */
.section { padding: 140px 0; }
.section + .section { border-top: 1px solid var(--hairline); }

@media (max-width: 720px) {
  .section { padding: 96px 0; }
  .nav-inner { padding: 0 24px; }
  .container { padding: 0 24px; }
}


/* ===========================================================
   EXPERIENCE — engineering log treatment
   =========================================================== */
.work { background: var(--bg-2); position: relative; overflow: hidden; }
.work::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 350px at 90% 30%, var(--tint-cobalt), transparent 60%);
  pointer-events: none;
}
.work .section-title {
  font-size: clamp(40px, 4.4vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.work .section-header { margin-bottom: 64px; }

.work .xp-list {
  position: relative;
  z-index: 1;
}

.work .xp-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  padding: 48px 24px 48px 32px;
  border-top: 1px solid var(--hairline);
  border-bottom: none;
  background: transparent;
  transition: background 0.3s;
  position: relative;
  align-items: start;
}
.work .xp-item:last-of-type { border-bottom: 1px solid var(--hairline); }
.work .xp-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cobalt-bright);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.work .xp-item:hover::before { transform: scaleY(1); }
.work .xp-item:hover { background: rgba(255,255,255,0.012); }

.work .xp-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}
.work .xp-period {
  font-family: var(--display);
  font-size: 26px !important;
  letter-spacing: -0.015em !important;
  color: var(--text) !important;
  text-transform: none !important;
  line-height: 1 !important;
}
.work .xp-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
  border-radius: 0;
}
.work .xp-badge.xp-badge-live {
  color: var(--cobalt-bright);
  border-color: var(--cobalt-bright);
  background: var(--cobalt-dim);
}
.work .xp-badge.xp-badge-live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow);
  animation: about-blink 2s infinite;
}

.work .xp-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 18px;
}
.work .xp-role {
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--text);
  font-weight: 400;
}
.work .xp-company {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  line-height: 1.5;
}
.work .xp-arrow {
  font-family: var(--display);
  font-size: 32px;
  color: var(--text-3);
  transition: color 0.3s, transform 0.3s var(--ease);
  line-height: 1;
}
.work .xp-item:hover .xp-arrow {
  color: var(--cobalt-bright);
  transform: translate(4px, -4px);
}
.work .xp-desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 64ch;
  margin-bottom: 22px;
}
.work .xp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.work .xp-tags span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  padding: 0 14px;
  border-right: 1px solid var(--hairline);
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: transparent;
  border-radius: 0;
}
.work .xp-tags span:first-child { padding-left: 0; }
.work .xp-tags span:last-child { border-right: none; }

.work .xp-prehistory {
  margin-top: 36px;
  padding: 24px 32px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  letter-spacing: 0.02em;
  border-top: 1px dashed var(--hairline);
  border-bottom: 1px dashed var(--hairline);
  border-left: none;
  background: transparent;
  max-width: none;
  position: relative;
}

@media (max-width: 720px) {
  .work .xp-item { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 36px 24px; }
  .work .xp-top { flex-direction: column; gap: 12px; }
  .work .xp-arrow { display: none; }
}


/* ===========================================================
   FOOTER — REBUILD · editorial colophon (no giant ego name)
   =========================================================== */
.footer-name { display: none !important; }
.footer-grid { display: none !important; }
.footer .footer-bottom .fb-right,
.footer .footer-bottom .fb-left { /* preserved styles below */ }

.footer { padding: 96px 0 32px; }
.footer .footer-inner {
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
  gap: 64px;
}

.footer-colophon {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 96px;
  align-items: start;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--hairline);
}

.colophon-id {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* Colophon mark — same Stack atom as the nav, sized larger as a
   footer signature. No border, no gradient: the brand mark stands
   alone. Bars use --text so they invert with theme; the middle bar
   is brand-pinned cobalt (see the [data-theme="light"] override). */
.colophon-mark {
  width: 96px;
  height: 58px;          /* 96 × (60/100) = 57.6 → round to 58 */
  display: block;
  flex: none;
}
.colophon-mark .cm-bar {
  fill: var(--text);
  transition: width 0.4s var(--ease), x 0.4s var(--ease), fill 0.3s var(--ease);
}
.colophon-mark .cm-bar-accent {
  fill: var(--cobalt-bright);
}
.colophon-id-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.colophon-name {
  font-family: var(--display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.colophon-role {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
}
.colophon-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  background: rgba(0,0,0,0.3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  align-self: flex-start;
}
.colophon-status .c-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,0.45);
  animation: about-blink 2.4s infinite;
}

.colophon-main {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}
.colophon-statement {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 28ch;
}
.colophon-statement em {
  color: var(--cobalt-bright);
  font-style: italic;
}
.colophon-statement .sep {
  color: var(--cobalt-bright);
  font-style: normal;
  margin: 0 2px;
}

.colophon-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.colophon-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 18px;
}
.colophon-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.colophon-col li {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.colophon-col a {
  color: var(--text-2);
  transition: color 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.colophon-col a:hover { color: var(--cobalt-bright); }
.colophon-col .ext { color: var(--text-3); transition: color 0.25s; }
.colophon-col a:hover .ext { color: var(--cobalt-bright); }
.colophon-col .plain {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.colophon-col .plain.muted { color: var(--text-3); }

.footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: none;
  padding-top: 0;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.footer-bottom .fb-left {
  display: inline-flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-bottom .fb-build .fb-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  box-shadow: 0 0 6px rgba(34,197,94,0.4);
  vertical-align: middle;
}

@media (max-width: 980px) {
  .footer-colophon { grid-template-columns: 1fr; gap: 48px; padding-bottom: 48px; }
  .colophon-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .colophon-cols { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}


/* ===========================================================
   CONSOLE V2 — trace fan · signal rail · frequency strip · clock
   Layered ON TOP of the existing .console structure. The original
   panes + log tail + canvas + metrics stay; we add chrome that
   makes the three-pane layout read as one synchronized rack.
   =========================================================== */

.console-v2 {
  position: relative;
  padding-left: 32px;
  isolation: isolate;
}

/* ── Console-bar enhancements ──────────────────────────────── */
.console-v2 .console-bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 8px 14px 8px 14px;
  margin-left: -32px;
  padding-left: 46px;       /* leave room for rail flush-left */
}
.console-v2 .cb-host { color: var(--text-3); }

/* Trace fan — three stacked trace IDs, newest first, aged by opacity */
.cb-trace-fan {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border-subtle);
  min-width: 0;
}
.cb-tf-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  transition: opacity 0.4s var(--ease), color 0.4s var(--ease);
}
.cb-tf-item .cb-tf-id { color: var(--text-2); }
.cb-tf-item .cb-tf-tag {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cb-tf-item.is-now .cb-tf-id  { color: var(--cobalt-bright); }
.cb-tf-item.is-now .cb-tf-tag { color: var(--cobalt-bright); }
.cb-tf-item[data-age="1"] { opacity: 0.7; }
.cb-tf-item[data-age="2"] { opacity: 0.4; }
.cb-tf-item[data-age="3"] { opacity: 0; }

/* Live UTC clock — far right */
.cb-clock {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  padding-left: 14px;
  border-left: 1px solid var(--border-subtle);
}
.cb-clock-time {
  font-size: 11px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cb-clock-z {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}

@media (max-width: 720px) {
  .cb-tf-item[data-age="2"] { display: none; }
  .cb-clock-z { display: none; }
}

/* ── Left signal rail ──────────────────────────────────────── */
.console-rail {
  position: absolute;
  left: 0;
  top: 38px;                /* below console-bar */
  bottom: 32px;             /* above frequency strip */
  width: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(0,0,0,0));
  z-index: 4;
  pointer-events: none;
}
.rail-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-3);
  transition: color 0.3s;
}
.rail-num .rn-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.4;
  transition: background 0.18s var(--ease), opacity 0.18s, box-shadow 0.18s;
}
.rail-num.is-active {
  color: var(--cobalt-bright);
}
.rail-num.is-active .rn-led {
  background: var(--cobalt-bright);
  opacity: 1;
  box-shadow: 0 0 8px var(--cobalt-glow), 0 0 14px rgba(232,70,55,0.35);
}

/* ── Pane "fresh data" sweep ─────────────────────────────────
   A thin cobalt line draws across the top of a pane briefly
   when activity arrives there. Triggered by .is-fresh class
   added by the JS ticker. */
.console-v2 .console-pane { position: relative; }
.console-v2 .console-pane::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cobalt-bright), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
  z-index: 3;
}
.console-v2 .console-pane.is-fresh::before {
  transform: scaleX(1);
  opacity: 1;
  transition-duration: 0.45s;
  animation: pane-fresh-fade 1.4s var(--ease) forwards;
}
@keyframes pane-fresh-fade {
  0%   { opacity: 1; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Bottom frequency strip ────────────────────────────────── */
.console-density {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 6px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.22);
  margin-left: -32px;
  padding-left: 46px;
  height: 32px;
}
.cd-label,
.cd-now {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.cd-now { color: var(--text-2); }
.cd-now::before {
  content: "·";
  margin-right: 4px;
  color: var(--cobalt-bright);
}
.cd-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 18px;
  min-width: 0;
  overflow: hidden;
}
.cd-bar {
  width: 2px;
  background: linear-gradient(180deg, var(--cobalt-bright), rgba(232,70,55,0.25));
  border-radius: 1px;
  flex: 0 0 auto;
  transform-origin: bottom;
  animation: cd-bar-in 0.5s var(--ease) backwards;
}
.cd-bar.cd-bar-warn {
  background: linear-gradient(180deg, var(--amber), rgba(245,158,11,0.25));
}
@keyframes cd-bar-in {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 720px) {
  .console-density { padding-right: 10px; }
  .cd-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .console-v2 .console-pane.is-fresh::before { animation: none; opacity: 0; }
  .cd-bar { animation: none; }
}


/* ===========================================================
   NAV LOGO — The Stack mark + wordmark lockup
   Replaces the IDS. monogram and the legacy LOGO.png. Inline
   SVG so the bars react to theme tokens and animate on hover.
   Source of truth: /media-kit/svg/mark-stack-*.svg
   =========================================================== */

.nav .nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  opacity: 1;
}
.nav .nav-logo-img { display: none; }   /* hide legacy PNG if cached */

/* ── Mark — The Stack. Three slabs, cobalt active line.
   Bars use --text so they invert with the theme (white on dark,
   obsidian on light). The middle bar stays --cobalt-bright in
   both themes because it carries the brand. ─────────────────── */
.nav-mark {
  width: 28px;
  height: 17px;          /* 28 × (60/100) = 16.8 → round to 17 */
  display: inline-block;
  flex: none;
  transform: translateY(1px);   /* visually align to wordmark cap-height */
  transition: transform 0.3s var(--ease);
}
.nav-mark .nm-bar {
  fill: var(--text);
  transition: width 0.4s var(--ease), x 0.4s var(--ease), fill 0.3s var(--ease);
}
.nav-mark .nm-bar-accent {
  fill: var(--cobalt-bright);
}

/* ── Wordmark — DM Serif Display, editorial signature feel.
   Same typeface as the H1 hero name so the nav reads as a small
   restatement of the masthead, not a separate identity. ─────────── */
.nav-wordmark {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.nav-wordmark .nw-period {
  color: var(--cobalt-bright);
  margin-left: -0.02em;
}

/* ── Hover — the cobalt active line extends to full edges,
   echoing the "hover state" defined in the brand motion spec.
   The outer bars hold steady; only the brand line responds.
   Note: CSS-side SVG geometry properties require explicit units —
   unitless `100` is invalid and silently dropped. `100px` is read
   as 100 user units in the local viewBox (`0 0 100 60`), which is
   exactly the viewBox width. ──────────────────────────────────── */
.nav .nav-logo:hover .nav-mark .nm-bar-accent {
  x: 0;
  width: 100px;
}
.nav .nav-logo:hover .nav-mark {
  transform: translateY(1px) scale(1.04);
}

/* Mobile — drop the wordmark, keep just the mark */
@media (max-width: 720px) {
  .nav-wordmark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mark,
  .nav-mark .nm-bar {
    transition: none !important;
  }
}

/* ===========================================================
   8 · SOPHISTICATION PASS
   Entrance choreography, hover depth, micro-details.
   =========================================================== */

/* ── Easing tokens ──────────────────────────────────────────── */
:root {
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Focus-visible states ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cobalt-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Section divider gradient ───────────────────────────────── */
section[id] { position: relative; }
section[id] + section[id]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(600px, 80%);
  height: 1px;
  background: radial-gradient(
    ellipse at center,
    var(--hairline-strong) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ── Stack diagram — layer entrance stagger ─────────────────── */
.stack-layer {
  transition: opacity 0.7s var(--ease-out-expo),
              transform 0.7s var(--ease-out-expo);
}
.stack-layers.reveal .stack-layer:nth-child(1) { transition-delay: 0.08s; }
.stack-layers.reveal .stack-layer:nth-child(2) { transition-delay: 0.18s; }
.stack-layers.reveal .stack-layer:nth-child(3) { transition-delay: 0.28s; }
.stack-layers.reveal .stack-layer:nth-child(4) { transition-delay: 0.38s; }

/* ── Stack principles — stagger + hover ─────────────────────── */
.principle {
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo),
              padding-left 0.35s var(--ease-out-quint);
  border-left: 2px solid transparent;
}
.stack-principles.reveal .principle:nth-child(1) { transition-delay: 0.12s; }
.stack-principles.reveal .principle:nth-child(2) { transition-delay: 0.24s; }
.stack-principles.reveal .principle:nth-child(3) { transition-delay: 0.36s; }

.principle:hover {
  padding-left: 14px;
  border-left-color: var(--cobalt-bright);
}

/* ── Case study SVG diagram entrance ────────────────────────── */
.cs-visual svg {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.9s var(--ease-out-expo) 0.25s,
              transform 0.9s var(--ease-out-expo) 0.25s;
}
.case-study.reveal.visible .cs-visual svg {
  opacity: 1;
  transform: scale(1);
}

/* ── Case study hover glow ──────────────────────────────────── */
.cs-body {
  position: relative;
  overflow: hidden;
}
.cs-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 40%,
    var(--tint-cobalt) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.case-study:hover .cs-body::after { opacity: 1; }

/* ── Case study SVG nodes + edges on hover ──────────────────── */
.cs-visual svg circle,
.cs-visual svg rect {
  transition: filter 0.4s ease;
}
.case-study:hover .cs-visual svg circle,
.case-study:hover .cs-visual svg rect {
  filter: drop-shadow(0 0 6px rgba(232, 70, 55, 0.25));
}

/* ── Portrait hover enhancement ─────────────────────────────── */
.portrait-shell {
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}
.portrait-shell:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35),
              0 0 0 1px var(--hairline-strong);
}

/* ── Philosophy quote mark breathing ────────────────────────── */
@keyframes quote-breathe {
  0%, 100% { opacity: 0.09; }
  50%      { opacity: 0.16; }
}
.philosophy-quote::before {
  animation: quote-breathe 5s ease-in-out infinite;
}

/* ── About field-log entry stagger ──────────────────────────── */
.field-log-entry {
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}
.field-log.reveal .field-log-entry:nth-child(1) { transition-delay: 0.1s; }
.field-log.reveal .field-log-entry:nth-child(2) { transition-delay: 0.22s; }

/* ── Experience item content stagger ────────────────────────── */
.xp-item .xp-meta,
.xp-item .xp-body {
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}
.xp-item.reveal .xp-meta  { transition-delay: 0.06s; }
.xp-item.reveal .xp-body  { transition-delay: 0.16s; }

/* ── Project row accent on hover ────────────────────────────── */
.proj-row {
  position: relative;
}
.proj-row::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 60%;
  background: var(--cobalt-bright);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-out-quint);
  transform-origin: center;
}
.proj-row:hover::before {
  transform: translateY(-50%) scaleY(1);
}

/* ── Intake preview cursor blink ────────────────────────────── */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
.intake-preview::after {
  content: "\2588";
  color: var(--cobalt-bright);
  font-family: var(--mono);
  font-size: 13px;
  animation: cursor-blink 1.1s step-end infinite;
  margin-left: 2px;
}

/* ── Social link hover accent ───────────────────────────────── */
.social-link {
  position: relative;
}
.social-link::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%;
  height: 1px;
  background: var(--cobalt-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-quint);
}
.social-link:hover::after {
  transform: scaleX(1);
}

/* ── Footer colophon mark hover ───────────────────────────────
   Lift + glow stays from the previous IDS-box treatment so the
   footer's micro-interaction signature is preserved. The cobalt
   active line also extends edge to edge, mirroring the nav mark
   and reinforcing the brand motion spec. */
.colophon-mark {
  transition: transform 0.5s var(--ease-out-expo),
              filter 0.5s var(--ease-out-expo);
}
.colophon-mark:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 8px 24px rgba(232, 70, 55, 0.15));
}
.colophon-mark:hover .cm-bar-accent {
  x: 0;
  width: 100px;
}

/* ── Process phase artifact stagger ─────────────────────────── */
.phase-artifact {
  transition: opacity 0.7s var(--ease-out-expo),
              transform 0.7s var(--ease-out-expo);
}
.phase.reveal .phase-artifact { transition-delay: 0.2s; }

/* ── Engagement banner shimmer ──────────────────────────────── */
@keyframes banner-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.engagement-banner {
  background: var(--bg-2) linear-gradient(
    110deg,
    transparent 25%,
    rgba(232, 70, 55, 0.04) 37%,
    transparent 50%
  ) !important;
  background-size: 200% 100% !important;
  animation: banner-shimmer 8s ease-in-out infinite;
}

/* ── Pulse chip hover glow ──────────────────────────────────── */
.pulse-chip {
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease;
}
.pulse-chip:hover {
  border-color: var(--cobalt-bright);
  box-shadow: 0 0 12px rgba(232, 70, 55, 0.12);
}

/* ── Console pane header dot pulse ──────────────────────────── */
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}
.cv2-pane-header .cv2-dot {
  animation: dot-pulse 2.5s ease-in-out infinite;
}

/* ── Reduced motion — disable all new animations ────────────── */
@media (prefers-reduced-motion: reduce) {
  .stack-layer,
  .principle,
  .cs-visual svg,
  .field-log-entry,
  .xp-item .xp-meta,
  .xp-item .xp-body,
  .phase-artifact,
  .portrait-shell,
  .colophon-mark,
  .colophon-mark .cm-bar,
  .proj-row::before,
  .social-link::after,
  .pulse-chip {
    transition: none !important;
  }

  .philosophy-quote::before,
  .intake-preview::after,
  .cv2-pane-header .cv2-dot {
    animation: none !important;
  }

  .engagement-banner {
    animation: none !important;
    background-image: none;
  }

  .cs-visual svg {
    opacity: 1;
    transform: none;
  }
}

/* ===========================================================
   9 · THEME TOGGLE + LIGHT MODE
   Sun/moon toggle in nav. Cream/ivory/indigo light palette via
   [data-theme="light"]. Console, diagrams, and artifacts all
   go light — nothing stays dark.
   =========================================================== */

/* ── Toggle — premium recessed pill with ambient glow ──────── */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.toggle-track {
  position: relative;
  width: 64px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.20),
              inset 0 0 1px rgba(0, 0, 0, 0.10);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease),
              box-shadow 0.5s var(--ease);
}
.theme-toggle:hover .toggle-track {
  border-color: rgba(232, 70, 55, 0.22);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.20),
              0 0 20px rgba(232, 70, 55, 0.08),
              0 0 6px rgba(232, 70, 55, 0.04);
}
.toggle-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  stroke-width: 2.2;
  transition: color 0.5s var(--ease), opacity 0.5s var(--ease),
              transform 0.5s var(--ease), filter 0.5s var(--ease);
}
/* Dark mode: sun rides on the knob (left), moon is the dim hint on the
   empty side of the track. Active icon is cream-white so it reads as
   a clear icon against the red knob, not a same-color dot. */
.toggle-sun {
  color: #FFF7EE;
  opacity: 1;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
  transform: rotate(0deg);
}
.toggle-moon {
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
  filter: none;
  transform: rotate(-12deg);
}
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f05a4c, var(--cobalt-bright));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.30),
              0 0 12px rgba(232, 70, 55, 0.22);
  transition: transform 0.5s cubic-bezier(0.68, -0.12, 0.27, 1.12),
              background 0.5s var(--ease),
              box-shadow 0.5s var(--ease);
}

/* Light mode: moon active (right) */
[data-theme="light"] .toggle-track {
  background: rgba(181, 48, 30, 0.05);
  border-color: rgba(181, 48, 30, 0.14);
  box-shadow: inset 0 1px 4px rgba(181, 48, 30, 0.10),
              inset 0 0 1px rgba(181, 48, 30, 0.06);
}
[data-theme="light"] .theme-toggle:hover .toggle-track {
  border-color: rgba(181, 48, 30, 0.28);
  box-shadow: inset 0 1px 4px rgba(181, 48, 30, 0.10),
              0 0 20px rgba(181, 48, 30, 0.08),
              0 0 6px rgba(181, 48, 30, 0.04);
}
[data-theme="light"] .toggle-sun {
  color: rgba(26, 20, 16, 0.45);
  opacity: 1;
  filter: none;
  transform: rotate(12deg);
}
[data-theme="light"] .toggle-moon {
  color: #FFFCF5;
  opacity: 1;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.30));
  transform: rotate(0deg);
}
[data-theme="light"] .toggle-knob {
  transform: translateX(32px);
  background: linear-gradient(145deg, #D2522E, #8B2418);
  box-shadow: 0 1px 3px rgba(181, 48, 30, 0.35),
              0 0 12px rgba(181, 48, 30, 0.20);
}

/* ── Mobile: toggle stays visible as standalone flex child ─── */
@media (max-width: 768px) {
  .theme-toggle {
    margin-left: auto;
  }
}

/* ── Light theme tokens — warm paper.
   Cream backgrounds, deeper red accent, saddle-brown secondary, warm grays.
   Replaces the previous indigo/slate palette; commits to a single brand
   that translates between dark and light instead of switching to a
   different brand for each mode. ───────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #FBF7F0;
  --bg-2:      #F5EDE0;
  --bg-3:      #EFE5D2;
  --surface:   #FFFCF5;
  --surface-2: #F8F2E7;

  --cobalt-bright: #B5301E;
  --cobalt:        #8B2418;
  --cobalt-dim:    rgba(181, 48, 30, 0.08);
  --cobalt-glow:   rgba(181, 48, 30, 0.20);

  --copper:        #8B4513;
  --copper-dim:    rgba(139, 69, 19, 0.06);
  --copper-glow:   rgba(139, 69, 19, 0.16);

  --border:        rgba(181, 48, 30, 0.14);
  --border-hover:  rgba(181, 48, 30, 0.32);
  --border-strong: rgba(181, 48, 30, 0.50);
  --border-subtle: rgba(26, 20, 16, 0.08);

  --text:   #1A1410;
  --text-2: #6B5848;
  --text-3: #A89986;

  --green: #4A7C2A;

  --hairline:        rgba(26, 20, 16, 0.06);
  --hairline-strong: rgba(26, 20, 16, 0.12);
  --ink:             #1A1410;
  --tint-warm:       rgba(139, 69, 19, 0.04);
  --tint-cobalt:     rgba(181, 48, 30, 0.04);
}

/* ── Smooth theme transition ───────────────────────────────── */
[data-theme="light"] body,
[data-theme="light"] .nav,
[data-theme="light"] .section,
[data-theme="light"] .footer {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

/* ── Nav ───────────────────────────────────────────────────── */
[data-theme="light"] .nav {
  background: rgba(250, 250, 250, 0.90) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .nav.scrolled {
  background: rgba(250, 250, 250, 0.94) !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .nav-wordmark {
  color: var(--text) !important;
}
[data-theme="light"] .nav-links a {
  color: var(--text-3);
}
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  color: var(--text);
}
[data-theme="light"] .nav-toggle span {
  background: var(--text-2);
}
[data-theme="light"] .nav-mobile {
  background: rgba(250, 250, 250, 0.97);
}
[data-theme="light"] .nav-mobile a {
  color: var(--text-2);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .nav-mobile a:hover {
  color: var(--text);
}

/* Nav mark — brand-pinned, not theme-tinted.
   The Stack carries the brand: outer bars at obsidian, middle at cobalt,
   in every theme. The warm-paper light theme softens --text to #1A1410
   and --cobalt-bright to #B5301E for body chrome — the mark must NOT
   follow those shifts or it loses brand weight on paper. ──────────── */
[data-theme="light"] .nav-mark .nm-bar              { fill: #09090B; }   /* obsidian */
[data-theme="light"] .nav-mark .nm-bar-accent       { fill: #E84637; }   /* cobalt, the active line */
[data-theme="light"] .colophon-mark .cm-bar         { fill: #09090B; }
[data-theme="light"] .colophon-mark .cm-bar-accent  { fill: #E84637; }
/* Wordmark continues to use --text (warm ink on paper, white on obsidian)
   and --cobalt-bright for the period — that softening reads fine on type. */

/* ── Body + sections ───────────────────────────────────────── */
[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}
[data-theme="light"] .section:nth-child(odd) {
  background: var(--bg);
}
[data-theme="light"] .section:nth-child(even) {
  background: var(--bg-2);
}
[data-theme="light"] .section-title {
  color: var(--text);
}
[data-theme="light"] .section-num {
  color: var(--text-3);
}

/* ── Hero ──────────────────────────────────────────────────── */
[data-theme="light"] .hero {
  background: var(--bg) !important;
}
[data-theme="light"] .hero-name {
  color: var(--text);
}
[data-theme="light"] .hero-sub,
[data-theme="light"] .hero-desc {
  color: var(--text-2);
}
[data-theme="light"] .hero-scroll-hint {
  color: var(--text-3);
}
[data-theme="light"] .hero-orb-1,
[data-theme="light"] .hero-orb-2 {
  opacity: 0.03;
}

/* ── Hero console — goes light ─────────────────────────────── */
[data-theme="light"] .console {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .console-bar {
  background: var(--bg-3);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .cb-host,
[data-theme="light"] .cb-status-text {
  color: var(--text-2);
}
[data-theme="light"] .cb-dot {
  background: var(--green);
}
[data-theme="light"] .cb-clock-time,
[data-theme="light"] .cb-clock-z {
  color: var(--text-3);
}
[data-theme="light"] .cb-tf-id {
  color: var(--text-3);
}
[data-theme="light"] .cb-tf-tag {
  color: var(--cobalt-bright);
}
[data-theme="light"] .console-pane {
  background: var(--surface);
  color: var(--text);
  border-top-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .console-pane .pane-bar {
  border-bottom-color: rgba(0, 0, 0, 0.05);
  background: var(--bg-3);
}
[data-theme="light"] .pane-title {
  color: var(--text-2);
}
/* ── Log tail pane — proper lt-* selectors ──────────────── */
[data-theme="light"] .console-pane-tail {
  background: linear-gradient(180deg, rgba(0,0,0,0.015) 0%, transparent 100%);
}
[data-theme="light"] .log-tail li {
  color: var(--text);
}
[data-theme="light"] .log-tail li.lt-old {
  opacity: 0.55;
}
[data-theme="light"] .log-tail li.lt-older {
  opacity: 0.35;
}
[data-theme="light"] .log-tail li.lt-oldest {
  opacity: 0.20;
}
[data-theme="light"] .lt-time {
  color: var(--text-2);
}
[data-theme="light"] .lt-detail {
  color: var(--text-2);
}
[data-theme="light"] .lt-latency {
  color: var(--text-2);
}
[data-theme="light"] .lt-200 .lt-latency {
  color: var(--green);
}
[data-theme="light"] .typed-cmd {
  color: var(--text);
}
[data-theme="light"] .typed-cursor {
  background: var(--cobalt-bright);
}

/* ── Console rail — swap dark gradient for light ────────── */
[data-theme="light"] .console-rail {
  background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0));
  border-right-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .rail-num .rn-led {
  background: var(--text-3);
}
[data-theme="light"] .rail-num.is-active .rn-led {
  background: var(--cobalt-bright);
  box-shadow: 0 0 8px var(--cobalt-glow), 0 0 14px rgba(181, 48, 30, 0.25);
}

/* ── Bottom frequency strip — light background ──────────── */
[data-theme="light"] .console-density {
  background: rgba(0, 0, 0, 0.025);
  border-top-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .cd-bar {
  background: linear-gradient(180deg, var(--cobalt-bright), rgba(181, 48, 30, 0.18));
}
[data-theme="light"] .cd-bar.cd-bar-warn {
  background: linear-gradient(180deg, var(--copper), rgba(196, 120, 58, 0.18));
}

/* ── Metric cells in the console telemetry pane ─────────── */
[data-theme="light"] .metric-cell {
  border-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .metric-sep {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .m-name {
  color: var(--text-3);
}
[data-theme="light"] .m-val {
  color: var(--text);
}
[data-theme="light"] .m-unit {
  color: var(--text-3);
}
[data-theme="light"] .m-spark {
  color: var(--cobalt-bright);
}
[data-theme="light"] .console-pane-metrics {
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.01) 100%);
}

/* ── Architecture pane blueprint ────────────────────────── */
[data-theme="light"] .console-pane-arch {
  background: var(--surface);
}
[data-theme="light"] .console-pane-arch .blueprint-canvas {
  background: var(--surface);
}
[data-theme="light"] .bp-node {
  background: var(--bg-3);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text);
}
[data-theme="light"] .bp-edge {
  stroke: var(--text-3);
}
[data-theme="light"] .bp-node.bp-active {
  border-color: var(--cobalt-bright);
  box-shadow: 0 0 12px rgba(181, 48, 30, 0.15);
}

/* ── Pane labels ────────────────────────────────────────── */
[data-theme="light"] .cp-label {
  background: rgba(0, 0, 0, 0.015);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* ── Fresh sweep line — use indigo ──────────────────────── */
[data-theme="light"] .console-v2 .console-pane::before {
  background: linear-gradient(90deg, transparent, var(--cobalt-bright), transparent);
}

/* ── Hero stat strip ───────────────────────────────────────── */
[data-theme="light"] .hero-strip {
  background: var(--bg-2);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ── Cards + surfaces ──────────────────────────────────────── */
[data-theme="light"] .process-step,
[data-theme="light"] .stack-card,
[data-theme="light"] .principle-card,
[data-theme="light"] .field-log {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .process-step:hover,
[data-theme="light"] .stack-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 10px rgba(181, 48, 30, 0.06);
}
[data-theme="light"] .step-title,
[data-theme="light"] .stack-card h3 {
  color: var(--text);
}
[data-theme="light"] .step-body,
[data-theme="light"] .stack-card p {
  color: var(--text-2);
}

/* ── Process artifacts — go light ──────────────────────────── */
[data-theme="light"] .phase-artifact {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.07);
}
[data-theme="light"] .phase:hover .phase-artifact {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.10),
              0 0 0 1px rgba(181, 48, 30, 0.05);
}
[data-theme="light"] .artifact-head {
  background: var(--bg-3);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .artifact-label {
  color: var(--text);
}
[data-theme="light"] .artifact-meta {
  color: var(--text-3);
}
[data-theme="light"] .artifact-body {
  color: var(--text-2);
}

/* Syntax colors — light-friendly palette */
[data-theme="light"] .phase-artifact-spec .ak {
  color: var(--cobalt-bright);
}
[data-theme="light"] .phase-artifact-spec .ap {
  color: var(--text-3);
}
[data-theme="light"] .phase-artifact-code .ck { color: #6C5CE7; }
[data-theme="light"] .phase-artifact-code .cs { color: #B8503A; }
[data-theme="light"] .phase-artifact-code .cd { color: #D97706; }
[data-theme="light"] .phase-artifact-code .cf { color: var(--text); }
[data-theme="light"] .phase-artifact-code .cn { color: #D97706; }
[data-theme="light"] .phase-artifact-terminal .tp { color: #1B8A50; }
[data-theme="light"] .phase-artifact-terminal .tk { color: #6C5CE7; }
[data-theme="light"] .phase-artifact-terminal .ts { color: #B8503A; }
[data-theme="light"] .phase-artifact-terminal .tn { color: #D97706; }
[data-theme="light"] .term-cursor {
  background: var(--cobalt-bright);
}

/* Eval bar fills — indigo accent */
[data-theme="light"] .eval-fill {
  background: var(--cobalt-bright);
  box-shadow: inset 0 0 0 1px rgba(181, 48, 30, 0.35);
}
[data-theme="light"] .eval-fill-warn {
  background: var(--copper);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.35);
}
[data-theme="light"] .eval-track {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .eval-delta {
  color: var(--green);
}

/* Dashboard sparkline rows */
[data-theme="light"] .dash-row {
  color: var(--text-2);
}
[data-theme="light"] .dash-spark {
  color: var(--cobalt-bright);
}
[data-theme="light"] .dash-row-warn .dash-spark {
  color: var(--copper);
}
[data-theme="light"] .dash-val {
  color: var(--text);
}

/* ── Portrait — B&W default, warm ember on hover.
   Light theme is warm paper (cream + deep red + saddle brown), so the
   hover filter tints toward red/sepia rather than the cold blue cast
   that paired with the previous indigo palette.
   hue-rotate(-8deg) nudges the sepia warmth slightly toward the cobalt
   red (#B5301E) without losing the warm-paper kinship. ────────────── */
[data-theme="light"] .portrait-img {
  filter: grayscale(1) brightness(1.18) contrast(0.92);
  transition: filter 0.7s var(--ease), transform 0.8s var(--ease);
}
[data-theme="light"] .portrait-frame:hover .portrait-img {
  filter:
    grayscale(0.55)
    sepia(0.45)
    hue-rotate(-8deg)
    saturate(0.65)
    brightness(1.12)
    contrast(1.06);
  transform: scale(1.02);
}

/* ── Experience timeline ───────────────────────────────────── */
[data-theme="light"] .exp-card {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .exp-role {
  color: var(--text);
}
[data-theme="light"] .exp-org {
  color: var(--text-2);
}

/* ── Projects ──────────────────────────────────────────────── */
[data-theme="light"] .case-study {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .cs-title {
  color: var(--text);
}
[data-theme="light"] .cs-desc {
  color: var(--text-2);
}

/* Diagrams go light — targeted colour swap (no filter) */
[data-theme="light"] .cs-visual {
  background: var(--surface) !important;
}

/* Metrics badges */
[data-theme="light"] .cs-metrics span {
  background: var(--bg-3);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-2);
}

/* Compact project rows */
[data-theme="light"] .proj-row {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .proj-row:hover {
  background: var(--cobalt-dim);
}
[data-theme="light"] .proj-name {
  color: var(--text);
}
[data-theme="light"] .proj-cat {
  color: var(--text-2);
}

/* ── Contact + form ────────────────────────────────────────── */
[data-theme="light"] .intake-group input,
[data-theme="light"] .intake-group textarea,
[data-theme="light"] .intake-group select {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.09);
  color: var(--text);
}
[data-theme="light"] .intake-group input:focus,
[data-theme="light"] .intake-group textarea:focus,
[data-theme="light"] .intake-group select:focus {
  border-color: var(--cobalt-bright);
  box-shadow: 0 0 0 3px var(--cobalt-dim);
}
[data-theme="light"] .intake-group label {
  color: var(--text-2);
}

/* ── Engagement banner ─────────────────────────────────────── */
[data-theme="light"] .engagement-banner {
  background: var(--surface) !important;
  border-color: rgba(0, 0, 0, 0.07) !important;
}

/* ── Buttons ───────────────────────────────────────────────── */
[data-theme="light"] .btn-primary {
  box-shadow: 0 2px 12px rgba(181, 48, 30, 0.18);
}
[data-theme="light"] .btn-sm:hover {
  color: #fff;
}
[data-theme="light"] .btn-ghost {
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .btn-ghost:hover {
  background: var(--cobalt-dim);
  border-color: var(--border-hover);
  color: var(--cobalt-bright);
}

/* ── Tags ──────────────────────────────────────────────────── */
[data-theme="light"] .tags span,
[data-theme="light"] .cs-stack-row span,
[data-theme="light"] .proj-stack span {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-2);
  border-color: rgba(0, 0, 0, 0.05);
}

/* ── Footer ────────────────────────────────────────────────── */
[data-theme="light"] .footer {
  background: var(--bg-2);
  border-top-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .footer-link,
[data-theme="light"] .social-link {
  color: var(--text-2);
}
[data-theme="light"] .footer-link:hover,
[data-theme="light"] .social-link:hover {
  color: var(--cobalt-bright);
}

/* ── Scroll progress bar ───────────────────────────────────── */
[data-theme="light"] #progress-bar {
  background: var(--cobalt-bright);
}

/* ── Misc ──────────────────────────────────────────────────── */
[data-theme="light"] .quote-block {
  border-left-color: var(--copper);
}
[data-theme="light"] .section-divider {
  border-color: rgba(0, 0, 0, 0.05);
}

/* ── Pulse chip + status dots ──────────────────────────────── */
[data-theme="light"] .pulse-chip {
  background: rgba(27, 138, 80, 0.06);
  border-color: rgba(27, 138, 80, 0.18);
}

/* ── Custom cursor ─────────────────────────────────────────── */
[data-theme="light"] #cursor-dot {
  background: var(--cobalt-bright);
}
[data-theme="light"] #cursor-ring {
  border-color: var(--cobalt-bright);
}

/* ── Case-study SVG diagrams — light-mode colour swap ─────── */

/* --- Accent gradients: red-orange → indigo ------------------- */
/* Orion */
[data-theme="light"] #orion-orch stop:first-child    { stop-color: rgba(181,48,30,0.28); }
[data-theme="light"] #orion-orch stop:last-child      { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #orion-accent-v stop:first-child  { stop-color: rgba(181,48,30,0.20); }
[data-theme="light"] #orion-accent-v stop:last-child   { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #orion-hero-glow stop:first-child { stop-color: rgba(181,48,30,0.16); }
[data-theme="light"] #orion-hero-glow stop:last-child  { stop-color: rgba(181,48,30,0); }
/* NexusRAG */
[data-theme="light"] #nxr-accent-v stop:first-child    { stop-color: rgba(181,48,30,0.20); }
[data-theme="light"] #nxr-accent-v stop:last-child     { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #nxr-embed-glow stop:first-child  { stop-color: rgba(181,48,30,0.14); }
[data-theme="light"] #nxr-embed-glow stop:last-child   { stop-color: rgba(181,48,30,0); }
[data-theme="light"] #nxr-gen-glow stop:first-child    { stop-color: rgba(181,48,30,0.14); }
[data-theme="light"] #nxr-gen-glow stop:last-child     { stop-color: rgba(181,48,30,0); }
/* SentinelID */
[data-theme="light"] #sid-accent-v stop:first-child    { stop-color: rgba(181,48,30,0.20); }
[data-theme="light"] #sid-accent-v stop:last-child     { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #sid-hero stop:first-child        { stop-color: rgba(181,48,30,0.28); }
[data-theme="light"] #sid-hero stop:last-child         { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #sid-hero-glow stop:first-child   { stop-color: rgba(181,48,30,0.18); }
[data-theme="light"] #sid-hero-glow stop:last-child    { stop-color: rgba(181,48,30,0); }

/* --- Node-fill gradients: dark tint for light bg ------------- */
[data-theme="light"] #orion-node-fill stop:first-child { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #orion-node-fill stop:last-child  { stop-color: rgba(181,48,30,0.02); }
[data-theme="light"] #nxr-node-fill stop:first-child   { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #nxr-node-fill stop:last-child    { stop-color: rgba(181,48,30,0.02); }
[data-theme="light"] #sid-node-fill stop:first-child   { stop-color: rgba(181,48,30,0.06); }
[data-theme="light"] #sid-node-fill stop:last-child    { stop-color: rgba(181,48,30,0.02); }

/* --- Dot patterns: dark dots --------------------------------- */
[data-theme="light"] #orion-dots circle { fill: rgba(0,0,0,0.08); }
[data-theme="light"] #nxr-dots circle   { fill: rgba(0,0,0,0.08); }
[data-theme="light"] #sid-dots circle   { fill: rgba(0,0,0,0.08); }

/* --- Arrow markers: indigo accent, dark dim ------------------- */
[data-theme="light"] #orion-arrow path     { fill: rgba(181,48,30,0.95); }
[data-theme="light"] #orion-arrow-dim path { fill: rgba(0,0,0,0.40); }

/* --- Node rects: visible dark strokes ------------------------ */
[data-theme="light"] .cs-diagram rect[stroke*="255,255,255"] {
  stroke: rgba(181,48,30,0.18);
}
/* Glow shells around accent nodes: indigo, visible             */
[data-theme="light"] .cs-diagram rect[stroke*="232,70,55"] {
  stroke: rgba(181,48,30,0.20);
}
/* Inner highlight strokes → subtle dark outline               */
[data-theme="light"] .cs-diagram rect[fill="none"][stroke*="255,255,255"] {
  stroke: rgba(181,48,30,0.10);
}
/* Chip-style rects (response pill etc.)                       */
[data-theme="light"] .cs-diagram rect[fill*="255,255,255"] {
  fill: rgba(181,48,30,0.06);
  stroke: rgba(181,48,30,0.16);
}

/* --- Class-based text: boost for small mono labels ----------- */
[data-theme="light"] .cs-node-sub {
  fill: #6B5848;
}
[data-theme="light"] .cs-row-tag,
[data-theme="light"] .cs-row-tag-inside {
  fill: #6B5848;
}
[data-theme="light"] .cs-node-baseline {
  fill: #8A7560;
}
[data-theme="light"] .cs-node-hero {
  filter: drop-shadow(0 0 14px rgba(181,48,30,0.20));
}
[data-theme="light"] .cs-loop-tag {
  opacity: 1;
}
[data-theme="light"] .cs-node-chip {
  fill: var(--text);
}

/* --- Inline text annotations (watermarks, zone labels) ------- */
[data-theme="light"] .cs-diagram text[fill*="255,255,255"] {
  fill: rgba(0,0,0,0.48);
}

/* --- Edges: separator lines + edge strokes ------------------- */
[data-theme="light"] .cs-diagram line[stroke*="255,255,255"] {
  stroke: rgba(0,0,0,0.12);
}
[data-theme="light"] .cs-edge {
  stroke: rgba(181,48,30,0.28);
}
[data-theme="light"] .cs-edge-active {
  stroke: var(--cobalt-bright);
  filter: drop-shadow(0 0 4px rgba(181,48,30,0.25));
}

/* --- Feedback loop glow paths -------------------------------- */
[data-theme="light"] .cs-diagram path[stroke*="232,70,55"] {
  stroke: rgba(181,48,30,0.24);
}

/* --- cs-visual container + grid ------------------------------ */
[data-theme="light"] .cs-visual {
  background: var(--surface);
}
[data-theme="light"] .cs-visual-grid {
  background-image:
    linear-gradient(rgba(181,48,30,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(181,48,30,0.04) 1px, transparent 1px);
}
[data-theme="light"] .cs-visual-corners > span {
  border-color: rgba(181,48,30,0.16);
}
[data-theme="light"] .cs-visual-label {
  color: #8A7560;
}
[data-theme="light"] .cs-visual-trace .live {
  color: var(--cobalt-bright);
}

/* ── Film grain overlay — soften on light ──────────────────── */
[data-theme="light"] .grain {
  opacity: 0.02;
}
