@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #070E17;
  --surface: #0B1622;
  --surface-2: #0F1E2E;
  --elevated: #152839;
  --border: rgba(148, 163, 184, 0.10);
  --border-strong: rgba(148, 163, 184, 0.20);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --accent: #34D399;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --accent-line: rgba(52, 211, 153, 0.35);
  --warn: #F59E0B;
  --ok: #34D399;
  --red: #F87171;

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'ss02';
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

body { overflow-x: hidden; }
html { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

img { max-width: 100%; display: block; }

/* Layout */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 140px 0;
  position: relative;
}

.section--tight { padding: 96px 0; }

/* Type */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56,189,248,0.12);
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
}

.h-display {
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 1.05;
  text-wrap: balance;
  word-break: keep-all;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.h-section {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.12;
  text-wrap: balance;
  word-break: keep-all;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.h-card {
  font-size: 22px;
  line-height: 1.3;
  text-wrap: balance;
  word-break: keep-all;
  font-weight: 600;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 76ch;
  text-wrap: pretty;
  word-break: keep-all;
}

.small {
  font-size: 13px;
  color: var(--text-dim);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}

.btn-accent {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-accent:hover { filter: brightness(1.08); }

.arrow-icn {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  position: relative;
}

.card--bordered {
  border: 1px solid var(--border-strong);
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

/* Ticker dots / hairlines */
.hairline {
  height: 1px; background: var(--border); width: 100%;
}

.label-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Backgrounds */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148,163,184,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 80%);
}

.section-header {
  margin-bottom: 72px;
  max-width: 880px;
}
.section-header .eyebrow { margin-bottom: 20px; }
.section-header .lead { margin-top: 20px; }

/* Section numbering */
.section-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ============================================================
   RESPONSIVE — mobile first overrides
   Target: 1024 (tablet), 768 (tablet portrait), 480 (phone)
   ============================================================ */

/* Tablet landscape & below */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .section { padding: 100px 0; }
  .section-header { margin-bottom: 56px; }
}

/* Tablet portrait & phone */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; gap: 16px !important; }
  .section { padding: 72px 0; }
  .section-header { margin-bottom: 40px; max-width: 100%; }

  /* FDE comparison — stack vertically */
  .fde-compare { grid-template-columns: 1fr !important; gap: 20px !important; margin-bottom: 56px !important; }

  /* Force any inline 2-col / 3-col grid to collapse (except elements opted out via .keep-grid) */
  [style*="gridTemplateColumns"]:not(.keep-grid),
  [style*="grid-template-columns"]:not(.keep-grid) {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Keep nav horizontal but simplified */
  nav [style*="display:flex"][style*="gap:4px"],
  nav [style*="display: flex"][style*="gap: 4px"] { display: none !important; }

  /* Section header */
  .h-display { font-size: 40px !important; line-height: 1.08 !important; }
  .h-section { font-size: 30px !important; line-height: 1.15 !important; }
  .h-card { font-size: 18px !important; }
  .lead { font-size: 16px !important; }

  /* Cards — reduce padding */
  .card { padding: 20px !important; }

  /* Section top spacing where grid-bg is used */
  header { padding-top: 96px !important; padding-bottom: 72px !important; }
  header > .container > div:first-child { margin-bottom: 32px !important; }

  /* Buttons — stack */
  .btn { padding: 12px 18px; font-size: 14px; }
}

/* Phone */
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  header { padding-top: 80px !important; padding-bottom: 56px !important; }
  header > .container > div:first-child { margin-bottom: 20px !important; }

  .h-display { font-size: 32px !important; letter-spacing: -0.025em !important; }
  .h-section { font-size: 24px !important; }
  .h-card { font-size: 17px !important; }
  .lead { font-size: 15px !important; line-height: 1.55 !important; }
  .eyebrow { font-size: 11px; }

  .btn { width: 100%; justify-content: center; }
  header > div > div:first-child + div,
  [style*="display:flex"][style*="gap:12px"][style*="marginTop:44px"] { flex-direction: column; width: 100%; }

  /* Hide top coordinate strip and grid overlays on very small screens */
  header [style*="letterSpacing:'0.1em'"][style*="fontSize:11"] span:nth-child(1),
  header [style*="letterSpacing:'0.1em'"][style*="fontSize:11"] span:nth-child(3) { display: none; }
}

/* Hide desktop nav links on mobile; show hamburger */
@media (max-width: 900px) {
  .nav-desktop-links { display: none !important; }
  .nav-desktop-cta { display: none !important; }
  .nav-mobile-toggle { display: flex !important; }
}
@media (min-width: 901px) {
  .nav-mobile-toggle { display: none !important; }
  .nav-mobile-drawer { display: none !important; }
}

