/* TDO Distribution API — developer portal.
   Brand: #155DFC primary, #FF6B2C accent, light ground — the same tokens as
   the product and the partner console, so all three read as one company.
   Light on purpose: docs are read for hours beside an IDE that is already
   dark. Code panels are the one dark surface, for contrast where it earns it. */

:root {
  --primary: #155DFC;
  --primary-soft: #E8F0FE;
  --primary-deep: #0B3FB5;
  --accent: #FF6B2C;
  --accent-soft: #FFF1E8;

  --ink: #111827;
  --ink-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;

  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --paper: #F7F9FC;
  --card: #FFFFFF;
  --sunk: #F1F5F9;

  --code-bg: #0F172A;
  --code-ink: #E2E8F0;
  --code-key: #93C5FD;
  --code-str: #86EFAC;
  --code-num: #FCA5A5;
  --code-mut: #64748B;

  --good: #059669;
  --good-soft: #E6F6F0;
  --warn: #B45309;
  --warn-soft: #FEF3E2;
  --bad: #DC2626;
  --bad-soft: #FDECEC;

  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 10px 28px -16px rgba(17,24,39,.18);
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* clip, not hidden: clip does not create a scroll container, so sticky keeps working */
html, body { overflow-x: clip; }
/* The hidden attribute must beat any author display rule — without this,
   display:grid on an overlay overrides the UA's [hidden]{display:none}. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.spacer { flex: 1; }
kbd {
  font: 600 10.5px var(--mono); background: var(--sunk); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted);
}

/* ------------------------------------------------------------- progress */
#progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0; z-index: 100;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0; transition: width .28s ease, opacity .3s ease .15s;
}
#progress.run { opacity: 1; }

