/* ─── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #080808;
  --bg-2:     #0f0f0f;
  --bg-3:     #141414;
  --bg-4:     #1a1a1a;
  --surface:  #1e1e1e;
  --surface-2:#262626;
  --line:     rgba(255,255,255,0.07);
  --line-2:   rgba(255,255,255,0.12);

  --ink:      #e8e8e8;
  --ink-2:    #999;
  --ink-3:    #555;

  --green:    #3fb950;
  --blue:     #58a6ff;
  --purple:   #c084fc;
  --orange:   #f0883e;
  --red:      #f85149;
  --yellow:   #e3b341;
  --teal:     #39d4ce;

  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Menlo', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

h1,h2,h3,h4 { letter-spacing: -0.02em; line-height: 1.1; }
p { line-height: 1.7; }
a { color: var(--blue); text-decoration: none; }
code { font-family: var(--mono); font-size: 0.88em; color: var(--green); background: rgba(63,185,80,0.1); padding: 2px 6px; border-radius: 4px; }

/* ─── SCROLL REVEAL ────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ─── NAV ──────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,8,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1.5rem;
}
.nav-inner {
  width: min(1160px, 100%); margin-inline: auto;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo svg { display: block; }
.nav-links { display: flex; gap: 0.15rem; margin-left: auto; }
.nav-links a {
  padding: 0.4rem 0.8rem; border-radius: 6px;
  font-size: 0.84rem; font-weight: 500; color: var(--ink-2);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface); }
.nav-cta {
  padding: 0.44rem 1rem; border-radius: 6px;
  font-size: 0.84rem; font-weight: 600;
  color: var(--ink-2); border: 1px solid var(--line-2);
  transition: color 0.15s, border-color 0.15s;
}
.nav-cta:hover { color: var(--ink); border-color: var(--ink-3); }

/* ─── HERO ─────────────────────────────────────────────────────── */
.hero {
  width: min(1160px, calc(100% - 3rem));
  margin-inline: auto;
  padding: 5rem 0 4rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Terminal */
.hero-terminal {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  font-family: var(--mono);
}
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--bg-4);
  border-bottom: 1px solid var(--line);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.terminal-title { margin-left: 0.5rem; font-size: 0.78rem; color: var(--ink-3); }
.terminal-body { padding: 1.2rem 1.4rem; min-height: 180px; }
.t-line { font-size: 0.82rem; line-height: 1.9; white-space: pre; }
.t-prompt { color: var(--green); }
.t-cmd { color: var(--blue); }
.t-out { color: var(--ink-2); padding-left: 1rem; }
.t-cursor { color: var(--green); animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* Hero text */
.hero-text { }
.badge {
  display: inline-block; margin-bottom: 1rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--green);
  background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.2);
  padding: 4px 12px; border-radius: 4px;
}
.hero-text h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 800;
  margin-bottom: 1rem; color: var(--ink);
}
.hero-sub {
  color: var(--ink-2); font-size: 1rem; line-height: 1.7;
  margin-bottom: 1.5rem;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.meta-pill {
  font-family: var(--mono); font-size: 0.78rem;
  padding: 4px 10px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink-2);
}

/* ─── SECTION ──────────────────────────────────────────────────── */
.section {
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--line);
}
.section-dark { background: var(--bg-2); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800;
  margin-bottom: 0.5rem;
  width: min(1160px, 100%); margin-inline: auto;
}
.section-title { display: block; }
.section-sub {
  color: var(--ink-2); font-size: 1rem; margin-bottom: 2.5rem;
  width: min(1160px, 100%); margin-inline: auto; display: block;
}
.accent { color: var(--blue); }
.accent-red { color: var(--red); }

