/* ==========================================================================
   Prismora — main stylesheet (original work, no frameworks)
   Dark-first glassmorphism with animated gradients.
   Accessibility: every state uses icon + text + border/underline, never colour alone.
   All animation is disabled under prefers-reduced-motion.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --c1: #8b5cf6; /* violet */
  --c2: #3b82f6; /* blue */
  --c3: #22d3ee; /* cyan */
  --c4: #ec4899; /* magenta */
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 35%, var(--c3) 65%, var(--c4));
  --grad-soft: linear-gradient(135deg, rgba(139,92,246,.22), rgba(34,211,238,.16) 60%, rgba(236,72,153,.18));
  --bg: #07070f;
  --bg-2: #0e0e1c;
  --surface: rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.14);
  --border-strong: rgba(255,255,255,.32);
  --text: #f5f6ff;
  --muted: #b7bbd6;
  --focus: #ffe066;
  --ok: #4ade80; --bad: #fb7185; --warn: #fbbf24; --info: #67e8f9;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.7);
  --glow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 40px -10px rgba(139,92,246,.6), 0 0 60px -20px rgba(34,211,238,.6);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f5ff; --bg-2: #ffffff;
  --surface: rgba(255,255,255,.72); --surface-2: rgba(255,255,255,.92);
  --border: rgba(20,20,60,.16); --border-strong: rgba(20,20,60,.4);
  --text: #0d0d24; --muted: #474a6a; --focus: #1d4ed8;
  --ok: #15803d; --bad: #be123c; --warn: #b45309; --info: #0e7490;
  --shadow: 0 20px 50px -25px rgba(40,30,120,.35);
  --glow: 0 0 0 1px rgba(20,20,60,.06), 0 10px 30px -12px rgba(139,92,246,.45);
  color-scheme: light;
}

@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* ---------- Base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--c1); color: #fff; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 1rem; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.ic-lg { width: 2rem; height: 2rem; } .ic-xl { width: 3rem; height: 3rem; }
.muted { color: var(--muted); } .center { text-align: center; } .nowrap { white-space: nowrap; }
.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--c3); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.link:hover { text-decoration-color: var(--c4); }
.spacer { flex: 1; }
.stack > * + * { margin-top: 1.25rem; }
.h2 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); } .h3 { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.display { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 800; }
.lead { font-size: 1.15rem; color: var(--muted); }
.grad-text { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
.eyebrow { display: inline-flex; gap: .45rem; align-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; padding: .35rem .8rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 600px at 50% -10%, rgba(139,92,246,.25), transparent 60%), var(--bg); }
.aurora span { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; mix-blend-mode: screen; }
.aurora span:nth-child(1) { background: var(--c1); top: -20%; left: -10%; }
.aurora span:nth-child(2) { background: var(--c3); top: 10%; right: -20%; animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { background: var(--c4); bottom: -30%; left: 20%; animation-duration: 32s; animation-delay: -12s; }
.aurora span:nth-child(4) { background: var(--c2); bottom: -10%; right: 10%; animation-duration: 26s; }
.aurora-soft span { opacity: .18; }
[data-theme="light"] .aurora span { mix-blend-mode: multiply; opacity: .18; }
.aurora::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 80%); }