/* --------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 20px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 27px; height: 27px; border-radius: 7px; background: var(--primary); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__text strong { font-size: 15px; letter-spacing: -.01em; }
.brand__text span { font-size: 11.5px; color: var(--muted); }

.pill {
  font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 5px;
}
.pill--ver { background: var(--primary-soft); color: var(--primary); }

.tbtn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 620 13px/1 var(--sans); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 13px;
  background: var(--card); transition: all .15s;
}
.tbtn:hover { text-decoration: none; background: var(--sunk); color: var(--ink); }
.tbtn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.tbtn--primary:hover { background: var(--primary-deep); color: #fff; }
.tbtn--icon { padding: 8px; display: none; }
.tbtn svg { width: 16px; height: 16px; }

.searchbtn {
  display: inline-flex; align-items: center; gap: 9px;
  font: 400 13px var(--sans); color: var(--faint);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; min-width: 230px; cursor: pointer; transition: border-color .15s;
}
.searchbtn:hover { border-color: var(--line-2); }
.searchbtn svg { width: 15px; height: 15px; }
.searchbtn kbd { margin-left: auto; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1560px; margin: 0 auto; }

.sidebar {
  position: sticky; top: 60px; align-self: start;
  height: calc(100vh - 60px); overflow-y: auto;
  padding: 22px 14px 40px; border-right: 1px solid var(--line);
}
.nav__group {
  font: 700 10px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint); margin: 20px 10px 8px;
}
.nav__group:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2);
  transition: background .13s, color .13s;
}
.nav a:hover { background: var(--sunk); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 630; }
.nav a .m { margin-left: auto; }

.page { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 40px; padding: 34px 40px 120px; }
.main { min-width: 0; max-width: 880px; }

.rail { position: sticky; top: 94px; align-self: start; font-size: 12.5px; }
.rail__t { font: 700 10px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.rail a {
  display: block; padding: 4px 0 4px 12px; color: var(--muted);
  border-left: 2px solid var(--line); transition: color .13s, border-color .13s;
}
.rail a:hover { color: var(--ink); text-decoration: none; }
.rail a.on { color: var(--primary); border-left-color: var(--primary); font-weight: 620; }

/* ----------------------------------------------------------------- type */
h1 { font-size: 31px; line-height: 1.14; letter-spacing: -.025em; font-weight: 700; margin: 0 0 10px; }
h2 { font-size: 21px; letter-spacing: -.016em; font-weight: 680; margin: 42px 0 12px; scroll-margin-top: 84px; }
h3 { font-size: 16px; font-weight: 660; margin: 26px 0 8px; scroll-margin-top: 84px; }
p { margin: 0 0 14px; max-width: 72ch; }
ul, ol { margin: 0 0 14px; padding-left: 22px; max-width: 72ch; }
li { margin-bottom: 6px; }
.lede { font-size: 16.5px; color: var(--muted); max-width: 66ch; margin-bottom: 26px; }
.eyebrow {
  font: 700 11px/1 var(--mono); letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
code {
  font-family: var(--mono); font-size: .87em; background: #EEF2F7;
  border-radius: 4px; padding: 1.5px 5px; color: var(--primary-deep);
}
hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.tile {
  display: block; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  box-shadow: var(--shadow); transition: transform .16s, border-color .16s, box-shadow .16s;
}
.tile:hover {
  text-decoration: none; transform: translateY(-2px); border-color: var(--line-2);
  box-shadow: 0 2px 4px rgba(17,24,39,.05), 0 16px 36px -18px rgba(17,24,39,.24);
}
.tile__ic { width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 12px; }
.tile__ic svg { width: 16px; height: 16px; stroke: var(--primary); }
.tile--accent .tile__ic { background: var(--accent-soft); }
.tile--accent .tile__ic svg { stroke: var(--accent); }
.tile__ic--geo { background: #E8F8F4; }
.tile__ic--geo svg { stroke: #0F9F7A; }
.tile__ic--content { background: var(--primary-soft); }
.tile__ic--content svg { stroke: var(--primary); }
.tile__ic--hotels { background: #EEF2FF; }
.tile__ic--hotels svg { stroke: #4F46E5; }
.tile__ic--bookings { background: var(--accent-soft); }
.tile__ic--bookings svg { stroke: var(--accent); }
.tile__ic--notifications { background: #FEF3E2; }
.tile__ic--notifications svg { stroke: #B45309; }
.tile__ic--reference { background: #F1F5F9; }
.tile__ic--reference svg { stroke: #475569; }
.tile h3 { margin: 0 0 4px; font-size: 15px; }
.tile p { margin: 0; font-size: 13px; color: var(--muted); }
.tile .tile__n { font: 700 10.5px var(--mono); color: var(--primary); }
.tile--accent .tile__n { color: var(--accent); }

.note {
  border-left: 3px solid var(--primary); background: var(--primary-soft);
  padding: 13px 17px; border-radius: 0 9px 9px 0; font-size: 14px; margin: 18px 0; max-width: 74ch;
}
.note--warn { border-left-color: var(--accent); background: var(--accent-soft); }
.note--bad { border-left-color: var(--bad); background: var(--bad-soft); }
.note--good { border-left-color: var(--good); background: var(--good-soft); }
.note strong { display: block; margin-bottom: 3px; }
.note p { margin: 0; }

/* ----------------------------------------------------------------- hero */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 42px); }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lede { font-size: 17px; }
.hero__code { margin: 22px 0 8px; max-width: 620px; }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 700 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 5px; white-space: normal; overflow-wrap: anywhere;
  word-break: break-word; max-width: 100%; min-width: 0;
}
.chip--good { background: var(--good-soft); color: var(--good); }
.chip--bad { background: var(--bad-soft); color: var(--bad); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--muted { background: var(--sunk); color: var(--muted); }
.chip--primary { background: var(--primary-soft); color: var(--primary); }

.m { font: 700 10.5px/1 var(--mono); letter-spacing: .05em; padding: 4.5px 7px; border-radius: 5px; color: #fff; flex: none; }
.m--get { background: var(--primary); }
.m--post { background: var(--accent); }
.m--del { background: var(--bad); }
.m--put { background: var(--warn); }

/* Key chips — the data-flow chain. Hovering one lights every use of the
   same key across the page, which is how "this output is that input" reads
   at a glance. */
.k {
  display: inline-flex; align-items: center; gap: 5px;
  font: 620 11.5px/1 var(--mono); padding: 5px 9px; border-radius: 6px;
  background: var(--sunk); color: var(--ink-2); border: 1px solid transparent;
  cursor: default; transition: all .14s; max-width: 100%;
  min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; white-space: normal; word-break: break-word;
}
.k--out { background: var(--primary-soft); color: var(--primary-deep); }
.k--in { background: var(--accent-soft); color: #B14A15; }
.k.glow { border-color: var(--accent); background: var(--accent-soft); color: #B14A15; box-shadow: 0 0 0 3px rgba(255,107,44,.15); }

.flowline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px;
  font-size: 12.5px; color: var(--muted); min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word;
}
.flowline .arr { color: var(--line-2); font-weight: 700; }
.flowline > .k,
.flowline > span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ----------------------------------------------------------------- code */
.code { position: relative; margin: 14px 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.code__bar {
  display: flex; align-items: center; gap: 10px;
  background: #1A2436; color: #7C8DA6; font: 620 10.5px/1 var(--mono);
  letter-spacing: .07em; text-transform: uppercase; padding: 8px 14px;
}
.code__bar .status { color: var(--code-str); }
.code__copy {
  margin-left: auto; background: none; border: 0; color: #7C8DA6; cursor: pointer;
  font: 620 10.5px var(--mono); letter-spacing: .06em; padding: 3px 6px; border-radius: 4px;
  transition: color .14s, background .14s; text-transform: uppercase;
}
.code__copy:hover { color: #fff; background: rgba(255,255,255,.08); }
.code pre {
  margin: 0; padding: 14px 16px; background: var(--code-bg); color: var(--code-ink);
  font: 12.5px/1.65 var(--mono); overflow-x: auto; tab-size: 2;
}
.code .j-k { color: var(--code-key); }
.code .j-s { color: var(--code-str); }
.code .j-n { color: var(--code-num); }
.code .j-b { color: var(--code-num); }
.code .j-c { color: var(--code-mut); font-style: italic; }

/* --------------------------------------------------------------- tables */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th {
  text-align: left; font: 700 10px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); padding: 10px 14px; background: var(--sunk); border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td code, td .mono { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.req { color: var(--bad); font-weight: 700; }
.opt { color: var(--faint); }

/* ------------------------------------------------------------- endpoint */
.ep { margin: 26px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.ep__head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 15px 20px; border-bottom: 1px solid var(--line); background: #FAFCFF;
  scroll-margin-top: 84px;
}
.ep__path { font: 640 14px var(--mono); color: var(--ink); word-break: break-all; }
.ep__sum { width: 100%; font-size: 13px; color: var(--muted); }
.ep__body { padding: 18px 20px 20px; }
.ep__body h4 {
  font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 20px 0 8px;
}
.ep__body h4:first-child { margin-top: 0; }
.ep__body p { font-size: 14px; }
.ep__chain {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--sunk); border-radius: 9px; padding: 12px 14px; margin: 4px 0 6px;
  min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
.ep__chain .row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px;
  font-size: 12.5px; color: var(--muted); min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word;
}
.ep__chain .row > * {
  min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.ep__chain .lbl {
  font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  min-width: 72px; width: auto; justify-self: start;
}
.ep__err { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ep__err:last-child { border-bottom: 0; }
.ep__err .mono { flex: none; }

/* ------------------------------------------------------------- timeline */
.tl { position: relative; margin: 30px 0 10px; padding-left: 30px; }
.tl::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl__step { position: relative; padding: 0 0 30px; }
.tl__step:last-child { padding-bottom: 0; }
.tl__dot {
  position: relative; left: -30px; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--primary); color: var(--primary);
  display: grid; place-items: center; font: 700 10.5px var(--mono); z-index: 1;
}
.tl__step--gate .tl__dot { border-color: var(--accent); color: var(--accent); }
.tl__step--done .tl__dot { background: var(--good); border-color: var(--good); color: #fff; }
.tl__head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin-bottom: 4px; min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
.tl__head > * { min-width: 0; max-width: 100%; }
.tl__head h3 {
  margin: 0; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word;
}
.tl__meta {
  font: 620 11px var(--mono); color: var(--faint); min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
.tl__head a,
.tl__head .chip,
.tl__head h3 {
  min-width: 0;
}
.tl__head a {
  min-width: 0; overflow-wrap: anywhere; word-break: break-word; white-space: normal;
  display: inline-block; justify-self: start;
}
.tl__body {
  font-size: 14px; color: var(--ink-2); max-width: 70ch; min-width: 0; overflow-wrap: anywhere;
}
.tl__body p { font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 900px) {
  .tl__head {
    grid-template-columns: 1fr;
  }
  .tl__head > * {
    width: 100%;
    max-width: 100%;
  }
  .ep__chain .row {
    grid-template-columns: 1fr;
  }
  .ep__chain .lbl {
    min-width: 0;
    margin-bottom: 4px;
  }
}

/* --------------------------------------------------------------- search */
.ovl { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); display: grid; place-items: start center; padding-top: 12vh; }
.ovl__box { width: min(620px, 92vw); background: var(--card); border-radius: 14px; box-shadow: 0 24px 64px -20px rgba(0,0,0,.4); overflow: hidden; }
.ovl__in { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.ovl__in svg { width: 17px; height: 17px; stroke: var(--faint); flex: none; }
.ovl__in input { flex: 1; border: 0; outline: 0; font: 15px var(--sans); color: var(--ink); background: none; }
.ovl__res { max-height: 46vh; overflow-y: auto; }
.ovl__res a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--sunk); }
.ovl__res a:hover, .ovl__res a.sel { background: var(--primary-soft); text-decoration: none; }
.ovl__res .sec { margin-left: auto; font: 620 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.ovl__res .none { padding: 26px 18px; color: var(--muted); font-size: 13.5px; text-align: center; }
.ovl__foot { display: flex; gap: 16px; padding: 9px 18px; background: var(--sunk); font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; font-size: 13px; padding: 11px 18px; border-radius: 9px;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.5); z-index: 90; opacity: 0;
  transition: opacity .18s, transform .18s;
}
.toast[data-show="1"] { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------- skeleton */
.skeleton { height: 13px; border-radius: 6px; background: linear-gradient(90deg, var(--sunk) 25%, #E9EEF5 50%, var(--sunk) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 12px 0; }
.skeleton--t { height: 26px; width: 45%; }
.skeleton--w { width: 70%; }
@keyframes sk { to { background-position: -200% 0; } }

/* --------------------------------------------------------------- motion */
.rv { opacity: 0; transform: translateY(10px); transition: opacity .4s cubic-bezier(.4,0,.2,1), transform .4s cubic-bezier(.4,0,.2,1); }
.rv.in { opacity: 1; transform: none; }

.backdrop { display: none; }

@media (max-width: 1180px) { .page { grid-template-columns: 1fr; } .rail { display: none; } }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 60px; bottom: 0; width: 270px; z-index: 60;
    background: var(--card); transform: translateX(-100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open { transform: none; box-shadow: 24px 0 48px -24px rgba(0,0,0,.25); }
  .backdrop { display: block; position: fixed; inset: 60px 0 0; z-index: 50; background: rgba(15,23,42,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .backdrop.show { opacity: 1; pointer-events: auto; }
  .tbtn--icon { display: inline-flex; }
  .searchbtn { min-width: 0; }
  .searchbtn span, .searchbtn kbd { display: none; }
  .page { padding: 24px 18px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .rv { animation: none !important; transition: none !important; }
  .rv { opacity: 1 !important; transform: none !important; }
}

/* ------------------------------------------------------- landing: hero */
.hero { padding: 18px 0 6px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px; align-items: center; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 8px; }
.btn-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font: 660 14.5px/1 var(--sans); color: #fff !important;
  background: linear-gradient(135deg, var(--accent), #E85A1E);
  border-radius: 9px; padding: 13px 22px; text-decoration: none !important;
  box-shadow: 0 8px 22px -10px rgba(255,107,44,.55);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(255,107,44,.6); filter: saturate(1.06); }
.btn-cta:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font: 640 14.5px/1 var(--sans); color: var(--ink-2) !important;
  border: 1px solid var(--line-2); border-radius: 9px; padding: 13px 20px;
  background: var(--card); text-decoration: none !important; transition: all .16s;
}
.btn-ghost:hover { background: var(--sunk); color: var(--ink) !important; transform: translateY(-1px); }
.btn-cta--invert { background: #fff; color: var(--primary-deep) !important; box-shadow: 0 10px 26px -12px rgba(0,0,0,.4); }
.btn-ghost--invert { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.4); }
.btn-ghost--invert:hover { background: rgba(255,255,255,.12); color: #fff !important; }

.hero__term .code { margin: 0; }
.term .t-line { display: block; opacity: 0; transform: translateY(5px); animation: tline .4s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes tline { to { opacity: 1; transform: none; } }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--code-str); margin-left: 2px; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------ landing: stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin: 30px 0 6px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s;
}
.stats.in { opacity: 1; transform: none; }
.stat-tile { background: var(--card); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.stat-tile > span:last-child { font-size: 12.5px; color: var(--muted); }
.stat-n { font: 700 30px/1.1 var(--sans); letter-spacing: -.02em; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ landing: steps */
.steps {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin: 24px 0 8px; opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s;
}
.steps.in { opacity: 1; transform: none; }
.steps::before {
  content: ""; position: absolute; top: 17px; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform .9s cubic-bezier(.4,0,.2,1) .15s;
}
.steps.in::before { transform: scaleX(1); }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 40px 16px 14px; box-shadow: var(--shadow); }
.step__n {
  position: absolute; top: 4px; left: 16px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font: 700 12px var(--mono); box-shadow: 0 0 0 4px var(--paper);
}
.step:last-child .step__n { background: var(--good); }
.step h3 { margin: 0 0 4px; font-size: 14.5px; }
.step p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------- animated flowline */
.flowline--animated .arr { animation: arrpulse 1.8s ease-in-out infinite; }
.flowline--animated .arr:nth-child(4) { animation-delay: .25s; }
.flowline--animated .arr:nth-child(6) { animation-delay: .5s; }
.flowline--animated .arr:nth-child(8) { animation-delay: .75s; }
@keyframes arrpulse { 0%,100% { color: var(--line-2); } 50% { color: var(--accent); } }

/* -------------------------------------------------------- landing: cta */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff; border-radius: 16px; padding: 30px 32px; margin: 44px 0 10px;
  position: relative; overflow: hidden; box-shadow: 0 18px 44px -18px rgba(21,93,252,.55);
}
.cta::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,107,44,.35), transparent 65%);
}
.cta h2 { color: #fff; }

/* ---------------------------------------------------------- prev/next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 46px 0 8px; }
.pn__a {
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--line); border-radius: 11px; padding: 14px 18px;
  background: var(--card); text-decoration: none !important; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.pn__a:hover { transform: translateY(-2px); border-color: var(--line-2); }
.pn__a:last-child { text-align: right; align-items: flex-end; }
.pn__dir { font: 620 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pn__t { font-weight: 640; color: var(--ink); font-size: 14px; }

/* --------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); background: var(--card); margin-top: 20px; }
.foot__grid {
  max-width: 1560px; margin: 0 auto; padding: 40px 40px 26px;
  display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px;
}
.foot__brand p { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; max-width: 30ch; }
.foot h5 { font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.foot a { display: block; font-size: 13px; color: var(--ink-2); padding: 3.5px 0; }
.foot a:hover { color: var(--primary); text-decoration: none; }
.foot__bar {
  border-top: 1px solid var(--line);
  max-width: 1560px; margin: 0 auto; padding: 14px 40px;
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--faint);
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
  .pn { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; padding: 30px 18px 20px; }
  .foot__bar { padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .term .t-line { animation: none; opacity: 1; transform: none; }
  .caret, .flowline--animated .arr { animation: none; }
  .stats, .steps { opacity: 1; transform: none; }
  .steps.in::before, .steps::before { transform: scaleX(1); transition: none; }
}

/* ------------------------------------------------------------ brand logo */
.brand__logo { height: 34px; width: auto; display: block; }
.brand__logo--foot { height: 40px; }
.brand__divide { width: 1px; height: 24px; background: var(--line-2); margin: 0 2px; }
.brand__sub { font: 640 12.5px/1.2 var(--sans); color: var(--muted); letter-spacing: .01em; }

/* --------------------------------------------- richer card entrances */
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(18px) scale(.975); filter: blur(3px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
.card.rv, .tile.rv, .ep.rv, .code.rv, .tw.rv, .note.rv {
  opacity: 0; transform: none; transition: none;
}
.card.rv.in, .tile.rv.in, .ep.rv.in, .code.rv.in, .tw.rv.in, .note.rv.in {
  animation: cardIn .55s cubic-bezier(.22,.9,.3,1) both;
}

/* ------------------------------------------------------- hero atmosphere */
.hero { position: relative; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px);
  z-index: -1; pointer-events: none; opacity: .55;
}
.hero::before {
  width: 380px; height: 380px; top: -110px; right: -60px;
  background: radial-gradient(circle, rgba(21,93,252,.18), transparent 70%);
  animation: drift 14s ease-in-out infinite;
}
.hero::after {
  width: 300px; height: 300px; bottom: -80px; left: -80px;
  background: radial-gradient(circle, rgba(255,107,44,.14), transparent 70%);
  animation: drift 18s ease-in-out infinite reverse;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 18px) scale(1.08); }
}
.hero h1 em {
  background: linear-gradient(100deg, var(--primary), #4A82FF 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 180% 100%; animation: hue 7s ease-in-out infinite;
}
@keyframes hue { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* CTA shimmer sweep */
.btn-cta { position: relative; overflow: hidden; }
.btn-cta::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 44px;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
  left: -60px; transform: skewX(-18deg); animation: sheen 3.6s ease-in-out infinite;
}
@keyframes sheen { 0%, 55% { left: -60px; } 85%, 100% { left: 120%; } }

/* -------------------------------------------------------- stats motion */
.stat-tile { transition: background .18s, transform .18s; }
.stat-tile:hover { background: #FAFCFF; transform: translateY(-2px); }
.stat-n {
  background: linear-gradient(120deg, var(--primary), #4A82FF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats.in .stat-tile { animation: cardIn .5s cubic-bezier(.22,.9,.3,1) both; }
.stats.in .stat-tile:nth-child(2) { animation-delay: .08s; }
.stats.in .stat-tile:nth-child(3) { animation-delay: .16s; }
.stats.in .stat-tile:nth-child(4) { animation-delay: .24s; }

/* -------------------------------------------------------- steps motion */
.step { transition: transform .18s, box-shadow .18s; }
.step:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(17,24,39,.25); }
.steps.in .step__n { animation: popDot .5s cubic-bezier(.3,1.6,.4,1) both; }
.steps.in .step:nth-child(2) .step__n { animation-delay: .18s; }
.steps.in .step:nth-child(3) .step__n { animation-delay: .36s; }
.steps.in .step:nth-child(4) .step__n { animation-delay: .54s; }
@keyframes popDot { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------------------------------------------------- chain chip motion */
.flowline .k { transition: transform .16s, box-shadow .16s, background .16s, color .16s, border-color .16s; }
.flowline .k:hover { transform: translateY(-2px) scale(1.04); }
.flowline--animated.rv.in .k { animation: chipIn .45s cubic-bezier(.3,1.4,.4,1) both; }
.flowline--animated.rv.in .k:nth-child(3) { animation-delay: .1s; }
.flowline--animated.rv.in .k:nth-child(5) { animation-delay: .2s; }
.flowline--animated.rv.in .k:nth-child(7) { animation-delay: .3s; }
.flowline--animated.rv.in .k:nth-child(9) { animation-delay: .4s; }
@keyframes chipIn { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 100% { opacity: 1; transform: none; } }

/* ------------------------------------------------- timeline gate pulse */
.tl__step--gate .tl__dot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: ring 2.4s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.7); opacity: .7; } 70%, 100% { transform: scale(1.7); opacity: 0; } }

/* ------------------------------------------------------ endpoint hover */
.ep { transition: border-color .2s, box-shadow .2s; }
.ep:hover { border-color: #C7D7FE; box-shadow: 0 4px 8px rgba(17,24,39,.04), 0 18px 40px -20px rgba(21,93,252,.22); }

/* ---------------------------------------------------- heading accents */
h2 { position: relative; padding-bottom: 8px; }
h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 30px;
  border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--accent));
}
.foot h5::after { content: none; }

/* ----------------------------------------------------- micro-movement */
.nav a { transition: background .13s, color .13s, transform .13s; }
.nav a:hover { transform: translateX(2px); }
.foot a { transition: color .13s, transform .13s; }
.foot a:hover { transform: translateX(3px); }
.tile__ic { transition: transform .2s, background .2s; }
.tile:hover .tile__ic { transform: scale(1.08) rotate(-3deg); background: var(--primary); }
.tile:hover .tile__ic svg { stroke: #fff; }
.tile--accent:hover .tile__ic { background: var(--accent); }
.pn__a .pn__t { transition: color .15s; }
.pn__a:hover .pn__t { color: var(--primary); }

/* ---------------------------------------------------- route transition */
#main.page-enter { animation: pageIn .3s cubic-bezier(.22,.9,.3,1); }
@keyframes pageIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }

/* --------------------------------------------------------- scrollbars */
.sidebar::-webkit-scrollbar, .ovl__res::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb, .ovl__res::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 5px; border: 2px solid var(--card);
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after, .hero h1 em, .btn-cta::after,
  .tl__step--gate .tl__dot::after { animation: none !important; }
  .card.rv, .tile.rv, .ep.rv, .code.rv, .tw.rv, .note.rv,
  .stats.in .stat-tile, .flowline--animated.rv.in .k { animation: none !important; opacity: 1 !important; }
  #main.page-enter { animation: none; }
}
@media (max-width: 900px) {
  .brand__sub { display: none; }
  .brand__divide { display: none; }
  .brand__logo { height: 30px; }
}

/* -------------------------------------------------- modern card system */
.card,
.tile,
.step,
.stat-tile,
.pn__a,
.note,
.ep {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(203, 213, 225, .86);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92)),
    var(--card);
  box-shadow:
    0 1px 2px rgba(15,23,42,.04),
    0 14px 34px -24px rgba(15,23,42,.42);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translate3d(0, var(--lift), 0);
  transition:
    transform .28s cubic-bezier(.2,.8,.2,1),
    border-color .28s ease,
    box-shadow .28s ease,
    background .28s ease,
    filter .28s ease;
  will-change: transform;
}

.tile,
.step,
.stat-tile,
.pn__a,
.card {
  border-radius: 14px;
}

.card::before,
.tile::before,
.step::before,
.stat-tile::before,
.pn__a::before,
.note::before,
.ep::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      520px circle at var(--mx) var(--my),
      rgba(21,93,252,.12),
      rgba(255,107,44,.055) 36%,
      transparent 68%
    );
  transition: opacity .32s ease;
}

.card::after,
.tile::after,
.step::after,
.stat-tile::after,
.pn__a::after,
.note::after,
.ep::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(21,93,252,.42), transparent 30%, transparent 64%, rgba(255,107,44,.38));
  opacity: 0;
  transition: opacity .28s ease;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}

.card:hover,
.tile:hover,
.step:hover,
.stat-tile:hover,
.pn__a:hover,
.note:hover,
.ep:hover,
.card.is-card-active,
.tile.is-card-active,
.step.is-card-active,
.stat-tile.is-card-active,
.pn__a.is-card-active,
.note.is-card-active,
.ep.is-card-active {
  --lift: -7px;
  text-decoration: none;
  border-color: rgba(21,93,252,.34);
  box-shadow:
    0 10px 20px -18px rgba(15,23,42,.35),
    0 28px 56px -32px rgba(21,93,252,.34),
    0 10px 30px -28px rgba(255,107,44,.3);
  filter: saturate(1.03);
}

.card:hover::before,
.tile:hover::before,
.step:hover::before,
.stat-tile:hover::before,
.pn__a:hover::before,
.note:hover::before,
.ep:hover::before,
.card.is-card-active::before,
.tile.is-card-active::before,
.step.is-card-active::before,
.stat-tile.is-card-active::before,
.pn__a.is-card-active::before,
.note.is-card-active::before,
.ep.is-card-active::before {
  opacity: 1;
}

.card:hover::after,
.tile:hover::after,
.step:hover::after,
.stat-tile:hover::after,
.pn__a:hover::after,
.note:hover::after,
.ep:hover::after,
.card.is-card-active::after,
.tile.is-card-active::after,
.step.is-card-active::after,
.stat-tile.is-card-active::after,
.pn__a.is-card-active::after,
.note.is-card-active::after,
.ep.is-card-active::after {
  opacity: 1;
}

.tile h3,
.step h3,
.card h3,
.pn__t {
  transition: color .22s ease, transform .22s ease;
}

.tile:hover h3,
.step:hover h3,
.card:hover h3,
.pn__a:hover .pn__t {
  color: var(--primary-deep);
}

.tile p,
.step p {
  transition: color .22s ease;
}

.tile:hover p,
.step:hover p {
  color: var(--ink-2);
}

.tile__ic,
.step__n,
.tl__dot {
  position: relative;
  transition:
    transform .34s cubic-bezier(.2,.9,.25,1.35),
    background .28s ease,
    box-shadow .28s ease,
    color .28s ease;
}

.tile:hover .tile__ic {
  transform: translateY(-2px) scale(1.12) rotate(-4deg);
  box-shadow: 0 14px 26px -16px rgba(21,93,252,.65);
}

.step:hover .step__n,
.tl__step:hover .tl__dot {
  transform: scale(1.12);
  box-shadow: 0 0 0 6px rgba(21,93,252,.1), 0 14px 24px -16px rgba(21,93,252,.7);
}

.step:last-child:hover .step__n {
  box-shadow: 0 0 0 6px rgba(5,150,105,.12), 0 14px 24px -16px rgba(5,150,105,.7);
}

.steps::before {
  height: 3px;
  top: 18px;
  border-radius: 99px;
  box-shadow: 0 0 18px rgba(21,93,252,.2);
}

.steps.in::before {
  animation: pathGlow 2.8s ease-in-out infinite 1s;
}

@keyframes pathGlow {
  0%, 100% { filter: saturate(1); opacity: .82; }
  50% { filter: saturate(1.35); opacity: 1; }
}

.tile .tile__n,
.pn__dir {
  transition: color .22s ease, transform .22s ease;
}

.tile:hover .tile__n,
.pn__a:hover .pn__dir {
  color: var(--accent);
  transform: translateX(2px);
}

.flowline .k {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}

.flowline .k:hover,
.k.glow {
  transform: translateY(-3px) scale(1.045);
  box-shadow:
    0 0 0 3px rgba(255,107,44,.15),
    0 16px 26px -20px rgba(255,107,44,.7);
}

.ep__head {
  background:
    linear-gradient(90deg, rgba(21,93,252,.045), rgba(255,107,44,.035)),
    #FAFCFF;
}

.ep:hover .ep__head {
  border-bottom-color: rgba(21,93,252,.22);
}

.note {
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .tile,
  .step,
  .stat-tile,
  .pn__a,
  .note,
  .ep {
    transform: none !important;
    will-change: auto;
  }

  .card::before,
  .tile::before,
  .step::before,
  .stat-tile::before,
  .pn__a::before,
  .note::before,
  .ep::before,
  .card::after,
  .tile::after,
  .step::after,
  .stat-tile::after,
  .pn__a::after,
  .note::after,
  .ep::after,
  .steps.in::before {
    animation: none !important;
    transition: none !important;
  }
}

/* ----------------------------------------------- premium motion polish */
body {
  background:
    linear-gradient(125deg, rgba(21,93,252,.035), transparent 28%),
    linear-gradient(235deg, rgba(255,107,44,.028), transparent 34%),
    var(--paper);
}

.topbar {
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  left: -35%;
  right: auto;
  bottom: -1px;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: .75;
  animation: topbarSweep 6.5s ease-in-out infinite;
}

@keyframes topbarSweep {
  0%, 48% { transform: translateX(0); opacity: 0; }
  58% { opacity: .85; }
  82%, 100% { transform: translateX(410%); opacity: 0; }
}

.searchbtn,
.tbtn,
.btn-ghost,
.code__copy {
  position: relative;
  overflow: hidden;
}

.searchbtn::after,
.tbtn::after,
.btn-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.55), transparent 44%);
  transform: translateX(-130%);
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}

.searchbtn:hover::after,
.tbtn:hover::after,
.btn-ghost:hover::after {
  transform: translateX(130%);
}

.searchbtn:hover,
.tbtn:hover,
.btn-ghost:hover {
  box-shadow: 0 12px 28px -22px rgba(21,93,252,.5);
}

.card.is-pressing,
.tile.is-pressing,
.step.is-pressing,
.stat-tile.is-pressing,
.pn__a.is-pressing,
.note.is-pressing,
.ep.is-pressing {
  --lift: -3px;
  transition-duration: .12s;
}

.motion-spark {
  position: absolute;
  z-index: 2;
  left: var(--sx);
  top: var(--sy);
  width: var(--ss);
  height: var(--ss);
  border-radius: 999px;
  pointer-events: none;
  background: var(--sc);
  box-shadow: 0 0 14px var(--sc);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.4);
  animation: motionSpark .72s cubic-bezier(.18,.9,.2,1) forwards;
}

@keyframes motionSpark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.35);
  }
  24% {
    opacity: .95;
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--tx)),
        calc(-50% + var(--ty))
      )
      scale(0);
  }
}

