/* ─── Design Tokens ────────────────────────────────────────────────────── */
:root {
  --bg: #0a0f1e;
  --bg-alt: #0d1526;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-card: #ffffff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37,99,235,0.08);
  --accent-glow: rgba(37,99,235,0.25);
  --text: #0f172a;
  --text-light: #f8fafc;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-light: rgba(255,255,255,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px -4px rgba(15,23,42,0.1);
  --shadow-md: 0 4px 24px -6px rgba(15,23,42,0.14);
  --shadow-lg: 0 12px 40px -8px rgba(15,23,42,0.18);
  --shadow-xl: 0 24px 64px -16px rgba(15,23,42,0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background-color: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1,h2,h3,h4 { margin: 0; line-height: 1.2; font-weight: 700; }

/* ─── Utilities ────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}

.section {
  padding: 6rem min(7vw, 4.5rem);
  background-color: var(--surface);
  scroll-margin-top: var(--nav-h);
}

.section.alt {
  background-color: var(--surface-alt);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.section-head h2 {
  margin: 0.65rem 0 0.85rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-lede {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn:hover, .btn:focus-visible {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px var(--accent-glow);
}

.btn:active { transform: translateY(0); }

.btn.ghost {
  background-color: transparent;
  color: var(--text-light);
  border-color: rgba(248,250,252,0.3);
}

.btn.ghost:hover {
  background-color: rgba(248,250,252,0.1);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-lg { padding: 0.9rem 2.2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Ghost on light backgrounds */
.btn.ghost-dark {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn.ghost-dark:hover {
  background: var(--surface-alt);
  box-shadow: none;
  transform: translateY(-1px);
}

/* Hero buttons */
.btn-hero {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  border: 2px solid transparent;
  box-shadow: 0 4px 24px -8px rgba(255,255,255,0.4);
}

.btn-hero:hover {
  background: #f0f5ff;
  color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px -8px rgba(255,255,255,0.5);
}

.btn-hero-ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(248,250,252,0.92);
  border: 2px solid rgba(255,255,255,0.22);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-hero-ghost:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
}

/* ─── Sticky Nav ───────────────────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 min(6vw, 4rem);
  gap: 1.5rem;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s;
}

.top-nav.scrolled {
  background: rgba(10, 15, 30, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(37,99,235,0.5);
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: rgba(248,250,252,0.72);
  transition: background-color 0.18s, color 0.18s;
}

.nav-links a:hover, .nav-links a:focus {
  background-color: rgba(248,250,252,0.1);
  color: var(--text-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-btn {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

#user-button { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid rgba(248,250,252,0.25);
  border-radius: var(--radius-xs);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  width: 40px;
  height: 38px;
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-light);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.site-header {
  position: relative;
  background: linear-gradient(160deg, #07111f 0%, #0d1f3c 45%, #0f2d5a 100%);
  color: var(--text-light);
  padding: 0 min(6vw, 4rem);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Mesh background grid */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Accent glow blob */
.site-header::after {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.hero-body {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-h) + 5rem);
  padding-bottom: 5rem;
  max-width: 800px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: #60a5fa;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0 0 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-copy .lede {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(248,250,252,0.75);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.25rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(248,250,252,0.5);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.12);
}

.hero-scroll-hint {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 2.5rem;
  color: rgba(248,250,252,0.35);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 2px solid rgba(248,250,252,0.3);
  border-bottom: 2px solid rgba(248,250,252,0.3);
  transform: rotate(45deg) translateY(-4px);
  animation: bounce-arrow 1.6s ease-in-out infinite;
}

@keyframes bounce-arrow {
  0%, 100% { transform: rotate(45deg) translateY(-4px); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(0); opacity: 0.9; }
}

/* ─── Strategy Map ─────────────────────────────────────────────────────── */
.strategy-map-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.diagram-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.diagram-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
  display: block;
  text-align: center;
  margin-bottom: 0.25rem;
}

.diagram-center-node { text-align: center; }

.diagram-ring {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

.diagram-support-row {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.diagram-advisor-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--surface-alt);
  border: 2px solid var(--node-color, var(--border));
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  min-width: 88px;
  text-align: center;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
}

.diagram-advisor-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--node-color, #2563eb) 40%, transparent);
}

.node-icon { font-size: 1.35rem; }
.node-name { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.node-area { font-size: 0.65rem; color: var(--muted); font-weight: 500; }

.strategy-table-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.advisor-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  max-width: 1080px;
  margin: 0 auto;
}

.advisor-row-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--advisor-accent, var(--border));
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
}

.advisor-row-item:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

.advisor-row-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.advisor-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.advisor-row-info strong {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 700;
}

