/* ==========================================================================
   Briand Architecture Showcase — Paper, ink, and a golden dog.
   Tokens mirror src/styles.css for complete light & dark parity.
   ========================================================================== */

:root {
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fbf8f2;
  --surface: #ffffff;
  --surface-2: #f6f1e7;
  --surface-3: #ede6d8;
  --line: #ece5d8;
  --line-strong: #dcd2c0;

  --ink: #17182b;
  --ink-2: #474a60;
  --ink-3: #7a7d92;

  --accent: #2f4bf0;
  --accent-hover: #2440d9;
  --accent-bright: #4b66ff;
  --accent-soft: #e4e9ff;
  --accent-softer: #f1f4ff;
  --accent-line: #c5cffc;
  --accent-ink: #1c31b0;

  --amber: #ffb627;
  --amber-deep: #9a5507;
  --amber-soft: #fff0cc;
  --amber-line: #f3d796;
  --cream: #fff7e6;

  --success: #1f9d6b;
  --success-soft: #dcf3e7;
  --success-line: #a7dfc3;
  --success-ink: #12684a;

  --highlight: #ee5a36;
  --highlight-soft: #ffe9e1;
  --highlight-ink: #a23217;

  --mint-soft: #d9f1ee;
  --mint-ink: #136b63;

  --on-accent: #ffffff;
  --glass: rgba(251, 248, 242, 0.84);
  --shadow-ink: 23, 24, 43;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-ink), 0.05);
  --shadow: 0 1px 2px rgba(var(--shadow-ink), 0.04), 0 12px 30px -16px rgba(var(--shadow-ink), 0.16);
  --shadow-lg: 0 2px 4px rgba(var(--shadow-ink), 0.05), 0 24px 52px -22px rgba(var(--shadow-ink), 0.24);
  --glow-gold: rgba(255, 182, 39, 0.17);
  --glow-blue: rgba(47, 75, 240, 0.08);
  --glow-green: rgba(31, 157, 107, 0.09);

  --radius-sm: 10px;
  --radius: 15px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121322;
  --surface: #1b1d31;
  --surface-2: #232641;
  --surface-3: #2f3252;
  --line: #2a2d47;
  --line-strong: #3c4063;

  --ink: #f4f0e7;
  --ink-2: #c5c6d8;
  --ink-3: #9093ad;

  --accent: #8196ff;
  --accent-hover: #96a8ff;
  --accent-bright: #98a9ff;
  --accent-soft: #262b5a;
  --accent-softer: #1d2145;
  --accent-line: #3e478f;
  --accent-ink: #b9c5ff;
  --on-accent: #10122a;

  --amber: #ffb627;
  --amber-deep: #ffcf73;
  --amber-soft: #382c12;
  --amber-line: #5b471b;
  --cream: #282319;

  --success: #3ecf8e;
  --success-soft: #153a2c;
  --success-line: #266049;
  --success-ink: #86e3ba;

  --highlight: #ff7c5c;
  --highlight-soft: #3e2019;
  --highlight-ink: #ffb09c;

  --mint-soft: #133936;
  --mint-ink: #7fe0d2;

  --glass: rgba(18, 19, 34, 0.84);
  --shadow-ink: 0, 0, 0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 32px -14px rgba(0, 0, 0, 0.62);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.38), 0 28px 60px -22px rgba(0, 0, 0, 0.82);
  --glow-gold: rgba(255, 182, 39, 0.08);
  --glow-blue: rgba(129, 150, 255, 0.11);
  --glow-green: rgba(62, 207, 142, 0.09);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 540px at 85% -80px, var(--glow-gold), transparent 65%),
    radial-gradient(760px 480px at 8% 120px, var(--glow-blue), transparent 65%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 66px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'SOFT' 70;
}

.brand-i {
  position: relative;
  display: inline-block;
}

.brand-i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.08em;
  width: 0.25em;
  height: 0.25em;
  border-radius: 50%;
  background: var(--amber);
  transform: translateX(-50%);
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.theme-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 4.4vw, 3.55rem);
  font-weight: 650;
  line-height: 1.09;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  font-variation-settings: 'SOFT' 65;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 28px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -10px rgba(47, 75, 240, 0.55);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}

.pillar strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 3px;
}

