/* ─────────────────────────────────────────────────────────────
   RAG Pipeline Guide — Design System
   Clean editorial dark theme. No blur blobs. No "intel" gradients.
   ───────────────────────────────────────────────────────────── */

/* Dark theme (default) */
:root {
  --bg: #0D0D0D;
  --surface: #141414;
  --surface-2: #1C1C1C;
  --border: #242424;
  --border-2: #303030;
  --guide-measure: 840px;

  --text-primary: #E8E8E8;
  --text-secondary: #888;
  --text-muted: #555;

  --accent: #D4A94B;
  --accent-2: #4CAF7D;
  --modal-backdrop-bg: rgba(7, 7, 7, 0.72);

  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* Light theme */
[data-theme="light"] {
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --surface-2: #ECEAE5;
  --border: #DDD9D3;
  --border-2: #CAC6BE;

  --text-primary: #18160F;
  --text-secondary: #5A5650;
  --text-muted: #9A9690;

  --accent: #B5891F;
  --accent-2: #2D8A5A;
  --modal-backdrop-bg: rgba(245, 243, 239, 0.78);
}

/* Smooth transitions when toggling theme */
.theme-transition,
.theme-transition * {
  transition: background-color .3s ease, border-color .25s ease, color .2s ease, box-shadow .3s ease !important;
}

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

body {
  background: var(--bg);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Typography ── */

h1,
h2,
h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: .4rem;
}

h3 {
  font-size: 1.1rem;
  margin: 2.8rem 0 1rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  font-size: .95rem;
  text-wrap: pretty;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85em;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: .15em .4em;
  border-radius: 4px;
  color: #c8a96a;
}

/* ── Sidebar ── */

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-topbar {
  position: relative;
}

.brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border);
}

.brand-title {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--text-primary);
}

.brand-subtitle {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.nav {
  padding: 12px 10px;
  flex: 1;
  position: relative;
}

.nav-pill {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 0;
  background: var(--surface-2);
  border-radius: 5px;
  z-index: 0;
  pointer-events: none;
  transition: top 0.2s cubic-bezier(0.22, 1, 0.36, 1), height 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-group {
  margin-bottom: 24px;
}

.nav-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 4px;
}

.nav-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  min-height: 32px;
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color .15s, transform .12s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.nav-item:active {
  transform: scale(0.97);
}

.nav-item.active {
  background: transparent;
  color: var(--accent);
  font-weight: 500;
}

/* ── Main Content ── */

.content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.content-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 52px;
}

/* ── Section Header ── */

.section-head {
  margin-bottom: 44px;
}

.section-head-eyebrow {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .75rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

.section-head p {
  max-width: 680px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-ai-assist {
  display: none;
}

.ai-assist-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  width: min(100%, 860px);
  margin: -8px 0 20px;
  padding: 12px 14px;
  background: rgba(255,255,255,.012);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}

.ai-assist-strip--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.ai-assist-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ai-assist-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(212,169,75,.88);
}

.ai-assist-note {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.42;
}

.ai-assist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ai-assist-actions--compact {
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
}

.ai-assist-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease, color .18s ease;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 500;
}

.ai-assist-btn--icon-only {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}

.ai-assist-btn:hover {
  border-color: rgba(212, 169, 75, .24);
  color: var(--accent);
  background: rgba(255,255,255,.03);
  transform: translateY(-1px);
}

.ai-assist-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: block;
  object-fit: cover;
}

.ai-assist-inline-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(212,169,75,.88);
  white-space: nowrap;
}

.ai-assist-status {
  grid-column: 1 / -1;
  font-size: .74rem;
  color: var(--text-muted);
  line-height: 1.45;
  opacity: .85;
}

.ai-assist-status[data-tone="success"] {
  color: var(--accent-2);
}

.ai-assist-status[data-tone="warn"] {
  color: var(--accent);
}

[data-theme="light"] .ai-assist-strip {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="light"] .ai-assist-btn {
  border-color: rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .6);
}

[data-theme="light"] .ai-assist-btn:hover {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(181, 137, 31, .30);
}

/* ── Toolbar ── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: nowrap;
}

.toolbar .glass-select {
  flex-shrink: 1;
  min-width: 0;
}

#main > .benchmark-stack {
  display: grid;
  justify-items: start;
  gap: 0;
  width: 100%;
  max-width: 100%;
}

#main > .benchmark-stack > .toolbar,
#main > .benchmark-stack > .chart-card,
#main > .benchmark-stack > .info-grid {
  justify-self: start;
  width: min(100%, var(--guide-measure)) !important;
  max-width: var(--guide-measure) !important;
  box-sizing: border-box;
}

.toolbar label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.glass-select {
  min-height: 40px;
  padding: 0 40px 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.03);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23908A80' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: .94rem;
  line-height: 1.2;
  appearance: none;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.glass-select:hover {
  border-color: rgba(212, 169, 75, 0.2);
  background-color: rgba(255, 255, 255, 0.045);
}

.glass-select:focus {
  outline: none;
  border-color: rgba(212, 169, 75, 0.42);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(212, 169, 75, 0.12);
}

.glass-select option {
  background: var(--surface);
  color: var(--text-primary);
}

.info-select {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-primary);
  padding: 8px 32px 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.info-select:focus {
  outline: 1px solid var(--accent);
}

.toggle-group {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .04em;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.toggle-btn.on {
  color: var(--accent);
  border-color: rgba(212, 169, 75, .5);
  background: rgba(212, 169, 75, .07);
}

/* ── Chart ── */

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 36px;
}

.chart-box {
  height: 440px;
  width: 100%;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  color: var(--text-secondary);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Info Cards Grid ── */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.info-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  border-left: 3px solid var(--border-2);
  transition: all .2s ease;
  animation: fadeUp .4s ease forwards;
  opacity: 0;
  margin-bottom: 16px;
}

.info-card:hover {
  border-left-color: var(--accent);
  border-color: var(--border-2);
}

.intro-nav-card {
  cursor: pointer;
  transition: border-left-color .2s, border-color .2s, background .2s;
}

.intro-nav-card:hover {
  background: rgba(212, 169, 75, .04);
  border-left-color: var(--accent);
  border-color: var(--border-2);
}

