/* ===== SciAgentKit portal — Minimal Light ===== */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-dim: #52525b;
  --fg-dimmer: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --accent: #0a0a0a;
  --accent-fg: #ffffff;
  --accent-hover: #262626;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 3px rgba(0,0,0,.06);
  --shadow-2: 0 16px 40px -20px rgba(0,0,0,.22);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain { display: none; }

main, .nav, .footer { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; letter-spacing: -0.025em; line-height: 1.08; }
p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 11px 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: var(--pad); border-radius: 10px; border: 1px solid transparent;
  font: 600 14px/1 "Inter", sans-serif; cursor: pointer; color: var(--fg);
  background: transparent; transition: transform .25s var(--ease), background .2s, box-shadow .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--bg); border-color: var(--border-strong); color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--fg-dimmer); }
.btn-lg { --pad: 15px 26px; font-size: 15px; border-radius: 12px; }
.btn-sm { --pad: 8px 13px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Card / surface ---------- */
.glass, .card, .price-card, .modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 4vw, 40px); max-width: var(--maxw); margin: 0 auto;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.nav.scrolled {
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.brand-mark { display: block; height: 30px; width: auto; object-fit: contain; }
.footer .brand-mark { height: 26px; }
.brand-name { font-size: 17px; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 26px; margin-left: 26px; font-size: 14px; color: var(--fg-dim); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; }
.nav-burger { display: none; margin-left: auto; background: none; border: 0; color: var(--fg); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(60px, 12vw, 150px) clamp(16px,4vw,40px) clamp(60px,10vw,120px);
  display: flex; align-items: center; min-height: 72vh;
}
.hero-inner { max-width: 620px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500;
  color: var(--fg-dim); background: var(--surface-2); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: 999px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.hero-title { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; margin: 22px 0 20px; letter-spacing: -0.035em; }
.grad { color: var(--fg); }
.hero-sub { font-size: clamp(15px,1.6vw,18px); color: var(--fg-dim); max-width: 32em; }
.hero-actions { display: flex; gap: 12px; margin: 30px 0 20px; flex-wrap: wrap; }
.hero-meta { display: flex; align-items: center; gap: 12px; color: var(--fg-dimmer); font-size: 13px; }
.hero-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-dimmer); display: inline-block; }

/* ---------- Strip ---------- */
.strip { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px,4vw,40px) 30px; display: flex; align-items: center; gap: 26px; color: var(--fg-dimmer); font-size: 13px; flex-wrap: wrap; }
.strip-logos { display: flex; gap: 28px; flex-wrap: wrap; }
.strip-logos span { font-weight: 600; color: var(--fg-dim); }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px,9vw,110px) clamp(16px,4vw,40px); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(28px,3.6vw,42px); font-weight: 700; letter-spacing: -0.03em; }
.section-head p { color: var(--fg-dim); margin-top: 14px; font-size: clamp(15px,1.5vw,17px); }
.grid { display: grid; gap: 16px; }
.features { grid-template-columns: repeat(3, 1fr); }
.card { padding: 28px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card h3 { font-size: 18px; margin: 16px 0 8px; }
.card p { color: var(--fg-dim); font-size: 14.5px; }
.ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: var(--fg); background: var(--surface-2); border: 1px solid var(--border); }
.ic-green, .ic-indigo { color: var(--fg); }

/* ---------- Workflow ---------- */
.workflow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }
.workflow li { padding: 22px 18px; }
.workflow .step { font: 700 13px "JetBrains Mono", monospace; color: var(--fg-dimmer); }
.workflow h4 { font-size: 16px; margin: 10px 0 6px; }
.workflow p { color: var(--fg-dim); font-size: 13.5px; }

/* ---------- Pricing ---------- */
.billing-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 40px; font-size: 14px; color: var(--fg-dim); }
.bt-label.active { color: var(--fg); }
.save { color: var(--fg); font-style: normal; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.switch { width: 52px; height: 28px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); position: relative; cursor: pointer; transition: background .25s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .25s var(--ease); }
.switch[aria-checked="true"] .knob { transform: translateX(24px); }

.pricing { grid-template-columns: repeat(3,1fr); align-items: start; }
.price-card { padding: 30px 26px; position: relative; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.price-card h3 { font-size: 18px; }
.tag { position: absolute; top: -11px; left: 26px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: 6px; margin: 16px 0 4px; }
.amt { font-size: 42px; font-weight: 800; letter-spacing: -0.04em; }
.per { color: var(--fg-dimmer); font-size: 13px; }
.price-sub { color: var(--fg-dim); font-size: 14px; margin-bottom: 18px; }
.ticks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; font-size: 14px; color: var(--fg-dim); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='3'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center/11px no-repeat; border: 1px solid var(--border); }
.seat-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; font-size: 13px; color: var(--fg-dim); }
.seat-row input[type=range] { flex: 1; accent-color: var(--accent); }
.seat-row output { font-weight: 700; color: var(--fg); min-width: 24px; text-align: right; }
.pricing-note { text-align: center; color: var(--fg-dimmer); font-size: 13px; margin-top: 22px; }
.pricing-note b { color: var(--fg); }
.ticks li.tick-no { color: var(--fg-dimmer); }
.ticks li.tick-no::before { background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='3'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/10px no-repeat; }

/* Checkout add-on */
.addon { display: flex; gap: 10px; align-items: flex-start; padding: 14px; margin-bottom: 18px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 13.5px; color: var(--fg-dim); }
.addon input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.addon > span { flex: 1; min-width: 0; }
.addon b { color: var(--fg); }
.addon-price { color: var(--fg); font-weight: 600; white-space: nowrap; }

