/* ── Reset & Tokens ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #09090B;
  --surface:    #111113;
  --surface-2:  #18181B;
  --border:     #27272A;
  --muted:      #52525B;
  --text:       #FAFAFA;
  --text-dim:   #A1A1AA;
  --green:      #22C55E;
  --green-dim:  #16A34A;
  --violet:     #A78BFA;
  --violet-dim: #7C3AED;
  --ff-sans:    'Inter', system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', monospace;
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }
html, body {
  width: 100%; max-width: 100vw; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--ff-sans); font-size: 16px;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.theme-toggle:hover { transform: scale(1.05); background: var(--surface-2); }
.theme-toggle:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; height: 56px;
  background: rgba(9,9,11,0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none;
}

.nav-logo { height: 28px; width: auto; }

.nav-wordmark {
  font-size: 0.9rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}

.nav-links {
  display: flex; align-items: center; gap: 1.75rem; list-style: none;
}

.nav-links a {
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-dim); text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

.nav-links .nav-cta {
  color: var(--bg); background: var(--text);
  padding: 0.38rem 1rem; border-radius: 4px;
  font-weight: 600; transition: background 0.15s;
}

.nav-links .nav-cta:hover { background: var(--text-dim); color: var(--bg); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 8rem 2rem 5rem;
  position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none; z-index: 0;
}

.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none; z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ff-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.06em; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.3rem 0.85rem; border-radius: 999px; margin-bottom: 2.25rem;
}

.hero-kicker-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem); font-weight: 900;
  letter-spacing: -0.05em; line-height: 0.95;
  color: var(--text); margin-bottom: 1.75rem;
}

.hero-title .dim { color: var(--muted); font-weight: 300; }

.hero-logo {
  width: clamp(220px, 32vw, 380px);
  height: auto;
  display: inline-block;
}

.hero-terminal {
  display: inline-flex; align-items: center; gap: 0;
  font-family: var(--ff-mono); font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 500; margin-bottom: 2.75rem;
  color: var(--text-dim);
}

.terminal-prefix { color: var(--green); margin-right: 0.6em; }
.terminal-static { color: var(--text-dim); }
.terminal-typed  { color: var(--text); }
.terminal-cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--green); margin-left: 2px;
  animation: blink-cursor 0.9s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  font-size: 1rem; color: var(--text-dim);
  max-width: 48ch; margin: 0 auto 3rem; line-height: 1.75;
}

.hero-actions {
  display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--ff-sans); font-size: 0.85rem; font-weight: 600;
  padding: 0.65rem 1.4rem; border-radius: 5px;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.15s var(--ease);
}

.btn-white { background: var(--text); color: var(--bg); }
.btn-white:hover { background: #e4e4e7; transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--muted); transform: translateY(-1px); }

.btn-green { background: var(--green); color: var(--bg); }
.btn-green:hover { background: var(--green-dim); transform: translateY(-1px); }

.btn-green.copied { background: #166534; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }

/* ── Section shared ──────────────────────────────────────── */
section { padding: 6rem 2.5rem; }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-eyebrow {
  font-family: var(--ff-mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.05; color: var(--text);
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1rem; color: var(--text-dim);
  line-height: 1.75; max-width: 54ch;
}

/* ── Products ────────────────────────────────────────────── */
.products { border-top: 1px solid var(--border); }

.products-header {
  display: flex; align-items: flex-end;
  justify-content: space-between; flex-wrap: wrap;
  gap: 1.5rem; margin-bottom: 3rem;
}

.products-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}

.product-card {
  background: var(--bg); padding: 2.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: background 0.2s var(--ease);
  text-decoration: none; color: inherit;
}

.product-card:hover { background: var(--surface); }

.product-card-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 0.25rem;
}

.product-tag {
  font-family: var(--ff-mono); font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 3px;
}

.tag-green  { color: var(--green);  background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.2); }
.tag-violet { color: var(--violet); background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.2); }
.tag-white  { color: var(--text-dim); background: rgba(255,255,255,0.05); border: 1px solid var(--border); }

.product-arrow {
  color: var(--muted); transition: color 0.15s, transform 0.15s;
}

.product-card:hover .product-arrow { color: var(--text); transform: translate(2px, -2px); }

.product-name {
  font-size: 1.35rem; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
}

.product-desc {
  font-size: 0.85rem; color: var(--text-dim);
  line-height: 1.65; flex: 1;
}

.product-meta {
  font-family: var(--ff-mono); font-size: 0.68rem;
  color: var(--muted); padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Terminal accents (removed glow from dollar sign prefix) */
.terminal-cursor,
.hero-kicker-dot,
.chat-status {
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.btn-green {
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}
.btn-green:hover {
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.6);
}

/* All product tags glowing */
.tag-green {
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.25);
}

.tag-violet {
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.25);
}

