:root {
    --bg: #08090a;
    --bg-1: #0c0e10;
    --bg-2: #111316;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.14);
    --text: #f2f3f5;
    --muted: #989ca3;
    --faint: #62666d;
    --accent: #22d3ee;
    --accent-2: #06b6d4;
    --tiktok: #22d3ee;
    --instagram: #e879a6;
    --youtube: #f26d6d;
    --r: 14px;
    --maxw: 1120px;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body {
    font-family: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }
  a { color: inherit; text-decoration: none; }
  ::selection { background: rgba(34, 211, 238, 0.25); color: #fff; }

  /* ---- Ambient background layers ---- */
  .bg-wrap { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .bg-grid {
    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: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% -5%, #000 35%, transparent 80%);
    mask-image: radial-gradient(ellipse 75% 55% at 50% -5%, #000 35%, transparent 80%);
  }
  .bg-glow {
    position: absolute; top: -340px; left: 50%; transform: translateX(-50%);
    width: 920px; height: 720px;
    background: radial-gradient(50% 50% at 50% 50%, rgba(34,211,238,0.13), transparent 70%);
    filter: blur(20px);
    animation: drift 22s ease-in-out infinite;
  }
  @keyframes drift {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
    50%      { transform: translateX(-46%) translateY(26px) scale(1.06); opacity: 0.82; }
  }
  .bg-grain {
    position: absolute; inset: 0; opacity: 0.04; mix-blend-mode: overlay;
    background-size: 180px 180px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---- Scroll progress ---- */
  .progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 100%;
    transform: scaleX(0); transform-origin: left; z-index: 60;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    will-change: transform;
  }

  .shell { position: relative; z-index: 1; }
  .container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

  /* ---- Mono label ---- */
  .eyebrow {
    font-family: var(--mono);
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--accent);
  }

  /* ---- Nav ---- */
  header {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid transparent;
    transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
  }
  header.scrolled {
    background: rgba(8, 9, 10, 0.72);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--line);
  }
  .nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
  .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
  .brand .sep { color: var(--faint); font-weight: 400; }
  .brand .tool { color: var(--muted); font-weight: 500; }
  .nav-links { display: flex; align-items: center; gap: 30px; }
  .nav-links a {
    position: relative; font-size: 14px; color: var(--muted); transition: color 0.18s;
    padding-bottom: 3px;
  }
  .nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
    background: var(--accent); transform: scaleX(0); transform-origin: right;
    transition: transform 0.28s cubic-bezier(.2,.7,.2,1);
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 10px 18px; border-radius: 10px; cursor: pointer;
    transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s;
    border: 1px solid transparent; white-space: nowrap;
  }
  .btn-primary { background: var(--accent); color: #052a30; }
  .btn-primary:hover { background: #3de3f5; transform: translateY(-1px); }
  .btn-primary:hover .arr { transform: translateX(3px); }
  .btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
  .btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.24); }
  .btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 11px; }
  .arr { transition: transform 0.18s ease; }

  /* ---- Hero ---- */
  .hero { padding: 92px 0 60px; text-align: center; }
  .hero-inner { max-width: 780px; margin: 0 auto; }
  .pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 6px 14px 6px 11px; border-radius: 999px;
    border: 1px solid var(--line); background: rgba(255,255,255,0.025);
    font-size: 13px; color: var(--muted); margin-bottom: 28px;
  }
  .pill .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
  }
  .pill b { color: var(--text); font-weight: 600; }
  h1 {
    font-size: clamp(40px, 6.4vw, 72px);
    line-height: 1.04; letter-spacing: -0.04em;
    font-weight: 700; margin-bottom: 22px;
  }
  .hero-h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
  .hero-h1 .line-in {
    display: inline-block; transform: translateY(118%);
    animation: lineUp 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  }
  .hero-h1 .line:nth-child(1) .line-in { animation-delay: 0.12s; }
  .hero-h1 .line:nth-child(2) .line-in { animation-delay: 0.28s; }
  @keyframes lineUp { from { transform: translateY(118%); } to { transform: translateY(0); } }
  h1 .accent {
    background: linear-gradient(100deg, #22d3ee 0%, #8ef2ff 50%, #22d3ee 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #22d3ee;
    animation: sheen 5.5s ease-in-out 1.1s infinite;
  }
  @keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
  @media (prefers-reduced-motion: reduce) {
    .hero-h1 .line-in { transform: none; animation: none; }
    h1 .accent { animation: none; }
  }
  .lead {
    font-size: clamp(16px, 1.7vw, 19px); color: var(--muted);
    max-width: 640px; margin: 0 auto 36px; line-height: 1.65;
  }
  .hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

  /* ---- Hero entrance stagger ---- */
  .js .fade-up { opacity: 0; transform: translateY(14px); animation: fadeUp 0.8s cubic-bezier(.2,.7,.2,1) forwards; }
  .fu1 { animation-delay: 0.05s; } .fu2 { animation-delay: 0.42s; }
  .fu3 { animation-delay: 0.52s; } .fu4 { animation-delay: 0.62s; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }

  /* ---- Stats strip ---- */
  .stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--bg-1); overflow: hidden; margin-top: 64px;
  }
  .stat { padding: 26px 22px; border-right: 1px solid var(--line); }
  .stat:last-child { border-right: none; }
  .stat-num { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .stat-label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-top: 7px; }

  /* ---- Section scaffold ---- */
  section { position: relative; }
  #how, #integrations, #behaviour { scroll-margin-top: 84px; }
  .sec { padding: 96px 0; }
  .sec-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
  .sec-head .eyebrow { display: block; margin-bottom: 16px; }
  .sec-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
  .sec-head p { color: var(--muted); margin-top: 16px; font-size: 16.5px; line-height: 1.6; }

  /* ---- Steps ---- */
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .step {
    padding: 26px 24px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--bg-1);
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  }
  .step:hover { border-color: var(--line-2); background: var(--bg-2); transform: translateY(-3px); }
  .step-n { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 16px; }
  .step h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
  .step p { font-size: 14px; color: var(--muted); line-height: 1.6; }
  .step.gate {
    border-color: rgba(34, 211, 238, 0.34);
    background: linear-gradient(180deg, rgba(34,211,238,0.07), rgba(34,211,238,0.01)), var(--bg-1);
  }
  .step.gate .step-n { display: inline-flex; align-items: center; gap: 7px; }
  .step.gate .step-n::after {
    content: "Manual"; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 6px; color: #052a30; background: var(--accent); font-weight: 600;
  }

  /* ---- Integration cards ---- */
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .card {
    position: relative; display: flex; flex-direction: column;
    padding: 28px 26px; border: 1px solid var(--line); border-radius: var(--r);
    background: var(--bg-1); overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  }
  .card::before {
    content: ""; position: absolute; inset: 0; opacity: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--tint, rgba(34,211,238,0.12)), transparent 60%);
    transition: opacity 0.3s ease; pointer-events: none;
  }
  .card:hover { border-color: var(--line-2); transform: translateY(-3px); background: var(--bg-2); }
  .card:hover::before { opacity: 1; }
  .card > * { position: relative; z-index: 1; }
  .card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
  .card-icon {
    width: 42px; height: 42px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); color: var(--ic, var(--accent));
    background: rgba(255,255,255,0.02);
  }
  .card-icon svg { width: 21px; height: 21px; }
  .status {
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 5px 10px; border-radius: 7px;
    border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--muted);
    display: inline-flex; align-items: center; gap: 7px;
  }
  .status .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .status.live { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
  .status.pending { color: var(--faint); }
  .card h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
  .card .api { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 16px; }
  .card p.desc { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
  .scopes { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
  .scopes li {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
    padding: 4px 9px; border-radius: 7px;
    border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--muted);
  }

  /* ---- Principles ---- */
  .principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .principle {
    padding: 26px 24px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--bg-1);
    transition: border-color 0.25s ease, background 0.25s ease;
  }
  .principle:hover { border-color: var(--line-2); background: var(--bg-2); }
  .principle .pic { color: var(--accent); margin-bottom: 16px; display: block; }
  .principle .pic svg { width: 20px; height: 20px; }
  .principle h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
  .principle p { font-size: 14px; color: var(--muted); line-height: 1.6; }

  /* ---- CTA ---- */
  .cta-band {
    position: relative; overflow: hidden; text-align: center;
    border: 1px solid var(--line); border-radius: 20px;
    background: var(--bg-1); padding: 64px 32px;
  }
  .cta-band::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(60% 120% at 50% 0%, rgba(34,211,238,0.12), transparent 70%);
    pointer-events: none;
  }
  .cta-band > * { position: relative; }
  .cta-band h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 14px; }
  .cta-band p { color: var(--muted); max-width: 520px; margin: 0 auto 30px; font-size: 16px; }

  /* ---- Footer ---- */
  footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 56px 0 36px; }
  .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 44px; }
  .foot-brand .brand { margin-bottom: 14px; }
  .foot-brand p { font-size: 14px; color: var(--faint); max-width: 340px; line-height: 1.6; }
  .foot-col h4 { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 16px; }
  .foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
  .foot-col a { font-size: 14px; color: var(--muted); transition: color 0.18s; }
  .foot-col a:hover { color: var(--text); }
  .foot-bottom {
    margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    font-family: var(--mono); font-size: 12px; color: var(--faint);
  }

  /* ---- Reveal ---- */
  /* Hidden only once JS has confirmed it can bring them back. */
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.in { opacity: 1; transform: none; }
  .d1 { transition-delay: 0.06s; } .d2 { transition-delay: 0.12s; } .d3 { transition-delay: 0.18s; } .d4 { transition-delay: 0.24s; }
  @media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .js .fade-up { opacity: 1; transform: none; animation: none; }
    .bg-glow { animation: none; }
    .progress { display: none; }
  }

  /* ---- Responsive ---- */
  @media (max-width: 980px) {
    .steps { grid-template-columns: repeat(2, 1fr); }
    .principles { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 900px) {
    .nav-links { display: none; }
    .grid-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .foot-brand { grid-column: 1 / -1; }
  }
  @media (max-width: 620px) {
    .hero { padding: 64px 0 48px; }
    .sec { padding: 72px 0; }
    .steps, .principles { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .stat { border-right: none; border-bottom: 1px solid var(--line); }
    .stat:last-child { border-bottom: none; }
    .foot-grid { grid-template-columns: 1fr; }
  }

/* ---- Brand mark ---- */
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line-2); display: block; flex: none;
}
.foot-brand .brand .mark { width: 30px; height: 30px; border-radius: 8px; }

