/* ============================================================= Tokens */
:root {
  --bg:        oklch(0.115 0.018 285);
  --bg-soft:   oklch(0.155 0.022 285);
  --ink:       oklch(0.975 0.008 285);
  --muted:     oklch(0.74 0.02 285);
  --faint:     oklch(0.56 0.02 285);

  --purple: #9e73f5;
  --blue:   #5cc7fa;
  --pink:   #f56680;
  --green:  #4fd089;

  --line:      oklch(1 0 0 / 0.10);
  --line-soft: oklch(1 0 0 / 0.06);

  --glass:   oklch(0.20 0.025 285 / 0.45);
  --glass-2: oklch(0.24 0.03 285 / 0.55);
  --blur: 20px;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
/* Deep radial wash so the page never reads as flat black. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(120% 80% at 80% -10%, color-mix(in oklab, var(--purple) 22%, transparent), transparent 60%),
    radial-gradient(90% 70% at 0% 110%, color-mix(in oklab, var(--blue) 14%, transparent), transparent 55%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.9em; }

/* ===================================================== Atmosphere layers */
#sky  { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
#glow {
  position: fixed; top: 0; left: 0; width: 540px; height: 540px; z-index: -1;
  margin: -270px 0 0 -270px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--purple) 42%, transparent), transparent 62%);
  mix-blend-mode: screen; filter: blur(28px);
  opacity: 0; transition: opacity 0.6s var(--ease);
  will-change: transform;
}
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================================================== Glass primitive */
.glass {
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(var(--blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.12) inset,
    0 30px 70px -40px oklch(0 0 0 / 0.85);
}

/* ===================================================== Logo mark */
.mark { position: relative; width: 26px; height: 26px; display: inline-block; flex: none; }
.mark i {
  position: absolute; width: 64%; height: 64%; border-radius: 30%;
}
.mark i:first-child { background: var(--pink); left: 0; top: 12%; }
.mark i:last-child  { background: var(--blue); right: 0; bottom: 12%; mix-blend-mode: screen; }
.mark.big { width: 56px; height: 56px; }

/* ===================================================== Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: oklch(0.12 0.02 285 / 0.6);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: -0.02em; }
.brand .mark { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.8rem); }
.nav-links > a:not(.btn) { color: var(--muted); font-size: 0.92rem; transition: color 0.25s; }
.nav-links > a:not(.btn):hover { color: var(--ink); }

/* ===================================================== Buttons */
.btn {
  --pad: 0.85rem 1.4rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: var(--pad); border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.3s, border-color 0.3s;
}
.btn-sm { --pad: 0.5rem 1rem; font-size: 0.88rem; }
.btn-lg { --pad: 1.05rem 2rem; font-size: 1.06rem; }
.btn-primary {
  background: var(--purple); color: #1a1030;
  box-shadow: 0 10px 40px -12px color-mix(in oklab, var(--purple) 80%, transparent);
}
.btn-primary:hover { box-shadow: 0 16px 50px -10px color-mix(in oklab, var(--purple) 90%, transparent); }
.btn-ghost {
  background: oklch(1 0 0 / 0.04); color: var(--ink); border-color: var(--line);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: oklch(1 0 0 / 0.09); border-color: oklch(1 0 0 / 0.2); }
.magnetic > * { display: inline-flex; align-items: center; gap: 0.55rem; will-change: transform; }

/* ===================================================== Layout shells */
main { position: relative; z-index: 1; }
section { padding-inline: clamp(1rem, 4vw, 2.5rem); }
.eyebrow {
  font-family: "Geist Mono", monospace; font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--purple); margin-bottom: 1.1rem;
}
.sec-head { max-width: var(--maxw); margin: 0 auto clamp(2rem, 5vw, 3.5rem); }
.sec-head.center { text-align: center; }
.sec-head h2, .download h2, .showcase h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04;
}

/* ===================================================== Hero */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  min-height: 100svh; display: grid; align-items: center;
  grid-template-columns: 1.02fr 0.98fr; gap: clamp(2rem, 5vw, 4rem);
  padding-top: 6rem; padding-bottom: 3rem;
}
.hero h1 {
  font-size: clamp(2.8rem, 7.2vw, 5.2rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 0.97; margin-bottom: 1.4rem;
  text-shadow: 0 0 60px color-mix(in oklab, var(--purple) 30%, transparent);
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 46ch; margin-bottom: 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.1rem; }
.cta-note { font-family: "Geist Mono", monospace; font-size: 0.8rem; color: var(--faint); letter-spacing: 0.01em; }

/* Hero stage: tilted screenshot + floating diff chip */
.hero-stage { position: relative; }
.shot-frame { position: relative; overflow: hidden; padding: 0; }
.shot-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.shot-bar i { width: 11px; height: 11px; border-radius: 50%; background: oklch(1 0 0 / 0.18); }
.shot-bar i:nth-child(1) { background: var(--pink); }
.shot-bar i:nth-child(2) { background: #f5c84b; }
.shot-bar i:nth-child(3) { background: var(--green); }
.shot-frame img { width: 100%; }
.diff-chip {
  position: absolute; right: -8%; bottom: -7%; width: 64%; max-width: 320px;
  padding: 0.85rem 1rem; font-family: "Geist Mono", monospace; font-size: 0.78rem;
  display: grid; gap: 0.25rem; transform: translateZ(60px);
}
.chip-row { white-space: nowrap; color: var(--muted); }
.chip-row b { display: inline-block; width: 1.1em; }
.chip-row.del { color: color-mix(in oklab, var(--pink) 85%, white); }
.chip-row.add { color: color-mix(in oklab, var(--green) 85%, white); }

/* ===================================================== Trust strip */
.trust {
  max-width: var(--maxw); margin: 1rem auto clamp(4rem, 9vw, 7rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  color: var(--faint); font-size: 0.86rem;
}
.trust i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); opacity: 0.6; }

/* ===================================================== Features bento */
.features { max-width: var(--maxw); margin: 0 auto; padding-block: clamp(2rem, 6vw, 4rem); }
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cell {
  position: relative; padding: 1.6rem; overflow: hidden;
  transform-style: preserve-3d; min-height: 240px;
  display: flex; flex-direction: column;
}
.cell-lg   { grid-row: span 2; }
.cell-wide { grid-column: span 2; }
.cell .idx { font-family: "Geist Mono", monospace; font-size: 0.8rem; color: var(--purple); opacity: 0.8; }
.cell h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; margin: 0.7rem 0 0.5rem; }
.cell p { color: var(--muted); font-size: 0.95rem; max-width: 42ch; }
.cell.accent { background: linear-gradient(160deg, color-mix(in oklab, var(--purple) 22%, var(--glass-2)), var(--glass)); }

