/* ─── Landing page — dark tech-professional theme ─── */

/* ─── Reset & base (standalone — no base.css on landing) ─── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  font-size: 15px;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
img { display: block; max-width: 100%; }

/* ─── Tokens ─── */

:root {
  --landing-max-w: 1120px;
  --section-py: var(--section-gap, 96px);
  --radius-card: 12px;
  --radius-pill: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Shared layout ─── */

.section-inner {
  max-width: var(--landing-max-w);
  margin: 0 auto;
  padding: 0 var(--space-6, 24px);
}

.section-title {
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
  margin-bottom: 40px;
}

/* ─── Header ─── */

header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
  background: var(--glass-bg-strong);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-logo-img {
  border-radius: 6px;
}

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

.nav-link-text {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2, var(--color-text));
  transition: color 0.15s;
  border-radius: var(--radius-pill);
}

.nav-link-text:hover {
  color: var(--color-primary);
}

/* ─── Buttons ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transition: transform 0.15s var(--ease-spring), box-shadow 0.2s, filter 0.15s;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 20px oklch(from var(--color-primary) l c h / 0.3);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: 10px;
}

.btn-nav {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-cta-inverse {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  font-weight: 700;
}

.btn-cta-inverse:hover {
  filter: brightness(0.96);
  box-shadow: var(--shadow-md);
}

/* ─── HERO ─── */

section.hero {
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 64px 48px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 20% 50%, oklch(from var(--color-text) l c h / 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 80% 30%, oklch(from var(--color-text) l c h / 0.03) 0%, transparent 70%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: oklch(from var(--color-primary) l c h / 0.1);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.2);
  margin-bottom: 20px;
}

.hero-content h1 {
  font-size: clamp(30px, 4.5vw, 52px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 20px 0;
  color: var(--color-text);
}

/* Monochrome gradient: text → muted. The old amber-to-gold ramp was the single
   most saturated element on the page. */
.text-gradient {
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 28px 0;
  color: var(--color-text-2, var(--color-text));
  max-width: 520px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-proof {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.proof-item svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ─── Hero graph visualization ─── */

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-canvas {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 8px 12px;
  box-shadow:
    0 0 80px -20px oklch(from var(--color-primary) l c h / 0.08),
    0 24px 60px -20px oklch(0 0 0 / 0.4);
}

.graph-svg {
  width: 100%;
  height: auto;
}

.graph-svg text {
  font-family: var(--font-sans, system-ui, sans-serif);
  pointer-events: none;
}

.graph-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-bg);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.3);
}

/* Edge draw animation */
.edge-anim {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: draw-edge 1.2s var(--ease-out) forwards;
}
.edge-d1 { animation-delay: 0.2s; }
.edge-d2 { animation-delay: 0.35s; }
.edge-d3 { animation-delay: 0.6s; }
.edge-d4 { animation-delay: 0.7s; }
.edge-d5 { animation-delay: 0.65s; }
.edge-d6 { animation-delay: 0.75s; }
.edge-d7 { animation-delay: 1.0s; }
.edge-d8 { animation-delay: 1.05s; }

@keyframes draw-edge {
  to { stroke-dashoffset: 0; }
}

/* Node entrance */
.graph-nodes .node {
  opacity: 0;
  animation: node-appear 0.5s var(--ease-spring) forwards;
}
.node-root { animation-delay: 0.1s !important; }
.node-agent:nth-child(2) { animation-delay: 0.4s !important; }
.node-agent:nth-child(3) { animation-delay: 0.55s !important; }
.node-leaf:nth-child(4) { animation-delay: 0.8s !important; }
.node-leaf:nth-child(5) { animation-delay: 0.85s !important; }
.node-leaf:nth-child(6) { animation-delay: 0.9s !important; }
.node-leaf:nth-child(7) { animation-delay: 0.95s !important; }
.node-synth { animation-delay: 1.2s !important; }

