:root {
  /* Warm Editorial Paper & Deep Ink (Default Light Theme) */
  --bg-canvas: #f6f3ec;
  --bg-grid: rgba(22, 24, 29, 0.045);
  --bg-surface: #fdfcf9;
  --bg-surface-alt: #f0ece3;
  --bg-elevated: #ffffff;
  --border: #dfd8ca;
  --border-strong: #bfb5a2;

  --ink-primary: #15181e;
  --ink-secondary: #434957;
  --ink-muted: #5d6473;

  --accent: #1c5b8c;
  --accent-hover: #14466d;
  --accent-soft: rgba(28, 91, 140, 0.09);
  --accent-ring: rgba(28, 91, 140, 0.35);

  --warm: #a65814;
  --warm-soft: rgba(166, 88, 20, 0.11);
  --sage: #1f6b53;
  --sage-soft: rgba(31, 107, 83, 0.11);
  --rose: #9f2c3f;
  --rose-soft: rgba(159, 44, 63, 0.1);

  --redact-bg: #1e232c;
  --redact-text: #f6f3ec;

  --shadow-card: 0 1px 2px rgba(21, 24, 30, 0.04), 0 10px 28px -18px rgba(21, 24, 30, 0.14);
  --shadow-hover: 0 8px 30px -14px rgba(21, 24, 30, 0.22);

  --font-display: "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --nav-h: 68px;
}

[data-theme="dark"] {
  /* Nocturnal Observatory Ink (Toggleable Dark Theme) */
  --bg-canvas: #0d1118;
  --bg-grid: rgba(241, 239, 234, 0.04);
  --bg-surface: #131924;
  --bg-surface-alt: #192130;
  --bg-elevated: #1b2434;
  --border: #273247;
  --border-strong: #3b4a66;

  --ink-primary: #f2efe9;
  --ink-secondary: #c5cbd8;
  --ink-muted: #98a2b3;

  --accent: #74bdf5;
  --accent-hover: #9bd1fa;
  --accent-soft: rgba(116, 189, 245, 0.13);
  --accent-ring: rgba(116, 189, 245, 0.45);

  --warm: #e8b366;
  --warm-soft: rgba(232, 179, 102, 0.15);
  --sage: #6ad3ae;
  --sage-soft: rgba(106, 211, 174, 0.14);
  --rose: #f28d9f;
  --rose-soft: rgba(242, 141, 159, 0.14);

  --redact-bg: #2e384b;
  --redact-text: #dbe4f2;

  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 14px 36px -14px rgba(0, 0, 0, 0.55);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  background-image:
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

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

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

.container {
  width: min(1220px, calc(100% - 48px));
  margin-inline: auto;
}

/* === Top Editorial Navigation === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg-canvas) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink-primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

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

.lang-btn {
  gap: 5px;
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.lang-opt {
  color: var(--ink-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

.lang-opt.active {
  color: var(--accent);
  font-weight: 700;
}

.lang-sep {
  color: var(--border-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn-sm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 13px;
}

.btn-primary {
  background: var(--ink-primary);
  color: var(--bg-canvas);
}

.btn-primary:hover {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
  color: #0b1018;
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

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

/* === Section Framing === */
.section {
  padding: 84px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--accent);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.section-lead {
  max-width: 520px;
  margin: 0;
  color: var(--ink-secondary);
  font-size: 15px;
}

/* === Hero === */
.hero {
  padding: 64px 0 84px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.96fr);
  gap: 48px;
  align-items: center;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-size: clamp(42px, 5.4vw, 68px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-title .latin-serif {
  display: block;
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.78em;
  margin-bottom: 4px;
}

.hero-desc {
  margin: 0 0 28px;
  max-width: 540px;
  font-size: 16.5px;
  color: var(--ink-secondary);
  line-height: 1.8;
}

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

.spec-ruler {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 75%, transparent);
}

.spec-cell {
  padding: 14px 12px;
  border-right: 1px solid var(--border);
}

.spec-cell:last-child {
  border-right: none;
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
  display: block;
}

.spec-label {
  font-size: 12px;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

.hero-plate {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.plate-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding: 0 4px 10px;
  letter-spacing: 0.06em;
}

.plate-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  background: var(--bg-surface-alt);
}

.plate-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 50%;
  display: block;
}

