/* ===========================================================================
   TTGO — product presentation site
   Dark, indigo-accented, responsive. No build step.
   =========================================================================== */

:root {
  --bg:        #0b0b12;
  --bg-alt:    #0e0e17;
  --surface:   #14141f;
  --surface-2: #1a1a27;
  --border:    #26263444;
  --border-s:  #2a2a3a;
  --text:      #e9e9f2;
  --text-dim:  #a2a2b8;
  --text-mut:  #6f6f86;
  --accent:    #6366f1;
  --accent-2:  #8b5cf6;
  --accent-h:  #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --green:     #34d399;
  --amber:     #fbbf24;
  --red:       #f87171;
  --maxw: 1120px;
  --radius: 16px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  font-synthesis: none;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px;
  font-weight: 600; font-size: 0.95rem; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn--sm { padding: 9px 14px; font-size: 0.85rem; }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(99, 102, 241, 0.85); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text); border-color: var(--border-s);
}
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-2px); }

/* ───────────── Nav ───────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 11, 18, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border-s);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand__mark { width: 24px; height: 24px; display: block; filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.45)); }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a { color: var(--text-dim); font-weight: 500; font-size: 0.95rem; transition: color .2s ease; }
.nav__links a:hover { color: var(--text); }
.nav__links .btn { color: var(--text); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav__toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }

/* ───────────── Hero ───────────── */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% 0 auto 0; height: 700px; pointer-events: none;
  background:
    radial-gradient(520px 320px at 50% 0%, rgba(99, 102, 241, 0.28), transparent 70%),
    radial-gradient(440px 280px at 78% 8%, rgba(139, 92, 246, 0.20), transparent 70%);
  filter: blur(6px);
}
.hero__inner { position: relative; text-align: center; }
.eyebrow {
  display: inline-block; color: var(--accent-h); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--border-s); border-radius: 999px;
  background: var(--accent-soft); margin-bottom: 22px;
}
.hero__title { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.grad { background: linear-gradient(120deg, var(--accent-h), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { max-width: 660px; margin: 22px auto 0; color: var(--text-dim); font-size: clamp(1.02rem, 2.2vw, 1.18rem); }
.hero__sub strong { color: var(--text); }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero__shot { margin-top: 56px; }

/* Browser frame */
.browser {
  border: 1px solid var(--border-s); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); position: relative;
}
.hero__shot .browser { max-width: 980px; margin: 0 auto; }
.hero__shot .browser::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18), 0 0 80px -10px rgba(99, 102, 241, 0.35);
}
.browser__bar { display: flex; gap: 7px; align-items: center; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border-s); }
.browser__bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3a4a; }
.browser__bar span:nth-child(1) { background: #ff5f57; }
.browser__bar span:nth-child(2) { background: #febc2e; }
.browser__bar span:nth-child(3) { background: #28c840; }
.browser img { display: block; width: 100%; height: auto; }

/* ───────────── Sections ───────────── */
.section { padding: 86px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section__head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.section__head p { color: var(--text-dim); margin-top: 14px; font-size: 1.08rem; }

/* ───────────── Highlight cards ───────────── */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius);
  padding: 26px 22px; transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--surface-2); }
.card__icon {
  width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.5rem;
  border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--border-s); margin-bottom: 16px;
}
.card h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { color: var(--text-dim); font-size: 0.93rem; margin-top: 8px; }
.card code, .feature__text code { background: var(--surface-2); border: 1px solid var(--border-s); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; color: var(--accent-h); }

/* ───────────── Automation pillars ───────────── */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 920px; margin: 0 auto; }

/* ───────────── Feature rows ───────────── */
.feature { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; margin-bottom: 72px; }
.feature:last-child { margin-bottom: 0; }
.feature--rev .feature__text { order: 2; }
.feature__text h3 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.feature__text h3::before { content: ""; display: block; width: 40px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); margin-bottom: 16px; }
.feature__text p { color: var(--text-dim); margin-top: 14px; font-size: 1.04rem; }