/* glare highlight (driven by JS vars) */
.glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 0%), oklch(1 0 0 / 0.14), transparent 60%);
  transition: opacity 0.35s var(--ease);
}
.tilt:hover .glare { opacity: 1; }

/* mini visual motifs inside cells */
.mini-diff { margin-top: auto; font-family: "Geist Mono", monospace; font-size: 0.74rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); }
.mini-diff .row { padding: 0.18rem 0.6rem; color: var(--muted); }
.mini-diff .ln { display: inline-block; width: 1.6em; color: var(--faint); }
.mini-diff .row.add { background: color-mix(in oklab, var(--green) 14%, transparent); }
.mini-diff .row.del { background: color-mix(in oklab, var(--pink) 14%, transparent); }
.mini-diff mark { background: oklch(1 0 0 / 0.14); color: var(--ink); border-radius: 3px; padding: 0 2px; }

.img-demo { margin-top: auto; height: 96px; border-radius: 12px; position: relative; overflow: hidden; border: 1px solid var(--line-soft); background: oklch(0.1 0.02 285); }
.img-demo .orb { position: absolute; left: 30%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--purple); filter: blur(1px); }
.img-demo .dot { position: absolute; left: 64%; top: 36%; width: 18px; height: 18px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 24px 4px var(--pink); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.tree { list-style: none; margin-top: auto; display: grid; gap: 0.35rem; font-family: "Geist Mono", monospace; font-size: 0.82rem; }
.tree li { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.tree b { width: 1.3em; height: 1.3em; display: grid; place-items: center; border-radius: 5px; font-size: 0.72rem; color: #14121c; }
.tree .a b { background: var(--green); } .tree .d b { background: var(--pink); } .tree .m b { background: var(--blue); }

.merge-demo { margin-top: auto; display: flex; gap: 0.5rem; }
.merge-demo span { flex: 1; height: 56px; border-radius: 10px; border: 1px solid var(--line-soft); }
.merge-demo span:nth-child(1) { background: color-mix(in oklab, var(--faint) 18%, transparent); }
.merge-demo span:nth-child(2) { background: color-mix(in oklab, var(--pink) 22%, transparent); }
.merge-demo span:nth-child(3) { background: color-mix(in oklab, var(--blue) 22%, transparent); }

/* ===================================================== Showcase */
.showcase { max-width: var(--maxw); margin: clamp(4rem, 10vw, 8rem) auto 0; }
.showcase-frame { position: relative; overflow: hidden; padding: 10px; transform-style: preserve-3d; }
.showcase-frame img { width: 100%; border-radius: 12px; }

/* ===================================================== Download */
.download { max-width: var(--maxw); margin: clamp(5rem, 12vw, 9rem) auto; }
.dl-card { text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; position: relative; overflow: hidden; }
.dl-card .mark { margin: 0 auto 1.4rem; }
.dl-card h2 { margin-bottom: 0.8rem; }
.dl-card p { color: var(--muted); max-width: 52ch; margin: 0 auto 1.8rem; }
.dl-card .btn { margin: 0 auto 1rem; }
.dl-card::after {
  content: ""; position: absolute; left: 50%; top: -40%; width: 70%; height: 80%;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklab, var(--purple) 30%, transparent), transparent 65%);
  filter: blur(20px);
}

/* ===================================================== Footer */
.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  color: var(--faint); font-size: 0.9rem;
}
.foot-left { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-weight: 600; }
.foot-left .mark { width: 20px; height: 20px; }
.foot-links { display: flex; gap: 1.4rem; }
.foot-links a { color: var(--muted); transition: color 0.25s; }
.foot-links a:hover { color: var(--ink); }

/* ===================================================== Reveal */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ===================================================== Responsive */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 7rem; gap: 3rem; }
  .hero-stage { order: 2; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell-wide { grid-column: span 2; }
  .cell-lg { grid-row: auto; }
}
@media (max-width: 600px) {
  .nav-links > a:not(.btn) { display: none; }
  .bento { grid-template-columns: 1fr; }
  .cell-wide { grid-column: auto; }
  .diff-chip { right: 0; bottom: -10%; width: 80%; }
  .foot { flex-direction: column; align-items: flex-start; }
}

/* ===================================================== Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  #glow { display: none; }
  .tilt { transform: none !important; }
}
