/*
  SuperAppAnalytics — shared design system.

  Mirrors the iOS dashboard (apps/ios-dashboard): pitch-black or warm off-white
  pages, flat cards with hairline borders, big bold numbers in the native San
  Francisco font, Liquid Glass controls, and blue reserved for charts, trends
  and the one thing that matters on screen. Never green.
*/

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* AnalyticsTheme */
  --glow: 102, 209, 255;      /* accentGlow    (0.40, 0.82, 1.00) */
  --primary: 69, 140, 255;    /* accentPrimary (0.27, 0.55, 1.00) */
  --deep: 41, 115, 255;       /* accentDeep    (0.16, 0.45, 1.00) */
  --positive: 102, 199, 255;  /* positive      (0.40, 0.78, 1.00) */
  --negative: 255, 71, 82;    /* negative      (1.00, 0.28, 0.32) */

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius-card: 24px;
  --radius-control: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --page: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --nav-h: 60px;

  color-scheme: dark;
  --bg: #000;
  --bg-rgb: 0, 0, 0;
  --surface: rgb(14, 16, 21);
  --surface-rgb: 14, 16, 21;
  --surface-2: rgb(21, 23, 29);
  --hairline: rgba(255, 255, 255, .07);
  --hairline-2: rgba(255, 255, 255, .12);
  --text: #fff;
  --text-rgb: 255, 255, 255;
  --text-2: #8e8e93;
  --text-3: rgba(235, 235, 245, .3);
  --fill: rgba(255, 255, 255, .04);
  --fill-2: rgba(255, 255, 255, .075);
  --track: rgba(118, 118, 128, .24);
  --card-shadow: 0 0 0 0 transparent;
  --glass: rgba(36, 38, 44, .52);
  --glass-strong: rgba(70, 72, 80, .5);
  --glass-rim: rgba(255, 255, 255, .22);
  --glass-rim-low: rgba(255, 255, 255, .06);
  --glass-shadow: 0 12px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1);
  --btn-bg: #fff;
  --btn-fg: #000;
  --aura: .95;
  --area-top: .42;
  --area-mid: .14;
  --line-glow: .6;
  --ghost: rgba(142, 142, 147, .42);
  --ring-1: rgb(56, 56, 56);
  --ring-2: rgb(46, 46, 46);
  --ring-3: rgb(38, 38, 38);
  --ring-4: rgb(31, 31, 31);
  --ring-5: rgb(26, 26, 26);
  --depth-reflection: .24;
  --depth-body-mix: 55%;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: rgb(241, 240, 236);
  --bg-rgb: 241, 240, 236;
  --surface: #fff;
  --surface-rgb: 255, 255, 255;
  --surface-2: rgb(248, 247, 244);
  --hairline: rgba(0, 0, 0, .06);
  --hairline-2: rgba(0, 0, 0, .1);
  --text: #000;
  --text-rgb: 0, 0, 0;
  --text-2: #6c6c70;
  --text-3: rgba(60, 60, 67, .32);
  --fill: rgba(0, 0, 0, .03);
  --fill-2: rgba(0, 0, 0, .055);
  --track: rgba(118, 118, 128, .14);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 44px rgba(0, 0, 0, .07);
  --glass: rgba(255, 255, 255, .6);
  --glass-strong: rgba(255, 255, 255, .92);
  --glass-rim: rgba(255, 255, 255, .95);
  --glass-rim-low: rgba(255, 255, 255, .4);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
  --btn-bg: #000;
  --btn-fg: #fff;
  --aura: .55;
  --area-top: .24;
  --area-mid: .08;
  --line-glow: .32;
  --ghost: rgba(108, 108, 112, .36);
  --ring-1: rgb(184, 184, 184);
  --ring-2: rgb(199, 199, 199);
  --ring-3: rgb(212, 212, 212);
  --ring-4: rgb(222, 222, 222);
  --ring-5: rgb(230, 230, 230);
  --depth-reflection: .14;
  --depth-body-mix: 12%;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid rgba(var(--glow), .9); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(var(--primary), .35); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 600;
  transition: top .2s ease;
}
.skip:focus { top: 16px; }

.container { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }

/* ---------- Type ---------- */

.display {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(54px, 9vw, 128px);
  line-height: .96;
  font-weight: 700;
  letter-spacing: -.048em;
}