/* ---------- Glass & gradient borders ---------- */
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--shadow); }
.glow-border { position: relative; isolation: isolate; }
.glow-border::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--angle), var(--c1), var(--c3), var(--c4), var(--c2), var(--c1)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite; z-index: -1; pointer-events: none; }
.card-pad { padding: 1.5rem; }
.grad-0 { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.grad-1 { background: linear-gradient(135deg, var(--c2), var(--c3)); }
.grad-2 { background: linear-gradient(135deg, var(--c4), var(--c1)); }

/* ---------- Buttons ---------- */
.btn { --b: var(--border-strong); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--b); background: var(--surface); color: var(--text); font: 600 .95rem/1.1 var(--font); text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .25s ease, background .25s ease; position: relative; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); background: var(--surface-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; transform: none; }
.btn-glow { border: 0; color: #fff; background: var(--grad); background-size: 220% auto; box-shadow: var(--glow); animation: shine 5s linear infinite; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.btn-glow::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; background: inherit; filter: blur(14px); opacity: .55; z-index: -1; transition: opacity .25s; }
.btn-glow:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.5), var(--glow); }
.btn-glow:hover::after { opacity: .9; }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: var(--border); }
.btn-danger { color: var(--bad); } .btn-danger:hover { border-color: var(--bad); }
.btn-danger-solid { background: #9f1239; border-color: #fecdd3; color: #fff; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .55rem; border-radius: 12px; }
.btn.is-loading .ic:first-child { animation: spin-ic 1s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Public header / footer ---------- */
.site-header { position: sticky; top: .75rem; z-index: 20; margin: .75rem auto 0; width: min(1240px, 100% - 1.5rem); border-radius: 999px; }
.nav-row { display: flex; align-items: center; gap: 1rem; padding: .55rem .5rem .55rem 1rem; width: 100%; }
.site-nav { display: flex; gap: .25rem; margin-left: 1rem; }
.site-nav a { padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--c3); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.brand-mark { width: 34px; height: 34px; animation: float 6s ease-in-out infinite; }
.flash-wrap { margin-top: 1rem; }
.site-footer { padding: 3rem 0; border-top: 1px solid var(--border); margin-top: 4rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 1rem; } .footer-links a { color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 5rem 0 3rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 2; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0; }
.hero-ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--muted); font-weight: 600; }
.hero-ticks li { display: flex; align-items: center; gap: .35rem; } .hero-ticks .ic { color: var(--ok); }
.hero-visual { position: relative; }
.ba { --pos: 50%; position: relative; margin: 0; border-radius: 24px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--glow), var(--shadow); user-select: none; }
.ba > img, .ba-before img { width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 18px rgba(255,255,255,.9); pointer-events: none; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; z-index: 3; }
.ba-handle { position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(10,10,25,.75); border: 2px solid #fff; color: #fff; z-index: 2; pointer-events: none; }
.ba-range:focus-visible ~ .ba-handle { outline: 3px solid var(--focus); outline-offset: 3px; }
.ba-tag { position: absolute; top: 1rem; z-index: 2; display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: rgba(5,5,15,.75); color: #fff; border: 1.5px solid rgba(255,255,255,.7); }
.ba-tag-l { left: 1rem; } .ba-tag-r { right: 1rem; border-style: dashed; }
.sample-note { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .9rem; font-size: .78rem; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; display: flex; gap: .4rem; align-items: center; z-index: 2; pointer-events: none; }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; animation: float 7s ease-in-out infinite; z-index: 4; }
.chip-a { left: -1.5rem; top: 12%; } .chip-b { right: -1rem; top: 46%; animation-delay: -2s; } .chip-c { right: 6%; bottom: -2.6rem; animation-delay: -4s; }
.chip-ok { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #14532d; color: #bbf7d0; border: 1.5px solid #bbf7d0; }
.marquee-wall { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0 1rem; opacity: .13; transform: rotate(-8deg) scale(1.3); pointer-events: none; mask-image: radial-gradient(closest-side, #000, transparent); }
.marquee-col { overflow: hidden; } .marquee-track { display: grid; gap: 1rem; animation: scroll-y 40s linear infinite; }
.col-1 .marquee-track { animation-direction: reverse; animation-duration: 50s; } .col-2 .marquee-track { animation-duration: 46s; }
.marquee-track img { border-radius: 16px; aspect-ratio: 3/4; object-fit: cover; width: 100%; }

/* ---------- Stats, features, showcase ---------- */
.stats-strip { padding: 1rem 0 2rem; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.2rem; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface); text-align: center; }
.stat strong { font-family: var(--display); font-size: 2rem; } .stat span { color: var(--muted); font-size: .9rem; } .stat .ic { color: var(--c3); }
.section { padding: 5rem 0; } .section-sm { padding: 2rem 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature { padding: 1.75rem; transition: transform .3s ease, border-color .3s ease, box-shadow .3s; }
.feature:hover { transform: translateY(-6px) rotateX(2deg); border-color: var(--border-strong); box-shadow: var(--glow); }
.feature p { color: var(--muted); margin: 0; }
.feature-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; margin-bottom: 1rem; box-shadow: 0 10px 30px -10px var(--c1); flex: none; }
.feature-ic .ic { width: 26px; height: 26px; }
.masonry { columns: 4 220px; column-gap: 1rem; }
.tile { break-inside: avoid; margin: 0 0 1rem; position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.tile img { width: 100%; transition: transform .6s ease; }
.tile:hover img { transform: scale(1.06); }
.tile figcaption { position: absolute; inset: auto 0 0 0; padding: 2rem .8rem .7rem; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .9rem; }
.tile-label { align-self: flex-start; display: inline-flex; gap: .3rem; align-items: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border: 1.5px solid #fff; border-radius: 999px; padding: .1rem .55rem; background: rgba(0,0,0,.5); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: s; }
.step { padding: 2rem 1.5rem; position: relative; } .step p { color: var(--muted); margin: 0; }
.step-num { position: absolute; top: 1rem; right: 1.25rem; font: 800 3rem/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--border-strong); }
.step-ic { width: 2rem; height: 2rem; color: var(--c3); margin-bottom: .8rem; }
.faq { display: grid; gap: .75rem; }
.faq details { padding: 0; border-radius: var(--radius-sm); }
.faq summary { cursor: pointer; padding: 1.1rem 1.25rem; font-weight: 700; list-style: none; display: flex; gap: .7rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq-ic { transition: transform .25s; } .faq details[open] .faq-ic { transform: rotate(45deg); }
.faq details[open] { border-color: var(--border-strong); } .faq details[open] summary { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--c3); }
.faq details p { padding: 0 1.25rem 1.2rem 3.1rem; color: var(--muted); margin: 0; }
.cta-band { text-align: center; padding: 4rem 2rem; border-radius: 28px; background: var(--grad-soft), var(--surface); }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; align-items: stretch; }
.plan { padding: 2rem 1.6rem; display: flex; flex-direction: column; gap: .4rem; position: relative; }
.plan-hl { transform: translateY(-8px); background: var(--grad-soft), var(--surface); }
.plan-flag { position: absolute; top: -.85rem; left: 50%; transform: translateX(-50%); display: inline-flex; gap: .3rem; align-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: .78rem; padding: .3rem .8rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.plan-price strong { font: 800 2.4rem/1 var(--display); } .plan-price span { color: var(--muted); margin-left: .3rem; }
.plan-credits { font-weight: 700; display: flex; gap: .4rem; align-items: center; } .plan-credits .ic { color: var(--warn); }
.plan-feats { list-style: none; padding: 0; margin: .5rem 0 1.25rem; display: grid; gap: .45rem; flex: 1; }
.plan-feats li { display: flex; gap: .5rem; } .plan-feats .ic { color: var(--ok); margin-top: .2em; }

/* ---------- Alerts, badges, tags, toasts ---------- */
.alert { display: flex; align-items: flex-start; gap: .55rem; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; background: var(--surface-2); border: 1.5px solid var(--border-strong); border-left-width: 6px; }
.alert-success { border-left-color: var(--ok); } .alert-success > .ic { color: var(--ok); }
.alert-error { border-left-color: var(--bad); border-style: solid solid solid double; } .alert-error > .ic { color: var(--bad); }
.alert-info { border-left-color: var(--info); border-left-style: dashed; } .alert-info > .ic { color: var(--info); }
.alert span { flex: 1; }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; padding: .1rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1.5px solid currentColor; white-space: nowrap; }
.badge-done { color: var(--ok); } .badge-failed { color: var(--bad); border-style: double; border-width: 3px; }
.badge-processing { color: var(--info); border-style: dashed; } .badge-processing .ic { animation: spin-ic 2s linear infinite; }
.badge-queued { color: var(--muted); border-style: dotted; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 8px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: grid; gap: .5rem; max-width: min(380px, 100% - 2rem); }
.toast { display: flex; gap: .55rem; align-items: center; padding: .8rem 1rem; border-radius: 14px; background: var(--bg-2); border: 1.5px solid var(--border-strong); border-left-width: 6px; box-shadow: var(--shadow); animation: toast-in .35s cubic-bezier(.2,.9,.3,1.3); font-weight: 600; }
.toast-success { border-left-color: var(--ok); } .toast-error { border-left-color: var(--bad); border-left-style: double; } .toast-info { border-left-color: var(--info); border-left-style: dashed; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > label, .field legend { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.field small { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; min-height: 6rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--c3); box-shadow: 0 0 0 3px var(--focus); }
input[aria-invalid="true"] { border-color: var(--bad); border-style: dashed; }
input[disabled] { opacity: .6; }
input[type=color] { width: 100%; height: 2.6rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-2); padding: .2rem; }
input[type=range] { accent-color: var(--c3); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--c1); width: 1.1rem; height: 1.1rem; }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; }
.check.inline { display: inline-flex; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hint { font-size: .82rem; color: var(--muted); display: flex; gap: .35rem; margin: 0; }
.form-error { color: var(--bad); font-weight: 700; display: flex; gap: .4rem; border: 1.5px dashed var(--bad); padding: .5rem .75rem; border-radius: 10px; margin: 0; }
.form-error::before { content: "⚠"; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span, .seg-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer; font-weight: 600; font-size: .88rem; text-decoration: none; background: var(--surface); }
.seg-item input:checked + span, .seg-link.is-active { border-color: var(--text); border-width: 2px; background: var(--grad-soft), var(--surface-2); text-decoration: underline; text-underline-offset: 4px; }
.seg-item input:checked + span::before, .seg-link.is-active::before { content: "✓"; font-weight: 800; }
.seg-item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.ratio-box { display: inline-block; width: calc(var(--w) / max(var(--w), var(--h)) * 16px); height: calc(var(--h) / max(var(--w), var(--h)) * 16px); border: 2px solid currentColor; border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .75rem; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text); font: 600 .8rem var(--font); cursor: pointer; transition: transform .15s, border-color .2s; }
.chip:hover { transform: translateY(-1px); border-style: solid; border-color: var(--c3); }
.inline-range { display: grid; grid-template-columns: 6.5rem 1fr 2.5rem; gap: .5rem; align-items: center; font-size: .85rem; font-weight: 600; }
.inline-range output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: .4rem; flex: 1; max-width: 420px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 3rem 1rem; }
.auth-card { width: min(440px, 100%); padding: 2.2rem; }
.auth-head { text-align: center; margin-bottom: 1.25rem; } .auth-head .feature-ic { margin-inline: auto; }
.auth-alt { text-align: center; margin: 1.25rem 0 0; color: var(--muted); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; gap: 1rem; padding: 1rem; }
.sidebar { position: sticky; top: 1rem; height: calc(100vh - 2rem); display: flex; flex-direction: column; padding: 1.2rem .9rem; overflow-y: auto; }
.sidebar .brand { padding: 0 .5rem 1.2rem; }
.side-nav { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .2rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1.5px solid transparent; transition: background .2s, color .2s; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.is-active { color: var(--text); background: var(--grad-soft); border-color: var(--border-strong); box-shadow: inset 4px 0 0 var(--c3); }
.side-nav a.is-active span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.side-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: .5rem .8rem; display: flex; gap: .4rem; align-items: center; font-weight: 700; }
.side-foot { margin-top: auto; }
.credit-card { display: grid; gap: .3rem; padding: 1rem; border-radius: 16px; text-decoration: none; background: var(--grad-soft), var(--surface-2); border: 1px solid var(--border-strong); }
.credit-card > .ic { color: var(--warn); width: 1.6rem; height: 1.6rem; } .credit-card strong { font: 800 1.6rem var(--display); }
.credit-plus { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .65rem 1rem; position: sticky; top: 1rem; z-index: 15; }
.page-title { font-size: 1.25rem; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.pill { display: inline-flex; gap: .35rem; align-items: center; padding: .4rem .85rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 700; }
.pill .ic { color: var(--warn); }
.pill.bump, .credit-card.bump { animation: bump .5s ease; }
.content { min-width: 0; }
.only-mobile { display: none !important; }
.theme-toggle .only-light { display: none; }
[data-theme="light"] .theme-toggle .only-dark { display: none; } [data-theme="light"] .theme-toggle .only-light { display: inline-flex; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid-2.wide-left { grid-template-columns: 1.6fr 1fr; align-items: start; }
.big-number { font: 800 3.4rem/1 var(--display); margin: .4rem 0 .2rem; }
.delta { display: inline-flex; gap: .25rem; align-items: center; font-weight: 700; }
.delta.is-plus { color: var(--ok); } .delta.is-minus { color: var(--bad); }
.danger-zone { border: 2px dashed var(--bad); margin-top: 1rem; max-width: 560px; }
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.empty { padding: 3rem; text-align: center; display: grid; justify-items: center; gap: .5rem; }
.pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pager-link { min-width: 2.4rem; padding: .4rem .6rem; text-align: center; border-radius: 10px; border: 1.5px solid var(--border); text-decoration: none; font-weight: 700; }
.pager-link.is-current { border-color: var(--text); border-width: 2px; text-decoration: underline; background: var(--surface-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .6rem .7rem; border-bottom: 2px solid var(--border-strong); }
.table td { padding: .65rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td { padding: .45rem .5rem; }
.inline { display: inline; }
.user-form { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.user-form select, .user-form input { width: auto !important; padding: .35rem .5rem !important; }
.w-sm { width: 5.5rem !important; }

/* ---------- Studio ---------- */
.tool-tabs { display: flex; gap: .35rem; padding: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.tool-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-radius: 12px; text-decoration: none; font-weight: 700; color: var(--muted); border: 1.5px solid transparent; white-space: nowrap; transition: background .2s; }
.tool-tab:hover { background: var(--surface-2); color: var(--text); }
.tool-tab.is-active { color: var(--text); border-color: var(--border-strong); background: var(--grad-soft); }
.tool-tab.is-active span { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.studio-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 1rem; align-items: start; }
.tool-panel { padding: 1.4rem; display: grid; gap: 1.1rem; position: sticky; top: 6rem; }
.tool-head { display: flex; gap: .9rem; align-items: center; } .tool-head .feature-ic { margin: 0; } .tool-head p { margin: 0; font-size: .9rem; }
.tool-foot { display: grid; gap: .6rem; }
.cost { display: flex; align-items: center; gap: .35rem; margin: 0; flex-wrap: wrap; } .cost .ic { color: var(--warn); }
.dropzone { position: relative; display: grid; place-items: center; min-height: 170px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--c3); border-style: solid; background: var(--surface-2); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.has-mask input[type=file] { pointer-events: none; }
.dz-empty { display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 1rem; pointer-events: none; } .dz-empty small { color: var(--muted); }
.dz-preview { position: relative; width: 100%; } .dz-preview img { width: 100%; max-height: 360px; object-fit: contain; }
.mask-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; touch-action: none; cursor: crosshair; z-index: 2; pointer-events: none; }
.has-mask .mask-canvas { pointer-events: auto; }
.mask-tools { display: grid; gap: .5rem; margin-top: .5rem; padding: .75rem; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); }
.results { padding: 1.4rem; min-height: 60vh; }
.result-stage { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-height: 340px; display: grid; place-items: center; overflow: hidden; margin-bottom: 1.2rem; position: relative; }
.result-stage img, .result-stage video { max-height: 70vh; width: auto; margin: auto; }
.result-stage .checker img { background: transparent; }
.stage-empty { display: grid; justify-items: center; gap: .5rem; color: var(--muted); text-align: center; padding: 2rem; }
.stage-busy { display: grid; justify-items: center; gap: 1rem; padding: 2rem; text-align: center; font-weight: 700; }
.orb { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(from var(--angle), var(--c1), var(--c3), var(--c4), var(--c1)); animation: spin 2.5s linear infinite; filter: blur(2px); box-shadow: 0 0 60px var(--c1); }
.progress { width: min(320px, 80%); height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; width: 40%; background: var(--grad); animation: indet 1.6s ease-in-out infinite; }
.stage-result { width: 100%; display: grid; gap: .8rem; padding: 1rem; }
.stage-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.recent-grid, .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.job-card { margin: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; animation: pop .4s ease both; }
.job-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.job-media { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.job-media img, .job-media video { width: 100%; height: 100%; object-fit: cover; }
.job-placeholder { color: var(--muted); display: grid; place-items: center; width: 100%; height: 100%; }
.job-placeholder .ic { width: 2.5rem; height: 2.5rem; }
.is-shimmer { background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%) var(--surface-2); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.job-card figcaption { padding: .8rem; display: grid; gap: .45rem; }
.job-meta { display: flex; gap: .35rem; flex-wrap: wrap; }
.job-prompt { margin: 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.job-error { color: var(--bad); font-size: .8rem; margin: 0; display: flex; gap: .3rem; }
.job-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #d4d4d8 25%, transparent 25%), linear-gradient(-45deg, #d4d4d8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d8 75%), linear-gradient(-45deg, transparent 75%, #d4d4d8 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
.editor-tools { padding: 1.2rem; display: grid; gap: 1rem; max-height: calc(100vh - 7rem); overflow-y: auto; position: sticky; top: 6rem; }
.ed-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; display: grid; gap: .7rem; margin: 0; }
.ed-group legend { font-weight: 800; display: flex; gap: .4rem; align-items: center; padding: 0 .3rem; }
.editor-stage { padding: 1rem; display: grid; gap: .8rem; }
.editor-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.canvas-wrap { position: relative; border-radius: var(--radius-sm); min-height: 420px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.canvas-wrap canvas { max-width: 100%; max-height: 72vh; height: auto; }
.canvas-wrap.is-text canvas { cursor: text; }
.canvas-wrap .stage-empty { position: absolute; inset: 0; place-content: center; background: var(--bg-2); }
.crop-box { position: absolute; border: 2px dashed #fff; outline: 2px dashed #000; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; touch-action: none; }
.crop-label { position: absolute; top: -2rem; left: 0; background: #000; color: #fff; font-size: .75rem; padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; display: inline-flex; gap: .3rem; }

/* ---------- Admin ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { display: flex; gap: .9rem; align-items: center; padding: 1.1rem; } .stat-card .feature-ic { margin: 0; } .stat-card p { margin: 0; }
.stat-value { font: 800 1.7rem var(--display); }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; height: 200px; align-items: end; padding-top: 1.5rem; }
.bar { height: var(--h); min-height: 3px; background: var(--grad); border-radius: 6px 6px 0 0; position: relative; animation: grow .8s ease both; }
.bar-val { position: absolute; top: -1.3rem; left: 0; right: 0; text-align: center; font-size: .7rem; font-weight: 700; }
.bar-day { position: absolute; bottom: -1.3rem; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); }
.status-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.provider-grid section { display: grid; gap: .9rem; align-content: start; }
.routing { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.test-result { margin: 0; padding: .6rem .8rem; border-radius: 10px; font-weight: 700; border: 1.5px solid; display: flex; gap: .4rem; }
.test-result.ok { color: var(--ok); } .test-result.bad { color: var(--bad); border-style: dashed; }
.error-card { margin-top: 4rem; } .error-code { font: 800 6rem/1 var(--display); margin: 0; }
.prose { max-width: 760px; } .prose h2 { margin-top: 1.5em; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease var(--d, 0ms), transform .7s ease var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes shine { to { background-position: 220% center; } }
@keyframes spin { to { --angle: 360deg; } }
@keyframes spin-ic { to { transform: rotate(360deg); } }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } 100% { transform: translate(-6vw, 10vh) scale(.95); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes scroll-y { to { transform: translateY(-50%); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes bump { 40% { transform: scale(1.15); } }
@keyframes grow { from { height: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .studio-grid, .editor { grid-template-columns: 1fr; }
  .tool-panel, .editor-tools { position: static; max-height: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 3rem; }
  .site-nav { display: none; }
  .shell { grid-template-columns: 1fr; padding: .6rem; }
  .sidebar { position: fixed; left: .6rem; top: .6rem; bottom: .6rem; height: auto; width: 270px; z-index: 50; transform: translateX(-120%); transition: transform .3s ease; background: var(--bg-2); }
  .sidebar.is-open { transform: none; }
  .only-mobile { display: inline-flex !important; }
  .grid-2, .grid-2.wide-left, .steps, .stats-row { grid-template-columns: 1fr 1fr; }
  .topbar { top: .6rem; }
}
@media (max-width: 640px) {
  .feature-grid, .grid-2, .grid-2.wide-left, .steps, .row-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .nav-actions:has(.btn-ghost) .btn-glow { display: none; } /* guests: keep "Log in", hero already has the sign-up CTA */
  .float-chip { display: none; }
  .site-header { border-radius: 20px; }
  .section { padding: 3.5rem 0; }
}

/* ---------- Motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-wall { display: none; }
}
@media (prefers-contrast: more) {
  :root { --border: rgba(255,255,255,.5); --border-strong: #fff; --muted: #e4e6f5; }
  [data-theme="light"] { --border: #333; --border-strong: #000; --muted: #222; }
  .glass { backdrop-filter: none; background: var(--bg-2); }
}
@media print { .aurora, .sidebar, .topbar, .site-header { display: none; } }

/* v1.1 SaaS: plan strip, upgrade prompt, low-credit flag (shape + text cues, not colour only) */
.plan-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.plan-strip > div { display: flex; flex-direction: column; gap: .2rem; }
.plan-strip-name { font: 800 1.25rem var(--display); }
.plan-strip-actions { flex-direction: row !important; flex-wrap: wrap; gap: .5rem !important; justify-content: flex-end; }
.plan-strip.is-low { border: 2px dashed var(--warn); }
.low-flag { display: inline-flex; gap: .3rem; align-items: center; padding: .1rem .5rem; border: 2px solid currentColor; border-radius: 8px; width: fit-content; }
.upgrade-box { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; padding: 1.5rem; border: 2px dashed var(--warn); border-radius: 16px; }
.upgrade-box .ic-lg { width: 2.2rem; height: 2.2rem; }
.rate-grid input { width: 5.5rem; }
.saas-off-flag { display: inline-flex; gap: .35rem; align-items: center; font-weight: 700; padding: .2rem .6rem; border: 2px solid currentColor; border-radius: 999px; }

/* v1.1 public demo mode: high-contrast banner (text + icon, never colour only) */
.demo-banner { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center;
  padding: .55rem 1rem; background: #000; color: #fff; border-bottom: 3px dashed #fff; font-size: .95rem; text-align: center; }
.demo-banner strong { letter-spacing: .12em; padding: .1rem .5rem; border: 2px solid #fff; border-radius: 6px; }
.demo-banner .ic { width: 1.1em; height: 1.1em; }
.demo-logins { display: grid; gap: .6rem; margin-bottom: 1.2rem; padding: 1rem; border: 2px dashed var(--border-strong); border-radius: 14px; }
.demo-logins p { margin: 0; }
