/* ============================================================
   LUCIF API · Design System & Global Styles
   Dark premium theme · black solid bg · red/maroon accents
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg0: #050507;
  --bg1: #0a0a0d;
  --sf: #101014;
  --sf2: #16161c;
  --ln: rgba(255, 255, 255, 0.07);
  --ln2: rgba(255, 255, 255, 0.14);
  --t1: #f5f5f7;
  --t2: #a6a6b0;
  --t3: #6f6f7a;
  --red: #e8192c;
  --red2: #ff4653;
  --mar: #8c0f1c;
  --mar2: #40060d;
  --grad: linear-gradient(115deg, #ff5a64 0%, #e8192c 45%, #8c0f1c 100%);
  --grad-soft: linear-gradient(180deg, rgba(232, 25, 44, 0.16), rgba(232, 25, 44, 0));
  --ring: 0 0 0 1px rgba(232, 25, 44, 0.35), 0 12px 48px rgba(232, 25, 44, 0.16);
  --r: 16px;
  --r-sm: 10px;
  --fd: "Satoshi", "Inter", system-ui, -apple-system, sans-serif;
  --fb: "Inter", system-ui, -apple-system, sans-serif;
  --fm: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --hdr-h: 68px;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 60px rgba(0, 0, 0, 0.55);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  background: var(--bg0);
  color: var(--t1);
  font-family: var(--fb);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before { /* global noise grain */
  content: "";
  position: fixed; inset: 0;
  background: var(--noise);
  pointer-events: none;
  z-index: 1;
  opacity: .55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(232, 25, 44, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--red2); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1180px, 92%); margin: 0 auto; position: relative; }
.mono { font-family: var(--fm); }
.dim { color: var(--t2); }

/* ---------- Type ---------- */
h1, h2, h3, .display { font-family: var(--fd); font-weight: 900; letter-spacing: -0.035em; line-height: 1.12; }
h1 { font-size: clamp(2.7rem, 6.4vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.eyebrow {
  font-family: var(--fm);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lede { color: var(--t2); font-size: clamp(1rem, 1.4vw, 1.15rem); max-width: 62ch; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* extra paint area so tall glyphs (f, y, g) are never clipped by the
     gradient's background box */
  padding: 0.12em 0.08em;
}

/* ---------- Header ---------- */
.hdr {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--hdr-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 5, 7, 0.55);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.hdr.scrolled { background: rgba(5, 5, 7, 0.85); border-bottom-color: var(--ln); }
.hdr-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--fd); font-weight: 900; letter-spacing: 0.02em; font-size: 1.12rem; }
.brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(232, 25, 44, 0.55)); }
.brand .brand-dim { color: var(--t3); font-weight: 700; margin-left: 2px; }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--t2); font-size: 0.92rem; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--t1); background: rgba(255, 255, 255, 0.05); }
.nav a.active { color: var(--t1); background: rgba(232, 25, 44, 0.12); box-shadow: inset 0 0 0 1px rgba(232, 25, 44, 0.3); }
.hdr-cta { display: flex; align-items: center; gap: 10px; }
@media (max-width: 860px) { .nav { display: none; } }