.intro-nav-card--research {
  border-left-color: var(--accent);
  background: rgba(212, 169, 75, .03);
}

.intro-nav-card--research:hover {
  background: rgba(212, 169, 75, .07);
}

.intro-learning-path {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: rgba(212, 169, 75, .03);
  border-radius: 6px;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.intro-lp-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .75rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.intro-lp-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(212, 169, 75, .4);
}

.intro-lp-link:hover {
  text-decoration-color: var(--accent);
}

.info-card {
  display: flex;
  flex-direction: column;
}

/* Tables that carry info-card for styling must remain display: table */
table.info-card {
  display: table;
}

.info-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 12px;
  font-weight: 500;
}

.info-card p {
  margin: 0 0 1rem;
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-card:last-child {
  margin-bottom: 0;
}

/* Higher specificity (0,2,0) overrides .info-card margin-bottom in grid containers */
.info-grid>.info-card,
.metric-row>.info-card,
.decision-grid>.info-card,
.two-col>.info-card {
  margin-bottom: 0;
}

.info-card.callout {
  border-left-color: var(--accent);
  background: rgba(212, 169, 75, 0.03);
}

.info-card.hero-banner {
  border-left-color: #E8A430;
  padding: 28px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.info-list li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 14px;
  color: var(--text-secondary);
  line-height: 1.72;
}

.info-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ── Guide Body ── */

.guide-body {
  animation: fadeUp .4s ease forwards;
  opacity: 0;
  max-width: var(--guide-measure);
}

.hero-banner,
#main > .intro-container,
#main > .metric-row.metric-row--triple,
#main > .info-grid.info-grid--triple,
#main > .intro-learning-path,
#main > .callout.info-card,
.ai-assist-strip--full {
  width: min(100%, var(--guide-measure));
}

.hero-banner,
#main > .intro-container,
#main > .metric-row.metric-row--triple,
#main > .info-grid.info-grid--triple,
#main > .intro-learning-path,
#main > .callout.info-card {
  max-width: var(--guide-measure);
}



.hero-banner h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.hero-banner p {
  margin: 0;
  font-size: 1rem;
}

/* Numbered list */

.step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  counter-reset: s;
}

.step-list li {
  counter-increment: s;
  padding: 18px 20px 18px 56px;
  position: relative;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .94rem;
  color: var(--text-secondary);
  line-height: 1.72;
}

.step-list li>strong:first-child {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.step-list li::before {
  content: counter(s);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  color: var(--accent);
  font-weight: 600;
}

/* Arch flow */

.arch-flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.arch-box {
  flex: 1;
  min-width: 100px;
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.arch-box.gold {
  border-color: rgba(212, 169, 75, .5);
  color: var(--accent);
}

.arch-box.cyan {
  border-color: rgba(76, 175, 125, .5);
  color: var(--accent-2);
}

.arch-arrow {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: .9rem;
  flex-shrink: 0;
}

/* Table */

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem;
  font-size: .9rem;
}

.mini-table th,
.mini-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.mini-table td {
  font-variant-numeric: tabular-nums;
}

.mini-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface);
}

.mini-table tbody tr:hover {
  background: var(--surface);
}

/* Mermaid diagrams */

.diagram-wrap {
  position: relative;
  margin: 18px 0 22px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.diagram-stage {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.diagram-stage .mermaid {
  min-width: 560px;
}

.diagram-stage svg {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
}

.diagram-zoom-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: 1px solid rgba(212, 169, 75, 0.28);
  background: rgba(20, 20, 20, 0.88);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.diagram-zoom-btn:hover {
  border-color: rgba(212, 169, 75, 0.5);
  background: rgba(28, 28, 28, 0.96);
}

[data-theme="light"] .diagram-zoom-btn {
  background: rgba(255, 255, 255, 0.94);
}

.read-progress {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 10;
  flex-shrink: 0;
}

dialog.diagram-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 16px;
  /* Reset browser dialog defaults */
  border: none;
  outline: none;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: transparent;
}

dialog.diagram-modal:not([open]) {
  display: none;
}

dialog.diagram-modal::backdrop {
  background: var(--modal-backdrop-bg, rgba(7, 7, 7, 0.72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.diagram-modal-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(92dvh, 860px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(13, 13, 13, 0.96);
  border: 1px solid rgba(212, 169, 75, 0.16);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4);
  transform: translateY(14px) scale(.985);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}

.diagram-modal.is-open .diagram-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

[data-theme="light"] .diagram-modal-panel {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(181, 137, 31, 0.18);
  box-shadow: 0 24px 60px rgba(24, 22, 15, 0.12);
}

.diagram-modal-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.diagram-modal-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.diagram-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.diagram-modal-close,
.diagram-modal-action {
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.diagram-modal-close:hover,
.diagram-modal-action:hover {
  border-color: rgba(212, 169, 75, 0.45);
  color: var(--accent);
}

.diagram-modal-close {
  padding: 9px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
}

.diagram-modal-actions {
  display: flex;
  gap: 8px;
}

.diagram-modal-action {
  min-width: 52px;
  padding: 8px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .76rem;
}

.diagram-modal-hint {
  font-size: .82rem;
  color: var(--text-muted);
}

.diagram-modal-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

[data-theme="light"] .diagram-modal-viewport {
  background: rgba(24, 22, 15, 0.02);
}

.diagram-modal-canvas {
  min-width: 100%;
}

.diagram-modal-canvas svg {
  display: block;
  height: auto;
  max-width: none;
  margin: 0 auto;
}

.diagram-modal-error {
  padding: 16px;
  border-radius: 10px;
  background: rgba(212, 169, 75, 0.08);
  color: var(--text-secondary);
}

body.diagram-modal-open {
  overflow: hidden;
}

/* Callout */

.callout {
  display: block;
  padding: 20px 24px;
  background: rgba(212, 169, 75, .06);
  border: 1px solid rgba(212, 169, 75, .2);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  margin: 2rem 0;
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 1.72;
}

.callout-info {
  background: rgba(76, 175, 125, .05);
  border-color: rgba(76, 175, 125, .2);
  border-left-color: var(--accent-2);
}

/* Decision grid / cards */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 1.5rem 0;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 1.5rem 0;
}

.decision-grid>* {
  max-width: 360px;
}

.decision-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 16px;
}

.dc-when {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dc-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: .95rem;
}

.dc-body {
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.68;
}

/* Metrics row */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 1.5rem 0;
}

.metric-row--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-row>* {
  max-width: 320px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 20px 16px;
  text-align: center;
}

.mc-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.mc-label {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
}

.mc-sub {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
}



/* Accordions */

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 8px;
  overflow: hidden;
}

