/* Substrack design system v2 — modern, glassy, gradient. Light/dark, responsive. */
:root {
  --bg: #f6f7fb; --bg-2: #eef0f8;
  --panel: rgba(255,255,255,.82); --panel-solid: #ffffff; --panel-2: #f2f4fa;
  --line: rgba(17,20,45,.09); --line-strong: rgba(17,20,45,.14);
  --fg: #0f1130; --muted: #5a5f7a; --faint: #8b90ab;
  --brand: #6d5efc; --brand-2: #9a6bff; --brand-3: #4f7bff;
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, #6d5efc 0%, #9a6bff 55%, #4f7bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(109,94,252,.16), rgba(79,123,255,.16));
  --good: #12a150; --good-bg: #e6f7ec; --warn: #b7791f; --warn-bg: #fdf3e2;
  --bad: #e5484d; --bad-bg: #fdecec; --info: #4f7bff;
  --ring: 0 0 0 3px rgba(109,94,252,.28);
  --shadow-sm: 0 1px 2px rgba(16,19,45,.06), 0 4px 14px rgba(16,19,45,.05);
  --shadow: 0 4px 12px rgba(16,19,45,.07), 0 18px 50px rgba(16,19,45,.09);
  --shadow-glow: 0 10px 30px rgba(109,94,252,.35);
  --radius: 18px; --radius-sm: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  --surface-blur: saturate(1.6) blur(14px);
}
[data-theme="dark"] {
  --bg: #08080f; --bg-2: #0d0d17;
  --panel: rgba(23,24,38,.72); --panel-solid: #16172a; --panel-2: #1e2036;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.16);
  --fg: #eef0fb; --muted: #a3a8c6; --faint: #6f7597;
  --brand: #9a8bff; --brand-2: #b79bff; --brand-3: #6f9bff; --brand-ink: #0b0b16;
  --grad: linear-gradient(135deg, #8b7bff 0%, #b79bff 55%, #6f9bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,123,255,.2), rgba(111,155,255,.18));
  --good: #3ddc84; --good-bg: #12281c; --warn: #eab657; --warn-bg: #2a2213;
  --bad: #ff6b6f; --bad-bg: #2c1618; --info: #6f9bff;
  --ring: 0 0 0 3px rgba(154,139,255,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.4);
  --shadow: 0 8px 24px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.5);
  --shadow-glow: 0 12px 40px rgba(124,110,255,.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; position: relative; overflow-x: hidden;
}
/* Aurora backdrop */
body::before {
  content: ""; position: fixed; inset: -20% -10% auto -10%; height: 720px; z-index: -1;
  background:
    radial-gradient(60% 55% at 15% 0%, rgba(109,94,252,.22), transparent 60%),
    radial-gradient(55% 50% at 85% 8%, rgba(79,123,255,.18), transparent 60%),
    radial-gradient(45% 45% at 55% 30%, rgba(154,107,255,.14), transparent 65%);
  filter: blur(20px); pointer-events: none;
}
[data-theme="dark"] body::before { opacity: .8; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { font-family: var(--display); line-height: 1.14; margin: 0 0 .4em;
  letter-spacing: -.02em; font-weight: 700; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; } .mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --- Nav --- */
.nav { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur);
  border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display);
  font-weight: 700; font-size: 18px; color: var(--fg); letter-spacing: -.02em; }
.brand:hover { color: var(--fg); }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: var(--shadow-glow); font-family: var(--display); }
.nav-links { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.nav-links a { color: var(--muted); padding: 8px 13px; border-radius: 10px; font-weight: 550; font-size: 14px; transition: .18s; }
.nav-links a:hover { color: var(--fg); background: var(--panel-2); }
.nav-links a.active { color: var(--fg); background: var(--panel-2); }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 8px;
  border-radius: 10px; display: grid; place-items: center; font-size: 16px; transition: .18s; }