/* avatar menu */
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-family: var(--fd); font-size: .95rem; box-shadow: var(--ring); }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 210px; background: var(--sf); border: 1px solid var(--ln2);
  border-radius: 14px; padding: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  display: none; z-index: 120;
}
.menu.open .menu-pop { display: block; animation: pop .18s ease; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; font-size: .92rem; color: var(--t2); }
.menu-pop a:hover, .menu-pop button:hover { background: rgba(255,255,255,.05); color: var(--t1); }
.menu-pop .danger { color: #ff6b74; }
.menu-pop hr { border: none; border-top: 1px solid var(--ln); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* premium days badge — label emerging from the right of the avatar */
.avatar-wrap { position: relative; display: inline-grid; }
.prem-badge {
  position: absolute; top: -8px; right: -15px;
  font-family: var(--fm); font-size: .62rem; font-weight: 700; letter-spacing: .05em;
  color: #fff; background: var(--grad);
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 2px 7px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(232,25,44,.45);
  animation: pop .18s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: var(--r-sm);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 28px rgba(232, 25, 44, 0.35), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary::after { /* sheen sweep */
  content: ""; position: absolute; top: 0; bottom: 0; left: -80%;
  width: 50%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transition: left .5s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(232, 25, 44, 0.45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover::after { left: 130%; }
.btn-ghost { border: 1px solid var(--ln2); color: var(--t1); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: rgba(232, 25, 44, 0.5); background: rgba(232, 25, 44, 0.08); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 0.87rem; }
.btn-lg { padding: 16px 32px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn svg { flex: none; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--fm); font-size: 0.85rem;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--ln2);
  color: var(--t2);
  transition: border-color .2s, box-shadow .2s;
  max-width: 100%;
}
/* long endpoint/referral URLs wrap instead of blowing out narrow cards */
.chip > span { min-width: 0; overflow-wrap: anywhere; }
.chip:hover { border-color: rgba(232,25,44,.45); box-shadow: 0 0 24px rgba(232,25,44,.15); }
.chip .copy-ic { color: var(--t3); transition: color .2s, transform .2s; }
.chip:hover .copy-ic { color: var(--red2); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  color: var(--red2); background: rgba(232,25,44,.1);
  border: 1px solid rgba(232,25,44,.35);
}
.badge-solid { background: var(--grad); color: #fff; border: none; box-shadow: 0 6px 20px rgba(232,25,44,.4); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red2); box-shadow: 0 0 0 0 rgba(255,70,83,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255,70,83,0); } 100% { box-shadow: 0 0 0 0 rgba(255,70,83,0); } }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--sf), var(--bg1));
  border: 1px solid var(--ln);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  position: relative;
}
.glow-card { overflow: hidden; }
.glow-card::before { /* cursor-tracked border glow */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(232, 25, 44, 0.14), transparent 65%);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }
.glow-card:hover { border-color: var(--ln2); }

/* ---------- Sections ---------- */
section { position: relative; padding: 96px 0; }
.sec-head { margin-bottom: 56px; display: flex; flex-direction: column; gap: 18px; }
.sec-head .lede { margin-top: 4px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--hdr-h) + 48px) 0 72px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-bg .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
}
.hero-bg .glow {
  position: absolute; left: 50%; top: -20%;
  width: 900px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(232, 25, 44, 0.22), rgba(140, 15, 28, 0.08) 55%, transparent 75%);
  filter: blur(10px);
}
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; z-index: 2; }
.emblem { width: clamp(96px, 12vw, 138px); filter: drop-shadow(0 0 42px rgba(232, 25, 44, 0.55)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero h1 .line { display: block; overflow: hidden; padding-block: 0.1em; }
.hero h1 .line > span { display: inline-block; transform: translateY(125%); animation: lineup .9s cubic-bezier(.2,.65,.2,1) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .24s; }
@keyframes lineup { to { transform: translateY(0); } }
/* hero headline: at phone widths the slogan is wider than the column, and a
   greedy wrap stranded "stop." alone on its own line. Balancing evens the two
   lines ("Never let your" / "agents stop.") at every width that wraps, keeps
   the line count greedy wrapping would have produced, and leaves the desktop
   single line untouched. Browsers without text-wrap simply wrap as before. */
.hero h1 .grad-text { text-wrap: balance; }
/* rotating slogan slot: masked glide-out / glide-in with blur */
.rot-wrap { display: inline-block; }
.rotator {
  display: inline-block;
  will-change: transform, filter, opacity;
  transition: transform .55s cubic-bezier(.22,.65,.2,1), opacity .4s ease, filter .55s ease;
  text-shadow: 0 0 34px rgba(255,255,255,.18);
}
.rotator.rot-out { transform: translateY(-125%); opacity: 0; filter: blur(10px); }
.rotator.rot-pre { transition: none; transform: translateY(125%); opacity: 0; filter: blur(10px); }
.hero-sub { max-width: 58ch; color: var(--t2); font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-meta { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.hero-meta .m { font-family: var(--fm); font-size: .8rem; color: var(--t3); display: inline-flex; gap: 8px; align-items: center; }
.hero-meta .m b { color: var(--t1); font-weight: 600; }

/* stat strip */
.stats { border-block: 1px solid var(--ln); background: rgba(255,255,255,.015); }
.stats-in { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 20px; text-align: center; border-left: 1px solid var(--ln); }
.stat:first-child { border-left: none; }
.stat .v { font-family: var(--fd); font-weight: 900; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.03em; }
.stat .v .unit { color: var(--red2); }
.stat .l { font-family: var(--fm); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--t3); margin-top: 6px; }
@media (max-width: 820px) { .stats-in { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: none; } .stat { border-top: 1px solid var(--ln); } .stat:nth-child(-n+2){ border-top: none; } }

/* ---------- Bento features ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.bento .card { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.bento .sp3 { grid-column: span 3; }
.bento .sp2 { grid-column: span 2; }
.bento .sp4 { grid-column: span 4; }
@media (max-width: 960px) { .bento .sp3, .bento .sp2, .bento .sp4 { grid-column: span 6; } }
.f-ic {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(232, 25, 44, 0.1);
  border: 1px solid rgba(232, 25, 44, 0.3);
  color: var(--red2);
  box-shadow: inset 0 0 20px rgba(232,25,44,.12);
}
.f-ic svg { width: 22px; height: 22px; }
.bento p { color: var(--t2); font-size: .95rem; }

/* routing diagram inside feature card */
.route-svg { width: 100%; margin-top: auto; }
.route-svg .dash { stroke-dasharray: 4 6; animation: dashmove 1.6s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -20; } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--ln); padding: 18px 0; background: rgba(255,255,255,.012); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: mq 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--fm); font-size: .9rem; color: var(--t3); display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; }
.marquee-track span::after { content: "◆"; color: var(--mar); font-size: .6rem; }
@keyframes mq { to { transform: translateX(-50%); } }

/* ---------- CTA band ---------- */
.cta-band { border-radius: 22px; padding: 64px 40px; text-align: center; overflow: hidden; position: relative;
  background: radial-gradient(120% 160% at 50% -40%, rgba(232,25,44,.28), rgba(64,6,13,.35) 55%, rgba(10,10,13,.9)), var(--sf);
  border: 1px solid rgba(232,25,44,.25);
}
.cta-band::after { content: ""; position: absolute; inset: 0; background: var(--noise); pointer-events: none; }
.cta-band > * { position: relative; z-index: 2; }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--ln); padding: 64px 0 32px; background: var(--bg1); position: relative; z-index: 2; }
.ftr-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
@media (max-width: 860px) { .ftr-grid { grid-template-columns: 1fr 1fr; } }
.ftr h4 { font-family: var(--fm); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--t3); margin-bottom: 16px; }
.ftr ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ftr ul a { color: var(--t2); font-size: .93rem; transition: color .2s; }
.ftr ul a:hover { color: var(--red2); }
.ftr-brand p { color: var(--t3); font-size: .92rem; max-width: 34ch; margin-top: 14px; }
.ftr-bar { border-top: 1px solid var(--ln); padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--t3); font-size: .85rem; font-family: var(--fm); }

/* ---------- Page hero (subpages) ---------- */
.phero { padding: calc(var(--hdr-h) + 84px) 0 56px; position: relative; overflow: hidden; }
.phero .glow { position: absolute; left: 50%; top: -60%; width: 800px; height: 560px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(232,25,44,.16), transparent 70%); pointer-events: none; }
.phero .container { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 2; }