.advisor-row-info span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.advisor-row-info p {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* ─── Six Simple Machines ──────────────────────────────────────────────── */
.machines-sequence {
  margin-bottom: 2.5rem;
}

.sequence-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: var(--accent-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sequence-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface-card);
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sequence-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sequence-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.sequence-arrow {
  font-size: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
}

.machines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.machine-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.machine-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.machine-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.machine-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.machine-num {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
}

.machine-name {
  font-size: 1.15rem;
  margin-top: 0.15rem;
}

.machine-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.machine-purpose {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.machine-question {
  background: var(--surface-alt);
  border-radius: var(--radius-xs);
  padding: 0.75rem 1rem;
}

.machine-question strong,
.machine-metrics strong,
.machine-failure strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.machine-question p,
.machine-failure p {
  font-size: 0.9rem;
  color: var(--text);
  font-style: italic;
}

.metric-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.metric-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

.machine-failure {
  background: #fef2f2;
  border-radius: var(--radius-xs);
  padding: 0.75rem 1rem;
  border-left: 3px solid #ef4444;
}

.machine-failure strong {
  color: #dc2626;
}

.machine-rule {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

@media (max-width: 768px) {
  .machines-grid {
    grid-template-columns: 1fr;
  }
  .sequence-flow {
    gap: 0.35rem;
  }
  .sequence-step {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }
  .sequence-arrow {
    font-size: 1rem;
  }
}

/* ─── Decision Console ─────────────────────────────────────────────────── */
.decision-console {
  display: grid;
  grid-template-columns: 58% 1fr;
  gap: 1.75rem;
  align-items: start;
}

.situation-panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.panel-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

/* Step indicator numbers */
.panel-heading .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.decision-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.decision-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s, transform 0.15s;
  font-family: inherit;
}

.decision-btn:hover, .decision-btn:focus-visible {
  border-color: var(--accent);
  background-color: var(--accent-light);
  box-shadow: 0 4px 16px -6px var(--accent-glow);
  transform: translateY(-2px);
  outline: none;
}

.decision-btn-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

.decision-btn-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.decision-btn-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.step-back-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.btn-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.routing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.2);
}

.routing-badge::before {
  content: '→';
  opacity: 0.7;
}

.form-field {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.87rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

textarea, input[type="text"] {
  width: 100%;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
  line-height: 1.55;
}

textarea { resize: vertical; min-height: 96px; }

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-actions { margin-top: 1.5rem; }

/* ─── Advisor Panel (Right) ────────────────────────────────────────────── */
.advisor-panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.advisor-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.advisor-mini-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-xs);
  border: 1.5px solid transparent;
  background: var(--surface-alt);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.advisor-mini-card.active {
  border-color: var(--advisor-color, var(--accent));
  background-color: color-mix(in srgb, var(--advisor-color, var(--accent)) 7%, white);
  box-shadow: 0 2px 12px -4px color-mix(in srgb, var(--advisor-color, var(--accent)) 30%, transparent);
  transform: translateX(3px);
}

.advisor-mini-icon { font-size: 1.2rem; flex-shrink: 0; }

.advisor-mini-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.advisor-mini-info strong {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 700;
}

.advisor-mini-info span {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ─── Auth Gate ────────────────────────────────────────────────────────── */
.auth-gate-card {
  border: 1px solid var(--border);
  padding: 3.5rem 2rem;
  border-radius: var(--radius);
  background-color: var(--surface-card);
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.auth-gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}

.auth-gate-content h3 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-gate-content p {
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

#gemini-sign-in { display: flex; justify-content: center; }

.auth-gate-content .loading-spinner { margin: 0 auto 1rem; }
.checking-msg { color: var(--muted); }

/* ─── Subscribe Gate ───────────────────────────────────────────────────── */
.subscribe-gate { max-width: 560px; }

.subscribe-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1rem;
}

.subscribe-price {
  margin-bottom: 0.5rem !important;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
}

.price-amount {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.subscribe-perks {
  text-align: left;
  max-width: 340px;
  margin: 1.25rem auto 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.subscribe-perks li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text);
  font-size: 0.92rem;
}

.subscribe-perks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.coupon-row {
  max-width: 340px;
  margin: 0 auto 1.25rem;
  text-align: left;
}

.coupon-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

#coupon-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
}

#coupon-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.subscribe-note {
  margin-top: 1rem !important;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.1em;
}

.subscribe-note.error { color: #dc2626; }

/* ─── Response Section ─────────────────────────────────────────────────── */
.response-section { scroll-margin-top: calc(var(--nav-h) + 1rem); }

.response-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.response-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #60a5fa, #a78bfa);
}

.response-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  justify-content: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.response-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.response-block {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: start;
}

.response-block:first-child { padding-top: 0.5rem; }
.response-block:last-child { border-bottom: none; padding-bottom: 0.5rem; }

.response-block-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
  padding-top: 0.2rem;
}

.response-block p, .response-block ul {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

.response-block ul {
  padding-left: 1.2rem;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Confidence Bar */
.confidence-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
}

.confidence-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.confidence-bar-track {
  flex: 1;
  min-width: 140px;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

.confidence-pct {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--accent);
  min-width: 38px;
}

/* Raw Response Block */
.console-output {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-height: 320px;
  overflow-y: auto;
}

.console-output pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Fira Code", monospace;
  line-height: 1.65;
}