details summary {
  padding: 18px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  position: relative;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 300;
}

details[open] summary::after {
  content: '–';
}

.details-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 20px;
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 1.78;
}

/* ── Report page ── */

body.report-detail {
  background:
    radial-gradient(circle at 86% 10%, rgba(212, 169, 75, .08), transparent 24%),
    radial-gradient(circle at 6% 18%, rgba(76, 175, 125, .05), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 18%),
    var(--bg);
}

[data-theme="light"] body.report-detail {
  background:
    radial-gradient(circle at 86% 10%, rgba(181, 137, 31, .08), transparent 24%),
    radial-gradient(circle at 6% 18%, rgba(45, 138, 90, .06), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 20%),
    var(--bg);
}

.report-content {
  max-width: 1040px;
}

.report-layout {
  display: grid;
  gap: 38px;
}

.report-anchor-section {
  scroll-margin-top: 112px;
}

.report-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .78fr);
  gap: 18px;
  margin-top: 10px;
  align-items: stretch;
}

.report-hero-grid--lead {
  align-items: stretch;
}

.report-hero-card,
.report-state-card,
.report-panel,
.report-cta {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .014));
  box-shadow: 0 22px 52px rgba(0, 0, 0, .16);
}

.report-hero-card,
.report-state-card,
.report-panel,
.report-cta {
  padding: 28px;
}

.report-hero-card--lead {
  min-height: 100%;
}

.report-hero-card::before,
.report-state-card::before,
.report-panel::before,
.report-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 169, 75, .56), rgba(76, 175, 125, .2), rgba(212, 169, 75, 0));
}

.report-state-card::after,
.report-cta::after {
  content: '';
  position: absolute;
  top: -90px;
  right: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 169, 75, .12), transparent 68%);
  pointer-events: none;
}

.report-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 14px;
}

.report-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.9rem, 6vw, 4.8rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .94;
  color: var(--text-primary);
  margin: 0 0 16px;
  max-width: 9ch;
}

.report-dek {
  font-size: 1rem;
  line-height: 1.84;
  color: var(--text-secondary);
  margin: 0;
  max-width: 62ch;
}

.report-state-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-state-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-state-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: right;
}

.report-state-list {
  display: grid;
  gap: 12px;
}

.report-state-item {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-decoration: none;
}

.report-state-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.report-state-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text-primary);
  transition: color .18s ease;
}

.report-state-copy {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: .92rem;
}

.report-state-item:hover .report-state-value,
.report-cite:hover {
  color: var(--accent);
}

.report-cite {
  display: inline-flex;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .18s ease;
}

.report-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, .02);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  letter-spacing: .04em;
}

.report-chip--accent2 {
  border-color: rgba(76, 175, 125, .24);
  color: var(--accent-2);
}

.report-section h2 {
  margin-bottom: .65rem;
}

.report-section>p {
  max-width: 68ch;
}

.report-panel {
  display: grid;
  gap: 18px;
}

.report-panel--wide {
  grid-column: 1 / -1;
}

.report-panel-head {
  display: grid;
  gap: 6px;
}

.report-panel-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .69rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.report-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--text-primary);
  margin: 0;
}

.agent-arc {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-top: 10px;
  align-items: stretch;
}

.agent-arc::before {
  content: '';
  position: absolute;
  top: 34px;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 169, 75, .28), rgba(76, 175, 125, .22), rgba(212, 169, 75, .12));
}

.agent-step {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0;
  min-height: 212px;
  padding: 34px 18px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .015));
}

.agent-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(212, 169, 75, .12);
}

.agent-step:nth-child(3)::before,
.agent-step:nth-child(5)::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(76, 175, 125, .12);
}

.agent-step-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.agent-step h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.agent-step p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.64;
}

.report-two-col {
  margin-top: 18px;
}

.report-path-card {
  border-left-color: var(--accent);
}

.report-path-card--alt {
  border-left-color: var(--accent-2);
}

.report-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: 18px;
  align-items: stretch;
}

.report-visual-grid > .report-panel,
.report-now-grid > .report-panel {
  height: 100%;
}

.report-bar-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  height: 320px;
  padding-top: 12px;
}

.report-bar-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.report-bar {
  height: var(--bar-height);
  min-height: 28px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, rgba(72, 173, 220, .98), rgba(43, 136, 192, .94));
  border: 1px solid rgba(72, 173, 220, .28);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.report-bar-col--dark .report-bar {
  background: linear-gradient(180deg, rgba(28, 112, 156, .98), rgba(22, 90, 128, .94));
  border-color: rgba(28, 112, 156, .28);
}

.report-bar-col--darkest .report-bar {
  background: linear-gradient(180deg, rgba(16, 84, 128, .98), rgba(13, 64, 100, .94));
  border-color: rgba(16, 84, 128, .32);
}

.report-bar span {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.03em;
}

.report-bar-label {
  margin-top: 12px;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: center;
  text-wrap: balance;
}

.report-chart-note {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.value-stack {
  display: grid;
  gap: 10px;
  grid-auto-rows: 1fr;
}

.value-layer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.value-layer--top {
  background: linear-gradient(180deg, rgba(212, 169, 75, .11), rgba(212, 169, 75, .03));
}

.value-layer--mid {
  background: linear-gradient(180deg, rgba(76, 175, 125, .1), rgba(76, 175, 125, .03));
}

.value-layer--base {
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
}

.value-layer-kicker {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.value-layer h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.value-layer p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.62;
}

.report-context-note {
  margin: 0;
}

.report-now-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.signal-list {
  display: grid;
  gap: 18px;
}

.signal-card {
  height: 100%;
}

.signal-row {
  display: grid;
  gap: 10px;
}

.signal-copy {
  display: grid;
  gap: 4px;
}

.signal-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text-primary);
}

.signal-text {
  font-size: .92rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.signal-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.signal-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(212, 169, 75, .92), rgba(76, 175, 125, .84));
}