.tile::before,
.step::before,
.stat-tile::before,
.card::before,
.ep::before {
  background:
    radial-gradient(
      420px circle at var(--mx) var(--my),
      rgba(255,255,255,.92),
      rgba(21,93,252,.13) 18%,
      rgba(255,107,44,.07) 42%,
      transparent 70%
    );
}

.tile:hover,
.step:hover,
.stat-tile:hover,
.card:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(250,252,255,.96)),
    var(--card);
}

.grid:hover .tile:not(:hover),
.steps:hover .step:not(:hover),
.stats:hover .stat-tile:not(:hover) {
  transform: perspective(900px) translateY(1px) scale(.985);
  opacity: .82;
}

.grid .tile,
.steps .step,
.stats .stat-tile {
  transition:
    transform .28s cubic-bezier(.2,.8,.2,1),
    opacity .28s ease,
    border-color .28s ease,
    box-shadow .28s ease,
    background .28s ease,
    filter .28s ease;
}

.tile h3::after,
.step h3::after,
.card h3::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  margin-top: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .32s cubic-bezier(.2,.8,.2,1);
}

.tile:hover h3::after,
.step:hover h3::after,
.card:hover h3::after {
  width: 34px;
}

.stat-tile:hover .stat-n {
  animation: numberPulse .62s cubic-bezier(.2,.9,.2,1);
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); filter: saturate(1); }
  45% { transform: scale(1.065); filter: saturate(1.35); }
}

