/* ============ tokens (from ui-ux-pro-max: Bento / dark cinematic / green-run) ============ */
:root {
  --bg: #0b1120;
  --surface: #131c2e;
  --surface-2: #1a2437;
  --primary: #1e293b;
  --accent: #22c55e;
  --accent-2: #34d399;
  --accent-glow: rgba(34, 197, 94, .35);
  --fg: #f8fafc;
  --muted: #94a3b8;
  --faint: #64748b;
  --border: #263349;
  --border-soft: #1e2a40;
  --high: #f87171;
  --med: #fbbf24;
  --low: #60a5fa;
  --ok: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
code { font-family: var(--mono); background: var(--surface-2); padding: .12em .4em; border-radius: 6px; font-size: .85em; color: var(--accent-2); }

/* ============ animated backdrop ============ */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 90% at 50% -10%, #16233c 0%, var(--bg) 60%); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.b1 { width: 480px; height: 480px; background: #1d4ed8; top: -120px; left: -100px; animation: drift1 22s var(--ease) infinite alternate; }
.b2 { width: 520px; height: 520px; background: #059669; top: 20%; right: -160px; animation: drift2 26s var(--ease) infinite alternate; }
.b3 { width: 380px; height: 380px; background: #7c3aed; bottom: -140px; left: 30%; animation: drift3 30s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-100px, 60px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(80px, -90px) scale(1.2); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(80% 60% at 50% 30%, #000 0%, transparent 75%);
  opacity: .4;
}

/* ============ header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.4rem;
  backdrop-filter: blur(14px);
  background: rgba(11, 17, 32, .6);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--fg); font-weight: 700; letter-spacing: -.01em; }
.brand-mark { color: var(--muted); }
.site-header nav { display: flex; align-items: center; gap: 1.1rem; }
.site-header nav a { color: var(--muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.site-header nav a:hover { color: var(--fg); }
.ghost-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); padding: .4rem .8rem; border-radius: 999px; color: var(--fg) !important; }
.ghost-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ============ layout ============ */
main { max-width: 1120px; margin: 0 auto; padding: 0 1.4rem 5rem; }

/* ============ hero ============ */
.hero { text-align: center; padding: clamp(3rem, 9vw, 6rem) 0 2.5rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--muted); font-weight: 500;
  border: 1px solid var(--border); padding: .35rem .9rem; border-radius: 999px;
  background: rgba(19, 28, 46, .6);
  animation: fadeUp .7s var(--ease) both;
}
.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; } }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -.03em;
  font-weight: 800; margin: 1.2rem auto .8rem; max-width: 15ch;
  animation: fadeUp .7s var(--ease) .05s both;
}
.grad { background: linear-gradient(105deg, var(--accent) 0%, var(--accent-2) 45%, #38bdf8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.18rem); max-width: 60ch; margin: 0 auto 2.4rem; animation: fadeUp .7s var(--ease) .1s both; }

/* composer */
.composer {
  text-align: left; max-width: 760px; margin: 0 auto;
  background: linear-gradient(180deg, var(--surface) 0%, #101a2c 100%);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 1.1rem; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.03);
  animation: fadeUp .7s var(--ease) .15s both;
  position: relative;
}
.composer::before {
  content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1px;
  background: linear-gradient(120deg, transparent, var(--accent-glow), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6; pointer-events: none;
}
.composer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.composer-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.wordcount { font-family: var(--mono); font-size: .75rem; color: var(--faint); }

textarea, input, select {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .8rem .9rem; font-family: var(--sans); font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
#prompt, #rewrite { font-family: var(--mono); font-size: .9rem; line-height: 1.6; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.target-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .9rem; }
.target-label { font-size: .8rem; color: var(--faint); font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.pill {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  padding: .42rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .2s var(--ease);
}
.pill:hover { color: var(--fg); border-color: var(--faint); transform: translateY(-1px); }
.pill[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #05130a; font-weight: 600; box-shadow: 0 6px 18px -6px var(--accent-glow); }

/* buttons */
.cta {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #05130a; border: none; border-radius: var(--radius-sm);
  padding: .72rem 1.2rem; font-weight: 700; font-size: .92rem; font-family: var(--sans);
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
  box-shadow: 0 8px 22px -8px var(--accent-glow);
}
.cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 30px -8px var(--accent-glow); }
.cta:active { transform: translateY(0) scale(.99); }
.cta:disabled { filter: grayscale(.5) brightness(.7); cursor: wait; transform: none; }
.cta.small { padding: .6rem 1rem; }
.cta svg { transition: transform .2s var(--ease); }
.cta:hover svg { transform: translateX(3px); }

.chip-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  padding: .4rem .8rem; border-radius: 8px; font-size: .82rem; font-weight: 500; cursor: pointer;
  transition: all .2s; font-family: var(--sans);
}
.chip-btn:hover { color: var(--fg); border-color: var(--accent); }

/* ============ bento results ============ */
.bento {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-top: 1rem;
}
.card {
  background: linear-gradient(180deg, var(--surface), #101a2c);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; transition: transform .25s var(--ease), border-color .25s;
}
.card:hover { border-color: var(--border); transform: translateY(-2px); }
.card-title { font-size: .95rem; font-weight: 700; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; letter-spacing: -.01em; }
.count-badge, .src-tag { font-size: .7rem; }
.count-badge { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: .1rem .5rem; font-family: var(--mono); }

.score-card { grid-column: span 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.score-ring { position: relative; width: 128px; height: 128px; margin: .3rem 0 .8rem; }
.score-ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fill { fill: none; stroke: url(#g); stroke: var(--accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.1s var(--ease), stroke .6s; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.score-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num span { font-size: 2.4rem; font-weight: 800; line-height: 1; font-family: var(--mono); }
.score-num small { color: var(--faint); font-size: .8rem; }
.score-caption { color: var(--muted); font-size: .85rem; margin: 0; }

.findings-card { grid-column: span 2; }
#findings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
#findings li {
  border-left: 3px solid var(--low);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .7rem .9rem; font-size: .88rem;
  opacity: 0; transform: translateX(-8px);
  animation: slideIn .45s var(--ease) forwards;
}
#findings li.sev-high { border-left-color: var(--high); }
#findings li.sev-med { border-left-color: var(--med); }
#findings li.ok { border-left-color: var(--ok); }
#findings li strong { display: block; margin-bottom: .2rem; color: var(--fg); font-weight: 600; }
#findings li a { font-size: .82rem; white-space: nowrap; }
.sev {
  float: right; font-size: .62rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: .05rem .4rem;
  font-family: var(--mono);
}
li.sev-high .sev { color: var(--high); border-color: var(--high); }
li.sev-med .sev { color: var(--med); border-color: var(--med); }

/* side-by-side compare */
.compare-card { grid-column: span 3; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: .9rem; align-items: stretch; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; min-height: 30px; }
.pane-head .card-title { margin: 0; color: var(--muted); }
.pane-head .card-title.accent { color: var(--accent-2); }
.pane-meta { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.pane textarea { flex: 1; }
#original { background: #0d1526; color: var(--muted); border-style: dashed; }
#rewrite { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .12); }
.compare-divider {
  display: flex; align-items: center; color: var(--accent);
  animation: nudge 2.2s var(--ease) infinite;
}
@keyframes nudge { 0%,100% { transform: translateX(0); opacity: .7; } 50% { transform: translateX(5px); opacity: 1; } }

/* bring-your-own-key card */
.byok-card { grid-column: span 3; position: relative; }
.byok-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 17px; padding: 1px;
  background: linear-gradient(100deg, transparent 20%, var(--accent-glow), transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .5; pointer-events: none;
}
.byok-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.byok-head .card-title { margin: 0; }
.byok-badge {
  font-family: var(--mono); font-size: .68rem; color: var(--accent-2);
  border: 1px solid rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08);
  padding: .2rem .6rem; border-radius: 999px; letter-spacing: .03em;
}

.hint { color: var(--faint); font-size: .82rem; margin: .3rem 0 .8rem; }
.hint.status { margin-top: .6rem; min-height: 1.2em; }

.llm-grid { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin-top: .8rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 150px; }
.field.grow { flex: 1; }
.field label { font-size: .75rem; color: var(--faint); font-weight: 500; }

/* ============ how it works ============ */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 4.5rem; }
.how-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.5rem; transition: transform .25s var(--ease), border-color .25s; }
.how-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.step { font-family: var(--mono); font-size: .85rem; color: var(--accent); font-weight: 500; }
.how-card h3 { margin: .6rem 0 .4rem; font-size: 1.15rem; letter-spacing: -.01em; }
.how-card p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ============ sources ============ */
.sources { margin-top: 4.5rem; }
.section-title { text-align: center; font-size: 1.4rem; letter-spacing: -.02em; margin-bottom: 1.6rem; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.source {
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; color: var(--fg); font-size: .92rem; font-weight: 500;
  transition: all .22s var(--ease);
}
.source:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 28px -14px var(--accent-glow); }
.src-tag { color: var(--accent); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }

/* ============ footer ============ */
.site-footer { text-align: center; color: var(--faint); font-size: .85rem; padding: 2rem 1rem 3rem; border-top: 1px solid var(--border-soft); }

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

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { to { opacity: 1; transform: none; } }

/* ============ responsive ============ */
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .score-card, .findings-card, .compare-card, .byok-card { grid-column: 1; }
  .how { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare-divider { justify-content: center; transform: rotate(90deg); animation: none; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto; }
  .blob { animation: none; }
  .reveal { opacity: 1; transform: none; }
  #findings li { opacity: 1; transform: none; }
}