.signal-meter--warn span {
  background: linear-gradient(90deg, rgba(212, 169, 75, .88), rgba(212, 169, 75, .62));
}

.signal-meter--accent2 span {
  background: linear-gradient(90deg, rgba(76, 175, 125, .95), rgba(76, 175, 125, .72));
}

.maturity-meter {
  display: flex;
  width: 100%;
  min-height: 18px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.maturity-segment {
  display: block;
  height: 100%;
}

.maturity-segment--exploring {
  background: rgba(255, 255, 255, .24);
}

.maturity-segment--pilot {
  background: rgba(72, 173, 220, .82);
}

.maturity-segment--partial {
  background: rgba(76, 175, 125, .82);
}

.maturity-segment--scale {
  background: rgba(212, 169, 75, .92);
}

.maturity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.maturity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-secondary);
}

.maturity-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.report-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: -4px;
}

.report-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.report-chart-swatch {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.report-chart-swatch--gold {
  background: linear-gradient(90deg, rgba(212, 169, 75, .28), rgba(212, 169, 75, .96));
}

.report-chart-swatch--green {
  background: linear-gradient(90deg, rgba(76, 175, 125, .28), rgba(76, 175, 125, .96));
}

.report-chart-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: -2px;
}

.report-chart-stat {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .015));
}

.report-chart-stat:first-child {
  border-color: rgba(212, 169, 75, .18);
  background: linear-gradient(180deg, rgba(212, 169, 75, .1), rgba(212, 169, 75, .03));
}

.report-chart-stat:last-child {
  border-color: rgba(76, 175, 125, .18);
  background: linear-gradient(180deg, rgba(76, 175, 125, .08), rgba(76, 175, 125, .025));
}

.report-chart-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.035em;
  color: var(--text-primary);
}

.report-chart-stat-copy {
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.report-svg-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2px;
}

.report-svg-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  fill: var(--text-muted);
  letter-spacing: .04em;
}

.report-svg-axis {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  fill: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.report-svg-end {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(13, 13, 13, .88);
  stroke-width: 6px;
  stroke-linejoin: round;
}

.report-svg-end--gold {
  fill: var(--accent);
}

.report-svg-end--green {
  fill: var(--accent-2);
}

.report-svg-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  fill: var(--text-primary);
}

.report-svg-tag--gold {
  fill: var(--accent);
}

.report-svg-tag--green {
  fill: var(--accent-2);
}

.report-svg-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  fill: var(--text-secondary);
}

.report-source-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.compute-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  grid-auto-rows: 1fr;
}

.compute-metric {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  height: 100%;
}

.compute-metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.compute-metric-label {
  font-size: .86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.report-cta {
  padding: 28px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.report-link-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .73rem;
  letter-spacing: .05em;
  transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}

.report-link-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 169, 75, .28);
  background: var(--surface);
  color: var(--accent);
}

.report-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.report-link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .05em;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.report-link-chip:hover {
  border-color: rgba(212, 169, 75, .26);
  color: var(--accent);
  background: rgba(255, 255, 255, .04);
}

/* ── Animation ── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   INTRO HERO
   ========================================================================== */

.intro-hero {
  padding: 44px 0 40px;
  margin-bottom: 36px;
}

.intro-hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.intro-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 16px;
}

.intro-hero-sub {
  max-width: 520px;
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.72;
  margin-bottom: 28px;
}

.intro-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.intro-hero-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

.intro-hero-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
  border-color: #444;
}

.intro-hero-btn--primary {
  border-color: rgba(212, 169, 75, .5);
  color: var(--accent);
}

.intro-hero-btn--primary:hover {
  background: rgba(212, 169, 75, .08);
  border-color: var(--accent);
}

/* ==========================================================================
   INTRO ANIMATION
   ========================================================================== */
.intro-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.intro-text {
  flex: 1;
  font-size: .95rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.intro-text p {
  margin-bottom: 20px;
}

.info-btn.primary {
  background: rgba(212, 169, 75, 0.15);
  border: 1px solid rgba(212, 169, 75, 0.4);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.info-btn.primary:hover:not(:disabled) {
  background: rgba(212, 169, 75, 0.25);
}

.info-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rag-timeline {
  flex: 1.2;
  position: relative;
  padding-left: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-line {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 10px;
  width: 2px;
  background: var(--border-2);
  z-index: 1;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--accent);
  height: 0%;
  transition: height 0.6s ease;
  box-shadow: 0 0 10px rgba(212, 169, 75, 0.4);
}

.tl-step {
  position: relative;
  z-index: 2;
  opacity: 0.3;
  transition: all 0.4s ease;
}

.tl-step.active {
  opacity: 1;
}

.tl-step.done {
  opacity: 0.8;
}

.tl-dot {
  position: absolute;
  left: -25px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text-muted);
  transition: all 0.4s ease;
  z-index: 3;
}

.tl-step.active .tl-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px rgba(212, 169, 75, 0.6);
}

.tl-step.done .tl-dot {
  border-color: var(--accent);
  background: var(--surface);
}

.tl-card {
  padding: 15px 20px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  transform: translateX(10px);
  transition: all 0.4s ease;
}

.tl-step.active .tl-card,
.tl-step.done .tl-card {
  transform: translateX(0);
}

.tl-step.active .tl-card {
  border-color: rgba(212, 169, 75, 0.4);
}

.tl-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.4s ease;
}

.tl-step.active .tl-title {
  color: var(--accent);
}