/* ─── TECH TABLE ───────────────────────────────────────────────── */
.table-wrap {
  width: min(1160px, 100%); margin-inline: auto;
  overflow-x: auto; border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
}
.tech-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
.tech-table th {
  background: var(--bg-4); padding: 0.75rem 1rem;
  text-align: left; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line-2);
}
.tech-table td {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tech-table tr:last-child td { border-bottom: none; }
.tech-table tr:hover td { background: var(--surface); }
.row-group td { padding: 0; }
.group-label {
  padding: 0.4rem 1rem !important;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--bg-3);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line) !important;
}
.mono { font-family: var(--mono); font-size: 0.84rem; color: var(--green); }

.badge-tech {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}
.badge-java    { background: rgba(88,166,255,0.12); color: var(--blue); }
.badge-kotlin  { background: rgba(192,132,252,0.12); color: var(--purple); }
.badge-angular { background: rgba(249,65,65,0.12); color: #f94141; }
.badge-ts      { background: rgba(88,166,255,0.12); color: var(--blue); }
.badge-lib     { background: rgba(240,136,62,0.12); color: var(--orange); }
.badge-db      { background: rgba(63,185,80,0.12); color: var(--green); }
.badge-cloud   { background: rgba(57,212,206,0.12); color: var(--teal); }

/* ─── ARCHITECTURE DIAGRAM ─────────────────────────────────────── */
.arch-diagram {
  width: min(1160px, 100%); margin-inline: auto;
  display: flex; align-items: stretch; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: 2.5rem;
}
.arch-col {
  flex: 1; padding: 1.5rem 1.2rem;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
}
.arch-col:last-child { border-right: none; }
.arch-header {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.8rem;
}
.arch-box {
  border-radius: var(--r-md); border: 1px solid var(--line-2);
  padding: 1rem;
}
.box-angular { border-color: rgba(249,65,65,0.3); background: rgba(249,65,65,0.05); }
.box-spring  { border-color: rgba(88,166,255,0.3); background: rgba(88,166,255,0.05); }
.box-kotlin  { border-color: rgba(192,132,252,0.3); background: rgba(192,132,252,0.05); }
.box-db      { border-color: rgba(63,185,80,0.3);  background: rgba(63,185,80,0.05); }
.box-ext     { border-color: rgba(240,136,62,0.3); background: rgba(240,136,62,0.05); }
.box-title { font-size: 0.84rem; font-weight: 700; margin-bottom: 0.5rem; }
.box-items { display: flex; flex-direction: column; gap: 3px; }
.box-items span { font-size: 0.78rem; color: var(--ink-2); }
.arch-tag { margin-top: auto; padding-top: 0.8rem; font-size: 0.72rem; color: var(--ink-3); font-family: var(--mono); }

.arch-arrows {
  display: flex; flex-direction: column; justify-content: center;
  gap: 1.5rem; padding: 0 0.6rem; flex-shrink: 0; width: 90px;
}
.arch-arrows-right { width: 90px; }
.arrow-block { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.arrow-label { font-size: 0.64rem; color: var(--ink-3); text-align: center; line-height: 1.2; }
.arrow-label.reverse { color: var(--ink-3); }
.arrow-line { display: flex; align-items: center; width: 100%; }
.arrow-shaft { flex: 1; height: 1px; background: var(--ink-3); }
.arrow-head { font-size: 0.7rem; color: var(--ink-3); }
.shaft-ws { background: var(--green); }
.head-ws { color: var(--green); }

/* Scheduler row */
.scheduler-row {
  width: min(1160px, 100%); margin-inline: auto;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 1.5rem;
}
.scheduler-title {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1rem;
}
.scheduler-steps {
  display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap;
}
.sched-step {
  flex: 1; min-width: 160px; padding: 0 1rem 0 0;
}
.sched-time {
  font-family: var(--mono); font-size: 0.78rem; color: var(--yellow);
  margin-bottom: 0.3rem;
}
.sched-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.sched-desc { font-size: 0.8rem; color: var(--ink-2); line-height: 1.45; }
.sched-manual .sched-time { color: var(--teal); }
.sched-arrow {
  padding: 0.5rem 0.5rem 0; font-size: 1.2rem; color: var(--ink-3); flex-shrink: 0;
}

/* ─── ALGORITHMS ───────────────────────────────────────────────── */
.algo-grid {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem; align-items: start;
}
.algo-card-wide { grid-column: 1; grid-row: span 2; }

.algo-card {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 1.6rem; overflow: hidden;
}
.algo-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.5rem; margin-bottom: 0.8rem; flex-wrap: wrap;
}
.algo-badge {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}
.badge-blue   { background: rgba(88,166,255,0.12); color: var(--blue); }
.badge-green  { background: rgba(63,185,80,0.12);  color: var(--green); }
.badge-purple { background: rgba(192,132,252,0.12); color: var(--purple); }
.algo-complexity { font-size: 0.72rem; color: var(--ink-3); font-family: var(--mono); }
.algo-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.algo-desc { font-size: 0.88rem; color: var(--ink-2); margin-bottom: 1.2rem; line-height: 1.6; }

/* Formula block */
.formula-block {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1rem; margin-bottom: 1.2rem;
}
.formula-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.7rem; }
.formula-row { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.4rem; font-size: 0.84rem; }
.f-label { font-family: var(--mono); color: var(--blue); min-width: 110px; flex-shrink: 0; }
.f-eq { color: var(--ink-3); }
.f-val { color: var(--ink-2); line-height: 1.5; }
.formula-divider { height: 1px; background: var(--line-2); margin: 0.6rem 0; }
.formula-final .f-label { color: var(--yellow); }
.formula-final .f-val { color: var(--ink); }