.code {
  transition: transform .24s cubic-bezier(.2,.8,.2,1), box-shadow .24s ease;
}

.code:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 34px -24px rgba(15,23,42,.45),
    0 26px 60px -34px rgba(21,93,252,.38);
}

.code__bar {
  position: relative;
  overflow: hidden;
}

.code__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(147,197,253,.12), transparent);
  transform: translateX(-120%);
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}

.code:hover .code__bar::after {
  transform: translateX(120%);
}

.code__copy:hover {
  transform: translateY(-1px);
}

tbody tr {
  transition: background .18s ease, transform .18s ease;
}

tbody tr:hover {
  background: rgba(21,93,252,.035);
  transform: translateX(2px);
}

.nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--primary), 0 8px 18px -18px rgba(21,93,252,.7);
}

.rail a.on {
  box-shadow: inset 2px 0 0 var(--primary);
}

.toast[data-show="1"] {
  animation: toastPop .22s cubic-bezier(.2,1.4,.35,1) both;
}

@keyframes toastPop {
  0% { transform: translateX(-50%) translateY(12px) scale(.96); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

#main.page-enter {
  animation: pageInPlus .42s cubic-bezier(.18,.85,.25,1);
}

@keyframes pageInPlus {
  0% { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(4px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar::after,
  .motion-spark,
  .stat-tile:hover .stat-n,
  .toast[data-show="1"],
  #main.page-enter {
    animation: none !important;
  }

  .grid:hover .tile:not(:hover),
  .steps:hover .step:not(:hover),
  .stats:hover .stat-tile:not(:hover),
  .code:hover,
  tbody tr:hover {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ----------------------------------------------- end-to-end grooming */
::selection {
  background: rgba(21,93,252,.18);
  color: var(--primary-deep);
}

a,
button,
.code__copy,
.searchbtn,
.tbtn,
.btn-cta,
.btn-ghost {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
.code__copy:focus-visible,
.searchbtn:focus-visible,
.tbtn:focus-visible,
.btn-cta:focus-visible,
.btn-ghost:focus-visible {
  outline: 3px solid rgba(21,93,252,.22);
  outline-offset: 3px;
}

.topbar {
  transition:
    box-shadow .24s ease,
    background .24s ease,
    border-color .24s ease,
    transform .24s ease;
}

.topbar.topbar--raised {
  background: rgba(255,255,255,.92);
  border-bottom-color: rgba(203,213,225,.86);
  box-shadow: 0 18px 40px -34px rgba(15,23,42,.48);
}

.brand {
  transition: transform .22s cubic-bezier(.2,.8,.2,1), filter .22s ease;
}

.brand:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.brand__logo {
  transition: transform .34s cubic-bezier(.2,1.35,.35,1), filter .28s ease;
}

.brand:hover .brand__logo {
  transform: rotate(-2deg) scale(1.03);
  filter: drop-shadow(0 10px 12px rgba(21,93,252,.16));
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.48), transparent 28%),
    transparent;
}

.nav a {
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(21,93,252,.08), rgba(255,107,44,.055));
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .18s ease, transform .18s ease;
}

.nav a:hover::before,
.nav a[aria-current="page"]::before {
  opacity: 1;
  transform: translateX(0);
}

.nav a > *,
.nav a {
  z-index: 1;
}

.nav__group {
  position: relative;
  padding-left: 10px;
}

.nav__group::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--accent);
  opacity: .65;
  transform: translateY(-50%);
}

