/* Lunatap — dark landing page in the Vercel / Supabase family.
   Near-black surfaces tinted toward the logo's indigo, 1px hairlines,
   one warm accent (moon gold) for actions and highlights. */

:root {
  --bg: oklch(0.145 0.012 281);
  --bg-raise: oklch(0.175 0.016 281);
  --bg-sunk: oklch(0.12 0.01 281);
  --card: oklch(0.165 0.014 281);
  --line: oklch(1 0 0 / 0.08);
  --line-strong: oklch(1 0 0 / 0.14);

  --ink: oklch(0.97 0.004 281);
  --ink-2: oklch(0.78 0.015 281);
  --ink-3: oklch(0.62 0.02 281);

  --indigo: oklch(0.58 0.2 277);
  --moon: oklch(0.85 0.13 86);
  --moon-pale: oklch(0.95 0.06 92);
  --moon-ink: oklch(0.25 0.05 70);
  --ok: oklch(0.8 0.15 155);
  --bad: oklch(0.72 0.17 25);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 32px);
  --s-2: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --s-3: clamp(1.75rem, 1.3rem + 1.6vw, 3rem);
  --s-4: clamp(3rem, 2rem + 4vw, 6rem);
  --s-5: clamp(5rem, 3.5rem + 6vw, 9.5rem);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --marquee-gap: clamp(36px, 5vw, 64px);

  --z-sticky: 10;
  --z-skip: 20;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
code, pre { font-family: var(--mono); }
p { text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.dim { color: var(--ink-3); }
.skip { position: absolute; left: -999px; top: 8px; z-index: var(--z-skip); background: var(--moon); color: var(--moon-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.nav.is-scrolled {
  background: oklch(0.145 0.012 281 / 0.72);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.nav-inner {
  width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: flex; align-items: center; gap: 28px; height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; }
.nav nav { display: flex; gap: 24px; margin-left: 12px; font-size: 0.93rem; }
.nav nav a { text-decoration: none; color: var(--ink-2); transition: color 0.2s; }
.nav nav a:hover { color: var(--ink); }
.nav-cta {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  background: var(--ink); color: var(--bg);
  transition: background-color 0.2s;
}
.nav-cta:hover { background: var(--moon-pale); }
@media (max-width: 760px) { .nav nav { display: none; } }

/* ---------- Hero ---------- */

.hero { position: relative; isolation: isolate; overflow: hidden; margin-top: -64px; padding-top: calc(64px + clamp(56px, 9vh, 110px)); }

/* Vercel-style hairline grid, fading out from the centre. */
.hero-grid {
  position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 25%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 55% at 50% 25%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute; z-index: -1;
  left: 50%; top: 30%; width: min(1100px, 140vw); aspect-ratio: 2 / 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side at 50% 60%, oklch(0.5 0.22 279 / 0.45), transparent),
    radial-gradient(closest-side at 64% 74%, oklch(0.85 0.13 86 / 0.12), transparent);
  filter: blur(20px);
  pointer-events: none;
}

.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: oklch(1 0 0 / 0.03);
  font-size: 0.88rem; color: var(--ink-2); text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: oklch(1 0 0 / 0.3); color: var(--ink); }
.pill-tag { padding: 2px 9px; border-radius: 999px; background: var(--moon); color: var(--moon-ink); font-weight: 700; font-size: 0.78rem; }

.hero h1 {
  margin-top: var(--s-2);
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.h1-accent { color: var(--moon-pale); }
.lede-punch { margin: -8px 0 var(--s-3); font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); font-weight: 650; color: var(--moon-pale); }
.stacks { margin: -10px 0 var(--s-3); font-size: 0.92rem; color: var(--ink-3); }
.stacks b { color: var(--ink-2); font-weight: 600; }
.lede { max-width: 42rem; margin: var(--s-2) 0 var(--s-3); color: var(--ink-2); font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.22rem); }

.install {
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 54rem);
  padding: 6px 6px 6px 16px;
  border-radius: 12px;
  background: var(--bg-sunk);
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 4px oklch(1 0 0 / 0.02), 0 24px 60px -30px oklch(0 0 0 / 0.9);
  text-align: left;
}
.install .prompt { color: var(--moon); font-family: var(--mono); font-size: 0.9rem; }
.install-cmd {
  flex: 1; min-width: 0;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  font-size: 0.86rem; color: var(--ink); padding: 8px 0;
}
.install-cmd::-webkit-scrollbar { display: none; }
.copy {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  font: 600 0.88rem/1 var(--display);
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg-raise); color: var(--ink);
  cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.copy:hover { background: oklch(0.22 0.02 281); border-color: oklch(1 0 0 / 0.24); }