/* Code block */
.code-block {
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line-2); margin-bottom: 1rem;
}
.code-header {
  padding: 0.45rem 0.9rem; background: var(--bg-4);
  font-size: 0.72rem; color: var(--ink-3);
  border-bottom: 1px solid var(--line); font-family: var(--mono);
}
.code-block pre {
  padding: 1rem; font-family: var(--mono);
  font-size: 0.8rem; line-height: 1.7; color: var(--ink-2);
  overflow-x: auto; margin: 0;
  background: var(--bg-3);
}
.c-kw   { color: var(--purple); }
.c-fn   { color: var(--blue); }
.c-str  { color: var(--orange); }
.c-comment { color: var(--ink-3); }
.c-tag  { color: var(--blue); }

/* Mini table */
.mini-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem; margin-bottom: 1rem;
}
.mini-table th {
  text-align: left; padding: 0.3rem 0.5rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
}
.mini-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.mini-table tr:last-child td { border-bottom: none; }

/* Wyckoff phases */
.wyckoff-phases { display: flex; flex-direction: column; gap: 0.55rem; }
.phase { display: flex; gap: 0.7rem; align-items: flex-start; }
.phase-num {
  font-size: 0.9rem; color: var(--purple); flex-shrink: 0;
  width: 22px; text-align: center;
}
.phase-name { font-size: 0.84rem; font-weight: 600; margin-bottom: 1px; }
.phase-rule { font-size: 0.78rem; color: var(--ink-2); line-height: 1.45; }

/* ─── DATABASE ─────────────────────────────────────────────────── */
.db-grid {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem; margin-bottom: 2rem;
}
.db-domain {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 1.1rem;
}
.db-domain-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 0.6rem; }
.db-entities { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.entity-chip {
  font-family: var(--mono); font-size: 0.72rem;
  padding: 2px 7px; border-radius: 4px;
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--green);
}
.db-note { font-size: 0.76rem; color: var(--ink-3); line-height: 1.45; }

.sql-callout {
  width: min(1160px, 100%); margin-inline: auto;
}
.sql-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.7rem;
}