.pillar span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Hero visual card */
.hero-visual {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px 26px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--glow-gold), transparent 70%);
  pointer-events: none;
}

.mascot-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.briand-mark {
  filter: drop-shadow(0 14px 20px rgba(154, 85, 7, 0.18));
}

.briand-pupils {
  transform: translate(var(--look-x, 0px), var(--look-y, 0px));
  transition: transform 90ms linear;
}

.shield-stack {
  width: 100%;
  margin-top: 20px;
  display: grid;
  gap: 9px;
}

.shield-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.83rem;
}

.shield-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.shield-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-gold { background: var(--amber-soft); color: var(--amber-deep); border: 1px solid var(--amber-line); }
.badge-green { background: var(--success-soft); color: var(--success-ink); border: 1px solid var(--success-line); }
.badge-blue { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.badge-muted { background: var(--surface); color: var(--ink-3); border: 1px solid var(--line-strong); }
.badge-coral { background: var(--highlight-soft); color: var(--highlight-ink); }

/* ---------- Sections ---------- */

section {
  padding: 68px 0;
}

.section-band {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 680px;
  margin-bottom: 34px;
}

.section-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-variation-settings: 'SOFT' 60;
}

.section-head p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink-2);
}

/* ---------- Usefulness Bento ---------- */

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

.bento-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.bento-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.bento-icon.blue { background: var(--accent-soft); color: var(--accent-ink); }
.bento-icon.gold { background: var(--amber-soft); color: var(--amber-deep); }
.bento-icon.green { background: var(--success-soft); color: var(--success-ink); }
.bento-icon.coral { background: var(--highlight-soft); color: var(--highlight-ink); }

.bento-card h3 {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.015em;
}

.bento-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.bento-meta {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Interactive Architecture Diagram ---------- */

.arch-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.node-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-pill {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms var(--ease);
}

.node-pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.node-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px -8px rgba(47, 75, 240, 0.6);
}

.diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--ink-2);
}

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

.legend-line {
  width: 22px;
  height: 3px;
  border-radius: 3px;
}

.legend-line.e2ee { background: var(--accent); }
.legend-line.tee { background: var(--success); }
.legend-line.wallet { background: var(--amber); }

.arch-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.arch-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.arch-svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}

.arch-zone {
  rx: 18;
  transition: opacity 200ms var(--ease);
}

.arch-zone-user { fill: var(--cream); stroke: var(--amber-line); stroke-width: 1.5; }
.arch-zone-edge { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 6 5; }
.arch-zone-tee  { fill: var(--success-soft); stroke: var(--success-line); stroke-width: 1.8; }

.arch-zone-title {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.arch-wire {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0.42;
  transition: opacity 220ms var(--ease), stroke-width 220ms var(--ease);
}

.arch-wire.e2ee { stroke: var(--accent); stroke-dasharray: 7 5; animation: dashFlow 18s linear infinite; }
.arch-wire.tee { stroke: var(--success); stroke-dasharray: 9 4; animation: dashFlow 14s linear infinite; }
.arch-wire.wallet { stroke: var(--amber-deep); stroke-dasharray: 4 4; }
.arch-wire.active { opacity: 1; stroke-width: 3.3; }
.arch-wire.dim { opacity: 0.14; }

@keyframes dashFlow {
  to { stroke-dashoffset: -240; }
}

.arch-node {
  cursor: pointer;
  outline: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.arch-node:focus {
  outline: none;
}

.arch-node:focus-visible rect.node-card {
  stroke: var(--accent);
  stroke-width: 3;
}

section[id] {
  scroll-margin-top: 76px;
}

.arch-node rect.node-card {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.5;
  rx: 14;
  transition: stroke 180ms var(--ease), stroke-width 180ms var(--ease), filter 180ms var(--ease);
}

.arch-node:hover rect.node-card {
  stroke: var(--accent);
  stroke-width: 2;
}

.arch-node.active rect.node-card {
  stroke: var(--accent);
  stroke-width: 2.5;
  filter: drop-shadow(0 8px 16px rgba(47, 75, 240, 0.22));
}

.arch-node.tee-node.active rect.node-card {
  stroke: var(--success);
  filter: drop-shadow(0 8px 16px rgba(31, 157, 107, 0.22));
}

.arch-node.dim {
  opacity: 0.48;
}

.node-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 650;
  fill: var(--ink);
}

.node-sub {
  font-family: var(--font);
  font-size: 11.2px;
  fill: var(--ink-2);
}

.node-tag-bg-blue { fill: var(--accent-soft); }
.node-tag-bg-green { fill: var(--success-soft); }
.node-tag-bg-gold { fill: var(--amber-soft); }
.node-tag-bg-muted { fill: var(--surface-2); }

.node-tag-txt-blue { fill: var(--accent-ink); font-size: 10px; font-weight: 700; font-family: var(--mono); }
.node-tag-txt-green { fill: var(--success-ink); font-size: 10px; font-weight: 700; font-family: var(--mono); }
.node-tag-txt-gold { fill: var(--amber-deep); font-size: 10px; font-weight: 700; font-family: var(--mono); }
.node-tag-txt-muted { fill: var(--ink-3); font-size: 10px; font-weight: 700; font-family: var(--mono); }

/* Node Inspector */
.inspector {
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.inspector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.inspector h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  margin: 0;
}

.inspector p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.inspector-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
}