/* ---------- Models page ---------- */
.flow-card {
  padding: 28px 22px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--sf), var(--bg1));
  background-size: 44px 44px, 44px 44px, 100% 100%;
  overflow: hidden;
}
.flow-card svg { display: block; width: 100%; height: auto; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.trio { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .trio { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.duo .card { padding: 34px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* long mono tokens (email, codes, URLs) must wrap inside console cards on narrow screens */
.duo .card .mono { overflow-wrap: anywhere; }
.model-name { font-family: var(--fm); font-size: 1.5rem; font-weight: 700; color: var(--t1); }
.model-name .suffix { color: var(--red2); }
.eq-note { font-family: var(--fm); font-size: .78rem; color: var(--t3); border: 1px dashed var(--ln2); border-radius: 8px; padding: 8px 12px; display: inline-block; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.model-card { padding: 18px 20px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
.model-card .nm { font-family: var(--fm); font-size: .92rem; font-weight: 600; }

/* ---------- Models page · card head + top-3 superiority ---------- */
/* card layout (head row + detail lines) lives in the merged .model-card rule above */
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* thin faint provider label above every model name */
.mc-provider {
  font-family: var(--fm); font-size: .6rem; font-weight: 500; color: var(--t3);
  letter-spacing: .14em; text-transform: uppercase; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
/* two stacked price lines on every card that has AA data */
.mc-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-family: var(--fm); font-size: .68rem; line-height: 1.45; }
.mm-actual { color: var(--t2); }
.mm-lucif {
  /* same brand red-gradient recipe as .grad-text */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}
.mm-lucif .lp { color: inherit; font-weight: 700; }
/* enlarged ∞ — line-height:1 keeps the taller glyph inside the gradient clip box */
.mm-lucif .inf { font-size: 1.35em; line-height: 1; }

/* top-3 cards: animated brand-gradient border + sheen sweep */
@property --ma { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.model-card.m-top {
  border-color: transparent;
  background: linear-gradient(var(--sf), var(--bg1)) padding-box,
              conic-gradient(from var(--ma, 0deg), #ff5a64, #e8192c, #8c0f1c, #40060d, #e8192c, #ff5a64) border-box;
  animation: mspin 6s linear infinite, mgold 3s ease-in-out infinite;
}
.model-card.m-top-2 { animation-delay: -2s; }
.model-card.m-top-3 { animation-delay: -4s; }
.model-card.m-top .nm { color: #fff; }
.model-card.m-top::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, .12) 48%, rgba(255, 255, 255, .02) 58%, transparent 72%);
  background-size: 240% 100%;
  animation: msheen 4.6s ease-in-out infinite;
  animation-fill-mode: backwards; /* hold the offscreen 0% frame during the stagger delay */
}
.model-card.m-top-2::after { animation-delay: 1.1s; }
.model-card.m-top-3::after { animation-delay: 2.2s; }
@keyframes msheen { 0%, 55% { background-position: 140% 0; } 100% { background-position: -60% 0; } }
@keyframes mspin { to { --ma: 360deg; } }
@keyframes mgold {
  0%, 100% { box-shadow: var(--shadow-1), 0 0 16px rgba(232, 25, 44, .14); }
  50% { box-shadow: var(--shadow-1), 0 0 30px rgba(232, 25, 44, .34); }
}
/* No @property (older engines): --ma can't interpolate, border stays a static
   conic while sheen + glow still animate. Same for reduced-motion users. */
@media (prefers-reduced-motion: reduce) {
  .model-card.m-top, .model-card.m-top::after { animation: none; }
}

.skeleton { position: relative; overflow: hidden; background: var(--sf); border-radius: var(--r-sm); height: 62px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: 22px; align-items: stretch; max-width: 920px; margin: 0 auto; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { padding: 40px 36px; display: flex; flex-direction: column; gap: 22px; }
.price-card.featured {
  border: 1px solid transparent;
  background: linear-gradient(var(--sf), var(--bg1)) padding-box,
              var(--grad) border-box;
  box-shadow: var(--ring), var(--shadow-1);
  transform: translateY(-6px);
  overflow: visible; /* let the Best Value ribbon breathe above the card */
}
@media (max-width: 860px) { .price-card.featured { transform: none; } }
.price-amt { font-family: var(--fd); font-weight: 900; font-size: 3rem; letter-spacing: -0.04em; line-height: 1; }
.price-amt .cur { font-size: 1.2rem; color: var(--t2); vertical-align: top; margin-right: 4px; font-weight: 700; }
.price-amt .per { font-size: .95rem; color: var(--t3); font-family: var(--fb); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.strike { color: var(--t3); text-decoration: line-through; font-size: 1.05rem; margin-right: 10px; }
.feat-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.feat-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--t2); font-size: .95rem; }
.feat-list li svg { flex: none; margin-top: 3px; color: var(--red2); }
.ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.social-proof { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 40px; color: var(--t3); font-size: .9rem; }
.avatars { display: flex; }
.avatars span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--bg0); margin-left: -10px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; font-family: var(--fm); }
.avatars span:first-child { margin-left: 0; }

/* accordion */
.acc { border: 1px solid var(--ln); border-radius: var(--r); background: var(--sf); overflow: hidden; }
.acc + .acc { margin-top: 12px; }
.acc-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-weight: 600; font-size: 1rem; text-align: left; }
.acc-btn .ic { transition: transform .3s; color: var(--red2); }
.acc.open .acc-btn .ic { transform: rotate(45deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc-body-in { padding: 0 24px 22px; color: var(--t2); font-size: .95rem; }

/* ---------- Setup page ---------- */
.setup-wrap { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .setup-wrap { grid-template-columns: minmax(0,1fr); } }
.setup-nav { position: sticky; top: calc(var(--hdr-h) + 24px); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* phones: scrollable tab bar with one-line labels and an on-brand visible
   scrollbar - no ragged wrapping, no mid-word breaks, every tab reachable */
@media (max-width: 900px) {
  .setup-nav {
    position: static; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(232,25,44,.35) transparent;
    padding-bottom: 4px; margin-bottom: 6px;
  }
  .setup-nav::-webkit-scrollbar{ height:5px }
  .setup-nav::-webkit-scrollbar-thumb{ background:rgba(232,25,44,.35); border-radius:3px }
  .setup-nav button { flex:0 0 auto; white-space:nowrap; }
}
.setup-nav button { text-align: left; padding: 11px 16px; border-radius: 10px; color: var(--t2); font-size: .94rem; font-weight: 500; display: flex; gap: 10px; align-items: center; transition: all .2s; }
.setup-nav button:hover { color: var(--t1); background: rgba(255,255,255,.04); }
.setup-nav button.active { color: var(--t1); background: rgba(232,25,44,.12); box-shadow: inset 0 0 0 1px rgba(232,25,44,.35); }
.setup-panel { display: none; }
.setup-panel.active { display: block; animation: fadeup .4s ease; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none; } }
.step { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--ln); }
.step:last-child { border-bottom: none; }
.step-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--fm); font-weight: 700; color: var(--red2); background: rgba(232,25,44,.1); border: 1px solid rgba(232,25,44,.35); }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--t2); font-size: .95rem; margin-bottom: 12px; }

