/* CodeOBF — cryptographic/terminal aesthetic
   near-black canvas · acid-lime signal · monospace-forward */

:root {
  --bg: #0a0b0e;
  --bg-2: #0d0f13;
  --surface: #121620;
  --surface-2: #171c28;
  --line: #232a38;
  --line-soft: #1a2030;
  --text: #eaedf2;
  --muted: #8b93a1;
  --faint: #565e6c;
  --accent: #c8f02f;
  --accent-2: #9fe0ff;
  --amber: #ffb44d;
  --display: "Syne", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1180px;
  --r: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Make the [hidden] attribute authoritative so JS `.hidden = true` always wins —
   an author `display:` rule (e.g. .pro-topbar-confirm) otherwise overrides UA [hidden]. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0a0b0e; }

/* Sleek, app-like scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 100px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Full-screen app mode (Pro obfuscator): no page scroll, no marketing chrome */
body.app-mode { overflow: hidden; }
body.app-mode .footer { display: none; }

/* grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(16px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; }
.brand-mark {
  font-family: var(--mono); font-weight: 700; color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--r);
  padding: 2px 7px; font-size: 14px; letter-spacing: -1px;
  box-shadow: 0 0 16px -6px var(--accent);
}
.brand-name { font-size: 19px; letter-spacing: -.5px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  padding: 11px 20px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; transition: transform .15s var(--ease), background .2s, box-shadow .25s, border-color .2s;
  white-space: nowrap;
}
.btn-solid { background: var(--accent); color: #0a0b0e; font-weight: 700; box-shadow: 0 0 0 0 var(--accent); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.full { width: 100%; }

/* ---------- layout ---------- */
main > section, .view > section { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 10vw, 130px) clamp(16px, 5vw, 48px); }
.section-head { max-width: 680px; margin-bottom: 54px; }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.section-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.5vw, 46px); line-height: 1.05; letter-spacing: -1px; margin: 14px 0 14px; }
.section-head p { color: var(--muted); font-size: 17px; max-width: 60ch; }