.tag-white {
  text-shadow: 0 0 8px rgba(250, 250, 250, 0.4);
  box-shadow: 0 0 15px rgba(250, 250, 250, 0.15);
}

.msg-user .msg-bubble {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* Main buttons glow */
.btn-white:hover {
  box-shadow: 0 0 20px rgba(250, 250, 250, 0.3);
}

/* Product cards ambient hover glow */
.product-card:hover {
  background: var(--surface);
  box-shadow: 0 0 35px rgba(167, 139, 250, 0.12), inset 0 0 15px rgba(255, 255, 255, 0.03);
}
/* ── Demo ────────────────────────────────────────────────── */
.demo { border-top: 1px solid var(--border); }

.demo-inner { max-width: 800px; margin: 0 auto; }

.demo-header { text-align: center; margin-bottom: 2.75rem; }

.demo-header .section-sub { margin: 0 auto; }

.chat-container {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
  height: 460px; background: var(--surface);
}

.chat-top {
  background: var(--surface-2); padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem;
}

.chat-status {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse-green 2.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.chat-name {
  font-size: 0.875rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}

.chat-subtitle {
  font-family: var(--ff-mono); font-size: 0.65rem;
  color: var(--muted); margin-left: 0.25rem;
}

.chat-counter {
  margin-left: auto; font-family: var(--ff-mono); font-size: 0.65rem;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 0.2rem 0.55rem;
  border-radius: 3px; letter-spacing: 0.05em;
}

.chat-messages {
  flex: 1; padding: 1.25rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.85rem;
}

.msg { display: flex; flex-direction: column; max-width: 78%; }

.msg-bubble {
  padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.55;
}

.msg-bot { align-self: flex-start; }
.msg-bot .msg-bubble {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px 12px 12px 12px;
}

.msg-user { align-self: flex-end; }
.msg-user .msg-bubble {
  background: var(--violet); color: #fff;
  border-radius: 12px 12px 2px 12px;
}

.typing-indicator {
  display: flex; align-items: center; gap: 4px;
  padding: 0.75rem 1rem; min-width: 48px;
}

.typing-indicator span {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet); opacity: 0.4;
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

.chat-input-row {
  display: flex; gap: 0.6rem;
  background: var(--surface-2); border-top: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
}

#chat-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.55rem 0.85rem;
  font-family: var(--ff-sans); font-size: 0.875rem; color: var(--text);
  outline: none; transition: border-color 0.15s;
}

#chat-input::placeholder { color: var(--muted); }
#chat-input:focus { border-color: var(--violet); }
#chat-input:disabled { opacity: 0.5; cursor: not-allowed; }

#send-btn { padding: 0.5rem 1.1rem; font-size: 0.8rem; }
#send-btn:disabled {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); cursor: not-allowed;
}

/* ── Studio strip ────────────────────────────────────────── */
.studio { border-top: 1px solid var(--border); background: var(--surface); }

.studio-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start;
}

.studio-pillars { display: flex; flex-direction: column; gap: 0; margin-top: 2rem; }

.studio-pillar {
  padding: 1.25rem 0; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
}

.studio-pillar:first-child { border-top: 1px solid var(--border); }

.pillar-num {
  font-family: var(--ff-mono); font-size: 0.65rem;
  color: var(--muted); padding-top: 0.15rem;
}

.pillar-body { font-size: 0.875rem; color: var(--text-dim); line-height: 1.65; }
.pillar-body strong { color: var(--text); font-weight: 600; }

/* ── Contact ─────────────────────────────────────────────── */
.contact { border-top: 1px solid var(--border); text-align: center; }

.contact-inner { max-width: 560px; margin: 0 auto; }

.contact-inner .section-sub { margin: 0 auto 2.5rem; }

.contact-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

.footer-left {
  display: flex; align-items: center; gap: 1.5rem;
}

.footer-brand {
  font-size: 0.8rem; font-weight: 700; color: var(--text-dim);
  letter-spacing: -0.01em;
}

.footer-copy {
  font-family: var(--ff-mono); font-size: 0.68rem; color: var(--muted);
}

.footer-links {
  display: flex; gap: 1.5rem; list-style: none;
}

.footer-links a {
  font-size: 0.75rem; color: var(--muted); text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

/* ── Scroll reveal ───────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .products-grid { grid-template-columns: 1fr; }
  .studio-inner  { grid-template-columns: 1fr; gap: 2.5rem; }
  section { padding: 4.5rem 2rem; }
}

@media (max-width: 680px) {
  nav { padding: 0 1.25rem; }
  .nav-links li:not(:has(.nav-cta)):not(:has(.theme-toggle)) { display: none; }
  section { padding: 3.5rem 1.25rem; }
  .hero { padding: 7rem 1.25rem 4rem; }
  .products-header { flex-direction: column; align-items: flex-start; }
  footer { padding: 1.5rem 1.25rem; flex-direction: column; align-items: flex-start; }
}