.tl-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.prompt-text {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.vector-text {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.doc-snippet {
  background: var(--bg);
  padding: 10px 14px;
  border-left: 3px solid var(--border-2);
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
}

@media (max-width: 800px) {
  .intro-container {
    flex-direction: column;
  }
}

/* ── Sidebar Footer ── */

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-credit {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.sidebar-credit-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.sidebar-credit-handle {
  font-size: .78rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-secondary);
  transition: color .15s;
}

.sidebar-inline-x {
  width: 11px;
  height: 11px;
  margin-left: 2px;
  display: inline-block;
  flex: 0 0 auto;
  background-color: var(--text-secondary);
  -webkit-mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
  mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
  transform: translateY(.5px);
  transition: background-color .15s;
}

.sidebar-credit:hover .sidebar-inline-x {
  background-color: var(--accent);
}

.sidebar-credit:hover .sidebar-credit-handle {
  color: var(--accent);
}

/* ── Research inline citations ── */

.ref-cite {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72em;
  color: var(--text-muted);
  vertical-align: super;
  line-height: 0;
}

.ref-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}

.ref-link:hover {
  color: var(--accent);
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

/* ── Sidebar back link (RAG guide → portfolio) ── */

.sidebar-back {
  display: block;
  padding: 10px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color .2s;
  letter-spacing: .02em;
}

.sidebar-back:hover {
  color: var(--accent);
}

/* ── Theme toggle button ── */

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 200;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s, color .2s;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}

.theme-toggle-icon {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(to right, currentColor 50%, transparent 50%);
  flex-shrink: 0;
}

[data-theme="light"] .theme-toggle-icon {
  background: linear-gradient(to right, transparent 50%, currentColor 50%);
}

/* ── RAG responsive ── */

@media (max-width: 900px) {
  body:not(.portfolio) {
    display: block;
    min-height: 100dvh;
    height: auto;
    overflow: auto;
  }

  body:not(.portfolio) .sidebar {
    position: sticky;
    top: 0;
    z-index: 120;
    width: 100%;
    min-width: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 13, 0.92);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  [data-theme="light"] body:not(.portfolio) .sidebar {
    background: rgba(245, 243, 239, 0.94);
    box-shadow: 0 12px 28px rgba(24, 22, 15, 0.08);
  }

  body:not(.portfolio) .sidebar-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  body:not(.portfolio) .sidebar-back {
    flex: 1;
    padding: 0;
    border-bottom: 0;
    font-size: .68rem;
  }

  body:not(.portfolio) .theme-toggle {
    position: static;
    top: auto;
    right: auto;
    flex: 0 0 auto;
  }

  body:not(.portfolio) .brand {
    padding: 14px 16px 6px;
    border-bottom: 0;
  }

  body:not(.portfolio) .brand-title {
    font-size: .95rem;
  }

  body:not(.portfolio) .brand-subtitle {
    font-size: .7rem;
    margin-top: 2px;
  }

  body:not(.portfolio) .nav {
    display: flex;
    gap: 10px;
    padding: 8px 16px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  body:not(.portfolio) .nav::-webkit-scrollbar {
    display: none;
  }

  body:not(.portfolio) .nav-group {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  body:not(.portfolio) .nav-label {
    display: none;
  }

  body:not(.portfolio) .nav-item {
    width: auto;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    white-space: nowrap;
    scroll-snap-align: start;
    scroll-margin-inline: 16px;
  }

  body:not(.portfolio) .nav-pill {
    display: none;
  }

  body:not(.portfolio) .read-progress {
    display: none;
  }

  body:not(.portfolio) .nav-item.active {
    border-color: rgba(212, 169, 75, 0.36);
    background: var(--surface);
  }

  body:not(.portfolio) .sidebar-footer {
    display: none;
  }

  body:not(.portfolio) .content {
    overflow: visible;
  }

  body:not(.portfolio) .content-inner {
    max-width: none;
    padding: 28px 20px 56px;
  }

  body:not(.portfolio) .section-head {
    margin-bottom: 32px;
  }

  body:not(.portfolio) .sidebar-ai-assist {
    display: block;
    padding: 8px 16px 8px;
    border-top: 1px solid var(--border);
  }

  body:not(.portfolio) .ai-assist-strip--full {
    display: none;
  }

  body:not(.portfolio) .section-head p,
  body:not(.portfolio) .guide-body,
  body:not(.portfolio) .intro-hero-sub {
    max-width: none;
  }

  body:not(.portfolio) h3 {
    margin: 2.2rem 0 .9rem;
  }

  body:not(.portfolio) .toolbar {
    gap: 10px;
    padding: 14px;
    align-items: flex-start;
  }

  body:not(.portfolio) .toolbar label,
  body:not(.portfolio) .toggle-group,
  body:not(.portfolio) .info-select,
  body:not(.portfolio) .glass-select {
    width: 100%;
  }

  body:not(.portfolio) .toggle-group {
    margin-left: 0;
    flex-wrap: wrap;
  }

  body:not(.portfolio) .chart-card,
  body:not(.portfolio) .info-card,
  body:not(.portfolio) .decision-card,
  body:not(.portfolio) .metric-card,
  body:not(.portfolio) .callout {
    padding: 18px;
  }

  body:not(.portfolio) .chart-box {
    height: 300px;
  }

  body:not(.portfolio) .diagram-wrap {
    padding: 52px 14px 14px;
    border-radius: 12px;
  }

  body:not(.portfolio) .diagram-stage .mermaid {
    min-width: 520px;
  }

  body:not(.portfolio) .diagram-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body:not(.portfolio) .legend {
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    padding-top: 12px;
  }

  body:not(.portfolio) .info-grid,
  body:not(.portfolio) .info-grid--triple,
  body:not(.portfolio) .decision-grid,
  body:not(.portfolio) .metric-row,
  body:not(.portfolio) .metric-row--triple,
  body:not(.portfolio) .two-col {
    grid-template-columns: 1fr;
  }

  body:not(.portfolio) .decision-grid>*,
  body:not(.portfolio) .metric-row>* {
    max-width: none;
  }

  body:not(.portfolio) .mini-table,
  body:not(.portfolio) table.mini-table.info-card {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0 1.5rem;
  }

  body:not(.portfolio) .mini-table th,
  body:not(.portfolio) .mini-table td {
    white-space: nowrap;
    padding: 10px 12px;
  }

  body:not(.portfolio) .step-list li {
    padding: 16px 16px 16px 50px;
  }

  body:not(.portfolio) .step-list li::before {
    left: 14px;
  }

  body.report-detail .report-hero-grid {
    grid-template-columns: 1fr;
  }

  body.report-detail .report-hero-card,
  body.report-detail .report-state-card,
  body.report-detail .report-panel,
  body.report-detail .report-cta {
    padding: 22px;
  }

  body.report-detail .report-visual-grid,
  body.report-detail .report-now-grid,
  body.report-detail .compute-metric-grid {
    grid-template-columns: 1fr;
  }

  body.report-detail .report-chart-stats {
    grid-template-columns: 1fr;
  }

  body.report-detail .agent-arc {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 0;
  }

  body.report-detail .agent-arc::before {
    top: 4px;
    bottom: 4px;
    left: 5px;
    right: auto;
    width: 1px;
    height: auto;
  }

  body.report-detail .agent-step {
    padding-top: 0;
    padding-left: 26px;
  }

  body.report-detail .agent-step::before {
    top: 3px;
  }

  body.report-detail .report-bar-chart {
    min-width: 560px;
  }

  body.report-detail .report-panel--chart {
    overflow-x: auto;
  }

  body.report-detail .report-chart-legend {
    gap: 8px 14px;
  }

  body.report-detail .report-link-grid {
    gap: 8px;
  }

  body.report-detail .report-title {
    font-size: clamp(2.5rem, 12vw, 3.8rem);
  }

  body:not(.portfolio) details summary {
    padding: 16px 18px;
  }

  body:not(.portfolio) .details-body {
    padding: 18px;
    padding-top: 18px;
  }

  body:not(.portfolio) .intro-hero {
    padding: 20px 0 28px;
    margin-bottom: 28px;
  }

  body:not(.portfolio) .intro-hero-title {
    font-size: clamp(2rem, 11vw, 2.8rem);
    margin-bottom: 14px;
  }

  body:not(.portfolio) .intro-hero-sub,
  body:not(.portfolio) .intro-text,
  body:not(.portfolio) .tl-body {
    font-size: .92rem;
  }

  body:not(.portfolio) .intro-container {
    flex-direction: column;
    gap: 22px;
  }

  body:not(.portfolio) .rag-timeline {
    width: 100%;
    padding-left: 26px;
  }

  body:not(.portfolio) .tl-dot {
    left: -20px;
  }

  body:not(.portfolio) .tl-card {
    padding: 14px 16px;
    transform: none;
  }
}

@media (max-width: 640px) {
  body:not(.portfolio) .content-inner {
    padding: 24px 16px 48px;
  }

  body:not(.portfolio) .diagram-modal {
    padding: 10px;
  }

  body:not(.portfolio) .diagram-modal-panel {
    max-height: calc(100dvh - 20px);
    padding: 14px;
    gap: 12px;
    border-radius: 14px;
  }

  body:not(.portfolio) .diagram-modal-topbar {
    align-items: flex-start;
  }

  body:not(.portfolio) .diagram-modal-title {
    font-size: 1rem;
  }

  body:not(.portfolio) .diagram-modal-close,
  body:not(.portfolio) .diagram-modal-action {
    font-size: .72rem;
  }

  body:not(.portfolio) .diagram-modal-actions {
    flex-wrap: wrap;
  }

  body:not(.portfolio) .diagram-modal-viewport {
    padding: 10px;
  }

  body:not(.portfolio) .nav {
    padding: 8px 16px 12px;
  }

  body:not(.portfolio) .nav-item {
    font-size: .8rem;
  }

  body:not(.portfolio) .chart-box {
    height: 260px;
  }

  body:not(.portfolio) .ai-assist-strip--full .ai-assist-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body:not(.portfolio) .ai-assist-strip--full .ai-assist-btn {
    justify-content: center;
    width: 100%;
  }

  body.report-detail .report-title {
    font-size: clamp(2.2rem, 14vw, 3.2rem);
  }

  body.report-detail .report-state-head {
    display: grid;
    gap: 8px;
  }

  body.report-detail .report-state-date {
    text-align: left;
  }

  body.report-detail .compute-metric {
    padding: 14px;
  }

  body.report-detail .report-chart-stat {
    padding: 12px 14px;
  }

  body.report-detail .report-chart-stat-value {
    font-size: 1.22rem;
  }

  body.report-detail .report-chart-legend-item {
    font-size: .66rem;
  }

  body.report-detail .report-link-chip {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   PORTFOLIO PAGE
   ========================================================================== */

body.portfolio {
  --port-panel: rgba(255, 255, 255, .035);
  --port-panel-strong: rgba(255, 255, 255, .05);
  --port-line: rgba(255, 255, 255, .08);
  --port-soft-line: rgba(255, 255, 255, .05);
  --port-shadow: 0 28px 72px rgba(0, 0, 0, .28);
  --port-cta-height: 46px;
  display: block;
  height: auto;
  overflow-y: auto;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 84% 14%, rgba(212, 169, 75, .18), transparent 28%),
    radial-gradient(circle at 8% 18%, rgba(76, 175, 125, .07), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 18%),
    var(--bg);
}

[data-theme="light"] body.portfolio {
  --port-panel: rgba(255, 255, 255, .82);
  --port-panel-strong: rgba(255, 255, 255, .94);
  --port-line: rgba(24, 22, 15, .09);
  --port-soft-line: rgba(24, 22, 15, .06);
  --port-shadow: 0 24px 56px rgba(63, 48, 18, .10);
  background:
    radial-gradient(circle at 84% 14%, rgba(181, 137, 31, .16), transparent 28%),
    radial-gradient(circle at 8% 18%, rgba(45, 138, 90, .08), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 20%),
    var(--bg);
}

body.portfolio::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: -1;
}

[data-theme="light"] body.portfolio::before {
  opacity: .025;
}

/* Entrance animation */
@keyframes port-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes port-soft-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.port-anim {
  animation: port-fade-up .7s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay, 0s);
}

.port-wrap {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 104px 40px 112px;
}

/* ── Top nav ── */

.port-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  height: 60px;
  background: rgba(13, 13, 13, .72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--port-soft-line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .10);
  transition: transform .3s ease;
}

[data-theme="light"] .port-nav {
  background: rgba(245, 243, 239, .82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .04);
}

.port-nav--hidden {
  transform: translateY(-100%);
}

.port-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.port-nav-brand {
  font-family: 'Outfit', sans-serif;
  font-size: .98rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  transition: color .2s ease;
}

.port-nav-brand:hover {
  color: var(--accent);
}

.port-nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.port-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: .05em;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.port-nav-link:hover {
  color: var(--text-primary);
  background: var(--port-panel);
  border-color: var(--port-soft-line);
}

.port-nav-link--accent {
  color: var(--accent);
  border-color: rgba(212, 169, 75, .26);
}

.port-nav-link--accent:hover {
  border-color: rgba(212, 169, 75, .4);
  background: rgba(212, 169, 75, .08);
}

[data-theme="light"] .port-nav-link--accent {
  border-color: rgba(181, 137, 31, .28);
}

.port-nav-link--icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.port-nav-icon-x {
  width: 14px;
  height: 14px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
  mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
}

body.portfolio .theme-toggle {
  position: static;
  top: auto;
  right: auto;
  margin-left: 2px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border-color: var(--port-soft-line);
  background: transparent;
  color: var(--text-secondary);
}

body.portfolio .theme-toggle:hover {
  border-color: rgba(212, 169, 75, .35);
  background: var(--port-panel);
  color: var(--accent);
}

/* ── Hero ── */

.port-hero {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 64px);
  align-items: center;
  min-height: calc(100svh - 142px);
  margin-bottom: 64px;
}