.plate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px 2px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.plate-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--sage);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px var(--sage-soft);
}

/* === Section 02: Archify Interactive Architecture Stage === */
.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.scenario-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: all 0.18s ease;
}

.scenario-tab .tab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.72;
}

.scenario-tab:hover {
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.scenario-tab[aria-selected="true"] {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--bg-canvas);
}

.archify-shell {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.archify-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.archify-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.mono-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.mono-badge.warm {
  background: var(--warm-soft);
  color: var(--warm);
}

.mono-badge.sage {
  background: var(--sage-soft);
  color: var(--sage);
}

.archify-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  transition: all 0.16s ease;
}

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

.ctrl-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .ctrl-btn.active {
  color: #0b1018;
}

.archify-stage {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

.story-rail {
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: color-mix(in srgb, var(--bg-surface-alt) 45%, var(--bg-surface));
}

.story-step {
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.story-step:hover {
  background: var(--bg-surface);
  border-color: var(--border);
}

.story-step.active {
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 4px 16px -10px var(--accent-ring);
}

.story-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.story-step-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.story-step-latency {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}

.story-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 4px;
}

.story-step-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
  margin: 0;
}

.diagram-wrap {
  position: relative;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
}

.diagram-svg {
  width: 100%;
  min-width: 680px;
  height: auto;
  display: block;
  overflow: visible;
}

.arch-edge {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.8;
  transition: stroke 0.25s ease, opacity 0.25s ease, stroke-width 0.25s ease;
}

.arch-edge.dimmed {
  opacity: 0.24;
}

.arch-edge.active {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  animation: flowDash 1.1s linear infinite;
}

.arch-edge.active-warm {
  stroke: var(--warm);
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  animation: flowDash 1.1s linear infinite;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: -28;
  }
}

.arch-node {
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.arch-node.dimmed {
  opacity: 0.34;
}

.arch-node rect.node-box {
  fill: var(--bg-surface);
  stroke: var(--border-strong);
  stroke-width: 1.4;
  rx: 12;
  transition: stroke 0.2s ease, fill 0.2s ease, stroke-width 0.2s ease;
}

.arch-node:hover rect.node-box {
  stroke: var(--accent);
}

.arch-node.active rect.node-box {
  stroke: var(--accent);
  stroke-width: 2.2;
  fill: var(--bg-elevated);
}

.arch-node.selected rect.node-box {
  stroke: var(--warm);
  stroke-width: 2.4;
}

.arch-node text.node-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--accent);
  font-weight: 600;
}

.arch-node text.node-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  fill: var(--ink-primary);
}

.arch-node text.node-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--ink-muted);
}

.arch-node rect.src-pill {
  fill: var(--warm-soft);
  rx: 5;
}

.arch-node text.src-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--warm);
}

.edge-label-bg {
  fill: var(--bg-surface);
  stroke: var(--border);
  stroke-width: 1;
  rx: 5;
}

.edge-label-text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--ink-secondary);
}

/* Archify Node Inspector Bar */
.node-inspector {
  border-top: 1px solid var(--border);
  padding: 16px 22px;
  background: var(--bg-surface-alt);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

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

.inspector-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.inspector-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.src-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-primary);
  transition: border-color 0.16s ease, color 0.16s ease;
}

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

/* === Section 03: Coded Interactive Product Showcase === */
.showcase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.showcase-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.18s ease;
}

.showcase-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.showcase-panel {
  display: none;
}

.showcase-panel.active {
  display: block;
}

/* Privacy Redaction Pill */
.redact {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  margin: 0 2px;
  border-radius: 4px;
  background: var(--redact-bg);
  color: var(--redact-text);
  font-family: var(--font-mono);
  font-size: 0.84em;
  letter-spacing: 0.08em;
  vertical-align: baseline;
  user-select: none;
}