.icon-btn:hover { background: var(--panel-2); color: var(--fg); transform: rotate(-8deg); }
.menu-toggle { display: none; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 650; font-family: inherit; transition: transform .18s, box-shadow .18s, background .18s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(109,94,252,.45); color: #fff; }
.btn-ghost { background: var(--panel); color: var(--fg); border-color: var(--line-strong);
  backdrop-filter: var(--surface-blur); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { filter: brightness(.97); }
.btn-block { width: 100%; } .btn-lg { padding: 14px 28px; font-size: 15.5px; border-radius: 14px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-google { background: var(--panel-solid); color: var(--fg); border: 1px solid var(--line-strong); }
.btn-google:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-google .g { width: 18px; height: 18px; display: grid; place-items: center; font-weight: 800;
  background: conic-gradient(from -45deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --- Cards --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur); }
.card-pad { padding: 24px; }
.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.section-title { font-family: var(--display); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }

/* --- Forms --- */
.field { margin-bottom: 15px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--panel-solid); color: var(--fg); font-size: 14px; font-family: inherit; transition: .16s; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.field-error { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.checkbox input { width: auto; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* --- Toasts --- */
.toasts { position: fixed; top: 80px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 370px; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); border-left: 4px solid var(--muted);
  border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start; animation: slidein .3s cubic-bezier(.2,.8,.2,1); }
.toast.success { border-left-color: var(--good); } .toast.error { border-left-color: var(--bad); } .toast.info { border-left-color: var(--info); }
.toast .x { margin-left: auto; cursor: pointer; color: var(--faint); background: none; border: 0; font-size: 17px; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Tiles (KPI) --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .2s, box-shadow .2s;
  backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .9; }
.tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile .value { font-family: var(--display); font-size: 30px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.tile .value .unit { font-size: 13px; color: var(--muted); font-weight: 500; font-family: var(--font); }
.tile .value.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* --- Bars --- */
.bar-row { display: grid; grid-template-columns: 130px 1fr 42px; align-items: center; gap: 12px; margin: 11px 0; font-size: 13px; }
.bar { height: 12px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--grad);
  box-shadow: 0 0 12px rgba(109,94,252,.45); animation: grow .7s cubic-bezier(.2,.8,.2,1); }
.bar.alt > span { background: linear-gradient(90deg, #12a150, #3ddc84); box-shadow: 0 0 12px rgba(61,220,132,.4); }
@keyframes grow { from { width: 0 !important; } }
.num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Table --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  box-shadow: var(--shadow-sm); backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.amt { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover td { background: var(--panel-2); }

/* --- Pills / badges --- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 550; }
.pill.brand { background: var(--grad-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.badge { padding: 2px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 650; }
.badge.ok { background: var(--good-bg); color: var(--good); } .badge.err { background: var(--bad-bg); color: var(--bad); } .badge.warn { background: var(--warn-bg); color: var(--warn); }

/* --- Layout --- */
.page { padding: 34px 0 70px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 27px; margin: 0; }
.page-head .spacer { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* --- Landing --- */
.hero { padding: 90px 0 30px; text-align: center; position: relative; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 22px;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.hero h1 { font-size: 60px; font-weight: 700; letter-spacing: -.035em; max-width: 900px; margin: 0 auto 18px; line-height: 1.04; }
.hero p.lede { font-size: 19px; color: var(--muted); max-width: 600px; margin: 0 auto 30px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 18px; color: var(--faint); font-size: 13px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }

/* faux dashboard preview */
.preview { margin: 56px auto 0; max-width: 940px; border-radius: 22px; border: 1px solid var(--line-strong);
  background: var(--panel); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: var(--surface-blur);
  transform: perspective(1600px) rotateX(6deg); transform-origin: top center; }
.preview .bar-top { display: flex; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.preview .bar-top i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.preview .body { padding: 22px; display: grid; gap: 14px; }
.preview .mini-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.preview .mt { background: var(--panel-2); border-radius: 12px; padding: 14px; }
.preview .mt .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.preview .mt .v { font-family: var(--display); font-size: 22px; font-weight: 700; margin-top: 4px; }
.preview .rows { display: grid; gap: 9px; }
.preview .pr { display: grid; grid-template-columns: 1fr 2fr 60px; gap: 10px; align-items: center; }
.preview .pr .nm { font-weight: 600; font-size: 13px; }
.preview .pr .bar { height: 9px; }

.section { padding: 64px 0 20px; }
.section .kicker { text-align: center; color: var(--brand); font-weight: 650; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.section h2 { text-align: center; font-size: 34px; margin: 8px auto 8px; letter-spacing: -.02em; }
.section .sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 36px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ic { width: 46px; height: 46px; border-radius: 13px; background: var(--grad-soft);
  color: var(--brand); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.feature h3 { font-size: 17px; margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-top: 8px; }
.stat { text-align: center; padding: 22px; }
.stat .n { font-family: var(--display); font-size: 34px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.cta-band { margin: 70px auto 20px; text-align: center; padding: 54px 24px; border-radius: 24px;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(40% 60% at 20% 10%, rgba(255,255,255,.25), transparent 60%),
  radial-gradient(40% 60% at 90% 90%, rgba(255,255,255,.18), transparent 60%); }
.cta-band h2 { color: #fff; font-size: 32px; position: relative; }
.cta-band p { color: rgba(255,255,255,.9); position: relative; margin-bottom: 22px; }
.cta-band .btn { background: #fff; color: #4b3fd6; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.cta-band .btn:hover { color: #4b3fd6; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 30px 0; color: var(--muted); font-size: 13.5px; }
.footer .foot-inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); } .footer a:hover { color: var(--fg); }
.footer .spacer { margin-left: auto; }

/* --- Prose --- */
.prose { max-width: 780px; }
.prose h1 { font-size: 32px; } .prose h2 { font-size: 19px; margin-top: 30px; }
.prose p, .prose li { color: var(--fg); } .prose ul { padding-left: 20px; }
.prose .updated { color: var(--muted); font-size: 13px; margin-bottom: 26px; }

/* --- Auth --- */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card h1 { font-size: 25px; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 14.5px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  .grid2 { grid-template-columns: 1fr; }
  .preview .mini-tiles { grid-template-columns: repeat(2,1fr); }
  .nav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--panel-solid); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .menu-toggle { display: grid; margin-left: auto; }
  .hero { padding: 60px 0 20px; } .hero h1 { font-size: 40px; }
  .preview { transform: none; }
}
