/* BLUN Developer Portal — premium dark-first. Matches invest page vars. */
:root {
  --ink: #0b0e14;
  --ink-2: #11151d;
  --ink-3: #1a1f2a;
  --bg: #07090f;
  --bg-2: #0b0e14;
  --bg-3: #11151d;
  --line: rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.14);
  --muted: #8892a6;
  --muted-2: #a7acb8;
  --text: #f0f2f7;
  --text-2: #d6dbe6;
  --blue: #2b6cff;
  --blue-bright: #5b8dff;
  --blue-soft: rgba(43,108,255,0.12);
  --blue-line: rgba(43,108,255,0.35);
  --success: #3ddc97;
  --warn: #ffb547;
  --danger: #ff4d6d;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(43,108,255,0.08), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(91,141,255,0.05), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 0.5em; letter-spacing: -0.02em; font-weight: 700; font-family: var(--font-serif); color: var(--text); }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p  { color: var(--text-2); }
code, pre, .mono { font-family: var(--font-mono); }
.mono { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 2rem; }
.wrap--narrow { max-width: 860px; }

.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(7,9,15,0.82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand__logo { font-weight: 900; font-size: 1.2rem; letter-spacing: 0.02em; color: var(--blue-bright); }
.brand__logo em { color: var(--text); font-style: normal; }
.brand__tag { font-size: .72rem; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 999px; }
.nav__links { display: flex; gap: 1.4rem; }
.nav__links a { color: var(--muted-2); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav__links a:hover, .nav__links a.active { color: var(--text); }
@media (max-width: 820px) { .nav__links { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.3rem;
  border-radius: 999px;
  font-size: .92rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s, color .2s;
  font-family: inherit;
  background: transparent; color: var(--text);
}
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 12px 36px -12px rgba(43,108,255,0.6); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 18px 50px -12px rgba(43,108,255,0.75); background: var(--blue-bright); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--blue-line); color: var(--text); background: var(--blue-soft); }
.btn--lg { padding: .95rem 1.7rem; font-size: 1rem; }
.btn--sm { padding: .5rem .9rem; font-size: .82rem; }
.btn--block { width: 100%; justify-content: center; }

.hero {
  padding: 7rem 0 5rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: auto 0 -40% 0; height: 80%;
  background: radial-gradient(600px 240px at 50% 0%, rgba(43,108,255,0.18), transparent 70%);
  pointer-events: none;
}
.hero__kicker { color: var(--blue-bright); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 1.25rem; }
.hero h1 { font-weight: 700; max-width: 18ch; margin: 0 auto .8rem; }
.hero h1 em { color: var(--blue-bright); font-style: italic; }
.hero__sub { font-size: 1.15rem; color: var(--muted-2); max-width: 56ch; margin: 0 auto 2rem; }
.hero__cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; padding: 5rem 0; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.01em; font-size: 1.05rem; }
.card p { font-size: .95rem; color: var(--muted-2); margin: 0; }
.card .mono { margin-bottom: .6rem; color: var(--blue-bright); }