/* ---------- hero ---------- */
.hero { position: relative; max-width: none !important; padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px) !important; overflow: hidden; }
.hero-grid {
  position: absolute; inset: -2px 0 auto 0; height: 620px; pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 46px 46px; opacity: .5;
  mask-image: radial-gradient(120% 70% at 70% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 70% at 70% 0%, #000 10%, transparent 72%);
}
.hero::after {
  content: ""; position: absolute; top: -260px; right: -120px; width: 720px; height: 720px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
  filter: blur(30px); opacity: .5;
}
.hero-inner {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.headline { font-family: var(--display); font-weight: 800; font-size: clamp(42px, 7.2vw, 82px); line-height: .98; letter-spacing: -2.5px; margin: 22px 0 20px; }
.headline .accent { color: var(--accent); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); }
.lede { color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); max-width: 52ch; margin-bottom: 30px; }
.lede b { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.hero-badges li { display: flex; align-items: center; gap: 7px; }
.hero-badges li::before { content: "✓"; color: var(--accent); }

/* staggered entrance */
.hero-copy > * { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease) forwards; }
.hero-copy > *:nth-child(1) { animation-delay: .05s; }
.hero-copy > *:nth-child(2) { animation-delay: .14s; }
.hero-copy > *:nth-child(3) { animation-delay: .23s; }
.hero-copy > *:nth-child(4) { animation-delay: .32s; }
.hero-copy > *:nth-child(5) { animation-delay: .41s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* terminal demo */
.hero-demo { opacity: 0; animation: rise .8s var(--ease) .4s forwards; }
.term {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 40px 80px -40px #000, 0 0 0 1px #000 inset;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #2a3140; }
.term-bar span:first-child { background: #ff5f57; } .term-bar span:nth-child(2) { background: #febc2e; } .term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 12px; color: var(--faint); }
.term-body { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; padding: 18px; height: 340px; overflow: hidden; white-space: pre-wrap; word-break: break-all; color: var(--muted); }
.term-body .k { color: var(--accent); } .term-body .s { color: var(--accent-2); } .term-body .c { color: var(--faint); }
.term-foot { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.4s infinite; }

/* ---------- strip ---------- */
.strip { text-align: center; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 44px clamp(16px,5vw,48px) !important; }
.strip > p { color: var(--faint); font-family: var(--mono); font-size: 13px; letter-spacing: .3px; margin-bottom: 30px; }
.strip-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(28px, 6vw, 80px); }
.strip-stats div { display: flex; flex-direction: column; }
.strip-stats b { font-family: var(--display); font-weight: 800; font-size: 40px; color: var(--text); letter-spacing: -1px; }
.strip-stats span { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- pipeline ---------- */
.pipe { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: p; }
.pipe li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 26px 22px; transition: border-color .25s, transform .25s; }
.pipe li:hover { border-color: var(--accent); transform: translateY(-4px); }
.pipe li:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); z-index: 2; }
.pipe-n { font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; }
.pipe h3 { font-family: var(--display); font-weight: 700; font-size: 19px; margin: 16px 0 8px; letter-spacing: -.3px; }
.pipe p { color: var(--muted); font-size: 14.5px; }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fcard { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: 6px; padding: 26px; transition: transform .25s var(--ease), border-color .25s, box-shadow .3s; position: relative; overflow: hidden; }
.fcard::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 120px at var(--mx,50%) 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); opacity: 0; transition: opacity .3s; }
.fcard:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 24px 50px -34px #000; }
.fcard:hover::before { opacity: 1; }
.fcard .ficon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); margin-bottom: 18px; }
.fcard .ficon svg { width: 20px; height: 20px; }
.fcard h3 { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.3px; margin-bottom: 8px; }
.fcard p { color: var(--muted); font-size: 14.5px; }
.fcard .ftag { position: absolute; top: 18px; right: 18px; font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- obfuscator ---------- */
.pg { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pg-col { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pg-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.pg-title { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.pg-actions { margin-left: auto; display: flex; gap: 6px; }
.chip { font-family: var(--mono); font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px; cursor: pointer; transition: .2s; }
.chip:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
#input, .pg-output { font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 16px; border: none; outline: none; resize: none; background: transparent; color: var(--text); width: 100%; }
#input { min-height: 260px; max-height: 60vh; flex: 1; overflow: auto; }
.pg-output { min-height: 260px; max-height: 60vh; flex: 1; overflow: auto; white-space: pre-wrap; word-break: break-all; color: var(--accent-2); }
.pg-placeholder { color: var(--faint); }

.pg-options { border-top: 1px solid var(--line-soft); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.preset-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.opt-label { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.segmented button { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: transparent; border: none; border-right: 1px solid var(--line); padding: 7px 13px; cursor: pointer; transition: .18s; }
.segmented button:last-child { border-right: none; }
.segmented button.on { background: var(--accent); color: #0a0b0e; font-weight: 700; }
.segmented button:not(.on):hover { color: var(--text); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.tog { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.tog input { display: none; }
.tog .sw { width: 34px; height: 19px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: .2s; flex: none; }
.tog .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--faint); transition: .2s; }
.tog input:checked + .sw { background: color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.tog input:checked + .sw::after { transform: translateX(15px); background: var(--accent); }
.tog input:checked ~ .tog-name { color: var(--text); }
.tog-cat { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); margin-top: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.tog-cat:first-child { margin-top: 2px; }

/* Live protection profile */
.prot-profile { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; font-family: var(--mono); font-size: 11.5px; flex-wrap: wrap; }
.pp-eng { padding: 3px 10px; border-radius: 100px; border: 1px solid var(--line); color: var(--muted); }
.pp-wasm { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.pp-js { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pp-n { color: var(--muted); }
.pp-n b { color: var(--text); }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.sliders label { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.sliders output { color: var(--accent); }
.sliders .seed-field { grid-column: 1 / -1; }
.sliders input[type=range] { -webkit-appearance: none; appearance: none; height: 3px; background: var(--line); border-radius: 3px; }
.sliders input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 10px -2px var(--accent); }
.opt-note { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; color: var(--faint); margin: 12px 0 0; padding: 9px 12px; border: 1px dashed var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.pro-fn-legend { font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--faint); margin: 4px 0 10px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.pro-fn-legend b { color: var(--muted); font-weight: 600; }
.pro-fn-legend em { font-style: normal; color: var(--accent-2); }

/* toast (checkout feedback) */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 10000; max-width: min(90vw, 460px);
  font-family: var(--mono); font-size: 13px; line-height: 1.4;
  padding: 13px 18px; border-radius: var(--r);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 20px 50px -20px #000; opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { border-color: var(--accent); box-shadow: 0 20px 50px -20px var(--accent); }
.toast-err { border-color: #ff5f57; color: #ffd7d4; }

/* ---------- view switching (top-nav page tabs) ---------- */
.view { display: none; }
.view.is-active { display: block; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nav-links a { position: relative; }
.nav-links a.on { color: var(--accent); }
.nav-links a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--accent); border-radius: 2px; }

/* ---------- options tabs (Presets / Layers / Advanced) ---------- */
.opt-tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.opt-tabs button { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; margin-bottom: -1px; cursor: pointer; transition: .18s; }
.opt-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.opt-tabs button:not(.on):hover { color: var(--text); }
.opt-panel { animation: viewIn .25s var(--ease); }

/* ---------- obfuscator input/output tabs (mobile) ---------- */
.pg-tabs { display: none; gap: 6px; margin-bottom: 12px; }
.pg-tabs button { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; cursor: pointer; transition: .18s; }
.pg-tabs button.on { color: #0a0b0e; background: var(--accent); font-weight: 700; border-color: var(--accent); }

/* ---------- auth (nav slot + modal) ---------- */
.auth-slot { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; }
.auth-slot .link { color: var(--muted); cursor: pointer; transition: color .2s; white-space: nowrap; }
.auth-slot .link:hover { color: var(--text); }
.auth-slot .auth-email { color: var(--text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; padding: 2px 7px; border-radius: 100px; border: 1px solid var(--line); color: var(--muted); }
.plan-badge.pro { color: #0a0b0e; background: var(--accent); border-color: var(--accent); font-weight: 700; }

.modal { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,5,7,.72); backdrop-filter: blur(6px); }
.modal-card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 30px 28px; box-shadow: 0 40px 90px -30px #000; animation: viewIn .3s var(--ease); }
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--faint); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-card h3 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.5px; }
.modal-sub { color: var(--muted); font-size: 14px; margin: 8px 0 18px; }
.modal-card input { width: 100%; font-family: var(--mono); font-size: 14px; padding: 12px 14px; margin-bottom: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); }
.modal-card input:focus { outline: none; border-color: var(--accent); }
.modal-msg { font-family: var(--mono); font-size: 12.5px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); color: var(--muted); word-break: break-word; }
.modal-msg.ok { border-color: var(--accent); color: var(--text); }
.modal-msg.err { border-color: #ff5f57; color: #ffd7d4; }
.modal-msg a { color: var(--accent); text-decoration: underline; }
.modal-fine { color: var(--faint); font-size: 11.5px; margin-top: 16px; }

/* account dashboard */
.acc-label { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.acc-label small, #account-modal code { color: var(--faint); }
#account-modal code { font-family: var(--mono); }
.acc-key-row { display: flex; gap: 8px; }
.acc-key-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--accent-2); }
.acc-actions { display: flex; gap: 8px; margin: 12px 0; }
.acc-actions .btn { flex: 1; padding: 9px; font-size: 13px; }
#acc-plan .plan-badge { vertical-align: middle; }

/* legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 90px) clamp(16px, 5vw, 48px); }
.legal h1 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5vw, 44px); letter-spacing: -1px; }
.legal-date { color: var(--faint); font-family: var(--mono); font-size: 13px; margin: 8px 0 30px; }
.legal h2 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.legal ul { margin: 10px 0 10px 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); }
.legal strong { color: var(--text); }
.legal-note { margin-top: 34px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 13px; color: var(--faint); }
.legal .btn { margin-top: 20px; }

/* export-settings modal */
.pg-export-row { margin-top: 14px; }
.pg-export-row .chip { width: 100%; text-align: center; }
.modal-wide { max-width: 640px; }
.exp-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 16px; border-bottom: 1px solid var(--line-soft); }
.exp-tabs button { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; margin-bottom: -1px; cursor: pointer; transition: .18s; }
.exp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.exp-tabs button:not(.on):hover { color: var(--text); }
.exp-code { font-family: var(--mono); font-size: 12px; line-height: 1.6; margin: 14px 0; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--accent-2); max-height: 340px; overflow: auto; white-space: pre; }

/* Preview & Run modal */
.run-modal-card { max-width: 900px; }
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 760px) { .rm-grid { grid-template-columns: 1fr; } }
.rm-pane { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); overflow: hidden; display: flex; flex-direction: column; }
.rm-pane-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.rm-pane-name { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rm-size { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.rm-pane-actions { margin-left: auto; display: flex; gap: 8px; }
.rm-code { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; padding: 12px; margin: 0; color: var(--accent-2); height: 300px; overflow: auto; white-space: pre; word-break: normal; }
.rm-console { height: 300px; max-height: 300px; margin: 0; }

/* build progress bar */
.pg-progress { margin-top: 14px; }
.pg-progress-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pg-progress-head #pgPct { color: var(--accent); }
.pg-progress-track { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px; overflow: hidden; }
.pg-progress-bar { height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px -2px var(--accent); transition: width .12s linear; }

.demo-note { font-family: var(--mono); font-size: 12px; line-height: 1.5; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--amber); border-radius: var(--r); background: color-mix(in srgb, var(--amber) 8%, transparent); color: var(--text); }
.demo-note a, .demo-link { color: var(--accent); }

/* Pro Obfuscator — full-bleed IDE (projects · files · editor · config) */
.pro-obf { max-width: none !important; padding: 0 !important; display: flex; flex-direction: column; height: calc(100dvh - var(--navh, 61px)); min-height: 540px; }

/* Topbar: project switcher + actions */
.pro-topbar { flex: none; display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.pro-proj { position: relative; display: flex; align-items: center; gap: 8px; }
.pp-ico-box { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); flex: none; }
.pp-ico { width: 16px; height: 16px; color: var(--accent); flex: none; }
.pro-proj-name { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 5px 9px; outline: none; width: clamp(120px, 20vw, 260px); transition: .15s var(--ease); }
.pro-proj-name:hover { background: var(--surface-2); }
.pro-proj-name:focus { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
.pro-proj-toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); cursor: pointer; transition: .15s var(--ease); flex: none; }
.pro-proj-toggle:hover { color: var(--accent); border-color: var(--accent); }
.pro-caret { font-size: 11px; }
.pro-save-status { font-family: var(--mono); font-size: 11px; color: var(--faint); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.pro-save-status.show { opacity: 1; }
.pro-save-status.ok { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.pro-topbar-confirm { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--amber); }
.pro-proj-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 264px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 6px; box-shadow: 0 24px 60px -30px #000; }
.proj-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: none; border-radius: 7px; padding: 9px 11px; cursor: pointer; transition: .12s; }
.proj-item:hover { background: var(--surface-2); }
.proj-item.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.proj-item-name { font-family: var(--body); font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item.on .proj-item-name { color: var(--accent); }
.proj-item-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); flex: none; }
.proj-new { border-top: 1px solid var(--line-soft); margin-top: 4px; color: var(--accent); font-family: var(--mono); font-size: 12px; justify-content: flex-start; }
.proj-new:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pro-topbar-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.pro-topbar-spacer { flex: 1; }
.pro-topbar-act { display: flex; gap: 8px; }
.pro-danger:hover { color: #ff5f57 !important; border-color: #ff5f57 !important; }

/* App: 3 columns filling the remaining viewport height */
.pro-app2 { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 246px minmax(0, 1fr) 402px; }
.pro-app2 > * { min-width: 0; min-height: 0; }

/* Files sidebar */
.pro-files { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.pro-files-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pro-files-act { display: flex; gap: 6px; }
.pro-filelist { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 3px; scrollbar-width: thin; }
.pro-fileitem { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: .12s var(--ease); }
.pro-fileitem:hover { background: var(--surface-2); }
.pro-fileitem.on { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pro-fi-name { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-fileitem.on .pro-fi-name { color: var(--accent); }
.pro-fi-size { font-family: var(--mono); font-size: 10px; color: var(--faint); flex: none; }
.pro-fi-x { background: none; border: none; color: var(--faint); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; flex: none; }
.pro-fi-x:hover { color: #ff5f57; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; transition: .15s var(--ease); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Editor column */
.pro-main { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.pro-ed-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.pro-ed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px -1px var(--accent); flex: none; }
.pro-ed-name { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13.5px; background: transparent; border: none; color: var(--text); outline: none; }
.pro-ed-name:focus { color: var(--accent); }
.pro-ed-size { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
/* Editor with a syntax-highlight overlay: a <pre> behind a transparent <textarea>,
   both boxes identical so the caret and the coloured text line up exactly. */
.pro-ed-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.pro-ed, .pro-ed-hl { position: absolute; inset: 0; margin: 0; box-sizing: border-box; font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 18px; border: 0; tab-size: 2; white-space: pre; word-wrap: normal; overflow: auto; }
.pro-ed { resize: none; outline: none; background: transparent; color: transparent; caret-color: var(--accent); z-index: 2; }
.pro-ed::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.pro-ed-hl { z-index: 1; pointer-events: none; overflow: hidden; color: var(--muted); }
.pro-ed-hl code { font: inherit; white-space: inherit; }
.pro-ed-wrap.no-hl .pro-ed { color: var(--text); }
.pro-ed-wrap.no-hl .pro-ed-hl { display: none; }
.hl-k { color: #e879c7; }
.hl-s { color: #b8e06a; }
.hl-c { color: var(--faint); font-style: italic; }
.hl-n { color: #f0a85c; }

/* Per-function protection (collapsible, pinned to editor bottom) */
.pro-fns { flex: none; border-top: 1px solid var(--line); background: var(--bg-2); }
.pro-fns-sum { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); user-select: none; }
.pro-fns-sum::-webkit-details-marker { display: none; }
.pro-fns-title { flex: none; }
.pro-fns-note { flex: 1; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 11px; }
.pro-fns-chev { transition: transform .2s var(--ease); color: var(--faint); font-size: 10px; }
details[open] > .pro-fns-sum .pro-fns-chev, details[open] > .pcfg-adv-sum .pro-fns-chev { transform: rotate(180deg); }
.pro-fnlist { max-height: min(46vh, 460px); overflow: auto; padding: 2px 12px 12px; }
.pro-fns-empty { font-family: var(--mono); font-size: 12px; color: var(--faint); padding: 4px 4px 8px; }

/* Function search */
.pro-fn-tools { padding: 0 14px 10px; display: flex; gap: 7px; align-items: center; }
.pro-fn-search { flex: 1; min-width: 0; box-sizing: border-box; font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; outline: none; transition: border-color .2s; }
.pro-fn-bulk { flex: none; font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; white-space: nowrap; transition: .12s var(--ease); }
.pro-fn-bulk:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); }
.pro-fn-bulk.max { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); font-weight: 700; }
.pro-fn-bulk.max:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: var(--accent); }
.pro-fn-search:focus { border-color: var(--accent); }
.pro-fn-search::placeholder { color: var(--faint); }

/* Easy mode: single script — hide project + file management, collapse to editor + config */
.pro-mode-toggle { flex: none; }
.pro-mode-toggle.on { color: var(--accent); border-color: var(--accent); }
.pro-obf.easy .pro-proj,
.pro-obf.easy .pro-topbar-meta,
.pro-obf.easy .pro-save-status,
.pro-obf.easy #projActs,
.pro-obf.easy #projConfirm,
.pro-obf.easy .pro-files { display: none !important; }
.pro-obf.easy .pro-app2 { grid-template-columns: minmax(0, 1fr) 402px; }
/* Per-function protection — one card per function, all options visible (no dropdowns). */
.pro-fnlist { display: flex; flex-direction: column; gap: 7px; }
.fncard { border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); padding: 9px 11px 10px; transition: border-color .14s var(--ease), background .14s var(--ease); }
.fncard:hover { border-color: color-mix(in srgb, var(--accent-2) 30%, var(--line)); }
.fncard.on { background: var(--surface); }
.fncard-top { display: flex; align-items: center; gap: 8px; }
.fn-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--text); background: transparent; border: 0; text-align: left; cursor: pointer; padding: 2px 2px; border-radius: 6px; }
.fn-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .12s; }
.fn-name:hover .fn-nm { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.fn-kind { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent); border-radius: 4px; padding: 1px 5px; flex: none; }
.fn-ln { font-family: var(--mono); font-size: 10px; color: var(--muted); flex: none; }

.fncard-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; margin-top: 9px; }
.fngrp { display: flex; align-items: center; gap: 8px; }
.fngrp-lbl { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; transition: color .12s; }
.fngrp.num.set .fngrp-lbl { color: #6ea2ff; }
.fngrp.str.set .fngrp-lbl { color: #3fd6b4; }
/* Segmented control: visible buttons, active one filled with the group's colour. */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg-btn { font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 5px 10px; cursor: pointer; white-space: nowrap; transition: .12s var(--ease); }
.seg-btn:hover { color: var(--text); background: var(--surface-2); }
.seg-btn[data-val="none"].active { background: var(--surface-2); color: var(--text); }
.fngrp.num .seg-btn.active:not([data-val="none"]) { background: #4f8cff; color: #fff; box-shadow: 0 1px 6px color-mix(in srgb, #4f8cff 45%, transparent); }
.fngrp.str .seg-btn.active:not([data-val="none"]) { background: #23c4a0; color: #04140f; box-shadow: 0 1px 6px color-mix(in srgb, #23c4a0 40%, transparent); }
/* A strict mode the function can't take: still selectable, marked "will step down". */
.seg-btn.will-step { color: var(--amber); }
.seg-btn.will-step::after { content: " ↓"; opacity: .85; }
.seg-btn.will-step.active { background: var(--amber); color: #1a1204; box-shadow: 0 1px 6px color-mix(in srgb, var(--amber) 45%, transparent); }

.fngrp-pills { display: inline-flex; gap: 6px; margin-left: auto; }
.fn-pill { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 5px 12px; cursor: pointer; transition: .12s var(--ease); }
.fn-pill:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); }
.fn-br.on { background: #a06bff; color: #fff; border-color: #a06bff; font-weight: 700; }
.fn-fl.on { background: #2fb6a6; color: #05100e; border-color: #2fb6a6; font-weight: 700; }
.fn-pill.will-step { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.fn-pill.will-step::after { content: " ↓"; opacity: .85; }
.fn-pill.fn-fl.will-step.on { background: var(--amber); color: #1a1204; border-color: var(--amber); }
.pro-obf.flash-ed .pro-ed-wrap { animation: edFlash .45s var(--ease); }
@keyframes edFlash { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 0 transparent; } }

/* Config panel — fills the right column; scrollable body + pinned footer */
.pro-config { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.pcfg-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 22px; scrollbar-width: thin; }
.pcfg-sec { display: flex; flex-direction: column; gap: 11px; }
.pcfg-h { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-grid button { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 4px; cursor: pointer; transition: .14s var(--ease); }
.preset-grid button:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.preset-grid button.on { background: var(--accent); color: #0a0b0e; font-weight: 700; border-color: var(--accent); box-shadow: 0 6px 18px -10px var(--accent); }
.pcfg-adv { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.pcfg-adv-sum { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); user-select: none; }
.pcfg-adv-sum::-webkit-details-marker { display: none; }
.pcfg-adv[open] { padding-bottom: 4px; }
.pcfg-adv .sliders { margin-top: 16px; }

/* Config footer — profile · build · export · results (pinned) */
.pcfg-foot { flex: none; border-top: 1px solid var(--line); background: var(--bg-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 11px; }
.pcfg-foot .prot-profile { margin: 0; }
.pro-build { margin: 0; font-size: 15px; padding: 14px; letter-spacing: .01em; }
.pcfg-export { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: none; border: none; cursor: pointer; text-align: center; padding: 2px; transition: .15s; }
.pcfg-export:hover { color: var(--accent); }
.pro-results { margin-top: 3px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 38vh; overflow: auto; background: var(--surface); }
.pro-results-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.pro-result { display: block; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.pro-result:first-of-type { border-top: none; padding-top: 0; }
.pro-result-top { display: flex; align-items: center; gap: 9px; }
.pro-result-name { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-result-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.eng-badge { font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); flex: none; }
.eng-wasm { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); background: color-mix(in srgb, var(--accent-2) 9%, transparent); }
.eng-js { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pro-result-note { font-family: var(--mono); font-size: 10.5px; color: var(--amber); margin-top: 6px; line-height: 1.55; }

/* preview upsell in the output column */
.pg-upsell { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; margin-top: 12px; padding: 13px 15px; border: 1px solid var(--accent); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); }
.pg-upsell b { color: var(--accent); }
.pg-upsell .btn { margin-top: 10px; }
.chip:disabled { opacity: .4; cursor: not-allowed; }

/* run-output console (sandboxed worker) */
.run-console { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.rc-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; color: var(--faint); }
.rc-x { background: none; border: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; }
.rc-x:hover { color: var(--text); }
.rc-body { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; padding: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--accent-2); }
.rc-body div { padding: 1px 0; }
.rc-body .rc-err { color: #ff8f88; }
.rc-body .rc-muted { color: var(--faint); }
.sliders input[type=text] { font-family: var(--mono); font-size: 13px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; color: var(--text); outline: none; }
.sliders input[type=text]:focus { border-color: var(--accent); }
.pg-run { margin: 0 16px 16px; }
.run-spin { width: 15px; height: 15px; border: 2px solid #0a0b0e40; border-top-color: #0a0b0e; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 14px 16px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--mono); font-size: 16px; color: var(--text); }
.stats span { font-family: var(--mono); font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.stat-ok b { color: var(--accent); }
.pg-error { padding: 14px 16px; color: var(--amber); font-family: var(--mono); font-size: 13px; border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--amber) 8%, transparent); }

/* ---------- pricing ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.tiers-2 { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin: 0 auto; }
.tier { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; transition: transform .25s, border-color .25s; }
.tier:hover { transform: translateY(-4px); }
.tier-hot { border-color: var(--accent); box-shadow: 0 30px 70px -44px var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface)); }
.tier-flag { position: absolute; top: -11px; left: 26px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; background: var(--accent); color: #0a0b0e; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.tier h3 { font-family: var(--display); font-weight: 700; font-size: 22px; }
.price { font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: -2px; line-height: 1; }
.price span { color: var(--muted); font-size: 24px; vertical-align: super; }
.price small { font-family: var(--mono); font-weight: 400; font-size: 14px; color: var(--faint); letter-spacing: 0; }
.tier-sub { color: var(--muted); font-size: 14px; margin-top: -6px; }
.tier ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; color: var(--muted); margin: 6px 0 8px; }
.tier li { display: flex; gap: 10px; }
.tier li::before { content: "→"; color: var(--accent); font-family: var(--mono); }
.tier .btn { margin-top: auto; }
.pricing-note { text-align: center; margin-top: 26px; color: var(--faint); font-size: 13px; }
.pricing-note code { font-family: var(--mono); color: var(--muted); background: var(--surface); padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); }

/* ---------- api ---------- */
.api-panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.api-tabs { display: flex; border-bottom: 1px solid var(--line-soft); }
.api-tabs button { font-family: var(--mono); font-size: 13px; color: var(--muted); background: transparent; border: none; border-right: 1px solid var(--line-soft); padding: 13px 20px; cursor: pointer; transition: .2s; }
.api-tabs button.on { color: var(--accent); background: var(--surface); }
.api-code { font-family: var(--mono); font-size: 13px; line-height: 1.8; padding: 22px; overflow-x: auto; color: var(--text); }
.api-code .t { color: var(--accent); } .api-code .g { color: var(--faint); } .api-code .v { color: var(--accent-2); }

/* ---------- faq ---------- */
.faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-q { width: 100%; text-align: left; background: transparent; border: none; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 18px; padding: 22px 2px; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.faq-q .x { color: var(--accent); font-family: var(--mono); transition: transform .25s; flex: none; }
.faq-item.open .faq-q .x { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); color: var(--muted); font-size: 15.5px; }
.faq-a p { padding: 0 2px 22px; max-width: 72ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.foot-main { max-width: var(--maxw); margin: 0 auto; padding: 56px clamp(16px,5vw,48px) 40px; display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.foot-brand { display: flex; flex-direction: column; gap: 12px; }
.foot-brand .brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; }
.foot-brand p { color: var(--muted); font-size: 14px; max-width: 34ch; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-cols h4 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin-bottom: 14px; }
.foot-cols a { display: block; color: var(--muted); font-size: 14.5px; padding: 5px 0; transition: color .2s; }
.foot-cols a:hover { color: var(--accent); }
.foot-bottom { max-width: var(--maxw); margin: 0 auto; padding: 22px clamp(16px,5vw,48px); border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.foot-honest { max-width: 62ch; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-inner > * { min-width: 0; }   /* let grid items shrink below content min-width (no h-overflow) */
  .hero-demo { order: 2; }
  .nav { gap: 12px; }
  /* nav is now the primary tab bar — keep it visible as a compact scroll strip */
  .nav-links { display: flex; gap: 18px; margin-left: auto; max-width: 62vw; overflow-x: auto; font-size: 13.5px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  .nav-links a.on::after { bottom: -3px; }
  .nav-cta { display: none; }
  .pipe, .feature-grid, .tiers { grid-template-columns: 1fr; }
  .pipe li::after { display: none; }
  .pg { grid-template-columns: 1fr; }
  .pro-obf { height: auto; }
  .pro-app2 { grid-template-columns: 1fr; }
  .pro-files, .pro-config { border-right: none; border-left: none; border-bottom: 1px solid var(--line); }
  .pro-filelist { max-height: 28vh; }
  .pro-main { min-height: 52vh; }
  .pro-topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px 10px; }
  .pro-proj { flex: 1 1 auto; min-width: 0; }
  .pro-proj-name { width: auto; flex: 1 1 auto; min-width: 0; }
  .pro-topbar-spacer, .pro-topbar-meta { display: none; }
  .pg-tabs { display: flex; }
  .pg .pg-col[data-pgcol] { display: none; }
  .pg .pg-col.pg-active { display: flex; }
  .foot-main { grid-template-columns: 1fr; }

  /* Pro app on phones: it stacks to one column and flows in the page, so the page
     itself must scroll (app-mode normally locks body scroll) and the config panel's
     internal scroll regions must flow instead of collapsing to zero height — otherwise
     the Build button and results are unreachable below the editor. */
  body.app-mode { overflow: auto; overflow-x: hidden; }
  .pro-config { overflow: visible; border-top: 1px solid var(--line); }
  .pcfg-scroll { overflow: visible; }
  .pro-results { max-height: none; }            /* no nested scroll trap inside page scroll */
  .pro-main { min-height: 56vh; }               /* keep the editor comfortably tall */

  /* Tall modals (e.g. View & run) top-align and scroll instead of clipping off-screen. */
  .modal { align-items: flex-start; overflow-y: auto; }
  .rm-code, .rm-console { height: auto; min-height: 200px; max-height: 46vh; }
}
@media (max-width: 560px) {
  .toggles, .sliders { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  /* The Syne display face is wide — "unreadable." at the 42px floor overflowed 390px screens. */
  .headline { font-size: clamp(28px, 8.2vw, 42px); letter-spacing: -1px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }
