/* ---------- tokens ---------- */
:root{
  --bg: #0D0D10;
  --bg-soft: #131316;
  --surface: #17171B;
  --border: #26262B;
  --text: #EDEBEF;
  --text-dim: #8B8792;
  --accent: #C65FA6;
  --accent-soft: #3A2534;
  --font-display: 'Sora', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --max: 1120px;
}

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

html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; text-decoration: none; }

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

h1,h2,h3{
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* subtle grain so the near-black doesn't feel flat/plasticky */
.grain{
  position: fixed; inset: 0; pointer-events:none; z-index: 1;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header{
  position: sticky; top:0; z-index: 10;
  background: rgba(13,13,16,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  height: 68px;
}
.brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.nav-links{ display:flex; align-items:center; gap: 32px; }
.nav-links a{ font-size: 15px; color: var(--text-dim); transition: color 0.15s ease; margin-right: 32px; }
.nav-links a:last-child{ margin-right: 0; }
.nav-links a:hover{ color: var(--text); }
.nav-cta{
  color: var(--text) !important;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-cta:hover{ border-color: var(--accent); background: var(--accent-soft); }

.nav-toggle{
  display:none; background:none; border:none; cursor:pointer;
  flex-direction:column; gap:5px; padding: 8px;
}
.nav-toggle span{ width: 22px; height: 2px; background: var(--text); display:block; }

/* ---------- hero ---------- */
.hero{ padding: 96px 0 80px; overflow:hidden; }
.hero-grid{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items:center;
}
.hero h1{
  font-size: 46px;
  line-height: 1.12;
  max-width: 520px;
}
.hero-lede{
  margin-top: 22px;
  font-size: 17px;
  color: var(--text-dim);
  max-width: 480px;
}
.hero-actions{
  display:flex; gap:14px; margin-top: 32px; flex-wrap: wrap;
}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 13px 22px; border-radius: 7px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary{
  background: var(--accent); color: #17070F;
}
.btn-primary:hover{ transform: translateY(-1px); }
.btn-ghost{
  border: 1px solid var(--border); color: var(--text);
}
.btn-ghost:hover{ border-color: var(--accent); }
.hero-note{
  margin-top: 14px; font-size: 13.5px; color: var(--text-dim);
}

/* hero diagram */
.hero-visual{ display:flex; justify-content:center; }
.diagram{ width: 100%; max-width: 420px; }
/* Visible by default — animation (below, gated behind .animate) is a
   progressive enhancement, not a requirement for seeing the diagram. */
.diagram .link{
  stroke: var(--border);
  stroke-width: 1.5;
  fill:none;
}
.diagram .node rect{
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
}
.node-center rect{
  stroke: var(--accent);
  fill: var(--accent-soft);
}
.diagram .node text{
  font-family: var(--font-body);
  text-anchor: middle;
}
.node-title{ fill: var(--text); font-size: 13px; font-weight: 500; }
.node-sub{ fill: var(--text-dim); font-size: 10.5px; }

/* Entrance animation — only runs when JS has confirmed load and added
   this class. Base state above already looks correct without it. */
.diagram.animate .link{
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw 1.1s ease forwards;
}
.diagram.animate .node rect,
.diagram.animate .node text{
  opacity: 0;
  animation: appear 0.5s ease forwards;
  animation-delay: 0.9s;
}
.diagram.animate .node text{ animation-delay: 1s; }

@keyframes draw{ to{ stroke-dashoffset: 0; } }
@keyframes appear{ to{ opacity: 1; } }

@media (prefers-reduced-motion: reduce){
  .diagram.animate .link, .diagram.animate .node rect, .diagram.animate .node text{
    animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important;
  }
}

/* ---------- shared section styles ---------- */
.section{ padding: 72px 0; border-top: 1px solid var(--border); }
.section h2{ font-size: 30px; margin-bottom: 12px; }
.section-lede{ color: var(--text-dim); margin-bottom: 40px; max-width: 520px; }

/* context */
.context-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.context-lead{
  font-family: var(--font-display);
  font-size: 21px; font-weight: 500; line-height: 1.45;
  color: var(--text);
}
.context-body{ color: var(--text-dim); align-self:center; }

/* how / steps */
.steps{
  display:grid; grid-template-columns: repeat(3,1fr); gap: 36px; margin-top: 40px;
}
.step{ border-left: 1px solid var(--border); padding-left: 22px; }
.step-num{
  font-family: var(--font-display); font-size: 13px; color: var(--accent);
  letter-spacing: 0.04em; display:block; margin-bottom: 14px;
}
.step h3{ font-size: 19px; margin-bottom: 10px; }
.step p{ color: var(--text-dim); font-size: 15px; }

/* replace list */
.replace-list{ list-style:none; border-top: 1px solid var(--border); }
.replace-list li{
  display:grid; grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.replace-name{ font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.replace-desc{ color: var(--text-dim); font-size: 15px; }

/* closing */
.closing{ background: var(--bg-soft); }
.closing-grid{
  display:grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items:center;
}
.closing p{ color: var(--text-dim); margin-top: 14px; max-width: 460px; }
.closing-actions{ display:flex; flex-direction:column; align-items:flex-start; gap: 10px; }

/* footer */
.site-footer{ border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner{
  display:flex; justify-content:space-between; color: var(--text-dim); font-size: 13.5px;
}

/* ---------- responsive ---------- */
@media (max-width: 860px){
  .nav-links{
    display:none;
    position: absolute; top: 68px; left:0; right:0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items:flex-start; gap: 0; padding: 8px 28px 20px;
  }
  .nav-links.open{ display:flex; }
  .nav-links a{ width:100%; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child{ border-bottom:none; }
  .nav-cta{ margin-top: 8px; text-align:center; }
  .nav-toggle{ display:flex; }
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-visual{ order:-1; margin-bottom: 12px; }
  .hero h1{ font-size: 36px; }
  .context-grid{ grid-template-columns: 1fr; }
  .steps{ grid-template-columns: 1fr; }
  .replace-list li{ grid-template-columns: 1fr; gap: 6px; }
  .closing-grid{ grid-template-columns: 1fr; }
}