/* ---- Sub-page scaffold ---- */
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

.page-head { padding: 76px 0 8px; max-width: 760px; }
.page-head .eyebrow { display: block; margin-bottom: 16px; }
.page-head h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 20px; }
.page-head p { color: var(--muted); font-size: clamp(16px, 1.6vw, 18.5px); line-height: 1.65; }

.prose { max-width: 760px; }
.prose h2 {
  font-size: clamp(22px, 2.6vw, 28px); font-weight: 700;
  letter-spacing: -0.025em; margin: 48px 0 14px;
}
.prose h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.prose p { color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.prose ul { color: var(--muted); margin: 0 0 18px 20px; line-height: 1.7; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 6px; padding: 2px 6px;
}

/* ---- Definition table ---- */
.tablewrap { overflow-x: auto; margin: 22px 0 8px; border: 1px solid var(--line); border-radius: var(--r); }
table.spec { width: 100%; border-collapse: collapse; min-width: 520px; background: var(--bg-1); }
table.spec th, table.spec td {
  text-align: left; padding: 14px 18px; font-size: 14px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
table.spec tr:last-child td { border-bottom: none; }
table.spec th {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--faint); font-weight: 500;
  background: rgba(255, 255, 255, 0.015);
}
table.spec td { color: var(--muted); }
table.spec td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
table.spec td.mono, table.spec td.mono code { font-family: var(--mono); font-size: 12.5px; }

/* ---- Page-to-page nav ---- */
.pager { display: flex; gap: 14px; flex-wrap: wrap; margin: 64px 0 8px; }
.pager a {
  flex: 1 1 240px; padding: 20px 22px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--bg-1);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.pager a:hover { border-color: var(--line-2); background: var(--bg-2); transform: translateY(-3px); }
.pager .k { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.pager .t { font-size: 16px; font-weight: 600; margin-top: 7px; letter-spacing: -0.01em; }

/* ---- Callback page ---- */
.auth { max-width: 620px; margin: 0 auto; padding: 80px 0 40px; }
.auth .panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-1); padding: 32px 30px; }
.auth h1 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 10px; }
.auth p.sub { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.auth .code {
  display: block; font-family: var(--mono); font-size: 13px; word-break: break-all;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 16px; color: var(--text); margin-bottom: 16px; line-height: 1.6;
}
.auth .bad { color: #f87171; }
.auth .ok { color: #4ade80; }

/* Keep the brand on one line once the nav collapses: the mark plus the
   company name carry it, the tool suffix would only force a second row. */
@media (max-width: 620px) {
  .brand { white-space: nowrap; }
  header .brand .sep, header .brand .tool { display: none; }
  .page-head { padding-top: 56px; }
}