/* API key card */
.ac-apikey { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.apikey-row { display: flex; gap: 10px; align-items: center; margin: 10px 0 8px; }
.apikey-row code { flex: 1; font: 500 13px "JetBrains Mono", monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: nowrap; color: var(--fg); }
.apikey-hint { color: var(--fg-dim); font-size: 12.5px; margin: 0 0 12px; }

/* ---------- CTA band ---------- */
.cta-band { padding-top: 20px; }
.cta-inner { text-align: center; padding: clamp(40px,6vw,72px); background: var(--surface-2); }
.cta-inner h2 { font-size: clamp(26px,3.4vw,40px); letter-spacing: -0.03em; }
.cta-inner p { color: var(--fg-dim); margin: 14px 0 26px; }

/* ---------- Footer ---------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 40px clamp(16px,4vw,40px) 60px; border-top: 1px solid var(--border); color: var(--fg-dim); }
.footer p { margin: 10px 0 6px; font-size: 14px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; margin: 14px 0 12px; font-size: 14px; }
.footer-links a { color: var(--fg-dim); transition: color .2s; }
.footer-links a:hover { color: var(--fg); }
.footer small { color: var(--fg-dimmer); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Modals ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(10,10,10,.38); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  position: absolute; top: 50%; left: 50%; width: min(440px, 92vw); transform: translate(-50%,-46%) scale(.96);
  padding: 30px; display: none; opacity: 0; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-2);
  transition: transform .35s var(--ease), opacity .3s;
}
.modal.show { display: block; opacity: 1; transform: translate(-50%,-50%) scale(1); }
.modal-wide { width: min(560px, 94vw); }
.modal-x { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--fg-dimmer); font-size: 16px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--fg); }
.modal h3 { font-size: 22px; }
.modal-sub { color: var(--fg-dim); font-size: 14px; margin: 8px 0 22px; }
.modal form { display: grid; gap: 8px; }
.modal label { font-size: 13px; color: var(--fg-dim); font-weight: 500; }
.modal input {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--fg); font: 500 15px "Inter", sans-serif; transition: border-color .2s, box-shadow .2s;
}
.modal input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px rgba(10,10,10,.1); }
.modal input::placeholder { color: var(--fg-dimmer); }
.modal .btn-block { margin-top: 14px; }
.field-error { color: var(--danger); font-size: 12.5px; min-height: 16px; margin: 0; }
.modal-foot { text-align: center; color: var(--fg-dim); font-size: 13px; margin-top: 18px; }
.modal-foot a, .co-note a { color: var(--fg); font-weight: 600; }

.co-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.co-summary .co-plan { display: flex; justify-content: space-between; align-items: baseline; }
.co-summary .co-plan b { font-size: 16px; }
.co-summary .co-total { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.co-summary .co-total b { font-size: 22px; }
.co-line { color: var(--fg-dim); font-size: 13px; margin-top: 4px; }
.fake-card { margin: 8px 0; border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface-2); position: relative; }
.fc-brand { position: absolute; top: 10px; right: 14px; font: 700 11px "JetBrains Mono"; color: var(--fg-dimmer); letter-spacing: .1em; }
.fake-card input { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px 2px; font-family: "JetBrains Mono", monospace; }
.fake-card input:focus { box-shadow: none; border-bottom-color: var(--fg); }
.fc-row { display: flex; gap: 14px; }
.co-note { color: var(--fg-dimmer); font-size: 12px; text-align: center; margin-top: 12px; }

/* Account dashboard */
.ac-head { display: flex; justify-content: space-between; align-items: flex-start; }
.badge { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--fg-dim); border: 1px solid var(--border); }
.badge.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge.expired { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.ac-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 22px 0; }
.ac-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.ac-stat span { display: block; font-size: 11px; color: var(--fg-dimmer); text-transform: uppercase; letter-spacing: .06em; }
.ac-stat b { font-size: 18px; margin-top: 4px; display: block; }
.ac-license { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.acl-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--fg-dim); }
.acl-id { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--fg-dimmer); }
.acl-expiry { font-size: 14px; margin: 8px 0 16px; }
.acl-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ac-integrate { margin-top: 22px; }
.ac-integrate h4 { font-size: 15px; }
.ac-integrate p { color: var(--fg-dim); font-size: 13.5px; margin: 6px 0 12px; }
.code-snippet { background: #0a0a0a; border-radius: 12px; padding: 16px; font: 500 12.5px/1.8 "JetBrains Mono", monospace; color: #e4e4e7; overflow-x: auto; white-space: pre; }
.code-snippet .c-note { color: #71717a; font-style: italic; }

/* ---------- Legal pages ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 40px clamp(16px,4vw,40px) 80px; }
.legal .back { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-dim); font-size: 14px; margin-bottom: 24px; }
.legal .back:hover { color: var(--fg); }
.legal h1 { font-size: clamp(28px,4vw,40px); letter-spacing: -0.03em; }
.legal .updated { color: var(--fg-dimmer); font-size: 13px; margin: 10px 0 32px; }
.legal h2 { font-size: 19px; margin: 34px 0 10px; letter-spacing: -0.02em; }
.legal p, .legal li { color: var(--fg-dim); font-size: 15px; line-height: 1.7; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--fg); font-weight: 600; }
.legal .note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--fg-dim); margin: 20px 0; }
.legal mark { background: #fef9c3; color: #713f12; padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: grid; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 14px 18px; font-size: 14px; box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px;
  animation: toastIn .4s var(--ease); color: var(--fg);
}
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) } to { opacity: 1; transform: none } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: block; }
  .hero { min-height: auto; }
  .features, .pricing { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: 1fr 1fr; }
  .ac-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .workflow { grid-template-columns: 1fr; }
  .modal { padding: 24px; }
}
