/* ===========================================================
   TOKENS
=========================================================== */
:root{
  /* Light theme (default) */
  --bg: #FAFAF7;
  --bg-elevated: #FFFFFF;
  --text: #15171C;
  --text-secondary: #6B7280;
  --border: #E8E6DD;
  --accent: #3D5AFE;
  --accent-soft: #EAEDFF;
  --accent-text: #FFFFFF;
  --terminal-bg: #15171C;
  --terminal-text: #E8E6DD;
  --code-green: #4ADE80;
  --shadow: 0 1px 2px rgba(21,23,28,0.04), 0 8px 24px rgba(21,23,28,0.06);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
  --radius: 14px;
  --radius-sm: 8px;

  color-scheme: light;
}

html[data-theme="dark"]{
  --bg: #0D0E12;
  --bg-elevated: #17181D;
  --text: #F4F4F2;
  --text-secondary: #8B8D98;
  --border: #26282F;
  --accent: #5B7FFF;
  --accent-soft: #1B2046;
  --accent-text: #FFFFFF;
  --terminal-bg: #08090C;
  --terminal-text: #C9CBD3;
  --code-green: #4ADE80;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.4);
  color-scheme: dark;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1,h2,h3{
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

a{ color:inherit; text-decoration:none; }

img{ max-width:100%; display:block; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ===========================================================
   THEME TOGGLE
=========================================================== */
.theme-toggle{
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover{ transform: scale(1.06); border-color: var(--accent); }
.theme-toggle:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-moon{ display:none; }
html[data-theme="dark"] .icon-sun{ display:none; }
html[data-theme="dark"] .icon-moon{ display:block; }

/* ===========================================================
   NAV
=========================================================== */
.nav{
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo-mark{
  color: var(--accent);
  font-family: var(--font-mono);
}
.nav-links{
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.nav-links a{ transition: color 0.2s ease; }
.nav-links a:hover{ color: var(--text); }
.nav-cta{
  background: var(--accent);
  color: var(--accent-text);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.nav-cta:hover{ opacity: 0.88; }

@media (max-width: 860px){
  .nav-links{ display:none; }
}

/* ===========================================================
   BUTTONS
=========================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn-primary{ background: var(--accent); color: var(--accent-text); }
.btn-primary:hover{ opacity: 0.9; transform: translateY(-1px); }
.btn-ghost{ background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover{ border-color: var(--accent); color: var(--accent); }
.btn-wide{ width: 100%; }
.btn:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===========================================================
   HERO
=========================================================== */
.hero{ padding: 64px 24px 40px; }
.hero-inner{
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 20px;
}
.dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--code-green);
  box-shadow: 0 0 0 0 rgba(74,222,128,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  70%{ box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100%{ box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.hero h1{
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 600;
  margin-bottom: 22px;
}
.highlight{ color: var(--accent); }

.hero-sub{
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.55;
}

.hero-actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats{
  display: flex;
  gap: 36px;
}
.stat{ display: flex; flex-direction: column; }
.stat-num{
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}
.stat-label{
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 90px;
}

/* ---- hero demo / chat ---- */
.hero-demo{ position: relative; }

.chat-window{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-header{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.chat-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--code-green);
}
.chat-title{
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.chat-body{
  padding: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg{
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  animation: msgIn 0.4s ease forwards;
}
@keyframes msgIn{ to{ opacity:1; transform: translateY(0); } }
.msg-client{
  background: var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-agent{
  background: var(--accent-soft);
  color: var(--accent);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
html[data-theme="dark"] .msg-agent{ color: #AEBFFF; }

.chat-input-row{
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.chat-input-fake{
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

.code-float{
  position: absolute;
  bottom: -22px;
  left: -22px;
  background: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.code-kw{ color: #5B9CFF; }
.code-str{ color: var(--code-green); }
.code-dim{ opacity: 0.6; }

@media (max-width: 980px){
  .hero-inner{ grid-template-columns: 1fr; gap: 56px; }
  .hero-demo{ order: -1; max-width: 440px; margin: 0 auto; }
  .code-float{ display: none; }
}
@media (max-width: 560px){
  .hero{ padding: 48px 18px 32px; }
  .hero-stats{ gap: 22px; flex-wrap: wrap; }
}

/* ===========================================================
   SECTION SHARED
=========================================================== */
section{
  max-width: var(--container);
  margin: 0 auto;
  padding: 100px 24px;
}
.section-eyebrow{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
section h2{
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 48px;
  max-width: 600px;
}

@media (max-width: 640px){
  section{ padding: 64px 18px; }
  section h2{ margin-bottom: 32px; }
}

/* ===========================================================
   SERVICES
=========================================================== */
.services-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card{
  background: var(--bg-elevated);
  padding: 32px 28px;
  position: relative;
  transition: background 0.2s ease;
}
.service-card:hover{ background: var(--accent-soft); }
.service-num{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 16px;
}
.service-card h3{
  font-size: 1.12rem;
  margin-bottom: 10px;
  font-weight: 600;
}
.service-card p{
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.service-card-featured{
  background: var(--accent-soft);
}
.service-link{
  display: inline-block;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 860px){
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .services-grid{ grid-template-columns: 1fr; }
}

/* ===========================================================
   AGENT SECTION
=========================================================== */
.agent{
  background: var(--bg-elevated);
  border-radius: 28px;
}
.agent-inner{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.agent-lead{
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 460px;
}
.agent-features{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 36px;
}
.agent-features li{
  display: flex;
  gap: 14px;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.agent-features strong{ color: var(--text); font-weight: 600; }
.feature-icon{ color: var(--accent); font-size: 0.8rem; margin-top: 4px; }

.terminal{
  background: var(--terminal-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.terminal-header{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.term-dot{ width:10px; height:10px; border-radius:50%; }
.term-dot.red{ background:#FF5F57; }
.term-dot.yellow{ background:#FEBC2E; }
.term-dot.green{ background:#28C840; }
.term-title{
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}
.terminal-body{
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--terminal-text);
  min-height: 260px;
}
.term-line{ opacity: 0; animation: termIn 0.3s ease forwards; }
@keyframes termIn{ to{ opacity:1; } }
.term-ok{ color: var(--code-green); }
.term-tag{ color: #5B9CFF; }

@media (max-width: 900px){
  .agent-inner{ grid-template-columns: 1fr; gap: 40px; }
  .agent{ border-radius: 20px; padding: 56px 22px; }
}

/* ===========================================================
   PROCESS
=========================================================== */
.process-track{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}
.process-step{
  border-top: 2px solid var(--border);
  padding-top: 20px;
  position: relative;
}
.process-marker{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
}
.process-step h3{
  font-size: 1.02rem;
  margin-bottom: 8px;
  font-weight: 600;
}
.process-step p{
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 900px){
  .process-track{ grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
}
@media (max-width: 540px){
  .process-track{ grid-template-columns: 1fr; }
}

/* ===========================================================
   WORK
=========================================================== */
.work-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.work-card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.work-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }
.work-thumb{
  height: 160px;
  background: linear-gradient(135deg, var(--accent-soft), var(--border));
}
.work-thumb-1{ background: linear-gradient(135deg, #3D5AFE22, #3D5AFE55); }
.work-thumb-2{ background: linear-gradient(135deg, #4ADE8022, #4ADE8055); }
.work-thumb-3{ background: linear-gradient(135deg, #FEBC2E22, #FEBC2E55); }
.work-card h3{
  font-size: 1.04rem;
  font-weight: 600;
  padding: 20px 20px 8px;
}
.work-card p{
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0 20px;
  line-height: 1.5;
}
.work-tags{
  display: block;
  padding: 16px 20px 20px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

@media (max-width: 860px){
  .work-grid{ grid-template-columns: 1fr; }
}

/* ===========================================================
   FAQ
=========================================================== */
.faq-list{
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item{
  background: var(--bg-elevated);
  padding: 4px 24px;
}
.faq-item summary{
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after{
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after{ transform: rotate(45deg); }
.faq-item p{
  padding-bottom: 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ===========================================================
   CONTACT
=========================================================== */
.contact{
  background: var(--bg-elevated);
  border-radius: 28px;
  text-align: center;
}
.contact-inner{ max-width: 560px; margin: 0 auto; }
.contact .section-eyebrow{ justify-content: center; }
.contact h2{ margin: 0 auto 14px; }
.contact-lead{
  color: var(--text-secondary);
  margin-bottom: 36px;
}
.contact-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.form-row{ display: flex; gap: 14px; }
.contact-form input,
.contact-form textarea{
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus{
  outline: none;
  border-color: var(--accent);
}
.contact-direct{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.contact-direct a{ color: var(--accent); font-weight: 500; }

@media (max-width: 560px){
  .form-row{ flex-direction: column; }
  .contact{ border-radius: 20px; padding: 56px 22px; }
}

/* ===========================================================
   FOOTER
=========================================================== */
.footer{
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer-inner{
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}