@keyframes node-appear {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* Glow pulse */
.glow-pulse {
  animation: glow-breathe 3s ease-in-out infinite;
}
.glow-d1 { animation-delay: 0.5s; }
.glow-d2 { animation-delay: 1s; }

@keyframes glow-breathe {
  0%, 100% { opacity: 0.5; r: 30; }
  50%      { opacity: 0.8; r: 36; }
}

/* Label fade-in */
.label-fade {
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) forwards;
}
.label-d1 { animation-delay: 0.6s; }
.label-d2 { animation-delay: 0.75s; }
.label-d3 { animation-delay: 1.3s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── PILLARS ─── */

section.pillars {
  padding: var(--section-py) 0;
  background: var(--color-bg);
  position: relative;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.pillar-card {
  background: var(--color-surface);
  padding: 32px 28px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-spring);
}

.pillar-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.35);
  box-shadow: 0 8px 32px -8px oklch(from var(--color-primary) l c h / 0.08);
  transform: translateY(-2px);
}

.pillar-icon-wrap {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--color-primary) l c h / 0.08);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.15);
  border-radius: 10px;
  margin-bottom: 18px;
}

.pillar-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.pillar-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* ─── MODES SHOWCASE ─── */

section.modes {
  padding: var(--section-py) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.modes-showcase {
  margin-top: 8px;
}

.modes-selector {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 4px;
  background: var(--glass-bg-subtle);
  backdrop-filter: var(--glass-filter-sm);
  -webkit-backdrop-filter: var(--glass-filter-sm);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mode-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.mode-tab.active {
  color: var(--color-text-inverse);
  background: var(--color-primary);
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.3);
}

.mode-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Fallback glyph for a registered mode with no bespoke SVG — renders its emoji. */
.mode-tab-emoji {
  font-size: 16px;
  line-height: 1;
}

.mode-display {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  overflow: hidden;
}

.mode-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 280px;
}

.mode-info {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-inline-end: 1px solid var(--color-border);
}

.mode-preview-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--color-text);
}

.mode-preview-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0 0 20px 0;
}

.mode-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-tag {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-primary);
  background: oklch(from var(--color-primary) l c h / 0.1);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.18);
}

.mode-graph {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--glass-bg-subtle);
}

.mode-graph-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.mode-graph-svg text {
  font-family: var(--font-sans, system-ui, sans-serif);
}

/* Conversion point at the end of the mode explorer — see the comment on
   .modes-cta in landing.html for why it sits here. */
.modes-cta {
  margin-top: 32px;
  text-align: center;
}

.modes-cta-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.modes-noscript {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
}

/* ─── FAQ ─── */

section.faq {
  padding: var(--section-py) 0;
  background: var(--color-bg);
}

.faq-container {
  max-width: 640px;
  margin: 32px auto 0;
}

details {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 0;
  background: var(--color-surface);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

details[open] {
  border-color: oklch(from var(--color-primary) l c h / 0.35);
  box-shadow: 0 0 0 1px oklch(from var(--color-primary) l c h / 0.08), 0 4px 16px -4px oklch(0 0 0 / 0.2);
}

summary {
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  padding: 16px 20px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}

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

summary::before {
  content: '';
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: oklch(from var(--color-primary) l c h / 0.12);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23c85d0a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s var(--ease-out);
}

details[open] summary::before {
  transform: rotate(180deg);
}

summary:hover {
  color: var(--color-primary);
}

summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

details p {
  margin: 0;
  padding: 0 20px 16px 50px;
  color: var(--color-text-muted);
  line-height: 1.65;
  font-size: 14px;
}

/* ─── FINAL CTA ─── */

section.final-cta {
  padding: var(--section-py) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
}

.cta-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 50% 0%, oklch(1 0 0 / 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.final-cta-inner {
  position: relative;
  z-index: 1;
}

.final-cta h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.25;
  font-weight: 800;
  color: var(--color-text-inverse);
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}

.final-cta p {
  color: oklch(from var(--color-text-inverse) l c h / 0.75);
  font-size: 16px;
  margin: 0 0 28px 0;
  line-height: 1.6;
}

/* ─── FOOTER ─── */

footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 48px 28px 32px;
}