/* code blocks */
.codeblock { position: relative; background: #0b0b0e; border: 1px solid var(--ln2); border-radius: 12px; overflow: hidden; }
.codeblock .cb-bar { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--ln); background: rgba(255,255,255,.02); }
.codeblock .cb-lang { font-family: var(--fm); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }
.cb-copy { font-family: var(--fm); font-size: .74rem; color: var(--t2); display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--ln); transition: all .2s; }
.cb-copy:hover { color: var(--red2); border-color: rgba(232,25,44,.4); }
/* icon-only variant of .cb-copy (API key row actions): square hit area, no text,
   meaning carried by title/aria-label on the button itself */
.cb-icon { padding: 7px; line-height: 0; }
.cb-icon svg { display: block; }
.cb-icon.busy { opacity: .45; pointer-events: none; }
.cb-danger { color: #ff6b74; }
.cb-danger:hover { color: #ff6b74; border-color: rgba(255,107,116,.5); background: rgba(255,107,116,.08); }
.codeblock pre { padding: 18px 20px; overflow-x: auto; font-family: var(--fm); font-size: .86rem; line-height: 1.7; color: #d6d6de; }
.codeblock .c { color: #5b5b66; } .codeblock .k { color: #ff7b84; } .codeblock .s { color: #ffa657; } .codeblock .v { color: #7ee0a3; }
.callout { border-left: 3px solid var(--red); background: rgba(232,25,44,.06); border-radius: 0 10px 10px 0; padding: 14px 18px; color: var(--t2); font-size: .9rem; margin-top: 12px; }
.callout b { color: var(--t1); }

/* ---------- Auth / private pages ---------- */
.auth-wrap { min-height: 100svh; display: grid; place-items: center; padding: 100px 20px 60px; position: relative; }
.auth-card { width: min(440px, 100%); padding: 44px 38px; text-align: center; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.g-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1a1a1a; font-weight: 600; padding: 13px; border-radius: 10px; transition: transform .15s, box-shadow .2s; }
.g-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,255,255,.12); }
/* sign-in is inert until the Terms/Privacy checkbox is ticked (js/page-login.js
   lifts the href while locked, so no activation vector can navigate an <a> that
   cannot be disabled; the visual lock lives here) */
.g-btn-locked { opacity: .45; filter: grayscale(.3); cursor: not-allowed; pointer-events: auto; }
.g-btn-locked:hover { transform: none; box-shadow: none; }
.tos-check { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: .82rem; line-height: 1.55; color: var(--t2); cursor: pointer; user-select: none; }
.tos-check input[type="checkbox"] { width: 17px; height: 17px; margin-top: .18em; flex: 0 0 auto; accent-color: var(--red2); cursor: pointer; }
.tos-check a { color: var(--t1); text-decoration: underline; text-underline-offset: 3px; }
.tos-check a:hover { color: var(--red2); }
.tos-check.tos-shake { animation: tos-shake .4s ease; }
@keyframes tos-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.divider { display: flex; align-items: center; gap: 14px; width: 100%; color: var(--t3); font-family: var(--fm); font-size: .72rem; letter-spacing: .14em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--ln); }

/* dashboard layout */
.dash { padding: calc(var(--hdr-h) + 56px) 0 80px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 960px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-cards { grid-template-columns: 1fr; } }
.scard { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.scard .lb { font-family: var(--fm); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); display: flex; justify-content: space-between; }
.scard .vl { font-family: var(--fd); font-weight: 900; font-size: 1.85rem; letter-spacing: -0.03em; }
.scard .delta { font-family: var(--fm); font-size: .74rem; color: var(--red2); }
.spark { width: 100%; height: 42px; margin-top: 4px; }
.chart-card { padding: 26px; margin-bottom: 22px; }
#chart { display: block; width: 100%; height: auto; }
.chart-card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 18px; font-family: var(--fm); font-size: .74rem; color: var(--t3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* tables */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
th { font-family: var(--fm); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--ln); background: rgba(255,255,255,.015); }
td { padding: 14px 20px; border-bottom: 1px solid var(--ln); color: var(--t2); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
td .mono { font-size: .84rem; }
.st { display: inline-flex; align-items: center; gap: 7px; font-family: var(--fm); font-size: .72rem; padding: 4px 10px; border-radius: 999px; }
.st-ok { color: #7ee0a3; background: rgba(126,224,163,.08); border: 1px solid rgba(126,224,163,.25); }
.st-err { color: #ff6b74; background: rgba(255,107,116,.08); border: 1px solid rgba(255,107,116,.3); }
/* bare round status dot — same color language as .st-ok/.st-err, minus the
   painted text; used where a labeled pill would be too heavy (Request Logs).
   The meaning stays machine-checkable and screen-reader accessible. */
.st-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.st-dot-ok { background: #7ee0a3; box-shadow: 0 0 0 3px rgba(126,224,163,.16); }
.st-dot-err { background: #ff6b74; box-shadow: 0 0 0 3px rgba(255,107,116,.18); }
/* Status reads as an indicator column on Request Logs and the dashboard's
   recent-requests table: the dot sits in the middle of its cell and the header
   follows it. Scoped by data-page so tables that paint labeled .st pills in
   some other column keep their left alignment. */
body[data-page="logs"] #log-rows td:last-child,
body[data-page="logs"] .table-card thead th:last-child,
body[data-page="dashboard"] #recent-rows td:last-child,
body[data-page="dashboard"] .table-card thead th:last-child { text-align: center; }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-family: var(--fm); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--t3); }
.input, select.input {
  background: #0b0b0e; border: 1px solid var(--ln2); border-radius: 10px;
  padding: 12px 16px; color: var(--t1); font-family: var(--fm); font-size: .9rem;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.input:focus { outline: none; border-color: rgba(232,25,44,.55); box-shadow: 0 0 0 3px rgba(232,25,44,.15); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; }

/* danger zone */
.danger-card { border-color: rgba(255,107,116,.35); background: linear-gradient(180deg, rgba(255,107,116,.05), var(--bg1)); }

/* empty state */
.empty { padding: 70px 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty svg { opacity: .8; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; gap: 10px; align-items: center;
  background: var(--sf2); border: 1px solid rgba(232,25,44,.4);
  color: var(--t1); font-size: .9rem; font-family: var(--fm);
  padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 24px rgba(232,25,44,.15);
  animation: toastin .3s cubic-bezier(.2,.9,.3,1.2);
}
.toast.out { animation: toastout .25s forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.95);} to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.65,.25,1); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Legal ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--t2); margin-bottom: 12px; font-size: .97rem; }
.legal ul { padding-left: 22px; }

/* misc */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; } .mt-64 { margin-top: 64px; }
.center { text-align: center; }
.flex-c { display: flex; align-items: center; gap: 10px; }
.hidden { display: none !important; }
.key-mask { letter-spacing: .06em; }

/* ---------- subscription-required overlay (BU-148) ---------- */
.sub-overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:rgba(2,2,4,.72);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);animation:subfade .25s ease}
.sub-overlay[hidden]{display:none}
@keyframes subfade{from{opacity:0}to{opacity:1}}
.sub-card{width:min(92vw,440px);background:linear-gradient(180deg,#0b0b10,#08080b);border:1px solid rgba(232,25,44,.25);border-radius:20px;padding:36px 30px;text-align:center;box-shadow:0 30px 90px rgba(0,0,0,.6),0 0 60px rgba(232,25,44,.12)}
.sub-card h3{font-family:Satoshi,Inter,sans-serif;font-size:1.35rem;margin:14px 0 10px;letter-spacing:-.01em}
.sub-card p{color:var(--t2);font-size:.9rem;line-height:1.55;margin:0 0 20px}
.sub-card strong{color:var(--t1)}
.sub-plans{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:20px}
.sub-plans>div{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:14px 10px;display:flex;flex-direction:column;gap:4px;background:rgba(255,255,255,.02)}
.sub-plans>div:last-child{border-color:rgba(232,25,44,.4)}
.sub-plans span{font-size:.72rem;color:var(--t3);text-transform:uppercase;letter-spacing:.08em}
.sub-plans strong{font-size:1.05rem}
.sub-plans em{font-style:normal;font-size:.68rem;color:var(--red);font-weight:600}

/* ---------- responsive diagrams + mobile polish (BU-149) ---------- */
.diagram-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:rgba(232,25,44,.35) transparent}
.diagram-scroll::-webkit-scrollbar{height:6px}
.diagram-scroll::-webkit-scrollbar-thumb{background:rgba(232,25,44,.35);border-radius:3px}
.diagram-scroll svg{min-width:680px;display:block;margin:0 auto}
@media (max-width:860px){
  .diagram-scroll{margin:0 -6px;padding:0 6px}
  /* diagrams must show FULL on phones: no min-width scroll, scale by viewBox */
  .diagram-scroll svg{min-width:0;width:100%;height:auto}
  .flow-card,.card svg[viewBox^="0 0 1120"],.card svg[viewBox^="0 0 900"]{padding-left:0;padding-right:0}
  /* bento grid: full-width cards on phones */
  .bento{grid-template-columns:1fr !important}
  .bento .sp2,.bento .sp3,.bento .sp4{grid-column:auto !important}
  /* stats readable */
  .stat b{font-size:1.6rem}
  /* hero & section paddings */
  .container{padding-left:18px;padding-right:18px}
  h1{font-size:clamp(1.9rem,7.5vw,2.6rem)}
  /* pricing chips & tables wrap */
  .price-card{padding:22px 18px}
  /* setup code blocks scroll horizontally instead of overflow */
  pre{overflow-x:auto;-webkit-overflow-scrolling:touch}
  /* console tables: every column fits on phones - drop the 720px floor and
     densify; .table-scroll remains the safety scroller with a visible bar */
  .tbl-wrap,.table-wrap{max-width:100%}
  .table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:rgba(232,25,44,.35) transparent}
  .table-scroll::-webkit-scrollbar{height:6px}
  .table-scroll::-webkit-scrollbar-thumb{background:rgba(232,25,44,.35);border-radius:3px}
  .table-scroll table{min-width:0}
  .table-scroll th,.table-scroll td{padding:11px 10px}
  .table-scroll th{font-size:.6rem;letter-spacing:.1em}
  .table-scroll td{font-size:.84rem}
  .table-scroll td .mono{font-size:.72rem}
  /* footer stacks */
  .ftr-grid{grid-template-columns:1fr;gap:22px}
}
@media (max-width:480px){
  .auth-card{padding:26px 20px}
  .sub-card{padding:26px 18px;margin:0 12px}
  .sub-plans{grid-template-columns:1fr}
  .btn-lg{padding:12px 18px;font-size:.95rem}
  .marquee-track{gap:24px}
}
.sub-exit{position:absolute;top:14px;right:18px;background:none;border:none;color:var(--t3);font-size:1.6rem;line-height:1;cursor:pointer;opacity:.45;transition:opacity .15s;padding:6px}
.sub-exit:hover{opacity:.9;color:var(--t1)}
.sub-overlay{position:fixed;inset:0;z-index:1000}
.sub-card{position:relative}
html,body{overflow-x:hidden;max-width:100%}

