/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: #000000; }

/* ── VARIABLES ── */
:root {
  --bg:           #000000;
  --bg-raised:    #0a0a0a;
  --bg-card:      #111111;
  --bg-mid:       #080808;
  --border:       rgba(0, 255, 102, 0.08);
  --border-hover: rgba(0, 255, 102, 0.2);

  --green:        #00ff66;
  --green-dim:    #00cc52;
  --green-glow:   rgba(0, 255, 102, 0.15);
  --green-subtle: rgba(0, 255, 102, 0.06);

  --text:         #b0e8b0;
  --text-bright:  #f5f5f5;
  --text-muted:   #88bb88;

  --font-brand:   'JetBrains Mono', monospace;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width:    1040px;
  --nav-height:   4rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--green); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

em { font-style: italic; color: var(--green); }

code {
  font-family: var(--font-brand);
  font-size: 0.82em;
  color: var(--green-dim);
  background: rgba(0, 255, 102, 0.05);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── NAV ── */
#site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1a1a1a;
  background: #000000;
  position: relative;
  z-index: 100;
}

#site-nav .nav-brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #ffffff;
}
#site-nav .nav-brand:hover { color: #cc2222; }
#site-nav .nav-brand--green { color: var(--green); }
#site-nav .nav-brand--green:hover { color: var(--green); opacity: 0.8; }

#site-nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

#site-nav .nav-links a {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888888;
  transition: color 0.15s;
}
#site-nav .nav-links a:hover { color: #ffffff; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: var(--font-brand);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.7rem 1.8rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--green);
  color: var(--bg);
  border: 1px solid var(--green);
}
.btn-primary:hover {
  background: var(--green-dim);
  border-color: var(--green-dim);
  box-shadow: 0 0 20px var(--green-glow);
  opacity: 1;
}

.btn-ghost {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  border: 1px solid var(--border-hover);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
  opacity: 1;
}

.btn-lg {
  padding: 0.9rem 2.5rem;
  font-size: 0.85rem;
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  margin: 12vh max(2rem, 8vw) 0 max(2rem, 8vw);
  /* 376px target: 15px + 344px row + 15px padding + 2px border (horizontal) */
  box-sizing: border-box;
  width: min(376px, calc(100vw - 2 * max(2rem, 8vw)));
  padding: 16px 15px;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
  background: rgba(30, 30, 30, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  box-shadow: inset 0 0 0 1px #111;
}

.hero-content a,
.hero-content button {
  pointer-events: auto;
}

.hero-copy {
  min-width: 0;
  width: 100%;
  container-type: inline-size;
  container-name: hero-copy;
}

.hero-label {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-dim);
  margin-bottom: 0.75rem;
  opacity: 0.7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-title {
  font-family: var(--font-brand);
  /* Fallback when container query length units are unavailable */
  font-size: clamp(1.475rem, 5.5vw, 2.975rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.5);
}

@supports (font-size: 1cqi) {
  .hero-title {
    /* Scales with hero card inner width (.hero-copy is the container) */
    font-size: clamp(1.325rem, calc(0.6rem + 11.5cqi), 3.05rem);
  }
}

.hero-sub {
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  color: var(--text-muted);
  margin-bottom: 0.625rem;
  line-height: 1.75;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  width: 164px;
  box-sizing: border-box;
  padding: 0.45rem 0.2rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── SECTIONS ── */
.section-title {
  font-family: var(--font-brand);
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

.section-dark {
  padding: 7rem 0;
  background: var(--bg);
}

.section-mid {
  padding: 7rem 0;
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── PROBLEM ── */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.problem-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
}

.problem-card h3 {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.problem-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.problem-punch {
  font-family: var(--font-brand);
  font-size: 1rem;
  color: var(--text);
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.problem-punch em {
  font-style: italic;
  color: var(--green);
}

/* ── ARCHITECTURE ── */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.arch-block {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
  transition: border-color 0.3s;
}
.arch-block:hover { border-color: var(--border-hover); }

.arch-block-wide {
  grid-column: 1 / -1;
}

.arch-label {
  font-family: var(--font-brand);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-dim);
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.arch-block h3 {
  font-family: var(--font-brand);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.arch-block p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ── CODE BLOCK ── */
.code-block {
  background: #080e08;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3rem;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 255, 102, 0.03);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
}

.code-filename {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-left: 0.5rem;
}

.code-body {
  font-family: var(--font-brand);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text);
  padding: 1.5rem;
  overflow-x: auto;
  white-space: pre;
}

.code-comment {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── INTEGRATION DETAILS ── */
.integration-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.int-detail {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.int-detail h4 {
  font-family: var(--font-brand);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.int-detail p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── CONTEXT COMPILATION VISUAL ── */
.ctx-compile {
  background: #060a06;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.ctx-layers {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-layer {
  background: rgba(0, 255, 102, 0.02);
  border-left: 2px solid rgba(0, 255, 102, 0.15);
  padding: 1rem 1.25rem;
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}

.ctx-layer:hover {
  border-left-color: var(--green-dim);
  background: rgba(0, 255, 102, 0.04);
}

.ctx-layer-input {
  border-left-color: var(--green);
  background: rgba(0, 255, 102, 0.05);
}

.ctx-layer-label {
  font-family: var(--font-brand);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ctx-layer-tag {
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--green-dim);
  background: rgba(0, 255, 102, 0.08);
  padding: 0.15em 0.5em;
  border-radius: 2px;
}

.ctx-layer-content {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.7;
}

.ctx-layer[data-tokens]::after {
  content: attr(data-tokens) " tok";
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-brand);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.05em;
}

.ctx-budget {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 255, 102, 0.02);
}

.ctx-budget-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.ctx-budget-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--green-glow);
}

.ctx-budget-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-brand);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.ctx-budget-status {
  color: var(--green-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* ── CTA ── */
.cta {
  padding: 8rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-raised) 100%);
}

.cta-title {
  font-family: var(--font-brand);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.cta-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 460px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── WAITLIST FORM ── */
.waitlist-form {
  display: flex;
  gap: 0.75rem;
  max-width: 460px;
  margin: 0 auto;
}

.waitlist-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.waitlist-input:focus {
  border-color: var(--green);
}

.waitlist-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.waitlist-msg {
  font-size: 0.8rem;
  margin-top: 1rem;
  color: var(--green);
  min-height: 1.2em;
}

.waitlist-form .btn-primary:hover {
  box-shadow: none;
}

/* ── FOOTER ── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.footer-brand {
  font-family: var(--font-brand);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.footer-sep { color: var(--text-muted); opacity: 0.3; }

.footer-link {
  font-family: var(--font-brand);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.footer-link:hover { color: var(--green); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-content {
    margin: 12vh 1.25rem 0 1.25rem;
    width: min(376px, calc(100vw - 2.5rem));
  }

  .problem-grid { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr; }
  .arch-block-wide { grid-column: 1; }
  .integration-details { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero-content { padding: 16px 15px; }
  .section-dark, .section-mid { padding: 5rem 0; }
  .waitlist-form { flex-direction: column; }
}

/* Two 164px buttons + gap need ~344px inner; below that, stack so the card still fits */
@media (max-width: 400px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-actions .btn {
    width: 100%;
    max-width: none;
  }
}