.footer-content {
  max-width: var(--landing-max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 32px;
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.footer-links-group {
  display: flex;
  gap: 48px;
}

.footer-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-2, var(--color-text));
  margin: 0 0 12px 0;
}

.footer-section ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-section a {
  font-size: 13px;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.footer-section a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  max-width: var(--landing-max-w);
  margin: 0 auto;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-bottom a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom a:hover {
  color: var(--color-primary);
}

/* ─── RESPONSIVE ─── */

@media (max-width: 1024px) {
  section.hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 48px 28px;
    gap: 40px;
  }

  .hero-content h1 { font-size: clamp(28px, 5vw, 40px); }

  /* The graph is illustration, not argument: once the hero stacks it must fall
     BELOW the headline and CTA. Ordering it first cost ~350px of the first
     screen on a phone before the visitor read what this product is. */
  .hero-visual { order: 1; }

  .graph-canvas { max-width: 400px; }

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

  .mode-preview {
    grid-template-columns: 1fr;
  }

  .mode-info { border-inline-end: none; border-bottom: 1px solid var(--color-border); }

  .footer-content { flex-direction: column; gap: 32px; }
}

@media (max-width: 768px) {
  header { padding: 10px 16px; }

  section.hero { margin-top: 48px; padding: 32px 16px; }

  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 15px; }

  .hero-proof { flex-direction: column; gap: 8px; }

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

  /* Horizontal scroller. The labels stay: an unlabelled icon row asks the
     visitor to guess what "Devil's Advocate" looks like as a glyph, and the
     mode names ARE the pitch. The mask is the scroll affordance — without it
     the tabs past the edge read as "there are five modes", not seven.

     `black` in these gradients is a stencil, not a colour: mask-image reads the
     alpha channel only, so the keyword marks "keep this region" and never
     paints. It needs no light/dark token, which is why it is not a violation of
     the no-colour-literals rule the way a hex fill would be. */
  .modes-selector {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 28px), transparent 100%);
  }

  .modes-selector::-webkit-scrollbar { display: none; }

  /* Fully scrolled: drop the trailing fade so the last tab isn't dimmed. */
  .modes-selector.is-scroll-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black 100%);
    mask-image: linear-gradient(to right, transparent 0, black 12px, black 100%);
  }

  .modes-selector.is-scroll-start {
    -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, black 0, black calc(100% - 28px), transparent 100%);
  }

  /* Both ends in view — the tabs fit, so no fade should suggest more content. */
  .modes-selector.is-scroll-start.is-scroll-end {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .mode-tab {
    scroll-snap-align: start;
    flex: 0 0 auto;
    padding: 9px 13px;
  }

  .mode-info { padding: 24px 20px; }
  .mode-graph { padding: 16px; }

  section.pillars,
  section.modes,
  section.faq,
  section.final-cta {
    padding: var(--section-gap, 64px) 0;
  }

  .section-inner { padding: 0 16px; }

  .footer-links-group { flex-direction: column; gap: 24px; }

  .btn-lg { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 24px; }
  .nav-logo { font-size: 18px; }
  .graph-canvas { max-width: 300px; }
  .mode-preview { min-height: auto; }
  header .lang-switcher-label { display: none; }
  .nav-link-text { padding: 8px 10px; }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .edge-anim { stroke-dashoffset: 0; }
  .graph-nodes .node { opacity: 1; }
  .label-fade { opacity: 1; }
}

/* ─── Light mode ───
 *
 * Intentionally empty. This file used to carry a
 * @media (prefers-color-scheme: light) block that re-stated every surface,
 * border and accent as a literal value. Two problems: it duplicated the token
 * file, and it keyed off the OS rather than the resolved theme — so once the
 * account menu could force light on a dark-OS machine (or dark on a light one),
 * the landing page would have painted the wrong half of its palette.
 *
 * Every rule above now reads from --color-*/--glass-* tokens, which
 * variables.css already resolves per theme. Light mode needs no overrides.
 * If you find yourself re-adding one here, the token is missing instead.
 */