/* ─── PIPELINE ─────────────────────────────────────────────────── */
.pipeline-grid {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.pipeline-source {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden;
}
.source-header {
  padding: 0.65rem 1rem; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em;
}
.source-polygon { background: rgba(88,166,255,0.1); color: var(--blue); }
.source-yahoo   { background: rgba(240,136,62,0.1); color: var(--orange); }
.source-minio   { background: rgba(63,185,80,0.1); color: var(--green); }
.source-ai      { background: rgba(192,132,252,0.1); color: var(--purple); }
.source-endpoints { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.endpoint { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-2); line-height: 1.5; }
.ep-method {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-4); color: var(--yellow); margin-right: 4px;
}
.source-note { padding: 0 1rem 0.75rem; font-size: 0.76rem; color: var(--ink-3); line-height: 1.45; }

/* ─── WEBSOCKET ────────────────────────────────────────────────── */
.ws-layout {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: start;
}
.ws-diagram {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; min-width: 240px;
}
.ws-node {
  padding: 0.9rem 1.4rem; border-radius: var(--r-md);
  text-align: center; font-size: 0.84rem; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--surface);
  width: 100%;
}
.ws-sub { font-size: 0.72rem; color: var(--ink-3); font-family: var(--mono); font-weight: 400; }
.ws-client { border-color: rgba(249,65,65,0.3); }
.ws-broker { border-color: rgba(88,166,255,0.3); }
.ws-service { border-color: rgba(63,185,80,0.3); }
.ws-conn {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.3rem 0; width: 100%; gap: 2px;
}
.ws-conn-label { font-size: 0.68rem; color: var(--ink-3); font-family: var(--mono); }
.ws-conn-line { width: 1px; height: 18px; background: var(--line-2); }