.rail {
  transition: opacity .22s ease, transform .22s ease;
}

.rail a {
  position: relative;
}

.rail a::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--primary);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.5);
  transition: opacity .18s ease, transform .18s ease;
}

.rail a.on::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.eyebrow.rv.in {
  animation: eyebrowIn .42s cubic-bezier(.2,.9,.25,1) both;
}

@keyframes eyebrowIn {
  0% { opacity: 0; transform: translateY(8px); letter-spacing: .24em; }
  100% { opacity: 1; transform: none; }
}

h1.rv.in {
  animation: headlineIn .58s cubic-bezier(.18,.85,.25,1) both;
}

@keyframes headlineIn {
  0% { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}

h2::after {
  transition: width .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease;
}

h2:hover::after {
  width: 44px;
  box-shadow: 0 0 18px rgba(21,93,252,.28);
}

.lede.rv.in,
p.rv.in,
ul.rv.in,
ol.rv.in {
  animation: textIn .5s cubic-bezier(.2,.85,.25,1) both;
}

@keyframes textIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}

.hero__term .code {
  transform-origin: center;
}

.hero__term.rv.in .code {
  animation: terminalSettle .72s cubic-bezier(.18,.9,.22,1) both;
}

@keyframes terminalSettle {
  0% { opacity: 0; transform: translateY(18px) rotateX(6deg) scale(.982); }
  100% { opacity: 1; transform: none; }
}

