:root {
  --bg: #060607;
  --bg-alt: #0b0b0d;
  --surface: rgba(255, 255, 255, 0.025);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --fg: #f4f4f2;
  --muted: #9b9ca3;
  --dim: #64656c;
  --acc: #7de3ff;
  --acc-rgb: 125, 227, 255;
  --font: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 16px;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Fine film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: rgba(var(--acc-rgb), .3); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; position: relative; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Type */
h1, h2, h3 { font-weight: 300; letter-spacing: -0.025em; line-height: 1.08; }
h1 { font-size: clamp(2.7rem, 6.6vw, 5.2rem); }
h1 em {
  font-style: normal; font-weight: 600;
  background: linear-gradient(100deg, #fff 20%, var(--acc) 50%, #fff 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.eyebrow, .num, .plan-sub, .node-label, .hint, .spec dt {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
}
.eyebrow { margin-bottom: 18px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--acc); }
.lede { font-size: 1.14rem; color: var(--muted); max-width: 34em; }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none;
  background: var(--fg); color: var(--bg);
  font-weight: 500; font-size: 0.94rem;
  padding: 14px 24px; border-radius: 999px; border: 1px solid var(--fg);
  transition: background .2s, color .2s, box-shadow .3s, border-color .2s;
}
.btn:hover { box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .18), 0 0 32px rgba(var(--acc-rgb), .25); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--fg); box-shadow: none; }
.btn-small { padding: 9px 18px; font-size: 0.84rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(6, 6, 7, .72);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.15rem; font-weight: 400; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; }
.links { display: none; gap: 28px; margin-left: auto; }
.links a { text-decoration: none; color: var(--muted); font-size: 0.9rem; transition: color .2s; }
.links a:hover { color: var(--fg); }
.nav .btn-small { margin-left: auto; }
@media (min-width: 900px) { .links { display: flex; } .nav .btn-small { margin-left: 0; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero::before {
  content: ""; position: absolute; width: 900px; height: 900px; right: -260px; top: -200px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--acc-rgb), .09), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 10%, transparent 75%);
  opacity: .55;
}
.hero-inner { display: grid; gap: 24px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; margin-bottom: 28px;
  background: rgba(255, 255, 255, .02);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero-copy h1 { margin-bottom: 24px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.spec { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.spec dd { font-size: 0.95rem; margin-top: 4px; }
.hero-art { position: relative; order: -1; }
.hero-canvas { display: block; width: 100%; aspect-ratio: 1; cursor: grab; touch-action: pan-y; }
.hero-canvas.grabbing { cursor: grabbing; }
.hint { position: absolute; bottom: 6%; left: 0; right: 0; text-align: center; opacity: .7; }
@media (max-width: 899px) { .hero-art { max-width: 420px; width: 100%; margin: 0 auto -24px; } .hint { display: none; } }
@media (min-width: 900px) {
  .hero { padding: 80px 0 110px; }
  .hero-inner { grid-template-columns: 1.1fr 1fr; gap: 32px; }
  .hero-art { order: 0; margin-right: -40px; }
}

/* Tools marquee */
.tools { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; }
.marquee {
  display: flex; width: max-content;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  animation: marquee 48s linear infinite;
}
.tools:hover .marquee { animation-play-state: paused; }
.track { list-style: none; display: flex; gap: 56px; padding-right: 56px; font-family: var(--mono); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Problem */
.problem { padding: 110px 0; }
.two-col { display: grid; gap: 32px; }
.stack { display: grid; gap: 18px; color: var(--muted); font-size: 1.06rem; align-content: end; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 80px; } }

/* Sections */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { margin-bottom: 56px; max-width: 18em; }

/* Architecture flow */
.flow { display: grid; gap: 0; align-items: stretch; }
@media (min-width: 900px) { .flow { grid-template-columns: 1fr 72px 1.15fr 72px 1fr; align-items: center; } }
.node, .card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.node::before, .card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--x, 50%) var(--y, 50%), rgba(var(--acc-rgb), .09), transparent 60%);
}
.node:hover::before, .card:hover::before { opacity: 1; }
.node { padding: 24px; }
.node ul { list-style: none; display: grid; gap: 8px; margin-top: 16px; }
.node li { font-size: 0.95rem; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.node-core { border-color: rgba(var(--acc-rgb), .35); box-shadow: 0 0 60px rgba(var(--acc-rgb), .07), inset 0 0 40px rgba(var(--acc-rgb), .04); }
.node-core .node-label { color: var(--acc); }
.node-core li { border-color: rgba(var(--acc-rgb), .18); }
.wire { position: relative; height: 48px; width: 1px; margin: 0 auto; background: var(--line-2); overflow: hidden; }
.wire span { position: absolute; left: 0; width: 100%; height: 40%; background: linear-gradient(transparent, var(--acc)); animation: flowY 1.8s linear infinite; }
@keyframes flowY { from { top: -40%; } to { top: 100%; } }
@media (min-width: 900px) {
  .wire { height: 1px; width: 100%; }
  .wire span { top: 0; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--acc)); animation: flowX 1.8s linear infinite; }
  @keyframes flowX { from { left: -40%; } to { left: 100%; } }
}