/* ───────────── Comparison table ───────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-s); border-radius: var(--radius); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; min-width: 720px; }
.compare th, .compare td { padding: 14px 12px; text-align: center; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.compare thead th { font-weight: 600; color: var(--text-dim); position: sticky; top: 0; background: var(--surface-2); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare th[scope="row"], .compare__cap { text-align: left; color: var(--text); font-weight: 500; white-space: nowrap; }
.compare__ttgo { color: var(--accent-h) !important; font-weight: 800 !important; }
.compare td.c { background: var(--accent-soft); font-weight: 700; }
.compare .y { color: var(--green); font-weight: 700; }
.compare .n { color: var(--text-mut); }
.compare .p { color: var(--amber); }
.compare tbody tr:hover td, .compare tbody tr:hover th { background: rgba(255, 255, 255, 0.02); }
.compare tbody tr:hover td.c { background: rgba(99, 102, 241, 0.22); }
.compare__legend { text-align: center; color: var(--text-dim); margin-top: 18px; font-size: 0.9rem; }
.compare__legend .y { color: var(--green); } .compare__legend .p { color: var(--amber); } .compare__legend .n { color: var(--text-mut); }
.compare__note { text-align: center; color: var(--text-mut); font-size: 0.82rem; margin-top: 8px; }

/* ───────────── Chips ───────────── */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 760px; margin: 0 auto; }
.chips li {
  padding: 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-s);
  color: var(--text-dim); font-weight: 500; font-size: 0.92rem; transition: color .2s, border-color .2s, transform .2s;
}
.chips li:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* ───────────── License / free to use ───────────── */
.license { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
.license__col { background: var(--surface); border: 1px solid var(--border-s); border-radius: var(--radius); padding: 28px 26px; }
.license__col--free { border-color: rgba(52, 211, 153, 0.45); }
.license__col h3 { font-size: 1.14rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 11px; }
.license__ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 0.9rem; font-weight: 800; }
.license__col--free .license__ic { color: var(--green); background: rgba(52, 211, 153, 0.14); }
.license__col--limit .license__ic { color: var(--text-mut); background: rgba(255, 255, 255, 0.05); }
.license__col ul { list-style: none; margin-top: 18px; display: grid; gap: 13px; }
.license__col li { color: var(--text-dim); font-size: 0.96rem; line-height: 1.5; padding-left: 26px; position: relative; }
.license__col li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.license__col--free li::before { content: "✓"; color: var(--green); }
.license__col--limit li::before { content: "✕"; color: var(--text-mut); }
.license__note { text-align: center; color: var(--text-dim); max-width: 760px; margin: 30px auto 0; font-size: 0.98rem; }
.license__note a { color: var(--accent-h); border-bottom: 1px solid transparent; transition: border-color .2s; }
.license__note a:hover { border-bottom-color: var(--accent); }

/* ───────────── CTA ───────────── */
.cta__inner { text-align: center; max-width: 720px; margin: 0 auto; }
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.cta p { color: var(--text-dim); margin-top: 12px; font-size: 1.08rem; }
.code {
  text-align: left; background: #07070d; border: 1px solid var(--border-s); border-radius: 14px;
  padding: 22px 24px; margin: 28px 0; overflow-x: auto; font-size: 0.9rem; line-height: 1.7; color: #d6d6e6;
}
.code .tok-c { color: var(--text-mut); }
.cta__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ───────────── Footer ───────────── */
.footer { border-top: 1px solid var(--border); padding: 36px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer__tag { color: var(--text-mut); font-weight: 400; font-size: 0.9rem; }
.footer__meta { display: flex; align-items: center; gap: 22px; color: var(--text-dim); font-size: 0.88rem; flex-wrap: wrap; }
.footer__meta a { color: var(--text-dim); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.footer__meta a:hover { color: var(--accent-h); border-bottom-color: var(--accent); }

/* ───────────── Reveal animation ───────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ───────────── Responsive ───────────── */
@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .license { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature--rev .feature__text { order: 0; }
  .feature__shot { order: -1; }
}
@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(11, 11, 18, 0.97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-s);
    padding: 8px 24px 20px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav__links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 13px 0; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 12px; justify-content: center; }
  .nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 24px; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover, .chips li:hover { transform: none; }
}