.h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.028em;
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  font-size: 13px; line-height: 1;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.lede {
  margin: 0;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
  letter-spacing: -.014em;
  text-wrap: pretty;
}

.muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.up { color: rgb(var(--positive)); }
.down { color: rgb(var(--negative)); }

.section { position: relative; padding-block: clamp(84px, 10vw, 144px); }
.section-head { max-width: 760px; margin: 0 auto clamp(48px, 6vw, 80px); text-align: center; }
.section-head .lede { margin-top: 20px; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---------- Surfaces ---------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

/* Liquid Glass: a translucent, saturated blur with a specular rim. */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--glass-shadow);
}
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(170deg, var(--glass-rim), transparent 34%, transparent 66%, var(--glass-rim-low));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font-size: 16px; font-weight: 600; letter-spacing: -.012em; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .35s ease, background-color .3s ease, color .3s ease;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { box-shadow: 0 0 0 4px rgba(var(--glow), .12), 0 12px 38px rgba(var(--primary), .34); }
.btn-glass { color: var(--text); }
.btn-glass:hover { background: var(--glass-strong); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 17px; }
.btn .i { font-size: 17px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text);
  cursor: pointer;
  transition: background-color .25s ease, transform .18s ease;
}
.icon-btn:hover { background: var(--fill-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .i { font-size: 19px; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
  color: var(--text);
  transition: gap .25s var(--ease), opacity .2s ease;
}
.text-link:hover { gap: 10px; }
.text-link .i { font-size: 15px; }

/* ---------- Command pill ---------- */

.cmd {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; max-width: 100%; min-width: 0;
  padding: 0 7px 0 20px;
  border-radius: 999px;
  font-family: var(--mono); font-size: 14.5px; letter-spacing: 0;
}
.cmd code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; }
.cmd-prompt { color: var(--text-3); user-select: none; -webkit-user-select: none; }

.copy-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; min-width: 42px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--fill-2); color: var(--text);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, transform .18s ease;
}
.copy-btn:hover { background: var(--track); }
.copy-btn:active { transform: scale(.95); }
.copy-btn .i { font-size: 15px; }
.copy-btn .i-done { display: none; color: rgb(var(--positive)); }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied .i-done { display: block; }

/* ---------- Liquid Glass segmented control ---------- */

.seg {
  position: relative;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px;
  border-radius: 999px;
}
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 .5px rgba(255, 255, 255, .1);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .seg-thumb { box-shadow: 0 3px 12px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04), inset 0 1px 0 #fff; }
.seg-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; min-width: 56px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn[aria-selected="true"], .seg-btn[aria-pressed="true"] { color: var(--text); }
.seg-btn:focus-visible { outline-offset: -2px; border-radius: 999px; }

.live-dot {
  position: relative;
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: rgb(var(--primary));
  box-shadow: 0 0 6px rgba(var(--primary), .9);
  animation: live-dot 2.2s ease-in-out infinite;
}
@keyframes live-dot {
  0%, 100% { transform: scale(.88); box-shadow: 0 0 2px rgba(var(--primary), .5); }
  50% { transform: scale(1.12); box-shadow: 0 0 9px rgba(var(--primary), .95); }
}

/* ---------- Rolling numbers (SwiftUI .numericText) ---------- */