.chip,
.m,
.k,
kbd {
  transition:
    transform .18s cubic-bezier(.2,.9,.25,1),
    box-shadow .18s ease,
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}

.chip:hover,
.m:hover,
kbd:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px -16px rgba(15,23,42,.5);
}

.tl__step {
  transition: transform .22s ease;
}

.tl__step:hover {
  transform: translateX(3px);
}

.tl::before {
  background:
    linear-gradient(180deg, var(--primary), rgba(21,93,252,.25), var(--accent));
  opacity: .55;
}

.tl__body {
  transition: color .2s ease;
}

.tl__step:hover .tl__body {
  color: var(--ink);
}

.ep__path {
  transition: color .22s ease;
}

.ep:hover .ep__path {
  color: var(--primary-deep);
}

.ep__sum {
  transition: color .22s ease;
}

.ep:hover .ep__sum {
  color: var(--ink-2);
}

.ep__chain {
  position: relative;
  overflow: hidden;
}

.ep__chain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-120%);
  transition: transform .65s cubic-bezier(.2,.8,.2,1);
}

.ep:hover .ep__chain::after {
  transform: translateX(120%);
}

.tw {
  transition:
    transform .24s cubic-bezier(.2,.8,.2,1),
    border-color .24s ease,
    box-shadow .24s ease;
}