.inspector-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.inspector-box p {
  font-size: 0.86rem;
  color: var(--ink);
}

/* ---------- Interactive Workflows ---------- */

.flow-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.flow-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 150ms var(--ease);
}

.flow-tab:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.flow-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 22px -12px rgba(47, 75, 240, 0.7);
}

.flow-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.flow-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.flow-prompt {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 15px;
  border-radius: 14px;
  font-size: 0.88rem;
  color: var(--ink);
}

.flow-prompt strong {
  color: var(--accent);
}

.flow-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms var(--ease);
}

.flow-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.flow-btn.play-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
}

.flow-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  margin-bottom: 22px;
}

.flow-step {
  position: relative;
  text-align: left;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 15px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: all 180ms var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-step:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.flow-step.done {
  border-color: var(--success-line);
  background: var(--surface);
}

.flow-step.active {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 26px -14px rgba(47, 75, 240, 0.45);
  transform: translateY(-2px);
}

.step-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.flow-step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.flow-step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-actor {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.28;
}

.step-state-pill {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  width: fit-content;
}

.flow-detail {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.flow-detail h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.flow-detail p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.flow-wire-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
}

.flow-wire-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.83rem;
  padding: 5px 0;
}

.flow-wire-row + .flow-wire-row {
  border-top: 1px dashed var(--line);
}

.flow-wire-row span:first-child {
  color: var(--ink-3);
  font-weight: 600;
}

.flow-wire-row strong {
  color: var(--ink);
  text-align: right;
}

/* ---------- Enclave Lifecycle ---------- */

.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.life-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  position: relative;
}

.life-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.life-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.life-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* ---------- Visibility Matrix ---------- */

.matrix-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.matrix {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.matrix th,
.matrix td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.matrix thead th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  background: var(--surface-2);
}

.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix tbody td:first-child {
  font-weight: 700;
  color: var(--ink);
}

.matrix-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 2px;
}

.vis-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.vis-you { background: var(--amber-soft); color: var(--amber-deep); }
.vis-tee { background: var(--success-soft); color: var(--success-ink); }
.vis-enc { background: var(--accent-soft); color: var(--accent-ink); }
.vis-none { background: var(--surface-2); color: var(--ink-3); }
.vis-opt { background: var(--highlight-soft); color: var(--highlight-ink); }

.matrix-note {
  margin: 14px 4px 0;
  font-size: 0.84rem;
  color: var(--ink-3);
}

/* ---------- Verify Cards ---------- */

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

.verify-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.verify-num {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  color: var(--success-ink);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
}

.verify-card h3 {
  font-family: var(--font-display);
  font-size: 1.14rem;
  margin: 0 0 6px;
}

.verify-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 46px 0 56px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copy {
  font-size: 0.88rem;
  color: var(--ink-3);
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .inspector { grid-template-columns: 1fr; }
  .flow-track { grid-template-columns: 1fr; }
  .flow-detail { grid-template-columns: 1fr; }
  .lifecycle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero { padding: 44px 0 36px; }
  .hero-pillars { grid-template-columns: 1fr; }
  .bento-grid, .verify-grid, .lifecycle-grid { grid-template-columns: 1fr; }
  .arch-shell, .flow-stage { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .arch-wire { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