.ticker { display: inline-flex; align-items: flex-start; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-d, .tk-s { display: inline-block; height: 1.12em; line-height: 1.12em; }
.tk-d { overflow: hidden; }
.tk-c { display: flex; flex-direction: column; transition: transform .75s cubic-bezier(.2, .85, .25, 1); will-change: transform; }
.tk-c > span { display: block; height: 1.12em; text-align: center; }

/* ---------- Trend label ---------- */

.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend::before {
  content: "";
  width: 0; height: 0;
  border-left: .32em solid transparent;
  border-right: .32em solid transparent;
  border-bottom: .52em solid currentColor;
}
.trend.up { color: rgb(var(--positive)); }
.trend.down { color: rgb(var(--negative)); }
.trend.down::before { transform: rotate(180deg); }

/* ---------- Pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  border-radius: 999px;
  background: rgba(var(--positive), .14);
  color: rgb(var(--positive));
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
[data-theme="light"] .pill { background: rgba(var(--deep), .09); color: rgb(var(--deep)); }
.pill.neutral { background: var(--fill-2); color: var(--text-2); }
.pill.neg { background: rgba(var(--negative), .12); color: rgb(var(--negative)); }

/* ---------- Navigation ---------- */

.nav-wrap {
  position: fixed; inset: 14px 0 auto; z-index: 50;
  display: flex; justify-content: center;
  padding: 0 14px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  width: min(100%, 1080px);
  height: var(--nav-h);
  padding: 0 10px 0 12px;
  border-radius: 999px;
  transition: width .5s var(--ease), box-shadow .4s ease, background-color .4s ease;
}
.nav-wrap.is-scrolled .nav { width: min(100%, 1000px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; flex: none; box-shadow: 0 0 0 .5px var(--hairline-2), 0 4px 18px rgba(var(--primary), .25); }
.brand-icon.light { display: none; }
[data-theme="light"] .brand-icon.dark { display: none; }
[data-theme="light"] .brand-icon.light { display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  transition: color .2s ease, background-color .2s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--fill-2); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.nav-menu-btn { display: none; }
.nav-signin {
  padding: 9px 14px; border-radius: 999px;
  color: var(--text-2); font-size: 15px; font-weight: 600;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.nav-signin:hover { color: var(--text); background: var(--fill-2); }

.theme-toggle .i-sun, [data-theme="light"] .theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
.theme-toggle .i { transition: transform .5s var(--ease-out); }
.theme-toggle:hover .i { transform: rotate(-18deg); }

.nav-sheet {
  position: fixed; inset: 86px 14px auto; z-index: 49;
  padding: 10px;
  border-radius: 28px;
  opacity: 0; transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .25s ease, transform .35s var(--ease-out);
}
.nav-sheet.is-open { opacity: 1; transform: none; pointer-events: auto; }
.nav-sheet a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-radius: 18px;
  font-size: 20px; font-weight: 600; letter-spacing: -.02em;
}
.nav-sheet a:hover { background: var(--fill-2); }
.nav-sheet .btn { width: 100%; margin-top: 8px; justify-content: center; font-size: 17px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-menu-btn { display: inline-grid; }
  .nav .btn-get { display: none; }
  .nav .nav-signin { display: none; }
}

/* ---------- Reveal (SoftEntrance: fade, rise, un-blur) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(8px);
  transition:
    opacity .9s var(--ease) var(--d, 0s),
    transform 1s var(--ease-out) var(--d, 0s),
    filter .9s var(--ease) var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Footer ---------- */

.footer { position: relative; padding: 72px 0 40px; border-top: 1px solid var(--hairline); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer-brand p { margin: 16px 0 0; max-width: 280px; color: var(--text-2); font-size: 15px; }
.footer h4 { margin: 4px 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer li a { font-size: 15px; color: var(--text); opacity: .86; transition: opacity .2s ease; }
.footer li a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-3); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--text-2); font-size: 14px;
}
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Aura (BrandAura) ---------- */

.aura {
  position: absolute; inset: 0 0 auto 0;
  height: 900px;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(var(--deep), .34), transparent 72%),
    radial-gradient(30% 30% at 72% 10%, rgba(var(--glow), .12), transparent 70%);
  opacity: var(--aura);
}

/* ---------- FAQ ---------- */

.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 4px;
  list-style: none; cursor: pointer;
  font-size: clamp(18px, 1.7vw, 21px); font-weight: 600; letter-spacing: -.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus {
  position: relative; width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: var(--fill-2);
  transition: transform .45s var(--ease-out), background-color .3s ease;
}
.faq summary .plus::before, .faq summary .plus::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 12px; height: 1.8px; margin: -.9px 0 0 -6px;
  border-radius: 2px; background: currentColor;
  transition: transform .45s var(--ease-out);
}
.faq summary .plus::after { transform: rotate(90deg); }
.faq details[open] summary .plus { transform: rotate(180deg); }
.faq details[open] summary .plus::after { transform: rotate(0deg); }
.faq summary:hover .plus { background: var(--track); }
.faq-body { overflow: hidden; }
.faq-body p { margin: 0 0 26px; padding-right: 54px; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.faq-body code { font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--fill-2); color: var(--text); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}

/* Theme switch: the new theme is revealed in a circle from the toggle. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ---------- Charts (RevenueTrendChart) ---------- */