/* Mock App Window Frame */
.mock-window {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.mock-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.chrome-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chrome-dots {
  display: inline-flex;
  gap: 6px;
}

.chrome-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.chrome-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.chrome-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.sub-switch {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  gap: 3px;
}

.sub-switch button {
  min-height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.sub-switch button.active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
}

/* Chat Simulator */
.chat-body {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 940px;
  margin-inline: auto;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-bubble {
  max-width: 78%;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-size: 14.5px;
  line-height: 1.78;
}

.chat-bubble p {
  margin: 0 0 10px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-row.user .chat-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

[data-theme="dark"] .chat-row.user .chat-bubble {
  color: #0b111b;
  font-weight: 500;
}

.chat-row.bot .chat-bubble {
  border-top-left-radius: 4px;
}

.mode-callout {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px dashed var(--warm);
  background: var(--warm-soft);
  color: var(--warm);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.chat-time {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* Interactive Voice Message Bubble */
.voice-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 82%;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: transform 0.15s ease, box-shadow 0.18s ease;
}

[data-theme="dark"] .voice-btn {
  color: #0b111b;
}

.voice-btn:hover {
  box-shadow: 0 8px 22px -10px var(--accent-ring);
}

.waveform {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.waveform span {
  width: 3px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.78;
  transition: height 0.2s ease;
}

.waveform span:nth-child(1) { height: 7px; }
.waveform span:nth-child(2) { height: 14px; }
.waveform span:nth-child(3) { height: 18px; }
.waveform span:nth-child(4) { height: 10px; }
.waveform span:nth-child(5) { height: 16px; }
.waveform span:nth-child(6) { height: 8px; }
.waveform span:nth-child(7) { height: 19px; }
.waveform span:nth-child(8) { height: 12px; }
.waveform span:nth-child(9) { height: 15px; }
.waveform span:nth-child(10) { height: 9px; }

.voice-btn.playing .waveform span {
  animation: waveBounce 0.75s ease-in-out infinite alternate;
}

.voice-btn.playing .waveform span:nth-child(odd) {
  animation-delay: 0.18s;
}

.voice-btn.playing .waveform span:nth-child(3n) {
  animation-delay: 0.34s;
}

@keyframes waveBounce {
  0% { transform: scaleY(0.45); opacity: 0.6; }
  100% { transform: scaleY(1.15); opacity: 1; }
}

.voice-hint-label {
  font-size: 11px;
  opacity: 0.88;
}

.asr-linked-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.chat-row.bot.asr-linked .chat-bubble {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-soft);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.asr-trace {
  width: min(520px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface-alt);
  padding: 12px 14px;
  font-size: 13px;
  transition: opacity 0.25s ease;
}

.asr-trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 6px;
}

.asr-trace-text {
  margin: 0;
  color: var(--ink-primary);
}

.vision-card-img {
  width: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.vision-card-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

/* Memory RAG Explorer */
.memory-explorer {
  padding: 24px 26px;
}

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

.rag-search-wrap {
  position: relative;
  flex: 1 1 300px;
  max-width: 440px;
}

.rag-search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 13px;
}

.rag-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-secondary);
}

.chip-btn.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--bg-canvas);
}

.quick-queries {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

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

.quick-pill {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
}

.quick-pill:hover {
  background: var(--accent-soft);
}

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

.memory-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.memory-card.matched {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -14px var(--accent-ring);
}

.memory-card.muted {
  opacity: 0.42;
}

.memory-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.star-tier {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--warm);
  font-weight: 600;
}

.memory-content {
  margin: 0;
  font-size: 14px;
  color: var(--ink-primary);
  line-height: 1.72;
}