/* Terminal */
.term { margin-top: 40px; border: 1px solid var(--line-2); border-radius: 12px; background: #08090a; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.term-tag { border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; letter-spacing: .06em; text-transform: uppercase; font-size: .66rem; }
.term-body { padding: 20px 20px 24px; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.9; color: var(--fg); }
.t-line { display: inline-block; transition: opacity .35s, transform .35s; }
.t-line.pending { opacity: 0; transform: translateY(4px); }
.t-cmd { color: #fff; }
.t-cmd.typing::after { content: ""; display: inline-block; width: .6em; height: 1.1em; margin-left: 2px; vertical-align: -0.2em; background: var(--acc); animation: pulse 1s steps(1) infinite; }
.t-dim { color: var(--dim); }
.t-ok { color: var(--acc); }
.t-warn { color: #ffd479; }
.t-done { color: var(--acc); margin-top: 6px; }

/* Cards */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 28px; display: flex; flex-direction: column; gap: 12px; transition: border-color .3s, transform .3s; }
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card p { color: var(--muted); font-size: 0.94rem; position: relative; }
.card .num { margin-bottom: 28px; color: var(--acc); }

/* Steps */
.steps { list-style: none; display: grid; gap: 0; }
.steps li { padding: 28px 0 28px 28px; position: relative; display: grid; gap: 8px; }
.steps li::before { content: ""; position: absolute; left: 0; top: 34px; width: 9px; height: 9px; border: 1px solid var(--acc); border-radius: 50%; background: var(--bg-alt); z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 4px; top: 34px; bottom: -34px; width: 1px; background: var(--line-2); }
.steps li:last-child::after { display: none; }
.steps li p { color: var(--muted); max-width: 32em; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .steps li { padding: 40px 0 0; }
  .steps li::before { top: 0; }
  .steps li::after { left: 9px; top: 4px; bottom: auto; width: calc(100% + 32px - 9px); height: 1px; }
  .steps li::after { transform-origin: left; transform: scaleX(0); transition: transform 1s ease; }
  .steps.in li::after { transform: scaleX(1); }
  .steps.in li:nth-child(2)::after { transition-delay: .25s; }
  .steps.in li:nth-child(3)::after { transition-delay: .5s; }
}

/* Plans */
.plan h3 { font-size: 1.4rem; font-weight: 400; }
.plan .plan-sub { margin-top: -4px; }
.plan ul { list-style: none; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; font-size: 0.92rem; position: relative; }
.plan ul li { padding-left: 18px; position: relative; }
.plan ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--acc); }
.plan-featured { border-color: rgba(var(--acc-rgb), .4); background: linear-gradient(180deg, rgba(var(--acc-rgb), .07), rgba(255, 255, 255, .02)); }
.plan-featured:hover { border-color: rgba(var(--acc-rgb), .6); }

/* FAQ */
.faq-wrap { display: grid; gap: 8px; }
@media (min-width: 900px) { .faq-wrap { grid-template-columns: 1fr 1.6fr; gap: 72px; } }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; font-size: 1.05rem; font-weight: 500; display: flex; gap: 20px; align-items: baseline; transition: color .2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: #fff; }
.faq summary .num { flex: none; }
.faq details[open] summary .num { color: var(--acc); }
.faq details p { color: var(--muted); padding: 0 0 24px 48px; max-width: 42em; }

/* Contact */
.contact { padding: 130px 0; text-align: center; position: relative; overflow: hidden; }
.contact .hero-grid { -webkit-mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%); mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%); }
.contact-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.contact-mark { width: 150px; height: 150px; margin-bottom: 4px; }
.contact h2 { max-width: 15em; }
.contact p { color: var(--muted); max-width: 34em; margin-bottom: 12px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer img { width: 120px; opacity: .8; }
.footer p { color: var(--dim); font-size: 0.82rem; font-family: var(--mono); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.grid .reveal:nth-child(2) { transition-delay: .08s; }
.grid .reveal:nth-child(3) { transition-delay: .16s; }
.grid .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Debug: ?still freezes motion for screenshots */
.still *, .still *::before, .still *::after { transition: none !important; animation: none !important; }