.copy.is-copied { background: var(--ok); border-color: var(--ok); color: oklch(0.2 0.05 155); }
.install-note { margin: 14px 0 0; font-size: 0.86rem; color: var(--ink-3); }
.byline {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 26px; padding: 7px 18px 7px 7px;
  border-radius: 999px;
  border: 1px solid oklch(0.85 0.13 86 / 0.45);
  background: linear-gradient(90deg, oklch(0.85 0.13 86 / 0.12), oklch(0.85 0.13 86 / 0.03));
  box-shadow: 0 0 0 4px oklch(0.85 0.13 86 / 0.05), 0 10px 40px -12px oklch(0.85 0.13 86 / 0.35);
  color: var(--ink-2); font-size: 1rem; text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.3s, transform 0.25s var(--ease);
}
.byline b { color: var(--moon); font-weight: 700; }
.byline svg { color: var(--moon); opacity: 0.85; }
.byline:hover { border-color: oklch(0.85 0.13 86 / 0.8); transform: translateY(-1px); box-shadow: 0 0 0 4px oklch(0.85 0.13 86 / 0.1), 0 14px 50px -12px oklch(0.85 0.13 86 / 0.5); }
.byline-avatar, .creator-avatar {
  flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover;
  background: linear-gradient(145deg, oklch(0.55 0.2 279), oklch(0.3 0.14 281));
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.18);
  color: var(--moon-pale); font-weight: 750; letter-spacing: -0.02em;
}
.byline-avatar { width: 34px; height: 34px; font-size: 0.8rem; box-shadow: 0 0 0 2px oklch(0.85 0.13 86 / 0.8); }

/* Stage, framed like a Vercel hero canvas with corner crosshairs. */
.stage-frame {
  position: relative;
  margin-top: var(--s-4);
  border: 1px solid var(--line);
  background: linear-gradient(to bottom, oklch(1 0 0 / 0.02), transparent 40%), var(--bg);
}
.cross { position: absolute; width: 21px; height: 21px; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--ink-3); }
.cross::before { left: 10px; top: 0; width: 1px; height: 21px; }
.cross::after { top: 10px; left: 0; height: 1px; width: 21px; }
.cross-tl { left: -11px; top: -11px; }
.cross-tr { right: -11px; top: -11px; }
.cross-bl { left: -11px; bottom: -11px; }
.cross-br { right: -11px; bottom: -11px; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(28px, 4vw, 56px);
}
.stage-label { margin: 0 0 12px; font: 500 0.75rem var(--mono); color: var(--ink-3); letter-spacing: 0.02em; }

.calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.calls li {
  display: grid; gap: 1px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color 0.45s var(--ease), background-color 0.45s, box-shadow 0.45s;
}
.calls code { font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.45s; }
.calls span { font-size: 0.76rem; color: oklch(0.55 0.02 281); transition: color 0.45s; }
.calls .pass { font-family: var(--mono); font-weight: 700; }
.calls li.is-done code { color: var(--ink-2); }
.calls li.is-done span { color: var(--ink-3); }
.calls li.is-done .pass, .calls li.is-active .pass { color: var(--ok); }
.calls li.is-active {
  border-color: oklch(0.85 0.13 86 / 0.55);
  background: oklch(0.2 0.03 281);
  box-shadow: 0 0 0 3px oklch(0.85 0.13 86 / 0.1);
}
.calls li.is-active code { color: var(--moon-pale); }
.calls li.is-active span { color: var(--ink-2); }