/* Team grid fallback */
@media (max-width: 1024px) {
  .team-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Timeline collapse: left/right → single column */
@media (max-width: 900px) {
  .timeline-centerline { display: none !important; }
  .timeline-row {
    display: block !important;
    padding-left: 0 !important;
    margin-bottom: 24px !important;
    position: relative;
  }
  /* Hide the empty placeholder divs */
  .timeline-row > div:empty { display: none !important; }
  /* Center dot column shows D+N label inline on top */
  .timeline-row > div:nth-child(2) {
    text-align: left !important;
    margin-bottom: 10px;
    display: flex !important;
    align-items: center;
    gap: 12px;
  }
  .timeline-row > div:nth-child(2) > div:first-child {
    margin: 0 !important;
  }
  .timeline-row > div:nth-child(2) > div:nth-child(2),
  .timeline-row > div:nth-child(2) > div:nth-child(3) {
    margin-top: 0 !important;
    display: inline-block;
  }
  /* Cards full width, left aligned */
  .timeline-row > div:nth-child(1),
  .timeline-row > div:nth-child(3) {
    text-align: left !important;
    width: 100%;
  }
}

/* Approach — tabs vertical on mobile */
@media (max-width: 900px) {
  .approach-tabs { grid-template-columns: 1fr !important; }
  .approach-tabs > button { border-right: none !important; border-bottom: 1px solid var(--border-strong) !important; }
  .approach-panel { padding: 28px !important; grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* Harness — stack sticky column */
@media (max-width: 900px) {
  .harness-sticky { position: static !important; }
}

/* Contact form wider */
@media (max-width: 900px) {
  .contact-form { padding: 24px !important; }
}

/* FAQ — stack sticky */
@media (max-width: 900px) {
  .faq-sticky { position: static !important; margin-bottom: 24px; }
}

/* Wireframe — stack */
@media (max-width: 900px) {
  .wireframe-left { position: static !important; }
  .wireframe-tabs { flex-wrap: wrap; }
}

/* Footer */
@media (max-width: 900px) {
  footer [style*="gridTemplateColumns"] { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
}
@media (max-width: 560px) {
  footer [style*="gridTemplateColumns"] { grid-template-columns: 1fr !important; }
  footer [style*="justifyContent:'space-between'"] { flex-direction: column; gap: 8px; text-align: left; }
}

/* AgentExpansion — options tabs vertical, detail panel single column */
@media (max-width: 900px) {
  #agent > div > div > div[style*="repeat(3, 1fr)"] { grid-template-columns: 1fr !important; }
  #agent > div > div > div[style*="repeat(3, 1fr)"] > button { border-right: none !important; border-bottom: 1px solid var(--border-strong) !important; }
  /* Detail panel: collapse 1fr 1fr → single column, reduce padding */
  #agent [style*="grid-template-columns: 1fr 1fr"],
  #agent [style*="gridTemplateColumns:'1fr 1fr'"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 24px !important;
  }
  /* AgentDiagram svg container — kill aspect-ratio, let svg size naturally */
  #agent [style*="aspect-ratio: 1 / 1"],
  #agent [style*="aspectRatio:'1/1'"] {
    aspect-ratio: auto !important;
    min-height: 320px;
  }
  #agent svg { max-width: 100% !important; height: auto !important; }
}

/* MvpHero — collapse hero grid */
@media (max-width: 900px) {
  #services-hero, header [style*="gridTemplateColumns:'1.25fr 1fr'"] { grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* MvpCta hero grid stack */
@media (max-width: 900px) {
  #mvp-cta [style*="gridTemplateColumns:'1.2fr 1fr'"] { grid-template-columns: 1fr !important; gap: 40px !important; }
}

/* MvpWhy comparison table — stack rows on phone */
@media (max-width: 560px) {
  #mvp-why [style*="gridTemplateColumns:'1.2fr 1fr 1fr'"] { grid-template-columns: 1fr !important; gap: 6px !important; padding: 14px 18px !important; }
  #mvp-why [style*="gridTemplateColumns:'1.2fr 1fr 1fr'"] > span:first-child { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 40px !important; align-items: start !important; }
  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 28px !important; margin-top: 64px !important; }
  .team-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .approach-tabs { grid-template-columns: 1fr !important; }
  .approach-panel { grid-template-columns: 1fr !important; gap: 32px !important; padding: 28px !important; }
  .harness-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .faq-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .contact-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
  .wireframe-reasons { grid-template-columns: 1fr !important; }
  .wireframe-reasons > div { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
  .wireframe-reasons > div:last-child { border-bottom: none !important; }
  .wireframe-session { grid-template-columns: 1fr !important; min-height: 0 !important; }
  .wireframe-session > div:first-child { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
}
@media (max-width: 560px) {
  .team-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hero-stats { gap: 20px !important; }
}
@media (max-width: 900px) {
  .directions-grid { grid-template-columns: 1fr !important; }
  .directions-grid > div:first-child { border-right: none !important; border-bottom: 1px solid var(--border) !important; }
  .directions-grid > div:last-child { min-height: 320px !important; }
}

/* Hero orb — shrink on mobile to avoid overflow */
@media (max-width: 900px) {
  .hero-orb { width: 320px !important; height: 320px !important; right: -20% !important; }
}
/* Tweaks panel — smaller on mobile */
@media (max-width: 560px) {
  .tweaks-panel { bottom: 12px !important; right: 12px !important; max-width: calc(100vw - 24px); }
}