.port-intro {
  min-width: 0;
  max-width: 520px;
}

.port-photo {
  margin: 0;
}

.port-photo-shell {
  padding: 10px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)),
    rgba(255, 255, 255, .02);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .32);
  transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color .35s ease,
    box-shadow .45s cubic-bezier(0.22, 1, 0.36, 1);
}

.port-photo-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 0.8;
  background: #111;
  line-height: 0;
}

.port-photo-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  pointer-events: none;
  z-index: 1;
}

.port-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .02) 0%, rgba(0, 0, 0, .14) 62%, rgba(0, 0, 0, .28) 100%),
    radial-gradient(circle at 54% 16%, rgba(212, 169, 75, .09), transparent 42%);
  opacity: .96;
  pointer-events: none;
  transition: opacity .45s ease;
}

.port-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 18%;
  display: block;
  filter: contrast(1.06) saturate(1.05) brightness(.94);
  transform: scale(1);
  transform-origin: center center;
  transition: transform .75s cubic-bezier(0.22, 1, 0.36, 1),
    filter .75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.port-photo:hover .port-photo-shell {
  transform: translateY(-2px);
  border-color: rgba(212, 169, 75, .18);
  box-shadow: 0 32px 84px rgba(0, 0, 0, .36);
}

.port-photo:hover .port-photo-wrap::after {
  opacity: 1;
}