.phone { position: relative; margin: 0; display: grid; justify-items: center; gap: 14px; isolation: isolate; }
.moon {
  position: absolute; z-index: -1;
  width: 170%; aspect-ratio: 1; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.85 0.13 86 / 0.2), oklch(0.5 0.2 279 / 0.16) 42%, transparent 66%);
  filter: blur(8px);
}
.phone-screen {
  width: clamp(220px, 20vw, 280px);
  aspect-ratio: 1320 / 2868;
  border-radius: clamp(34px, 3vw, 44px);
  padding: 8px;
  background: linear-gradient(160deg, oklch(0.34 0.01 281), oklch(0.13 0.005 281));
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.12), 0 50px 100px -40px oklch(0 0 0 / 0.95);
}
.phone-screen video { width: 100%; height: 100%; object-fit: cover; border-radius: clamp(27px, 2.5vw, 37px); background: #f2f2f7; }
.phone figcaption { font: 0.72rem var(--mono); color: var(--ink-3); }

.stage-right { display: grid; gap: 14px; align-content: center; }
.bubble { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.bubble p:last-child { margin: 0; color: var(--ink); font-size: 0.98rem; line-height: 1.5; }
.bubble ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.93rem; color: var(--ink-2); }
.bubble li { display: flex; align-items: center; gap: 10px; }
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px oklch(0.8 0.15 155 / 0.18); flex: none; }
.bubble-result { transition: opacity 0.6s var(--ease), translate 0.6s var(--ease); }
.bubble-result.is-waiting { opacity: 0.35; translate: 0 4px; }

/* Trust strip */
.trust { border-top: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-grid > div { display: grid; align-content: start; gap: 6px; padding: clamp(22px, 3vw, 36px) clamp(16px, 2vw, 28px); }
.trust-grid > div + div { border-left: 1px solid var(--line); }
.trust-grid b { font-size: 1.02rem; font-weight: 650; letter-spacing: -0.01em; }
.trust-grid span { color: var(--ink-3); font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 900px) {
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid > div:nth-child(3) { border-left: 0; }
  .trust-grid > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .trust-grid { grid-template-columns: minmax(0, 1fr); }
  .trust-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* Sliding logos */
.logos { padding: var(--s-4) 0 var(--s-3); text-align: center; }
.logos p { margin: 0 0 var(--s-2); color: var(--ink-3); font-size: 0.92rem; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; width: max-content; gap: var(--marquee-gap);
  list-style: none; margin: 0; padding: 6px 0;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  font-weight: 600; font-size: 1.12rem; letter-spacing: -0.015em; color: var(--ink-2);
  transition: color 0.2s;
}
.marquee-track li:hover { color: var(--ink); }
.tool-icon {
  width: 24px; height: 24px; flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
@keyframes marquee { to { transform: translateX(calc(-50% - var(--marquee-gap) / 2)); } }

/* ---------- Sections ---------- */

.section { padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 50rem; margin-bottom: var(--s-4); }
.section-head h2 { font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.6rem); }
.section-head p { margin: var(--s-2) 0 0; color: var(--ink-2); font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem); max-width: 36rem; }
.section-head-center { margin-inline: auto; text-align: center; }
.section p code, .section span code { font-size: 0.86em; padding: 1px 6px; border-radius: 6px; background: oklch(1 0 0 / 0.06); color: var(--ink); }

/* Loop */
.loop-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s-3); align-items: start; }
.steps { display: grid; gap: 6px; }
.steps button {
  all: unset;
  display: grid; gap: 4px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), border-color 0.3s;
}
.steps button b { font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink-2); transition: color 0.3s; }
.steps button span { color: var(--ink-3); font-size: 0.96rem; line-height: 1.5; transition: color 0.3s; }
.steps button:hover { background: oklch(1 0 0 / 0.025); }
.steps button[aria-selected="true"] { background: var(--card); border-color: var(--line-strong); }
.steps button[aria-selected="true"] b { color: var(--ink); }
.steps button[aria-selected="true"] span { color: var(--ink-2); }
.steps button:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }

.terminal {
  position: sticky; top: 88px;
  border-radius: var(--radius);
  background: var(--bg-sunk);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  min-height: 24rem;
  box-shadow: 0 40px 90px -50px oklch(0.45 0.22 279 / 0.7);
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: oklch(1 0 0 / 0.14); }
.term-bar span { margin-left: auto; font: 0.74rem var(--mono); color: var(--ink-3); }
.terminal pre, .card-code {
  margin: 0; padding: 20px 22px 24px;
  font-size: clamp(0.76rem, 0.73rem + 0.15vw, 0.86rem); line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; color: var(--ink-2);
}
.terminal pre { animation: panel-in 0.4s var(--ease); }
@keyframes panel-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
pre .c { color: var(--moon); }
pre .g { color: var(--ok); font-weight: 600; }
pre .r { color: var(--bad); font-weight: 600; }
pre b { color: var(--ink); font-weight: 600; }
.footnote { margin: var(--s-2) 0 0; font-size: 0.86rem; color: var(--ink-3); }

/* Bento cards with a cursor spotlight (Supabase / Vercel). */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color 0.3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), oklch(0.58 0.2 277 / 0.14), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: 1.15rem; letter-spacing: -0.02em; margin: 18px 0 8px; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.card-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-3); align-items: center; padding: clamp(22px, 3vw, 36px); }
.card-wide h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-top: 0; }
.card-wide p { font-size: 1.02rem; }
.card-code { border-radius: 12px; border: 1px solid var(--line); background: var(--bg-sunk); }

.card-visual {
  position: relative; height: 150px;
  border-radius: 10px; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 0%, oklch(0.5 0.2 279 / 0.18), transparent 70%), var(--bg-sunk);
  overflow: hidden;
}
.visual-flows { display: grid; align-content: center; gap: 8px; padding: 0 18px; font: 0.78rem var(--mono); color: var(--ink-2); }
.visual-flows span { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; background: oklch(1 0 0 / 0.03); border: 1px solid var(--line); }
.visual-flows i { font-style: normal; font-weight: 700; }
.visual-flows .g { color: var(--ok); }
.visual-flows .r { color: var(--bad); }
.visual-video img { position: absolute; left: 50%; top: 14px; width: 42%; transform: translateX(-50%); border-radius: 14px; box-shadow: 0 0 0 1px oklch(1 0 0 / 0.12); }
.visual-video .caption-chip {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  white-space: nowrap; font-size: 0.74rem; padding: 6px 12px; border-radius: 8px;
  background: oklch(0.1 0.01 281 / 0.92); border: 1px solid var(--line-strong); color: var(--ink);
}
.visual-pins {
  background:
    linear-gradient(115deg, transparent 46%, oklch(1 0 0 / 0.06) 47%, oklch(1 0 0 / 0.06) 49%, transparent 50%),
    linear-gradient(25deg, transparent 58%, oklch(1 0 0 / 0.05) 59%, oklch(1 0 0 / 0.05) 61%, transparent 62%),
    radial-gradient(circle at 50% 0%, oklch(0.5 0.2 279 / 0.18), transparent 70%),
    var(--bg-sunk);
}
.visual-pins i, .visual-pins b { position: absolute; transform: translate(-50%, -50%); }
.visual-pins i {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink-3); border: 3px solid var(--ink);
  animation: ping 3s var(--ease) infinite;
}
.visual-pins i:nth-child(2) { animation-delay: 1s; }
.visual-pins i:nth-child(3) { animation-delay: 2s; }
.visual-pins b { padding: 6px 10px; border-radius: 999px; font: 700 0.78rem var(--mono); background: var(--moon); color: var(--moon-ink); }
@keyframes ping { 0%, 60%, 100% { box-shadow: 0 0 0 0 oklch(0.85 0.13 86 / 0); } 20% { box-shadow: 0 0 0 8px oklch(0.85 0.13 86 / 0.35); } }
.visual-devices { display: flex; align-items: center; justify-content: center; gap: 14px; }
.visual-devices .dev {
  display: grid; justify-items: center; gap: 2px;
  width: 104px; padding: 16px 0;
  border-radius: 16px; border: 1px solid var(--line-strong); background: oklch(1 0 0 / 0.03);
  font-weight: 600; font-size: 0.9rem;
}
.visual-devices small { font: 0.68rem var(--mono); color: var(--ink-3); }
.visual-agent { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 12px; }
.visual-agent span { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: oklch(1 0 0 / 0.03); font: 0.78rem var(--mono); color: var(--ink); }
.visual-agent em { font-style: normal; color: var(--ink-3); }