.response-error { padding: 2rem; text-align: center; }
.error-msg {
  color: #dc2626;
  font-size: 0.92rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-xs);
  padding: 0.75rem 1rem;
  display: inline-block;
}

/* ─── Conversation Thread ──────────────────────────────────────────────── */
.conversation-thread {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.thread-heading {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.thread-messages {
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thread-msg {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.thread-msg-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.thread-msg-user .thread-msg-role { color: var(--accent); }

.thread-msg-content {
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.thread-msg-user .thread-msg-content {
  background: var(--accent-light);
  border: 1px solid rgba(37,99,235,0.12);
}

.thread-msg-assistant .thread-msg-content {
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.thread-msg-content p { margin-bottom: 0.5rem; }
.thread-msg-content p:last-child { margin-bottom: 0; }
.thread-msg-content ul { padding-left: 1.25rem; margin: 0.5rem 0; list-style: disc; }
.thread-msg-content li { margin-bottom: 0.25rem; }

/* ─── Follow-Up Form ──────────────────────────────────────────────────── */
.follow-up-form {
  margin-top: 1.5rem;
}

.follow-up-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.follow-up-row textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 56px;
  max-height: 200px;
  line-height: 1.5;
}

.follow-up-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.follow-up-row .btn {
  flex-shrink: 0;
  height: 44px;
}

@media (max-width: 768px) {
  .follow-up-row {
    flex-direction: column;
    align-items: stretch;
  }
  .thread-messages {
    max-height: 360px;
  }
}

.response-actions {
  text-align: center;
  margin-top: 2rem;
}

/* ─── Example Briefs ───────────────────────────────────────────────────── */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.example-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.example-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.example-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.example-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.example-advisor {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.example-situation {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.65;
}

.example-question {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.example-question strong { color: var(--text); }

/* ─── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(160deg, var(--bg) 0%, #0d1f3c 100%);
  color: var(--text-light);
  padding: 4rem min(6vw, 4rem) 3rem;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.footer-content {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  align-items: start;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-desc {
  color: rgba(248,250,252,0.5);
  font-size: 0.87rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.footer-actions .btn {
  background-color: var(--accent);
  color: #fff;
  font-size: 0.88rem;
}

.footer-actions .btn:hover {
  background-color: var(--accent-hover);
}

.footer-actions .btn.ghost {
  border-color: rgba(248,250,252,0.25);
  color: var(--text-light);
  background: transparent;
}

.footer-actions .btn.ghost:hover {
  background-color: rgba(248,250,252,0.08);
  box-shadow: none;
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(248,250,252,0.3);
}

/* ─── Auth Modal ───────────────────────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 17, 31, 0.8);
  backdrop-filter: blur(8px);
}

.auth-modal-content {
  position: relative;
  z-index: 1;
  background-color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px -16px rgba(0,0,0,0.4);
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background-color 0.18s;
}

.auth-modal-close:hover { background: rgba(0,0,0,0.1); }
#sign-in-mount { min-height: 300px; }

/* ─── Scroll-in Animations ─────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-head,
.decision-console,
.advisor-table-grid,
.examples-grid,
.auth-gate-card {
  animation: fade-up 0.5s ease both;
}

/* ─── Tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .strategy-map-layout {
    grid-template-columns: 1fr;
  }

  .decision-console {
    grid-template-columns: 1fr;
  }

  .advisor-panel {
    position: static;
    order: -1;
  }

  .advisor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  .advisor-mini-card {
    flex-direction: column;
    text-align: center;
    padding: 0.7rem;
    gap: 0.3rem;
  }

  .advisor-mini-card.active {
    transform: translateY(-2px);
  }

  .response-block {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-right { align-items: flex-start; }
  .footer-actions { justify-content: flex-start; }
}

/* ─── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(7, 17, 31, 0.98);
    backdrop-filter: blur(20px);
    padding: 1.25rem min(6vw, 1.5rem);
    flex-direction: column;
    gap: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 99;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border-radius: var(--radius-xs);
  }

  .brand-name { display: none; }

  .hero-copy h1 { font-size: 2.1rem; }
  .hero-stats { gap: 1rem; }
  .hero-stat-divider { display: none; }
  .hero-scroll-hint { display: none; }

  .section { padding: 4rem min(5vw, 1.5rem); }

  .decision-buttons {
    grid-template-columns: 1fr;
  }

  .situation-panel { padding: 1.25rem; }
  .advisor-panel { padding: 1.25rem; }
  .response-card { padding: 1.5rem; }

  .auth-modal-content { padding: 1.5rem; width: 95%; }
  .auth-gate-card { padding: 2.25rem 1.25rem; }

  .confidence-display { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .confidence-bar-track { width: 100%; min-width: unset; }

  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .hero-badge { font-size: 0.68rem; }
}
