:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f4;
  --panel: #ececeb;
  --ink: #0a0a0a;
  --ink-2: #3f3f3f;
  --muted: #7a7a7a;
  --line: #e2e2e0;
  --line-2: #cfcfcc;
  --term: #0d0d0d;
  --term-2: #161616;
  --sans: "Inter", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }

/* ---------- Type ---------- */
.display {
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.display.sm { font-size: clamp(34px, 5vw, 58px); }
.h2 {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.h3 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { color: var(--ink-2); font-size: 18px; max-width: 620px; }
.lede.sm { font-size: 16px; max-width: 440px; margin-top: 16px; }
.fine { color: var(--muted); font-size: 13px; }
.k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  transition: background .15s, color .15s, transform .15s;
  white-space: nowrap;
}
.btn-sm { padding: 7px 12px; font-size: 11.5px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2a2a; }
.btn-line { background: #fff; color: var(--ink); }
.btn-line:hover { background: var(--bg-alt); }
.btn.full { width: 100%; margin-top: auto; }
.chev-d { font-size: 12px; transform: translateY(-2px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; height: 64px; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: 0.12em; font-size: 15px; }
.nav-links { display: flex; gap: 26px; font-size: 14px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.chev { color: var(--muted); margin-left: 2px; }
.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--ink); transition: transform .2s; }
.menu-btn span:first-child { top: 14px; }
.menu-btn span:last-child { top: 21px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.mobile-menu { border-top: 1px solid var(--line); padding: 8px 24px 20px; background: #fff; }
.mobile-menu a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 0; overflow: hidden; }

/* Full-width ribbon with a loop in the middle */
.ribbon { width: 100%; margin: 0 0 40px; }
.ribbon > svg { display: block; width: 100%; height: 340px; overflow: hidden; }
.ribbon .rb, .ribbon .rb-gap { fill: none; stroke-linecap: butt; stroke-linejoin: round; }
.ribbon .rb { stroke: var(--ink); stroke-width: 20; }
.ribbon .rb-1 { stroke-linecap: round; } /* covers the hairline seam where strand 2 continues from strand 1 */
.ribbon .rb-gap { stroke: var(--bg); stroke-width: 34; }
/* Draw-in: strand 1 first, then strand 2 */
.ribbon .rb-1 { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s cubic-bezier(.6,0,.3,1) forwards; }
.ribbon .rb-2, .ribbon .rb-gap { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.2,0,.3,1) 1.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Draggable tags strung on the ribbon (positioned by main.js) */
.ribbon { position: relative; }
.rb-tags { opacity: 0; animation: fadeIn .6s ease 2.4s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.rb-tag { cursor: grab; touch-action: none; }
.rb-tag-body { stroke: var(--bg); stroke-width: 3; stroke-linejoin: round; transition: filter .15s; }
.rb-tag-hole { fill: var(--bg); stroke: rgba(0,0,0,.25); stroke-width: 1.5; }
.rb-tag text { font-family: var(--sans); font-size: 24px; font-weight: 700; letter-spacing: -.01em; pointer-events: none; user-select: none; }
.rb-tag:hover .rb-tag-body, .rb-tag.dragging .rb-tag-body { filter: drop-shadow(0 6px 12px rgba(0,0,0,.25)); }
.rb-tag.dragging { cursor: grabbing; }
/* Idle float: gentle bob + sway, per-tag duration/delay set in main.js */
.rb-float { transform-box: fill-box; transform-origin: center; animation: tagFloat 3.6s ease-in-out infinite; }
.rb-tag.dragging .rb-float { animation-play-state: paused; }
@keyframes tagFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-7px) rotate(-2.5deg); }
  50%      { transform: translateY(-2px) rotate(0deg); }
  75%      { transform: translateY(-8px) rotate(2.5deg); }
}
.ribbon { pointer-events: none; }
.ribbon .rb-tag { pointer-events: auto; }
.hero-h { text-transform: none; font-size: clamp(34px, 5vw, 66px); line-height: 1.04; letter-spacing: -0.035em; max-width: 980px; margin: 0 auto; text-wrap: balance; }
.hero-sub { color: var(--ink-2); font-size: clamp(16px, 1.5vw, 19px); max-width: 680px; margin: 26px auto 0; text-wrap: pretty; }
.hero .eyebrow { margin-top: 22px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.install {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: 26px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px 9px 14px;
  font-family: var(--mono); font-size: 13px;
  max-width: 100%;
}
.install code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.copy { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; display: grid; place-items: center; border-radius: 4px; }
.copy:hover { color: var(--ink); background: var(--panel); }
.copy.done { color: var(--ink); }

/* App mockup */
.stage {
  margin-top: 64px;
  background: linear-gradient(180deg, var(--panel), var(--bg-alt));
  border-radius: 16px;
  padding: clamp(16px, 5vw, 64px) clamp(12px, 6vw, 80px) 0;
  overflow: hidden;
}
.app {
  background: var(--term);
  color: #d6d6d6;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow: hidden;
}
.app-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid #222; }
.app-bar i { width: 10px; height: 10px; border-radius: 50%; background: #333; }
.app-title { margin-left: 12px; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.live { margin-left: auto; font-size: 10.5px; color: #fff; letter-spacing: .1em; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.app-body { display: grid; grid-template-columns: 230px 1fr; min-height: 400px; }
.app-side { border-right: 1px solid #222; padding: 14px 10px; background: var(--term-2); }
.side-h { color: #666; font-size: 10.5px; letter-spacing: .14em; padding: 10px 8px 6px; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item.active { background: #252525; color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.ok { background: #8a8a8a; }
.dot.run { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15); animation: blink 1.2s infinite; }
.dot.wait { border: 1px solid #777; }
.tag { font-size: 9.5px; border: 1px solid #3a3a3a; color: #888; padding: 1px 5px; border-radius: 3px; min-width: 44px; text-align: center; }
.app-main { padding: 18px 22px 22px; min-width: 0; }
.goal { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px; padding: 12px 14px; color: #cfcfcf; line-height: 1.6; }
.goal b { color: #fff; font-weight: 500; }
.goal .label { display: inline-block; font-size: 10px; letter-spacing: .14em; color: #0a0a0a; background: #e8e8e8; padding: 1px 6px; border-radius: 3px; margin-right: 8px; }
.log { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.log li { display: grid; grid-template-columns: 62px 64px 1fr; gap: 10px; opacity: 0; transform: translateY(4px); animation: in .35s forwards; }
.log .t { color: #555; }
.log .s { color: #fff; font-size: 10.5px; letter-spacing: .1em; padding-top: 1px; }
.log .m { color: #bdbdbd; overflow-wrap: anywhere; }
.log .m em { font-style: normal; color: #fff; }
.log li.pass .m { color: #fff; }
@keyframes in { to { opacity: 1; transform: none; } }

/* ---------- Stack ---------- */
.stack { padding: 110px 0 60px; }
.stack-grid {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 38px 20px;
  text-align: center;
}
.stack-grid span { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: #2b2b2b; opacity: .8; transition: opacity .2s; }
.stack-grid span:hover { opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 56px; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head .lede { margin-top: 20px; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

.loop-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.loop-step { padding: 28px 24px 30px 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; position: relative; }
.loop-step + .loop-step { padding-left: 24px; }
.loop-step:last-child { border-right: 0; }
.loop-step .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.loop-step h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.loop-step p { color: var(--ink-2); font-size: 15px; }
.mini { margin-top: auto; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.mini span { font-family: var(--mono); font-size: 11px; background: var(--bg-alt); border: 1px solid var(--line); padding: 3px 7px; border-radius: 4px; color: var(--ink-2); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature { background: #fff; padding: 28px 24px 32px; transition: background .2s; }
.feature:hover { background: #fcfcfb; }
.ficon { width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 8px; display: grid; place-items: center; margin-bottom: 22px; }
.ficon svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.feature p { color: var(--ink-2); font-size: 14.5px; }

/* Models */
.models {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: clamp(28px, 6vw, 72px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.sq { display: block; width: 8px; height: 8px; background: var(--line-2); margin-bottom: 26px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chips span { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 8px; text-align: center; font-size: 14px; box-shadow: 0 1px 0 rgba(0,0,0,.03); white-space: nowrap; }
.chips span:last-child { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips-wrap .fine { margin-top: 14px; }

/* Enterprise */
.ent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line-2); }
.ent { padding: 26px 24px 30px 0; border-bottom: 1px solid var(--line); }
.ent p { margin-top: 10px; font-size: 16px; color: var(--ink-2); max-width: 320px; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.price { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; display: flex; flex-direction: column; gap: 6px; min-height: 420px; }
.price.feat { border-color: var(--ink); box-shadow: 0 20px 50px -30px rgba(0,0,0,.35); }
.amt { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; margin-top: 10px; }
.amt small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.price ul { list-style: none; margin: 22px 0 28px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--ink-2); }
.price li::before { content: "→"; font-family: var(--mono); color: var(--muted); margin-right: 10px; }

/* CTA */
.cta { padding: 130px 0; border-top: 1px solid var(--line); }
.cta img { margin: 0 auto 30px; }
.cta .eyebrow { margin-top: 20px; }

/* Footer */
.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 64px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid > div { display: flex; flex-direction: column; gap: 10px; }
.foot-grid .k { margin-bottom: 4px; }
.foot-grid a:not(.brand) { font-size: 14px; color: var(--ink-2); }
.foot-grid a:not(.brand):hover { color: var(--ink); }
.foot-bottom { display: flex; justify-content: space-between; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .loop-grid { grid-template-columns: repeat(2, 1fr); }
  .loop-step:nth-child(2) { border-right: 0; }
  .loop-step:nth-child(3) { padding-left: 0; }
  .loop-step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .models { grid-template-columns: 1fr; }
  .ent-grid { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .price { min-height: 0; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .hide-sm { display: none; }
  .hero { padding-top: 56px; }
  .app-body { grid-template-columns: 1fr; min-height: 360px; }
  .app-side { display: none; }
  .app-main { padding: 14px; }
  .log li { grid-template-columns: 54px 1fr; }
  .log .t { display: none; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .stack-grid span { font-size: 19px; }
  .section { padding: 80px 0; }
  .feature-grid, .loop-grid, .ent-grid { grid-template-columns: 1fr; }
  .loop-step, .loop-step + .loop-step { padding: 24px 0; border-right: 0; border-top: 1px solid var(--line); }
  .loop-step:first-child { border-top: 0; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .foot-bottom { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .log li { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) { .ribbon .rb, .ribbon .rb-gap { stroke-dashoffset: 0 !important; } }
.nowrap { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .rb-tags { opacity: 1 !important; } }