/* Tools */
.tools-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-4); align-items: start; }
.tools-grid .section-head { margin-bottom: 0; position: sticky; top: 100px; }
.tools { margin: 0; border-top: 1px solid var(--line); }
.tools div { display: grid; grid-template-columns: 12rem 1fr; gap: 16px; padding: 15px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.tools dt { font: 500 0.88rem var(--mono); color: var(--moon-pale); }
.tools dd { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* Video */
.video-frame { max-width: 1000px; margin: 0 auto; padding: 6px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--card); box-shadow: 0 60px 120px -60px oklch(0.45 0.22 279 / 0.8); }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; border-radius: 13px; background: var(--bg-sunk); }

/* Closing */
.closing { position: relative; isolation: isolate; overflow: hidden; padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.closing-moon {
  position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(1000px, 130vw); height: 560px;
  background:
    radial-gradient(ellipse 34% 30% at 50% 42%, oklch(0.85 0.13 86 / 0.12), transparent 100%),
    radial-gradient(ellipse 50% 46% at 50% 50%, oklch(0.5 0.22 279 / 0.28), transparent 100%);
  filter: blur(10px);
}
.closing-inner { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.closing h2 { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4rem); margin-bottom: var(--s-2); }
.closing-sub { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem); max-width: 38rem; }
.closing-then { margin: var(--s-2) 0 0; color: var(--ink-2); max-width: 40rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--s-3); }
.btn { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--moon); color: var(--moon-ink); }
.btn-primary:hover { background: var(--moon-pale); }
.btn-secondary { border: 1px solid var(--line-strong); background: oklch(0.145 0.012 281 / 0.6); }
.btn-secondary:hover { border-color: oklch(1 0 0 / 0.3); }

/* Footer: a hairline panel of links over a giant cropped wordmark
   with a moonrise glow behind it. */