.port-photo:hover .port-avatar {
  transform: scale(1.028);
  filter: contrast(1.08) saturate(1.08) brightness(.97);
}

.port-brand-mark {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
}

@keyframes port-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .45;
  }
}

.port-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .66rem;
  color: var(--text-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.port-eyebrow::after {
  content: '';
  display: block;
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 169, 75, .5), transparent);
  flex-shrink: 0;
}

.port-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(3.45rem, 7vw, 5.35rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: .92;
  margin-bottom: 18px;
  max-width: 8.5ch;
}

.port-name-dot {
  color: var(--accent);
}

.port-hero.port-anim .port-photo,
.port-hero.port-anim .port-brand-mark,
.port-hero.port-anim .port-eyebrow,
.port-hero.port-anim .port-name,
.port-hero.port-anim .port-bio,
.port-hero.port-anim .port-links {
  opacity: 0;
  animation: port-soft-enter .78s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.port-hero.port-anim .port-photo {
  animation-delay: .05s;
}

.port-hero.port-anim .port-brand-mark {
  animation-delay: .11s;
}

.port-hero.port-anim .port-eyebrow {
  animation-delay: .17s;
}

.port-hero.port-anim .port-name {
  animation-delay: .23s;
}

.port-hero.port-anim .port-bio {
  animation-delay: .31s;
}

.port-hero.port-anim .port-links {
  animation-delay: .41s;
}

.port-bio {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 30rem;
}

.port-bio strong {
  color: var(--text-primary);
}

.port-links {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}

.port-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  min-height: var(--port-cta-height);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--port-soft-line);
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: .05em;
  text-align: center;
  transition: transform .24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color .24s ease,
    background .24s ease,
    color .24s ease,
    box-shadow .24s ease;
}

.port-link:hover {
  transform: translateY(-1px);
  color: var(--text-primary);
  border-color: var(--port-line);
  background: var(--port-panel);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .08);
}

.port-link:active {
  transform: scale(0.96);
  box-shadow: none;
}

.port-link--primary {
  border-color: rgba(212, 169, 75, .28);
  background: rgba(212, 169, 75, .1);
  color: var(--accent);
}

[data-theme="light"] .port-link--primary {
  border-color: rgba(181, 137, 31, .32);
  background: rgba(181, 137, 31, .08);
}

.port-link--primary:hover {
  background: rgba(212, 169, 75, .14);
  border-color: var(--accent);
}

.port-inline-x {
  width: 11px;
  height: 11px;
  margin-left: 6px;
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
  mask: url("images/x-social-media-black-icon.png") center / contain no-repeat;
  transform: translateY(.5px);
}

/* ── Divider ── */

.port-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--port-line) 20%, var(--port-line) 80%, transparent);
  margin: 0 0 56px;
}

/* ── Sections ── */

.port-section {
  margin-bottom: 62px;
}

.port-section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.port-section-label::after {
  content: '';
  display: block;
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 169, 75, .24), transparent 55%);
}

.port-section-num {
  color: var(--accent);
}

.port-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform .6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.port-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.port-reveal .port-project,
.port-reveal .port-resource-card,
.port-reveal .port-coming-soon {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s cubic-bezier(0.16, 1, 0.3, 1),
    transform .55s cubic-bezier(0.16, 1, 0.3, 1);
}

.port-reveal.visible .port-project,
.port-reveal.visible .port-resource-card {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .08s;
}

.port-reveal.visible .port-coming-soon {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .16s;
}

/* ── Project card ── */

.port-project {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, .78fr);
  gap: 30px;
  padding: 0 0 0 2px;
}

.port-project::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 169, 75, .52), rgba(212, 169, 75, .1) 38%, transparent 78%);
}

.port-project::after {
  content: '';
  position: absolute;
  inset: 18px 0 auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(212, 169, 75, .07), transparent 72%);
  pointer-events: none;
}

.port-project-main {
  min-width: 0;
  padding: 28px 0 0;
}