.ws-details { }
.ws-notes { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.ws-note {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.65rem 0.9rem; border-radius: var(--r-sm);
  font-size: 0.84rem; line-height: 1.55;
}
.note-icon { flex-shrink: 0; font-size: 0.8rem; margin-top: 1px; }
.ws-note-ok   { background: rgba(63,185,80,0.06);  border: 1px solid rgba(63,185,80,0.15); color: var(--ink-2); }
.ws-note-warn { background: rgba(240,136,62,0.06); border: 1px solid rgba(240,136,62,0.15); color: var(--ink-2); }
.ws-note-ok .note-icon   { color: var(--green); }
.ws-note-warn .note-icon { color: var(--orange); }

/* ─── KOTLIN STRATEGY ──────────────────────────────────────────── */
.kotlin-grid {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1.5rem;
}
.kotlin-col {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 1.5rem;
}
.kotlin-header { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem; }
.kotlin-reason { font-size: 0.82rem; color: var(--ink-2); margin-bottom: 1rem; line-height: 1.55; }
.kotlin-files { display: flex; flex-direction: column; gap: 0.5rem; }
.kf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.kf:last-child { border-bottom: none; }
.kf-name { font-family: var(--mono); font-size: 0.78rem; color: var(--green); }
.kf-why { font-size: 0.74rem; color: var(--ink-3); text-align: right; }
.kotlin-config { width: min(1160px, 100%); margin-inline: auto; }

/* ─── TECH DEBT ────────────────────────────────────────────────── */
.debt-grid {
  width: min(1160px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.debt-card {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 1.4rem; border-left: 3px solid transparent;
}
.debt-high { border-left-color: var(--red);    background: rgba(248,81,73,0.04); }
.debt-med  { border-left-color: var(--orange); background: rgba(240,136,62,0.04); }
.debt-low  { border-left-color: var(--yellow); background: rgba(227,179,65,0.04); }
.debt-severity {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.45rem;
}
.debt-high .debt-severity { color: var(--red); }
.debt-med  .debt-severity { color: var(--orange); }
.debt-low  .debt-severity { color: var(--yellow); }
.debt-card h4 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.debt-card p { font-size: 0.84rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 0.75rem; }
.debt-fix {
  font-size: 0.8rem; color: var(--ink-3); padding: 0.5rem 0.75rem;
  background: var(--bg-3); border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.debt-fix::before { content: "→ "; color: var(--green); }

/* ─── FOOTER ───────────────────────────────────────────────────── */
.site-footer {
  padding: 2.5rem 1.5rem; border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer-inner {
  width: min(1160px, 100%); margin-inline: auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-sub { font-size: 0.78rem; color: var(--ink-3); margin-top: 0.3rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.84rem; color: var(--ink-3); transition: color 0.15s; }
.footer-links a:hover { color: var(--ink); }

/* ─── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .algo-grid { grid-template-columns: 1fr 1fr; }
  .algo-card-wide { grid-column: span 2; grid-row: auto; }
  .db-grid { grid-template-columns: repeat(2, 1fr); }
  .arch-diagram { flex-direction: column; }
  .arch-arrows, .arch-arrows-right { flex-direction: row; width: 100%; justify-content: center; padding: 0.5rem 0; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .pipeline-grid, .kotlin-grid { grid-template-columns: 1fr; }
  .ws-layout { grid-template-columns: 1fr; }
  .algo-grid { grid-template-columns: 1fr; }
  .algo-card-wide { grid-column: span 1; }
  .nav-links { display: none; }
  .debt-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .db-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

/* ─── AI INTEGRATION SECTION ─────────────────────────────────────── */
.ai-arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.ai-feature-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 28px;
}
.ai-feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 8px;
}
.ai-feature-header {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* Chat mockup */
.ai-mockup {
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 16px 0;
  font-size: 12px;
}
.aim-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.aim-icon { font-size: 14px; }
.aim-title { font-weight: 600; color: var(--ink); font-size: 13px; }
.aim-ticker {
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
}
.aim-close { margin-left: auto; color: var(--ink-3); cursor: pointer; font-size: 11px; }
.aim-messages { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.aim-msg {
  max-width: 90%;
  padding: 7px 10px;
  border-radius: 10px;
  line-height: 1.5;
  font-size: 11px;
}
.aim-user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.aim-ai {
  align-self: flex-start;
  background: var(--surface-2, #262626);
  color: var(--ink-2);
  border-bottom-left-radius: 3px;
}
.aim-attach-bar {
  padding: 4px 12px 8px;
  display: flex;
  gap: 6px;
}
.aim-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(88,166,255,0.12);
  color: var(--blue);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 10px;
}
.aim-input-row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  gap: 8px;
}
.aim-input {
  flex: 1;
  color: var(--ink-3);
  font-size: 11px;
}
.aim-send {
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
}

/* Detail rows */
.ai-details { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ai-detail-row { display: flex; gap: 12px; font-size: 12px; }
.ai-dt { color: var(--ink-3); flex-shrink: 0; width: 120px; padding-top: 1px; }
.ai-dv { color: var(--ink-2); line-height: 1.5; }
.ai-dv code { font-family: var(--mono); font-size: 11px; color: var(--orange); }

/* Provider architecture diagram */
.ai-provider-arch {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 28px;
}
.ai-pa-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 20px;
}
.ai-pa-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ai-pa-node {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 20px;
  min-width: 170px;
}
.ai-pa-app  { border-color: var(--blue);   background: rgba(88,166,255,0.06); }
.ai-pa-local{ border-color: var(--green);  background: rgba(63,185,80,0.06); }
.ai-pa-cloud{ border-color: var(--orange); background: rgba(240,136,62,0.06); }
.ai-pa-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.ai-pa-sub  { font-size: 11px; color: var(--ink-3); line-height: 1.5; font-family: var(--mono); }
.ai-pa-sub code { color: var(--orange); }
.ai-pa-arrow { font-size: 20px; color: var(--ink-3); }
.ai-pa-or   { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ai-pa-note { font-size: 12px; color: var(--ink-3); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 12px; }
.ai-pa-note code { font-family: var(--mono); font-size: 11px; color: var(--orange); }

@media (max-width: 900px) {
  .ai-arch-grid { grid-template-columns: 1fr; }
  .ai-pa-row { flex-direction: column; align-items: flex-start; }
}