.memory-feeling {
  margin: 0;
  padding: 10px 12px;
  border-left: 2.5px solid var(--accent);
  background: var(--bg-surface-alt);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.mem-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.mem-tag.hit {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Email Simulator */
.mail-shell {
  padding: 24px 28px;
}

.mail-header {
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.mail-subject {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.mail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.mail-summary {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-primary);
  margin-bottom: 20px;
}

.mail-none-banner {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--warm);
  background: var(--warm-soft);
  margin-bottom: 20px;
}

.mail-none-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mail-none-title {
  margin: 0;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-primary);
}

.mail-none-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink-secondary);
}

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

.deal-item {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deal-item.filtered {
  border-style: dashed;
  opacity: 0.85;
}

.deal-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.deal-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* === Section 04: 1GB VPS Footprint & Command Console === */
.eng-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 24px;
  align-items: stretch;
}

.eng-card,
.cmd-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.eng-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.eng-card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.eng-card-desc {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.68;
}

.ram-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.ram-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.ram-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.ram-val.accent { color: var(--accent); }
.ram-val.sage { color: var(--sage); }
.ram-val.warm { color: var(--warm); }

.ram-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ram-track.dashed {
  border-style: dashed;
  border-color: var(--warm);
  background: var(--warm-soft);
}

.ram-fill {
  height: 100%;
  border-radius: 999px;
}

.ram-fill.accent { background: var(--accent); }
.ram-fill.sage { background: var(--sage); }
.ram-fill.muted { background: var(--border-strong); opacity: 0.72; }
.ram-fill.warm {
  background: repeating-linear-gradient(
    -45deg,
    var(--warm),
    var(--warm) 8px,
    color-mix(in srgb, var(--warm) 65%, transparent) 8px,
    color-mix(in srgb, var(--warm) 65%, transparent) 16px
  );
}

.ram-divider {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.guard-box {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.guard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

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

.guard-cell {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-align: center;
}

.guard-cell strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 3px;
}

.guard-cell span {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* Command Console */
.cmd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cmd-pill {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.16s ease;
}

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

.cmd-pill[aria-selected="true"] {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--bg-canvas);
}

.cmd-console {
  margin-top: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cmd-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.cmd-console-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cmd-syntax {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.cmd-console-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-console-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmd-explain {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.cmd-sim-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.cmd-prompt {
  opacity: 0.7;
}

.cmd-sim-output {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.cmd-out-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.cmd-out-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--ink-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* === Section 05: Quick Deploy === */
.deploy-shell {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.deploy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.deploy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deploy-tab {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.deploy-tab[aria-selected="true"] {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--bg-canvas);
}

.deploy-body {
  padding: 22px 24px;
}

.code-block {
  margin: 0;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.72;
  color: var(--ink-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.deploy-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

/* === Section 06: Open Source & Contact === */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
}

.repo-card,
.contact-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.repo-card h3,
.contact-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.repo-card p,
.contact-card > p {
  margin: 0 0 22px;
  color: var(--ink-secondary);
  font-size: 14.5px;
}

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

.repo-link-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.repo-link-tile:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface-alt);
}

.contact-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-label {
  display: block;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

.contact-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 42px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

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

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 140;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink-primary);
  color: var(--bg-canvas);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-grid,
  .archify-stage,
  .eng-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .story-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 28px);
  }

  .nav-links {
    display: none;
  }

  .section {
    padding: 56px 0;
  }

  .spec-ruler {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-cell:nth-child(2) {
    border-right: none;
  }

  .spec-cell:nth-child(1),
  .spec-cell:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .chat-body,
  .memory-explorer,
  .mail-shell {
    padding: 18px 14px;
  }

  .eng-card,
  .cmd-card {
    padding: 20px 16px;
  }

  .guard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-bubble {
    max-width: 90%;
  }

  .deal-list,
  .repo-links {
    grid-template-columns: 1fr;
  }

  .node-inspector {
    grid-template-columns: 1fr;
  }

  .contact-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-tag {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-actions {
    gap: 6px;
  }

  #themeLabel {
    display: none;
  }

  #themeToggle {
    padding: 0 10px;
  }

  .btn-sm {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .arch-edge.active,
  .arch-edge.active-warm,
  .voice-btn.playing .waveform span {
    animation: none;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