/* ---------- mobile nav (BU-149) ---------- */
.nav-auth{display:none}
.hdr-burger{display:none;background:none;border:1px solid rgba(255,255,255,.12);border-radius:10px;width:40px;height:40px;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;padding:0}
.hdr-burger span{display:block;width:16px;height:2px;background:var(--t1);border-radius:2px;transition:transform .2s,opacity .2s}
@media (max-width:860px){
  .hdr-burger{display:flex}
  body.nav-open .nav{
    display:flex;flex-direction:column;position:fixed;top:64px;left:0;right:0;
    background:rgba(5,5,7,.97);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
    border-bottom:1px solid rgba(255,255,255,.08);padding:18px 22px 22px;gap:4px;z-index:99;
  }
  body.nav-open .nav a{padding:12px 8px;font-size:1.02rem;border-bottom:1px solid rgba(255,255,255,.05)}
  body.nav-open .nav a:last-child{border-bottom:none}
  /* auth block lives inside the burger drawer on mobile */
  body.nav-open .nav .nav-auth{display:flex;flex-direction:column;gap:10px;margin-top:16px;padding-top:18px;border-top:1px solid rgba(255,255,255,.08)}
  body.nav-open .nav .nav-auth a{border-bottom:none;padding:4px 8px}
  body.nav-open .nav .nav-auth .btn{padding:12px 16px;font-size:.98rem}
  .nav-auth-label{display:block;color:var(--t3);font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;padding:2px 8px 0}
  body.nav-open .nav .nav-auth a:not(.btn){padding:12px 8px;font-size:1.02rem;border-bottom:1px solid rgba(255,255,255,.05);color:var(--t2);font-weight:600}
  .nav-logout{margin-top:6px;color:#ff6b74;border-color:rgba(255,107,116,.35)}
  /* Sign in needs to read as a button on phones: the desktop hairline
     (--ln2, 14% white) disappears against the dark drawer/header. White
     border for Sign in only — Sign out keeps its red outline.
     The drawer rule drops the :hover red so a tap does not leave a stale
     red ring behind on touch devices. */
  body.nav-open .nav .nav-auth .btn-ghost:not(.nav-logout),
  .hdr-cta .btn-ghost{border-color:rgba(255,255,255,.85)}
}
/* keep the header CTA row from crowding the brand on narrow phones;
   Sign in remains available in the burger drawer (.nav-auth above) */
@media (max-width:430px){
  .hdr-cta .btn-ghost{display:none}
}


/* ---------- BU-150: brand AI recessed red, console sidebar, native modal ---------- */
.brand-ai{
  font-style:normal;
  color:rgba(232,25,44,.72);
  /* recessed look: dark drop below + faint light edge above (text-shadow
     has no inset keyword - an invalid entry would void the whole list) */
  text-shadow:0 1px 0 rgba(0,0,0,.85), 0 2px 6px rgba(0,0,0,.55), 0 -1px 0 rgba(255,255,255,.07);
  filter:brightness(.96);
  letter-spacing:.02em;
}
main.dash.with-side{ display:grid; grid-template-columns:240px minmax(0,1fr); gap:34px; align-items:start; }
.console-side{
  position:sticky; top:calc(var(--hdr-h) + 30px);
  display:flex; flex-direction:column; gap:22px;
  border:1px solid var(--ln); border-radius:18px; background:rgba(255,255,255,.015);
  padding:20px 14px 14px;
}
.console-side .side-brand{ font-size:.95rem; padding:0 10px 4px; }
.console-side .side-brand img{ width:22px; height:22px; }
.side-nav{ display:flex; flex-direction:column; gap:2px; }
.side-nav a{
  display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:11px;
  color:var(--t2); font-size:.92rem; font-weight:600; text-decoration:none;
  transition:background .15s,color .15s;
}
.side-nav a:hover{ background:rgba(255,255,255,.045); color:var(--t1); }
.side-nav a.active{ background:rgba(232,25,44,.1); color:var(--red2); box-shadow:inset 0 0 0 1px rgba(232,25,44,.28); }
.side-nav a.active svg{ stroke:var(--red); }
.console-main{ min-width:0; display:flex; flex-direction:column; gap:0; }

.lx-modal .sub-card{ max-width:460px; width:100%; margin:0 14px; }
.lx-modal{ opacity:0; transition:opacity .18s ease; }
.lx-modal.in{ opacity:1; }
.lx-modal .lxm-body{ font-size:.94rem; color:var(--t2); }
.lx-modal .lxm-foot{ display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.lx-modal .lxm-foot .btn{ min-width:120px; }
.lx-modal .lxm-err{ margin-top:14px; font-size:.86rem; color:#ff6b74; background:rgba(255,107,116,.08); border:1px solid rgba(255,107,116,.3); border-radius:10px; padding:10px 12px; }
.lx-modal .field label{ display:block; font-size:.78rem; color:var(--t3); margin-bottom:8px; letter-spacing:.04em; }
.lx-modal input.input{ width:100%; }
.lx-modal input.input[readonly]{ font-family:var(--fm); color:var(--red2); }

@media (max-width:980px){
  /* minmax(0,1fr) so the single column cannot be blown out by nowrap
     side-nav content; the rail then scrolls inside its own bounded box */
  main.dash.with-side{ grid-template-columns:minmax(0,1fr); gap:0; }
  .console-side{ position:static; border-radius:14px; margin-bottom:26px; padding:12px; min-width:0; }
  .console-side .side-brand{ display:none; }
  /* pills wrap onto fully-visible rows instead of a hidden scroll strip,
     so every console menu is reachable on phones (no menu appears "cut off") */
  .side-nav{ flex-direction:row; flex-wrap:wrap; gap:6px; overflow:visible; }
  .side-nav a{ white-space:nowrap; padding:9px 13px; }
}

/* modal card: left-aligned, text-input friendly (inherits sub-card skin) */
.lx-modal .lx-modal-card{ text-align:left; padding:28px 26px; }
.lx-modal .lx-modal-card h3{ margin:0 0 12px; font-size:1.22rem; text-align:left; }
/* ============================================================
   RANKS PAGE · public TOP-10 leaderboard
   Podium (ranks 1-3) + flat list (ranks 4-10).
   Three DISTINCT effects for the top three — each its own keyframe set,
   its own timing, its own reduced-motion off switch:
     rk-1 · inferno — rotating brand-gradient conic border + pulsing glow
                       + a sheen that sweeps across the card
     rk-2 · ember   — static hairline border, slower breathing glow, and a
                       vertical-only shimmer travelling down the card
     rk-3 · steel   — no animated border; a static hairline plus a slow
                       pulse on the number itself
   Order on desktop is 2 / 1 / 3 (tallest in the middle); on a phone it is
   1 / 2 / 3, tallest first, because a three-column podium cannot fit a name.
   ============================================================ */

/* ---------- total strip ---------- */
.rank-total {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  flex-wrap: wrap;
  border: 1px solid var(--ln); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  padding: 20px 24px; margin-bottom: 30px;
}
.rt-l { font-family: var(--fm); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }
.rt-v { font-family: var(--fd); font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.03em; color: var(--t1); line-height: 1.15; }
.rt-v .unit { color: var(--red2); }

/* ---------- podium grid ---------- */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; align-items: end; margin-bottom: 54px;
}
/* rank 2 sits first in DOM order (tallest in the middle on desktop) */
.podium-card {
  padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 6px;
  min-width: 0; text-align: center; overflow: hidden;
}
.podium-card.rk-1 { padding-top: 34px; padding-bottom: 36px; }
.podium-card.rk-2 { padding-top: 28px; }
.podium-card.rk-3 { padding-top: 24px; }
.pod-top { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.pod-rank { font-family: var(--fd); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--t1); }
.pod-hash { color: var(--red2); font-size: 1rem; margin-right: 1px; }
.pod-medal { width: 26px; height: 26px; color: var(--red2); display: inline-grid; place-items: center; }
.pod-medal svg { width: 26px; height: 26px; }
.pod-name {
  font-family: var(--fd); font-weight: 700; font-size: clamp(1rem, 1.6vw, 1.24rem);
  color: var(--t1); line-height: 1.3;
  overflow-wrap: anywhere; min-width: 0;
}
.pod-num { font-family: var(--fm); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.3rem); color: var(--t1); letter-spacing: -0.02em; line-height: 1.1; margin-top: 6px; }
.pod-num .unit { color: var(--red2); font-size: .62em; margin-left: 2px; }
.pod-l { font-family: var(--fm); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--t3); }
.pod-req { font-family: var(--fm); font-size: .72rem; color: var(--t2); margin-top: 10px; }
/* every effect draws through this layer so the card content stays untouched */
.pod-sheen { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }

/* ---------- rank 1 · INFERNO ----------
   rotating conic brand border + breathing glow + sheen sweep */
@property --rk1a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.podium-card.rk-1 {
  border-color: transparent;
  background:
    linear-gradient(var(--sf), var(--bg1)) padding-box,
    conic-gradient(from var(--rk1a, 0deg), #ff5a64, #e8192c, #8c0f1c, #40060d, #8c0f1c, #e8192c, #ff5a64) border-box;
  animation: rk1spin 5s linear infinite, rk1glow 2.6s ease-in-out infinite;
}
.podium-card.rk-1 .pod-medal { color: #ff4653; }
.podium-card.rk-1 .pod-name { color: #fff; }
.podium-card.rk-1 .pod-sheen {
  background: linear-gradient(100deg, transparent 34%, rgba(255,255,255,.14) 48%, rgba(255,255,255,.02) 58%, transparent 72%);
  background-size: 240% 100%;
  animation: rk1sheen 3.8s ease-in-out infinite;
  animation-fill-mode: backwards;
}
@keyframes rk1spin { to { --rk1a: 360deg; } }
@keyframes rk1glow {
  0%, 100% { box-shadow: var(--shadow-1), 0 0 18px rgba(232,25,44,.20); }
  50% { box-shadow: var(--shadow-1), 0 0 46px rgba(232,25,44,.48); }
}
@keyframes rk1sheen { 0%, 55% { background-position: 140% 0; } 100% { background-position: -60% 0; } }

/* ---------- rank 2 · EMBER ----------
   static accent border + slower breathing glow + a shimmer that falls DOWN
   the card only (no horizontal travel), which reads nothing like rank 1 */
.podium-card.rk-2 {
  border-color: rgba(232,25,44,.45);
  animation: rk2glow 4.4s ease-in-out infinite;
}
.podium-card.rk-2 .pod-medal { color: #c9a227; }
.podium-card.rk-2 .pod-name { color: #fff; }
.podium-card.rk-2 .pod-sheen {
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,.10) 45%, rgba(255,255,255,.02) 60%, transparent 100%);
  background-size: 100% 260%;
  animation: rk2fall 3.2s ease-in-out infinite;
  animation-fill-mode: backwards;
}
@keyframes rk2glow {
  0%, 100% { box-shadow: var(--shadow-1), 0 0 12px rgba(232,25,44,.12); }
  50% { box-shadow: var(--shadow-1), 0 0 26px rgba(232,25,44,.30); }
}
@keyframes rk2fall { 0%, 100% { background-position: 0 -60%; } 50% { background-position: 0 160%; } }

/* ---------- rank 3 · STEEL ----------
   no animated border at all — a static hairline, and the NUMBER itself
   pulses slowly so it still separates from ranks 4-10 */
.podium-card.rk-3 { border-color: var(--ln2); }
.podium-card.rk-3 .pod-medal { color: #9aa3ad; }
.podium-card.rk-3 .pod-num { animation: rk3pulse 3.6s ease-in-out infinite; }
.podium-card.rk-3 .pod-name { color: #fff; }
@keyframes rk3pulse {
  0%, 100% { text-shadow: 0 0 0 rgba(255,255,255,0); opacity: .82; }
  50% { text-shadow: 0 0 22px rgba(232,25,44,.45); opacity: 1; }
}

/* A board with fewer than three named accounts leaves a grid cell. The filler
   card keeps the podium visually whole and states why the position is empty. */
.podium-empty {
  border-style: dashed;
  border-color: var(--ln);
  background: none;
  box-shadow: none;
  justify-content: center;
  gap: 12px;
  color: var(--t3);
}
.podium-empty .pod-name { color: var(--t2); font-size: .98rem; }

/* ---------- the platform's own row ("Lucif") ----------
   It is one of the ten, at whatever rank its real usage earns — it holds no
   position of its own. Two things alone mark it as the platform rather than a
   customer, and neither of them changes its rank, its podium effect, or the
   ordering of anyone else's row:
     - the `brand-flame` name treatment (below): an animated brand-gradient
       sweep with a breathing glow, unique in the sheet;
     - a red border tint on the card, so the row still reads apart from a
       consumer's at a glance even before the eye reaches the name.
   `house` rides on top of the podium/list effects rather than replacing them:
   a rank-1 house card keeps the rank-1 effect, which is the honest reading of
   "we use our own product". Neither property animates layout. */
.podium-card.house, .rank-row.house { border-color: rgba(232, 25, 44, 0.42); }

/* the animated name itself */
.brand-flame {
  background: linear-gradient(90deg, #8c0f1c 0%, #e8192c 22%, #ff8a94 38%, #ff4653 52%, #e8192c 68%, #8c0f1c 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* the paint overflow that keeps tall glyphs (f, y, g) unclipped */
  padding: 0.1em 0.06em;
  will-change: background-position;
  animation: brandFlame 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(232, 25, 44, 0.35));
}
/* The name lives on a podium card, whose per-rank rules set an explicit colour
   on `.pod-name` with THREE classes of specificity. `color: transparent` on a
   single class loses to those, so on ranks 1-3 the gradient would be painted and
   then covered by solid white — the flame would visibly not work. Restate the
   transparent colour at the same specificity as the rule it has to beat; the
   selectors are narrow on purpose so nothing else on the site is affected. */
.podium-card .pod-name.brand-flame { color: transparent; }
.podium-empty .pod-name.brand-flame { color: var(--red2); }
/* On a list row the base colour is `var(--t1)` on TWO classes, which also beats
   one class — same restatement there. */
.rank-row .rr-name.brand-flame { color: transparent; }
@keyframes brandFlame {
  0%, 18%   { background-position: 0% 50%; }
  70%, 100% { background-position: 100% 50%; }
}

/* ---------- ranks 4-10 ---------- */
.rank-sec-head { margin-bottom: 22px; display: flex; flex-direction: column; gap: 10px; }
.rank-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rank-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center; gap: 16px;
  padding: 16px 20px;
}
.rank-row .rr-rank {
  font-family: var(--fm); font-weight: 700; font-size: 1rem; color: var(--t3);
  text-align: center;
}
.rank-row .rr-name { font-family: var(--fb); font-weight: 600; font-size: 1rem; color: var(--t1); min-width: 0; overflow-wrap: anywhere; }
.rank-row .rr-tok { font-family: var(--fm); font-weight: 700; font-size: .98rem; color: var(--t1); white-space: nowrap; }
.rank-row .rr-tok b { color: #fff; }
.rank-row .rr-req { font-family: var(--fm); font-size: .76rem; color: var(--t3); white-space: nowrap; }

.rank-note { color: var(--t3); font-size: .84rem; max-width: 78ch; margin-top: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .podium { grid-template-columns: 1fr; gap: 14px; margin-bottom: 42px; }
  /* phone: rank 1 first, then 2, then 3 — a three-column podium cannot
     hold a 20-character name without clipping it */
  .podium-card.rk-2 { order: 2; }
  .podium-card.rk-1 { order: 1; }
  .podium-card.rk-3 { order: 3; }
  .podium-card { padding-top: 22px !important; padding-bottom: 24px !important; }
  .pod-num { font-size: 1.7rem; }
}
@media (max-width: 520px) {
  .rank-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; }
  .rank-row .rr-req { display: none; } /* keep the row on one line on a phone */
  .rank-row .rr-rank { font-size: .9rem; }
  .rt-v { font-size: 1.5rem; }
}
@media (max-width: 380px) {
  .podium-card { padding-left: 16px; padding-right: 16px; }
  .pod-name { font-size: .98rem; }
}

/* ---------- reduced motion: every effect off, layout untouched ---------- */
@media (prefers-reduced-motion: reduce) {
  .podium-card.rk-1, .podium-card.rk-2, .podium-card.rk-3,
  .podium-card.rk-1 .pod-sheen, .podium-card.rk-2 .pod-sheen,
  .podium-card.rk-3 .pod-num { animation: none; }
  /* rank 1 keeps its gradient border, rank 2 its accent hairline, rank 3 its
     pulse target — only the motion is removed, so the hierarchy survives */
  .podium-card.rk-1 .pod-sheen { opacity: .5; }
  /* the house name keeps its gradient but stops sweeping, and the glow becomes
     a static halo: the row is still visually distinct, just never moving */
  .brand-flame { animation: none; background-position: 50% 50%; filter: none; }
}

/* Legacy engine (no background-clip:text — e.g. UC 12.x, older Android): a
   transparent colour with no gradient would render this text invisible, so it
   falls back to a flat brand red. Selectors are narrow on purpose — `!important`
   is needed to beat the animation's own background-position, and a broad
   `[class]` selector would strip the background off the whole site. Every
   gradient-text rule in the sheet is listed here; a new one must be added.
   This block sits last so the fallback wins wherever it applies, and on a
   modern engine the `not (...)` query never matches so none of it runs. */
@supports not (background-clip: text) {
  .grad-text, .mm-lucif, .brand-flame {
    background: none !important; color: var(--red2) !important;
    /* brandFlame animates background-position, not background, so !important
       on the colour alone would leave the animation running on a legacy engine */
    animation: none !important;
  }
}
