/* TPanel landing — design tokens */
:root {
  --bg: oklch(0.16 0.03 275);
  --bg-2: oklch(0.2 0.035 275);
  --surface: oklch(0.23 0.035 275 / 0.7);
  --line: oklch(0.9 0.02 275 / 0.08);
  --line-2: oklch(0.9 0.02 275 / 0.16);
  --ink: oklch(0.97 0.01 275);
  --ink-2: oklch(0.82 0.02 275);
  --ink-3: oklch(0.66 0.03 275);
  --ink-4: oklch(0.5 0.03 275);
  --indigo: #5b5bf0;
  --cyan: #1fc6e0;
  --green: #22c55e;
  --grad: linear-gradient(120deg, #6366f1 0%, #22d3ee 100%);

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--f-body); font-size: clamp(16px, 1.1vw, 19px); line-height: 1.55; letter-spacing: -0.01em;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: -20vh -20vw auto; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 70% 30%, oklch(0.5 0.2 275 / 0.35), transparent 70%),
    radial-gradient(30% 40% at 85% 60%, oklch(0.7 0.14 210 / 0.18), transparent 70%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
code { font-family: var(--f-mono); font-size: 0.86em; padding: 0.1em 0.4em; border-radius: 6px; background: oklch(0.3 0.04 275 / 0.6); color: var(--ink); }
kbd {
  font-family: var(--f-mono); font-size: 0.8em; padding: 0.15em 0.5em; border-radius: 6px; color: var(--ink);
  background: oklch(0.28 0.04 275); border: 1px solid var(--line-2); box-shadow: 0 2px 0 oklch(0.1 0.03 275);
}
h1, h2, h3 { font-family: var(--f-display); color: var(--ink); margin: 0; font-weight: 800; }
h2 { font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: 0.93; letter-spacing: -0.035em; }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
.label, .eyebrow {
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin: 0 0 20px;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -8px oklch(0.6 0.2 275 / 0.6); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: oklch(0.9 0.02 275 / 0.06); }
.btn-small { padding: 10px 18px; font-size: 14px; }
.play { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* Nav */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: oklch(0.18 0.03 275 / 0.6); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 28px; font-size: 14.5px; color: var(--ink-3); }
.nav-links a { transition: color 0.25s; }
.nav-links a:hover { color: var(--ink); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto; min-height: 100svh;
  padding: 140px var(--gutter) 80px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px oklch(0.7 0.18 150 / 0.2); animation: pulse 2s infinite; }
.hero-title { font-size: clamp(3.2rem, 8.2vw, 8.4rem); line-height: 0.9; letter-spacing: -0.045em; }
.hero-title .line { display: block; }
.muted-line { color: var(--ink-4); font-weight: 600; font-size: 0.5em; letter-spacing: -0.03em; margin-top: 0.25em; }
.rotor { position: relative; height: 1.12em; overflow: hidden; }
.rotor-word {
  position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1.05;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: translateY(120%); transition: transform 0.8s var(--ease-io);
}
.rotor-word.is-active { transform: translateY(0); }
.rotor-word.is-leaving { transform: translateY(-120%); }
.lede { max-width: 34ch; font-size: clamp(1.05rem, 1.35vw, 1.3rem); color: var(--ink-2); margin: 32px 0 36px; }
.lede em { color: var(--ink); font-style: normal; border-bottom: 2px solid var(--cyan); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 36px 0 0; font-family: var(--f-mono); font-size: 12px; color: var(--ink-4); letter-spacing: 0.04em; }
.hero-meta li::before { content: "◆ "; color: var(--indigo); }

/* Stage / demo */
.stage { position: relative; padding: 70px 28px 34px; border-radius: 28px; background: oklch(0.19 0.03 275 / 0.6); border: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.hud { position: absolute; width: 22px; height: 22px; border-color: var(--cyan); border-style: solid; opacity: 0.8; }
.hud-tl { top: 14px; left: 14px; border-width: 2px 0 0 2px; }
.hud-tr { top: 14px; right: 14px; border-width: 2px 2px 0 0; }
.hud-bl { bottom: 14px; left: 14px; border-width: 0 0 2px 2px; }
.hud-br { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; }

.tp-bar { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 5px;
  border-radius: 14px; background: oklch(0.2 0.04 270 / 0.92); border: 1px solid oklch(0.8 0.03 260 / 0.22); box-shadow: 0 10px 30px oklch(0.1 0.04 270 / 0.5);
  font-size: 12.5px; color: #e2e8f0; white-space: nowrap; }
.tp-logo { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(135deg, #4f46e5, #06b6d4); color: #fff; font-weight: 800; font-size: 12px; }
.tp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: rgba(99,102,241,.18); border: 1px solid rgba(129,140,248,.35); color: #c7d2fe; font-weight: 600; }
.tp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.tp-dot.wait { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); animation: pulse 1s infinite; }
.tp-sep { width: 1px; height: 16px; background: rgba(148,163,184,.25); }
.tp-toggle { padding: 4px 9px; border-radius: 999px; font-weight: 600; font-size: 11.5px; background: rgba(34,197,94,.16); color: #86efac; border: 1px solid rgba(34,197,94,.35); }
.tp-btn { padding: 4px 9px; border-radius: 8px; color: #cbd5e1; }
.tp-btn.primary { background: linear-gradient(135deg, #4f46e5, #0891b2); color: #fff; font-weight: 600; }

.chat { position: relative; border-radius: 18px; background: oklch(0.97 0.006 260); color: #0f172a; overflow: visible; box-shadow: 0 30px 80px -20px oklch(0.1 0.05 275 / 0.8); font-size: 14.5px; }
.chat-hdr { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; border-radius: 18px 18px 0 0; background: #fff; }
.chat-hdr strong { display: block; font-size: 15px; }
.chat-hdr span { font-size: 12px; color: #16a34a; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #16a34a; color: #fff; font-weight: 700; }
.chat-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 16px; height: 230px; overflow: hidden; justify-content: flex-end; }
.msg { max-width: 78%; padding: 9px 12px 7px; border-radius: 14px; line-height: 1.35; position: relative; animation: pop 0.4s var(--ease-back); }
.msg time { display: block; font-size: 10.5px; color: #94a3b8; text-align: right; margin-top: 2px; }
.msg.in { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.out { background: #dcfce7; border-bottom-right-radius: 4px; align-self: flex-end; }
.composer { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #e2e8f0; background: #fff; border-radius: 0 0 18px 18px; }
.input { flex: 1; min-height: 42px; padding: 10px 14px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; flex-wrap: wrap; }
.input .txt { border-radius: 4px; transition: background 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.input .txt.sel { background: rgba(99,102,241,.18); box-shadow: 0 0 0 2px rgba(99,102,241,.55); }
.input .txt.sel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.1s infinite; }
.caret { width: 2px; height: 1.1em; background: #4f46e5; margin-left: 1px; animation: blink 1s steps(1) infinite; }
.send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #16a34a; color: #fff; font-size: 15px; }
.pill { position: absolute; left: 22px; bottom: calc(100% - 4px); display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #4f46e5, #0891b2); box-shadow: 0 8px 20px rgba(15,23,42,.3); animation: pop 0.25s var(--ease-back); }
.pill.done { background: linear-gradient(135deg, #059669, #0d9488); }
.pill .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.pill.done .spin { display: none; }
.pill[hidden] { display: none; }

.tracker { position: absolute; pointer-events: none; border: 1.5px solid var(--cyan); border-radius: 6px; opacity: 0;
  transition: all 0.6s var(--ease); box-shadow: 0 0 0 4px oklch(0.75 0.14 210 / 0.12); }
.tracker span { position: absolute; top: -22px; left: -1px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em; padding: 2px 6px; background: var(--cyan); color: #04202a; border-radius: 3px; font-weight: 600; }
.tracker.on { opacity: 1; }

/* Marquee */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 26px 0; }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: marquee 38s linear infinite; font-family: var(--f-display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 2.4rem); color: var(--ink-3); letter-spacing: -0.02em; white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--indigo); }

/* How */
.how { max-width: var(--max); margin: 0 auto; padding: clamp(100px, 14vw, 200px) var(--gutter); display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(40px, 6vw, 100px); }
.section-head h2 { position: sticky; top: 120px; }
.section-head.center { text-align: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 64px 1fr; column-gap: 24px; padding: 40px 0; border-top: 1px solid var(--line-2); }
.step:last-child { border-bottom: 1px solid var(--line-2); }
.step-n { grid-row: span 2; font-family: var(--f-mono); font-size: 13px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--cyan); }
.step h3 { margin-bottom: 10px; }
.step p { margin: 0; max-width: 52ch; }

/* Panel section */
.panel-sec { position: relative; padding: clamp(90px, 12vw, 160px) var(--gutter); background: var(--bg-2); border-block: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.panel-sec > * { max-width: 640px; }
.panel-copy { justify-self: end; }
.panel-copy h2 { font-size: clamp(2.2rem, 4.6vw, 4.2rem); margin-bottom: 24px; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }
.ticks b { color: var(--ink); }
.panel-mock { position: relative; padding-top: 8px; }
.tp-bar.big { position: relative; left: auto; top: auto; transform: none; display: inline-flex; font-size: 13px; }
.grip { color: #64748b; letter-spacing: -2px; padding: 0 2px; }
.mini { opacity: 0.8; margin-left: 4px; }
.drawer { margin-top: 8px; padding: 12px; border-radius: 16px; background: oklch(0.2 0.04 270 / 0.95); border: 1px solid oklch(0.8 0.03 260 / 0.2); box-shadow: 0 30px 60px -20px oklch(0.05 0.04 270 / 0.8); color: #e2e8f0; font-size: 13.5px; }
.drawer-row { display: flex; align-items: center; gap: 8px; }
.sel { padding: 5px 12px; border-radius: 8px; background: rgba(30,41,59,.9); border: 1px solid rgba(148,163,184,.25); font-size: 12.5px; }
.swap { color: #94a3b8; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ta { min-height: 110px; padding: 11px 12px; border-radius: 10px; background: rgba(30,41,59,.75); border: 1px solid rgba(148,163,184,.22); color: #f1f5f9; line-height: 1.45; }
.ta.ro { background: rgba(30,41,59,.4); border-color: rgba(129,140,248,.5); }
.drawer-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.drawer-foot .hint { flex: 1; color: #94a3b8; font-size: 12px; }
.g { padding: 5px 10px; border-radius: 9px; border: 1px solid rgba(148,163,184,.25); font-size: 12px; color: #cbd5e1; }

/* Bento */
.bento { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 10vw, 140px) var(--gutter);
  display: grid; gap: 16px; grid-template-columns: repeat(6, 1fr);
  grid-template-areas: "eng eng eng lang lang lang" "keys keys ctrl ctrl ctrl ctrl"; }
.tile { border-radius: 24px; padding: clamp(24px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); overflow: hidden; position: relative; }
.tile-engines { grid-area: eng; }
.tile-langs { grid-area: lang; }
.tile-keys { grid-area: keys; }
.tile-ctrl { grid-area: ctrl; background: var(--grad); border: 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; }
.tile-ctrl .label { color: oklch(0.2 0.05 275 / 0.7); }
.tile-ctrl h3 { color: oklch(0.15 0.05 275); font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; max-width: 20ch; }
.engines { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.engines li { padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.engines small { width: 100%; font-weight: 400; color: var(--ink-4); font-family: var(--f-mono); font-size: 11px; }
.lang-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-cloud span { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 15px; transition: all 0.3s var(--ease); }
.lang-cloud span:hover, .lang-cloud span.hot { background: var(--ink); color: var(--bg); border-color: transparent; }
.keyrow { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.keyrow span { display: flex; gap: 6px; }
.keyrow em { font-style: normal; color: var(--ink-3); font-size: 15px; }

/* Film */
.film { max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) clamp(100px, 12vw, 180px); }
.film-frame { margin-top: 56px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 40px 120px -30px oklch(0.45 0.2 275 / 0.5); background: #05060d; aspect-ratio: 16 / 9; }
.film-frame video { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Install */
.install { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(100px, 12vw, 180px); }
.install-steps { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.install-steps li { padding: 28px; border-radius: 20px; border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 40px; }
.install-steps li > span { font-family: var(--f-display); font-size: 4rem; font-weight: 800; line-height: 0.8; color: transparent; -webkit-text-stroke: 1.5px var(--ink-4); }
.install-steps p { margin: 0; color: var(--ink); font-size: 1.1rem; }
.install-steps small { color: var(--ink-4); font-size: 0.85rem; }
.install-steps .dl { color: var(--cyan); border-bottom: 1px solid currentColor; }
.install-note { margin-top: 28px; color: var(--ink-3); max-width: 60ch; }
.install-note b { color: var(--ink); }

/* Footer */
.foot { padding: 0 var(--gutter) 28px; overflow: hidden; }
.foot-big { font-family: var(--f-display); font-weight: 800; font-size: clamp(5rem, 24vw, 22rem); line-height: 0.8; letter-spacing: -0.06em; text-align: center;
  background: linear-gradient(180deg, oklch(0.4 0.08 275), oklch(0.16 0.03 275) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-4); border-top: 1px solid var(--line); padding-top: 18px; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.steps .reveal:nth-child(2), .install-steps .reveal:nth-child(2) { transition-delay: 80ms; }
.steps .reveal:nth-child(3), .install-steps .reveal:nth-child(3) { transition-delay: 160ms; }

@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes pop { from { transform: translateY(6px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Responsive */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 120px; min-height: auto; }
  .how, .panel-sec { grid-template-columns: 1fr; }
  .section-head h2 { position: static; }
  .panel-copy { justify-self: start; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "eng" "lang" "keys" "ctrl"; }
  .install-steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stage { padding: 64px 12px 20px; }
  .tp-bar .tp-toggle, .tp-bar .tp-sep { display: none; }
  .tp-bar.big .tp-btn { display: none; }
  .cols { grid-template-columns: 1fr; }
  .engines { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; }
  .step-n { grid-row: auto; margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