.tw:hover {
  transform: translateY(-2px);
  border-color: rgba(21,93,252,.22);
  box-shadow:
    0 14px 30px -26px rgba(15,23,42,.42),
    0 24px 48px -34px rgba(21,93,252,.26);
}

.ovl {
  opacity: 0;
  transition: opacity .22s ease;
}

.ovl:not([hidden]) {
  opacity: 1;
}

.ovl__box {
  transform: translateY(16px) scale(.985);
  opacity: 0;
  transition:
    transform .28s cubic-bezier(.18,.85,.25,1),
    opacity .22s ease,
    box-shadow .24s ease;
}

.ovl:not([hidden]) .ovl__box {
  transform: none;
  opacity: 1;
}

.ovl__res a {
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.ovl__res a:hover,
.ovl__res a.sel {
  transform: translateX(3px);
}

.toast {
  border: 1px solid rgba(255,255,255,.12);
}

.foot {
  position: relative;
  overflow: hidden;
}

.foot::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: .65;
}

.foot__grid > div {
  transition: transform .22s ease;
}

.foot__grid > div:hover {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .brand,
  .brand__logo,
  .nav a::before,
  .rail,
  .rail a::after,
  .chip,
  .m,
  .k,
  kbd,
  .tl__step,
  .tw,
  .ovl,
  .ovl__box,
  .ovl__res a,
  .foot__grid > div {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