.code {
  background: #070a10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: #cfd4df;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.6;
  white-space: pre;
}
.code .k { color: #c792ea; }
.code .s { color: #a3d9a5; }
.code .n { color: #ffcb8b; }
.code .c { color: #5f6b80; font-style: italic; }

.section { padding: 5rem 0; border-bottom: 1px solid var(--line); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.section__head .mono { margin-bottom: .8rem; }
.section__head h2 { margin-bottom: .6rem; }
.section__head p { color: var(--muted-2); }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 960px) { .pricing { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  background: var(--ink-2);
  display: flex; flex-direction: column;
}
.plan--featured { border-color: var(--blue-line); background: linear-gradient(180deg, rgba(43,108,255,0.06), rgba(43,108,255,0) 60%), var(--ink-2); box-shadow: 0 24px 60px -40px rgba(43,108,255,0.6); }
.plan__name { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.plan__price { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--text); margin-bottom: .3rem; }
.plan__price small { font-family: var(--font-sans); font-size: .9rem; color: var(--muted); font-weight: 500; margin-left: .3rem; }
.plan__tag { color: var(--blue-bright); font-size: .85rem; margin-bottom: 1.5rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 2rem; }
.plan li { padding: .45rem 0; color: var(--text-2); font-size: .92rem; border-bottom: 1px solid var(--line); }
.plan li:last-child { border-bottom: none; }
.plan .btn { margin-top: auto; }

.dash { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 66px); }
.dash__side { border-right: 1px solid var(--line); padding: 2rem 1.5rem; }
.dash__side a { display: block; padding: .6rem .8rem; border-radius: 8px; color: var(--muted-2); font-size: .92rem; margin-bottom: .2rem; }
.dash__side a:hover, .dash__side a.active { background: var(--blue-soft); color: var(--text); }
.dash__main { padding: 2.5rem 3rem; }
@media (max-width: 880px) { .dash { grid-template-columns: 1fr; } .dash__side { display: none; } .dash__main { padding: 1.5rem; } }

.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 2rem; }
@media (max-width: 880px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; }
.stat__label { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin-top: .25rem; }
.stat__meta { font-size: .78rem; color: var(--muted-2); margin-top: .2rem; }

.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; margin-bottom: 1.5rem; }
.panel__head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 1rem; }
.panel__head h3 { margin: 0; font-family: var(--font-sans); font-size: 1rem; letter-spacing: -0.01em; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .75rem .6rem; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.table td .mono-inline { font-family: var(--font-mono); font-size: .82rem; color: var(--text-2); }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.tag--free    { background: rgba(255,255,255,0.06); color: var(--muted-2); }
.tag--starter { background: rgba(91,141,255,0.15); color: var(--blue-bright); }
.tag--pro     { background: rgba(61,220,151,0.15); color: var(--success); }
.tag--admin   { background: rgba(255,181,71,0.15); color: var(--warn); }
.tag--revoked { background: rgba(255,77,109,0.12); color: var(--danger); }

.input, .select, .textarea {
  width: 100%; padding: .75rem .95rem;
  background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-line); }
.textarea { resize: vertical; min-height: 88px; }
.label { display:block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.form-row { display: flex; gap: .6rem; align-items: center; }

.chart { width: 100%; height: 220px; }
.chart path.area { fill: url(#grad); opacity: .6; }
.chart path.line { fill: none; stroke: var(--blue-bright); stroke-width: 2; }
.chart .axis { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(7,9,15,0.7);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--ink-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); max-width: 520px; width: 100%;
  padding: 2rem;
}
.modal h3 { font-family: var(--font-sans); margin-bottom: .4rem; }
.modal .keybox {
  background: #050810; border: 1px solid var(--blue-line);
  padding: 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: .88rem; color: var(--blue-bright);
  word-break: break-all; margin: 1rem 0;
}
.modal .warn { color: var(--warn); font-size: .85rem; margin-bottom: 1rem; }

.play { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; height: calc(100vh - 66px - 4rem); }
@media (max-width: 960px) { .play { grid-template-columns: 1fr; height: auto; } }
.play__config { padding: 1.5rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); }
.play__chat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.play__msgs { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.play__msg { padding: .9rem 1.1rem; border-radius: 12px; font-size: .95rem; line-height: 1.55; max-width: 80%; }
.play__msg--user { background: var(--blue); color: #fff; align-self: flex-end; }
.play__msg--assistant { background: var(--ink-3); color: var(--text); border: 1px solid var(--line); align-self: flex-start; white-space: pre-wrap; }
.play__input { display: flex; gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); }
.play__input .input { flex: 1; }

.footer { padding: 3rem 0 4rem; color: var(--muted); font-size: .88rem; text-align: center; border-top: 1px solid var(--line); }
.footer a { color: var(--muted-2); }
.footer a:hover { color: var(--text); }
.footer__brand { font-family: var(--font-serif); font-size: 1.5rem; color: var(--text); margin-bottom: .5rem; }

.hidden { display: none !important; }
.flex { display: flex; gap: .75rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.text-muted { color: var(--muted); }
.text-blue { color: var(--blue-bright); }