.port-project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.port-live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  color: var(--accent-2);
  background: rgba(76, 175, 125, .08);
  border: 1px solid rgba(76, 175, 125, .18);
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: .05em;
}

.port-live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-2);
  border-radius: 50%;
  flex-shrink: 0;
  animation: port-pulse 1.8s ease-in-out infinite;
}

.port-project-url {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: color .2s ease;
}

.port-project-url:hover {
  color: var(--accent);
}

.port-pullquote {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  max-width: 18ch;
}

.port-project-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 14px;
}

.port-project-desc {
  font-size: .96rem;
  line-height: 1.82;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.port-project-highlights {
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 42rem;
  margin: 0;
  padding: 0;
}

.port-project-point {
  position: relative;
  padding-left: 18px;
  font-size: .92rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.port-project-point::before {
  content: '';
  position: absolute;
  top: .72em;
  left: 0;
  width: 8px;
  height: 1px;
  background: rgba(212, 169, 75, .72);
}

.port-project-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 24px 0 0 24px;
  border-left: 1px solid var(--port-soft-line);
}

.port-project-side-top {
  padding-top: 0;
}

.port-project-side-label {
  display: block;
  margin-bottom: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .64rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.port-project-side-text {
  font-size: .92rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin: 0;
  max-width: 23ch;
}

.port-project-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 0;
  padding: 0;
  border-top: 0;
}

.port-btn {
  display: inline-block;
  padding: 11px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .14),
    0 2px 4px rgba(0, 0, 0, .10),
    0 4px 8px rgba(0, 0, 0, .08),
    0 0 0 1px rgba(255, 255, 255, .12) inset,
    0 1px 0 rgba(255, 255, 255, .18) inset;
  transition: transform .24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow .24s ease,
    filter .24s ease;
}

.port-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .14),
    0 4px 8px rgba(0, 0, 0, .10),
    0 8px 20px rgba(0, 0, 0, .08),
    0 12px 24px rgba(212, 169, 75, .18),
    0 0 0 1px rgba(255, 255, 255, .12) inset,
    0 1px 0 rgba(255, 255, 255, .18) inset;
  filter: brightness(1.03);
}

.port-btn:active {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .14),
    0 0 0 1px rgba(255, 255, 255, .08) inset;
  filter: brightness(0.98);
}

.port-project-note {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Resource grid ── */

.port-resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.port-resource-card {
  position: relative;
  background: transparent;
  border-top: 1px solid var(--port-soft-line);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  padding: 20px 14px 22px;
  box-shadow: none;
}

a.port-resource-card {
  display: block;
  text-decoration: none;
  transition: transform .24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color .24s ease,
    background .24s ease,
    box-shadow .24s ease;
}

a.port-resource-card:hover {
  border-top-color: rgba(212, 169, 75, .24);
  border-bottom-color: rgba(212, 169, 75, .10);
  transform: translateY(-2px);
  background: transparent;
  box-shadow: none;
}

a.port-resource-card:active {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.port-resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.port-resource-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.port-resource-arrow {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: inline-block;
  transition: transform .2s;
}

a.port-resource-card:hover .port-resource-arrow {
  transform: translateX(6px);
}

.port-resource-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .64rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.port-resource-card h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.48rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 10px;
  letter-spacing: -.02em;
  max-width: 16ch;
}

.port-resource-card p {
  font-size: .92rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin: 0;
  max-width: 38ch;
}

.port-inline-link {
  color: var(--accent);
  text-decoration: none;
}

.port-inline-link:hover {
  text-decoration: underline;
}

.port-coming-soon {
  margin: 12px 2px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.port-coming-soon a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.port-coming-soon a:hover {
  color: var(--accent);
}

/* ── Footer ── */

.port-footer {
  padding-top: 28px;
  margin-top: 76px;
  border-top: 1px solid var(--port-soft-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  color: var(--text-muted);
}

.port-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}

.port-footer a:hover {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {

  .port-anim,
  .port-hero.port-anim .port-photo,
  .port-hero.port-anim .port-brand-mark,
  .port-hero.port-anim .port-eyebrow,
  .port-hero.port-anim .port-name,
  .port-hero.port-anim .port-bio,
  .port-hero.port-anim .port-links {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .port-reveal,
  .port-reveal .port-project,
  .port-reveal .port-resource-card,
  .port-reveal .port-coming-soon,
  .port-photo-shell,
  .port-photo-wrap::after,
  .port-avatar,
  .port-link,
  .port-btn,
  a.port-resource-card {
    transition: none !important;
  }

  .port-reveal,
  .port-reveal .port-project,
  .port-reveal .port-resource-card,
  .port-reveal .port-coming-soon {
    opacity: 1 !important;
    transform: none !important;
  }

  .port-photo:hover .port-photo-shell,
  .port-photo:hover .port-avatar,
  .port-link:hover,
  .port-btn:hover,
  a.port-resource-card:hover {
    transform: none !important;
  }
}

/* ── Portfolio responsive ── */

@media (max-width: 900px) {
  .port-wrap {
    padding: 96px 32px 96px;
  }

  .port-nav-inner {
    padding: 0 32px;
  }

  .port-project {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .port-project-side {
    padding-left: 0;
    padding-top: 22px;
    border-left: 0;
    border-top: 1px solid var(--port-soft-line);
  }

  .port-project-side-top {
    padding-top: 0;
  }

  .port-project-side-text {
    max-width: none;
  }

  .port-resources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .port-wrap {
    padding: 88px 24px 88px;
  }

  .port-nav-inner {
    padding: 0 24px;
  }

  .port-nav-link--hide-mobile {
    display: none;
  }

  .port-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: auto;
  }

  .port-photo {
    max-width: 460px;
  }

  .port-intro {
    max-width: none;
  }

  .port-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .port-wrap {
    padding: 84px 20px 76px;
  }

  .port-nav {
    height: 56px;
  }

  .port-nav-inner {
    padding: 0 20px;
  }

  .port-name {
    font-size: clamp(2.8rem, 18vw, 3.8rem);
  }

  .port-pullquote {
    font-size: 1.2rem;
  }

  .port-project,
  .port-resource-card {
    padding: 22px;
  }

  .port-avatar {
    object-position: 46% 18%;
  }

  .port-brand-mark,
  .port-eyebrow {
    letter-spacing: .12em;
  }
}
