/* BAPC Sēmýdō design system (report v0.6, §1.1).
   Tokens: primary violet, accent magenta, highlight amber, success teal, plus cyan for water.
   Dark-first; light theme provided. Glow and gradients are decoration only: body text sits on solid surfaces. */

:root {
  --violet: #8b5cff;
  --violet-strong: #6d3dff;
  --magenta: #ff4fd8;
  --amber: #ffb547;
  --teal: #2ee6b8;
  --cyan: #3fd4ff;
  --danger: #ff6b7d;

  --bg: #07061a;
  --bg-2: #0e0b2b;
  --surface: #14113a;
  --surface-2: #1b1749;
  --glass: rgba(30, 24, 82, .62);
  --glass-strong: rgba(22, 18, 64, .9);
  --line: rgba(160, 140, 255, .22);
  --line-strong: rgba(190, 170, 255, .45);
  --text: #f4f1ff;
  --text-2: #c9c2ee;
  --text-3: #9d95cc;
  --on-accent: #ffffff;

  --grad-brand: linear-gradient(100deg, var(--magenta) 0%, #c56bff 40%, var(--amber) 100%);
  --grad-violet: linear-gradient(135deg, #9b6bff, #5b3dff 60%, #2fa8ff);
  --grad-amber: linear-gradient(135deg, #ffcf6b, #ff8a3d);
  --grad-teal: linear-gradient(135deg, #3ff5c8, #12a6a0);

  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --glow-violet: 0 0 0 1px rgba(155, 107, 255, .5), 0 0 28px -4px rgba(139, 92, 255, .65);
  --glow-amber: 0 0 0 1px rgba(255, 181, 71, .55), 0 0 28px -4px rgba(255, 150, 60, .6);
  --glow-teal: 0 0 0 1px rgba(46, 230, 184, .5), 0 0 28px -4px rgba(46, 230, 184, .55);
  --font: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f4ff;
  --bg-2: #ece8ff;
  --surface: #ffffff;
  --surface-2: #f2efff;
  --glass: rgba(255, 255, 255, .78);
  --glass-strong: rgba(255, 255, 255, .96);
  --line: rgba(90, 60, 200, .16);
  --line-strong: rgba(90, 60, 200, .34);
  --text: #16123a;
  --text-2: #3d3670;
  --text-3: #5f5896;
  --violet: #6a3df0;
  --magenta: #c21fa6;
  --amber: #b86a00;
  --teal: #0a8a6c;
  --cyan: #0a7fb5;
  --shadow: 0 20px 50px -24px rgba(60, 40, 140, .35);
  --glow-violet: 0 0 0 1px rgba(106, 61, 240, .35), 0 10px 30px -12px rgba(106, 61, 240, .45);
  --glow-amber: 0 0 0 1px rgba(184, 106, 0, .35), 0 10px 30px -12px rgba(255, 140, 40, .45);
  --glow-teal: 0 0 0 1px rgba(10, 138, 108, .35), 0 10px 30px -12px rgba(10, 160, 120, .4);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* ---------- Backdrop: neon streaks, grid, glass shards ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background:
  radial-gradient(60% 50% at 15% 10%, rgba(139, 92, 255, .30), transparent 70%),
  radial-gradient(50% 45% at 90% 20%, rgba(63, 212, 255, .18), transparent 70%),
  radial-gradient(60% 50% at 80% 95%, rgba(255, 79, 216, .20), transparent 70%),
  radial-gradient(40% 40% at 5% 90%, rgba(255, 181, 71, .14), transparent 70%),
  var(--bg); }
.backdrop::before { content: ""; position: absolute; inset: -50%; background-image:
  linear-gradient(rgba(140, 120, 255, .07) 1px, transparent 1px),
  linear-gradient(90deg, rgba(140, 120, 255, .07) 1px, transparent 1px);
  background-size: 56px 56px; transform: perspective(900px) rotateX(58deg) translateY(30%);
  mask-image: linear-gradient(to top, #000 10%, transparent 60%); }
.backdrop svg.streaks { position: absolute; inset: 0; width: 100%; height: 100%; }
.streak { fill: none; stroke-width: 2.4; stroke-linecap: round; opacity: .75; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 3.2s cubic-bezier(.3, .7, .2, 1) forwards, drift 14s ease-in-out 3.2s infinite alternate; }
.streak.s2 { animation-delay: .3s, 3.5s; } .streak.s3 { animation-delay: .6s, 3.8s; } .streak.s4 { animation-delay: .9s, 4.1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-14px); } }
.shard { position: absolute; border: 1px solid rgba(160, 140, 255, .25); background: linear-gradient(135deg, rgba(139, 92, 255, .18), rgba(63, 212, 255, .05)); backdrop-filter: blur(2px); border-radius: 6px; animation: float 12s ease-in-out infinite alternate; }
@keyframes float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-22px) rotate(3deg); } }
:root[data-theme="light"] .backdrop { background:
  radial-gradient(60% 50% at 15% 10%, rgba(139, 92, 255, .16), transparent 70%),
  radial-gradient(60% 50% at 80% 95%, rgba(255, 79, 216, .10), transparent 70%), var(--bg); }
:root[data-theme="light"] .streak { opacity: .35; }

/* ---------- Brand ---------- */
.wordmark { font-family: var(--font); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.wordmark .bapc { color: var(--text); }
.wordmark .name { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .wordmark .name { background: linear-gradient(100deg, #b0128f, #7a2fe0 50%, #a35a00); -webkit-background-clip: text; background-clip: text; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(139, 92, 255, .55)); }
.brand .wordmark { font-size: 1.25rem; }

/* ---------- Controls ---------- */
.btn { --b: var(--violet); display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font: 600 .98rem var(--font); text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; color: var(--on-accent); background: var(--grad-violet); box-shadow: var(--glow-violet); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(190, 160, 255, .7), 0 12px 36px -8px rgba(139, 92, 255, .85); }
.btn.ghost { background: var(--glass); color: var(--text); border-color: var(--line-strong); box-shadow: none; backdrop-filter: blur(10px); }
.btn.ghost:hover { border-color: var(--violet); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--violet); }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font: 600 .8rem var(--font); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.chip.ok .dot { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.chip.warn .dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.chip.off .dot { background: var(--danger); }

/* ---------- Glass panels ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-lg); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--shadow); position: relative; }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(255, 255, 255, .35), transparent 30%, transparent 70%, rgba(255, 79, 216, .35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
:root[data-theme="light"] .glass::before { background: linear-gradient(140deg, rgba(106, 61, 240, .25), transparent 40%); }

/* ---------- Action cards (Clean export / Replace mark) ---------- */
.action { --tone: var(--violet); --toneglow: var(--glow-violet); position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius-lg); text-decoration: none; color: var(--text); border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent); background:
  linear-gradient(160deg, color-mix(in srgb, var(--tone) 30%, transparent), color-mix(in srgb, var(--tone) 8%, transparent) 60%), var(--glass-strong);
  box-shadow: var(--toneglow); transition: transform .25s, box-shadow .25s; overflow: hidden; cursor: pointer; font: inherit; text-align: left; }
.action:hover { transform: translateY(-4px); }
.action.amber { --tone: var(--amber); --toneglow: var(--glow-amber); }
.action.teal { --tone: var(--teal); --toneglow: var(--glow-teal); }
.action .art { height: 104px; display: grid; place-items: center; border-radius: 14px; background: rgba(0, 0, 0, .22); }
:root[data-theme="light"] .action .art, :root[data-theme="light"] dialog .art { background: linear-gradient(160deg, color-mix(in srgb, var(--tone, #6a3df0) 35%, #1b1749), #14113a); }
.action .art svg { height: 84px; width: auto; }
.action h3 { font-size: 1.1rem; margin: 0; }
.action p { color: var(--text-2); font-size: .92rem; margin: 0; }
.action .go { display: inline-flex; align-items: center; gap: 6px; font: 600 .85rem var(--font); color: color-mix(in srgb, var(--tone) 80%, var(--text)); }
.action .lock { position: absolute; top: 14px; right: 14px; }

/* ---------- Before / after slider ---------- */
.compare { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: #0b0a24; user-select: none; touch-action: none; isolation: isolate; }
.compare .layer { position: absolute; inset: 0; }
.compare .layer svg { width: 100%; height: 100%; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); z-index: 2; }
.compare .divider { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: linear-gradient(var(--cyan), var(--magenta)); box-shadow: 0 0 16px var(--cyan); z-index: 3; }
.compare .handle { position: absolute; top: 50%; left: var(--pos, 50%); width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-violet); border: 2px solid #fff; box-shadow: 0 0 24px rgba(139, 92, 255, .9); z-index: 4; color: #fff; cursor: ew-resize; }
.compare .handle svg { width: 22px; height: 22px; }
.compare .tag { position: absolute; bottom: 12px; z-index: 5; padding: 5px 11px; border-radius: 999px; font: 700 .72rem var(--font); letter-spacing: .06em; text-transform: uppercase; background: rgba(7, 6, 26, .78); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.compare .tag.l { left: 12px; } .compare .tag.r { right: 12px; }
.compare .tag.top { bottom: auto; top: 12px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 6; margin: 0; }

/* ---------- Usage bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding-top: 8px; }
.bars span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(to top, var(--cyan), var(--violet) 60%, var(--magenta)); box-shadow: 0 0 14px rgba(139, 92, 255, .45); min-height: 4px; }
.bars.empty span { background: var(--surface-2); box-shadow: none; border: 1px dashed var(--line-strong); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .streak { stroke-dashoffset: 0; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
:root[data-motion="reduce"] .streak { stroke-dashoffset: 0; }

/* ---------- BAPC Enterprise Kit footer and cookie notice, in Sēmýdō's look ---------- */
body .bapc-legal { grid-column: 1 / -1; background: transparent; color: var(--text-3); font: 500 .85rem var(--font-body); border-top: 1px solid var(--line); padding: 18px 16px 26px; }
body .bapc-legal a, body .bapc-cookie a { color: var(--cyan); }
body .bapc-cookie { background: var(--glass-strong); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; backdrop-filter: blur(16px); box-shadow: var(--shadow); font: 500 .9rem var(--font-body); }
body .bapc-cookie button { background: var(--grad-violet); color: #fff; border: 0; border-radius: 999px; font: 600 .9rem var(--font); box-shadow: var(--glow-violet); }
body .bapc-legal a:focus-visible, body .bapc-cookie a:focus-visible, body .bapc-cookie button:focus-visible { outline: 3px solid var(--cyan); }
@media (max-width: 860px) { body.has-rail .bapc-cookie { bottom: 96px; } body.has-rail .bapc-legal { padding-bottom: 100px; } }