.lc-wrap { position: relative; }
.lc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc .stop-deep { stop-color: rgb(var(--deep)); }
.lc .stop-primary { stop-color: rgb(var(--primary)); }
.lc .stop-glow { stop-color: rgb(var(--glow)); }
.lc .stop-area-top { stop-color: rgb(var(--primary)); stop-opacity: var(--area-top); }
.lc .stop-area-mid { stop-color: rgb(var(--deep)); stop-opacity: var(--area-mid); }
.lc .stop-area-end { stop-color: rgb(var(--deep)); stop-opacity: 0; }
.lc-line, .lc-glow, .lc-ghost { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lc-glow { opacity: var(--line-glow); }
.lc-ghost { stroke: var(--ghost); stroke-width: 2; opacity: 0; transition: opacity 1s ease .2s; }
.lc-wrap.is-drawing .lc-ghost, .lc-wrap.is-drawn .lc-ghost { opacity: 1; }
.lc-grid line { stroke: var(--hairline-2); stroke-width: 1; stroke-dasharray: 2 6; }
.lc-area { opacity: 0; transition: opacity 1.2s ease; }
.lc-wrap.is-drawn .lc-area { opacity: 1; }
.lc-orb { opacity: 0; transition: opacity .3s ease; }
.lc-wrap.is-drawn .lc-orb { opacity: 1; }
.lc-dot { fill: #fff; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.lc-wrap.is-drawn .lc-dot { transform: scale(1); }
[data-theme="light"] .lc-dot { stroke: rgb(var(--glow)); stroke-width: 2.2; }
.lc-orb-glow { fill: rgba(var(--glow), .55); }
[data-theme="light"] .lc-orb-glow { fill: rgba(var(--glow), .45); }
.lc-halo { fill: rgba(var(--glow), .42); opacity: 0; transform-box: fill-box; transform-origin: center; }
.lc-orb.is-pulsing .lc-halo { animation: lc-pulse 2.8s ease-out infinite; }
@keyframes lc-pulse { 0% { opacity: .75; transform: scale(.45); } 100% { opacity: 0; transform: scale(2.6); } }
.lc-scrub { opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.lc-wrap.is-scrubbing .lc-scrub { opacity: 1; }
.lc-wrap.is-scrubbing .lc-orb { opacity: .2; }
.lc-scrub line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 4; }
.lc-scrub circle { fill: var(--text); stroke: var(--bg); stroke-width: 2.5; }
.lc-label {
  position: absolute; left: 0; top: -6px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--fill-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.lc-wrap.is-scrubbing .lc-label { opacity: 1; }

/* ---------- DepthBlock (Records podium, funnel bars, plan staircase) ---------- */

.db {
  --h: 0px;
  --fade: 0;
  --keep: calc(100% - var(--fade) * 100%);
  --keep-top: calc(100% - var(--fade) * 50%);
  position: relative;
  display: flex; flex-direction: column;
  width: 100%;
  transition: filter .5s ease;
}
.db-top {
  display: block;
  height: var(--depth, 12px);
  margin: 0 -20%;
  background: linear-gradient(180deg,
    color-mix(in srgb, color-mix(in srgb, rgb(var(--primary)) 40%, rgb(var(--glow))) var(--keep-top), var(--surface)),
    color-mix(in srgb, color-mix(in srgb, rgb(var(--glow)) 60%, #fff) var(--keep-top), var(--surface)));
  transition: background .5s ease;
}
.db-front {
  position: relative;
  display: block;
  height: var(--h);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .06) 22%, rgba(255, 255, 255, .06) 78%, rgba(0, 0, 0, .22)),
    linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 34px),
    linear-gradient(180deg,
      color-mix(in srgb, rgb(var(--primary)) var(--keep), var(--surface)),
      color-mix(in srgb, rgb(var(--deep)) var(--keep), var(--surface)) 55%,
      color-mix(in srgb, color-mix(in srgb, rgb(var(--deep)) 65%, #000) var(--keep), var(--surface)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, calc(.6 - var(--fade) * .45)), 0 4px 18px rgba(var(--primary), calc(.3 - var(--fade) * .3));
}
[data-theme="light"] .db-front { box-shadow: inset 0 1px 0 rgba(255, 255, 255, calc(.6 - var(--fade) * .45)), 0 4px 14px rgba(var(--primary), calc(.18 - var(--fade) * .18)); }
.db-face {
  position: absolute; inset: 10px 0 auto; z-index: 1;
  text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1;
  color: rgba(255, 255, 255, .26);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22), 0 -1px 0 rgba(0, 0, 0, .28);
}
.db-glint {
  position: absolute; top: -30%; left: 0;
  width: 40%; height: 160%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  mix-blend-mode: plus-lighter;
  transform: translateX(-160%) rotate(16deg);
  pointer-events: none;
}
.db-reflection {
  display: block;
  height: 18px;
  background: linear-gradient(0deg,
    color-mix(in srgb, rgb(var(--primary)) var(--keep), var(--surface)),
    color-mix(in srgb, rgb(var(--deep)) var(--keep), var(--surface)));
  opacity: var(--depth-reflection);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

/* ---------- Plan staircase ---------- */

.stairs {
  position: relative;
  display: grid; grid-template-columns: repeat(6, 1fr); align-items: end;
  gap: clamp(6px, 1.2vw, 14px);
  padding-bottom: 6px;
}
.stair {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  min-width: 0;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.stair .db { width: 100%; }
.stair-price {
  display: flex; align-items: baseline; gap: 2px;
  margin-bottom: 12px;
  font-family: var(--display); font-weight: 700; font-size: clamp(17px, 2vw, 26px); letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  transition: color .3s ease, transform .5s var(--ease-out);
}
.stair-per { font-size: .55em; font-weight: 600; letter-spacing: 0; opacity: .8; }
.stair-name { margin-top: 4px; font-size: clamp(13px, 1.2vw, 15px); font-weight: 650; letter-spacing: -.01em; color: var(--text-2); transition: color .3s ease; }
.stair-events { font-size: clamp(11px, 1vw, 13px); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stair.is-selected .stair-price { color: var(--text); transform: translateY(-4px); }
.stair.is-selected .stair-name { color: var(--text); }
.stair:hover .stair-price { color: var(--text); }
.stair:focus-visible { outline-offset: 6px; border-radius: 14px; }
.stairs-floor {
  position: absolute; left: 0; bottom: 34px;
  width: 260px; height: 46px;
  margin-left: -130px;
  transform: translateX(var(--x, 50%));
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--primary), .34), transparent);
  filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transition: transform .6s var(--ease-out), opacity .8s ease;
  z-index: -1;
}
.stairs.is-risen .stairs-floor { opacity: 1; }

/* ---------- Events slider ---------- */

.ev-readout { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 22px; }
.ev-number { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); }
.ev-number .ticker { font-size: clamp(44px, 5vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.ev-number small { font-size: 17px; font-weight: 500; color: var(--text-2); letter-spacing: -.01em; }
.ev-plan { display: flex; align-items: baseline; gap: 10px; color: var(--text-2); font-size: 17px; }
.ev-plan strong { color: var(--text); font-weight: 650; }
.ev-plan .ticker { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.ev-track { position: relative; padding: 14px 0 34px; }
.ev-range {
  --p: 50%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 30px; margin: 0;
  background: transparent; cursor: pointer;
}
.ev-range:focus-visible { outline: none; }
.ev-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background:
    linear-gradient(90deg, rgb(var(--deep)), rgb(var(--primary)) 60%, rgb(var(--glow))) 0 0 / var(--p) 100% no-repeat,
    var(--track);
  box-shadow: 0 0 10px rgba(var(--primary), .35);
}
.ev-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--track); }
.ev-range::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, rgb(var(--deep)), rgb(var(--glow))); box-shadow: 0 0 10px rgba(var(--primary), .35); }
.ev-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; margin-top: -12px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 6px rgba(var(--glow), .22), 0 0 22px rgba(var(--glow), .8), 0 2px 6px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ev-range::-moz-range-thumb {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(var(--glow), .22), 0 0 22px rgba(var(--glow), .8), 0 2px 6px rgba(0, 0, 0, .3);
}
.ev-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.ev-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(var(--glow), .45), 0 0 26px rgba(var(--glow), .9); }
.ev-ticks { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 20px; }
.ev-tick {
  position: absolute; top: 0;
  transform: translateX(-50%);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ev-tick::before { content: ""; position: absolute; left: 50%; top: -14px; width: 1px; height: 8px; background: var(--hairline-2); }

/* ---------- App icons (fictional demo apps) ---------- */

.app-icon {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 23%;
  background: linear-gradient(150deg, #ffb340, #ff6b2c 62%, #ff3d5a);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .25), 0 2px 8px rgba(0, 0, 0, .18);
  color: #fff;
  overflow: hidden;
}
.app-icon::before {
  content: ""; width: 46%; height: 46%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, rgba(255, 255, 255, .85) 45%, rgba(255, 255, 255, 0) 72%);
  box-shadow: 0 0 14px rgba(255, 255, 255, .7);
}
.app-icon.app-tempo { background: linear-gradient(150deg, #8e8cff, #5e5ce6 55%, #3a2fb8); }
.app-icon.app-tempo::before { width: 34%; height: 54%; border-radius: 3px; transform: skewX(-14deg); background: #fff; box-shadow: none; clip-path: polygon(60% 0, 0 58%, 44% 58%, 34% 100%, 100% 40%, 56% 40%); }
.app-icon.app-pixel { background: linear-gradient(150deg, #ff7ac6, #d63fa4 55%, #8a2bd8); }
.app-icon.app-pixel::before { border-radius: 30%; width: 44%; height: 44%; background: none; border: 3px solid #fff; box-shadow: none; }

/* Images that swap with the theme (app icon variants). */
.t-light { display: none; }
[data-theme="light"] .t-dark { display: none; }
[data-theme="light"] .t-light { display: block; }

/* 3D ring walls (Top markets) */
:root { --ring-wall: rgb(10, 10, 11); --ring-active-wall: color-mix(in srgb, rgb(41, 115, 255) 45%, #000); }
[data-theme="light"] { --ring-wall: rgb(158, 158, 160); --ring-active-wall: color-mix(in srgb, rgb(41, 115, 255) 88%, #000); }

/* ---------- Terminal ---------- */

.terminal {
  position: relative;
  border-radius: 22px;
  background: rgba(9, 10, 13, .96);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .8), 0 0 0 .5px rgba(0, 0, 0, .6), 0 30px 80px -50px rgba(var(--primary), .5);
  color: #e8e8ed;
  color-scheme: dark;
  overflow: hidden;
}
[data-theme="light"] .terminal { box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .4), 0 30px 80px -50px rgba(var(--primary), .45); }
.term-bar {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .03);
}
.term-dots { display: flex; gap: 8px; }
.term-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.term-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 500; color: rgba(235, 235, 245, .5); pointer-events: none; }
.term-replay {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; margin-left: auto; padding: 0 12px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.term-replay:hover { background: rgba(255, 255, 255, .14); }
.term-replay .i { font-size: 13px; }
.term-body {
  height: 520px;
  padding: 18px 22px 22px;
  overflow: hidden;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75; letter-spacing: 0;
}
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; animation: t-in .3s ease both; }
@keyframes t-in { from { opacity: 0; transform: translateY(4px); } }
.t-cmd .t-p { color: rgb(var(--glow)); }
.t-dim { color: rgba(235, 235, 245, .46); }
.t-ok { color: rgb(var(--glow)); }
.t-bul { color: rgb(var(--primary)); }
.t-strong { color: #fff; font-weight: 600; }
.t-user {
  margin: 10px 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .06);
  color: #fff;
}
.t-user .t-p { color: rgba(235, 235, 245, .5); }
.t-table { margin: 4px 0 6px 2px; padding: 4px 0 4px 14px; border-left: 2px solid rgba(var(--primary), .55); }
.t-row { display: flex; justify-content: space-between; gap: 24px; animation: t-in .3s ease both; }
.t-row span:last-child { color: rgba(235, 235, 245, .5); }
.t-caret { display: inline-block; width: 8px; height: 15px; margin-left: 1px; vertical-align: -2px; background: #fff; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.t-spin { color: rgb(var(--glow)); }
.t-link { color: rgb(var(--glow)); text-decoration: underline; text-decoration-color: rgba(var(--glow), .4); text-underline-offset: 3px; }

/* ---------- Plan picker card ---------- */

.picker { max-width: 1060px; margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.picker-stairs { margin-top: 26px; }
.picker-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--hairline); }

@media (max-width: 640px) {
  /* The staircase keeps its 3D steps on phones and scrolls sideways. */
  .picker-stairs { overflow-x: auto; margin-inline: calc(-1 * clamp(24px, 4vw, 48px)); padding: 0 clamp(24px, 4vw, 48px) 6px; scrollbar-width: none; }
  .picker-stairs::-webkit-scrollbar { display: none; }
  .picker-stairs .stairs { min-width: 620px; }
  .ev-tick:nth-child(2), .ev-tick:nth-child(4), .ev-tick:nth-child(5) { display: none; }
}