.foot {
  position: relative; overflow: hidden; isolation: isolate;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding-top: clamp(48px, 6vw, 88px);
  font-size: 0.92rem; color: var(--ink-3);
}
.foot::after {
  content: ""; position: absolute; z-index: -2; pointer-events: none;
  left: 50%; bottom: -40%; transform: translateX(-50%);
  width: min(1500px, 170vw); height: 90%;
  background:
    radial-gradient(ellipse 30% 45% at 50% 70%, oklch(0.85 0.13 86 / 0.32), transparent 100%),
    radial-gradient(ellipse 55% 70% at 50% 75%, oklch(0.5 0.22 279 / 0.45), transparent 100%);
  filter: blur(30px);
}
.foot-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: oklch(0.16 0.014 281 / 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.foot-cell { padding: clamp(22px, 2.6vw, 34px); display: grid; align-content: start; gap: 11px; }
.foot-cell + .foot-cell { border-left: 1px solid var(--line); }
.foot .brand { color: var(--ink); font-size: 1.05rem; }
.foot-tagline {
  margin: 18px 0 24px;
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.15; color: var(--ink);
}
.foot-tagline span { color: var(--ink-3); }
.creator { display: grid; gap: 12px; margin-top: 4px; padding-top: 22px; border-top: 1px solid var(--line); }
.creator-label { font: 500 0.78rem var(--mono); color: var(--ink-3); }
.creator-row { display: flex; align-items: center; gap: 14px; }
.creator-avatar { width: 52px; height: 52px; font-size: 1.05rem; box-shadow: 0 0 0 2px oklch(0.85 0.13 86 / 0.8), 0 0 30px -6px oklch(0.85 0.13 86 / 0.5); }
.creator-row b { display: block; color: var(--moon); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.creator-row small { color: var(--ink-2); font-size: 0.9rem; }
.creator-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink) !important;
  font-size: 0.86rem; font-weight: 600; text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.pill-btn:hover { border-color: oklch(0.85 0.13 86 / 0.6); background: oklch(0.85 0.13 86 / 0.08); }
.foot h4 { margin: 0 0 6px; font: 500 0.78rem var(--mono); color: var(--ink-3); letter-spacing: 0.02em; }
.foot-cell a:not(.brand):not(.pill-btn) { color: var(--ink-2); text-decoration: none; width: fit-content; transition: color 0.2s; }
.foot-cell a:not(.brand):not(.pill-btn):hover { color: var(--ink); }
.foot-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: flex-end;
  padding: 22px 4px 0; font-size: 0.84rem;
}
.foot-bottom p { margin: 0; }
.foot-credit a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid oklch(1 0 0 / 0.25); transition: border-color 0.2s; }
.foot-credit a:hover { border-color: var(--moon); }

/* The wordmark: solid, full width, cropped by the page edge. */
.foot-mark {
  height: clamp(5.2rem, 17.5vw, 15.5rem);
  margin-top: clamp(28px, 4vw, 56px);
  overflow: hidden;
  display: flex; justify-content: center;
}
.foot-mark span {
  display: block;
  font-weight: 700; letter-spacing: 0.02em; line-height: 0.82;
  font-variation-settings: "opsz" 24;
  font-size: clamp(6rem, 21vw, 18.5rem);
  color: oklch(0.26 0.075 279);
  white-space: nowrap; user-select: none;
  transform: translateY(2%);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.24s; }
  .stage-frame { animation: rise 1.1s var(--ease) 0.3s both; }
  @keyframes rise { from { opacity: 0; translate: 0 16px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee-track li[aria-hidden="true"] { display: none; }
  .visual-pins i { animation: none; }
  .terminal pre { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .foot-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .foot-intro + .foot-cell { border-left: 0; }
  .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .stage-side { width: min(100%, 30rem); }
  .phone { order: 1; }
  .stage-side:first-child { order: 2; }
  .stage-right { order: 3; }
  .loop-grid, .tools-grid, .card-wide { grid-template-columns: minmax(0, 1fr); }
  .terminal { position: relative; top: 0; min-height: 0; }
  .tools-grid .section-head { position: static; margin-bottom: var(--s-3); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .byline-role { display: none; }
  .foot-panel { grid-template-columns: minmax(0, 1fr); }
  .foot-cell + .foot-cell { border-left: 0; border-top: 1px solid var(--line); }
  .foot-intro { border-bottom: 0; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tools div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .install { padding-left: 12px; }
  .install-cmd { font-size: 0.78rem; }
  .copy span { display: none; }
  .stage-frame { border-left: 0; border-right: 0; width: 100%; }
  .cross { display: none; }
}
