/* Substrate. Pure black, Framer-style display type, solid rounded cards, the
   planet-horizon glow and the orb. No hairline rules, no translucent washes.
   Every text/background pair below clears WCAG AA. */
:root {
  --bg: #000;
  --card: #0E0F14;
  --card-2: #17181F;
  --btn-2: #1C1D22;
  --text: #F5F5F7;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --faint: #8B8B94;
  --blue: #3B5BFF;
  --amber: #FFB547;
  --amber-bg: #17110A;
  --amber-ring: #4A3611;
  --teal: #5BE3C4;
  --teal-bg: #0B1F1B;
  --red: #FF7A6B;
  --red-bg: #1F0E0C;
  --ring: #2A2F55;
  --display: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--display); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
a:hover { color: #BFC8FF; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #8FA8FF; outline-offset: 2px;
}
.mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* nav */
.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crumbs .sep { color: #52525B; }

/* type */
h1.hero { margin: 0; font-weight: 600; font-size: clamp(40px, 6vw, 64px); line-height: 1.04; letter-spacing: -.035em; max-width: 880px; }
h1 { font-weight: 600; font-size: clamp(30px, 4vw, 44px); line-height: 1.06; letter-spacing: -.03em; margin: 0; }
h2 { font-weight: 600; font-size: clamp(26px, 3vw, 40px); line-height: 1.08; letter-spacing: -.03em; margin: 0; }
h3 { font-weight: 500; font-size: 18px; margin: 0; }
.grad { background: linear-gradient(90deg, #8FF0E0, #8FA8FF 55%, #C79BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0; }

/* buttons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border: 0; border-radius: 10px; font: 500 14px var(--display); text-decoration: none; cursor: pointer; background: var(--btn-2); color: var(--text); }
.btn.primary { background: #fff; color: #000; }
.btn.primary:hover { background: #E4E4E7; color: #000; }
.btn:hover { background: #26272E; color: var(--text); }
.btn.amber { background: var(--amber); color: #000; font-weight: 600; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
form.inline { display: inline; margin: 0; }

/* inputs */
input[type=email], input[type=text], input[type=number], select, textarea {
  background: var(--card-2); color: var(--text); border: 0; border-radius: 10px; padding: 12px 14px; font: 15px var(--display); min-height: 44px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.card.glow { box-shadow: 0 0 0 1px var(--ring), 0 0 40px #18238F; }
.card.attention { background: var(--amber-bg); box-shadow: 0 0 0 1px var(--amber-ring); }
.card.danger { background: var(--red-bg); }
.inset { background: var(--card-2); border-radius: 14px; padding: 12px 14px; }
.code { background: var(--card-2); border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.envelope { background: #000; border-radius: 14px; padding: 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.envelope .untrusted { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid.tight { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 999 1 620px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 22px; font-weight: 500; }
.stat .big { font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
dl.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--faint); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* pills, badges, dots */
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; }
.tag { display: inline-flex; border-radius: 999px; padding: 3px 10px; font-size: 12px; background: var(--card-2); color: var(--text-2); }
.tag.ok { background: var(--teal-bg); color: var(--teal); }
.tag.warn { background: #2A1E08; color: var(--amber); }
.tag.bad { background: var(--red-bg); color: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #52525B; display: inline-block; flex: none; }
.dot.ok { background: var(--teal); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); } .dot.blue { background: #8FA8FF; }
.logo { width: 18px; height: 18px; vertical-align: -3px; }
.logo.lg { width: 26px; height: 26px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2B2E45; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; position: relative; }
.avatar .logo { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; background: #000; border-radius: 50%; padding: 2px; }

/* transcript */
.ev .head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.ev .who { display: inline-flex; gap: 10px; align-items: center; }
.ev .role { color: var(--muted); font-size: 13px; }
.ev .time { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.ev .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.deploy { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; font-size: 13px; }
.deploy > div { background: var(--card-2); border-radius: 14px; padding: 12px; }
.deploy > div.on { background: #fff; color: #000; }

/* list rows */
.list { background: var(--card); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.list a.item, .list div.item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px; border-radius: 14px; text-decoration: none; }
.list a.item:hover { background: var(--card-2); color: var(--text); }
.list .item .l { display: flex; gap: 10px; align-items: center; min-width: 0; }
.list .item .r { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.list .label { padding: 10px 12px 6px; font-size: 13px; color: var(--muted); }
.side-nav { background: var(--card); border-radius: var(--r); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.side-nav a { padding: 9px 12px; border-radius: 12px; text-decoration: none; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.side-nav a.on, .side-nav a:hover { background: var(--btn-2); color: var(--text); }
.side-nav .label { padding: 12px 12px 4px; color: var(--faint); font-size: 12px; }

/* hero stage + horizon */
.stage { position: relative; overflow: hidden; border-radius: 24px; min-height: 600px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 60% 55% at 50% 42%, #0E1A6B 0%, #070A2A 45%, #000 80%); padding: 48px 20px 140px; }
.horizon { position: absolute; left: -10%; right: -10%; bottom: -1180px; height: 1400px; border-radius: 50%; background: #000; pointer-events: none;
  box-shadow: 0 -2px 0 #F2F4FF, 0 -10px 40px #6E8CFF, 0 -40px 120px #2D47FF, 120px -30px 160px #FF8A5B; }
.stage .inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 520px; }
.page-horizon { position: fixed; left: -20%; right: -20%; bottom: -1300px; height: 1400px; border-radius: 50%; background: #000; z-index: -1; pointer-events: none;
  box-shadow: 0 -2px 0 #F2F4FF, 0 -10px 40px #6E8CFF, 0 -40px 140px #2D47FF, 160px -30px 180px #FF8A5B; }

/* the orb */
@keyframes orbspin { to { transform: rotate(360deg); } }
@keyframes orbmorph { 0%, 100% { border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%; } 33% { border-radius: 44% 56% 48% 52% / 56% 44% 54% 46%; } 66% { border-radius: 54% 46% 44% 56% / 46% 54% 50% 50%; } }
@keyframes orbglow { 0%, 100% { box-shadow: 0 0 60px 6px #2E4BFF, 0 0 140px 30px #3A1C8C; } 50% { box-shadow: 0 0 80px 10px #6A3BFF, 0 0 160px 40px #1C3FAF; } }
.orb { position: relative; display: inline-block; flex: none; border-radius: 50%; overflow: hidden; width: 20px; height: 20px;
  background: conic-gradient(from 20deg, #1E3BFF, #7B2CFF, #FF5FCF, #FFB070, #5FE6FF, #1E3BFF); animation: orbmorph 7s ease-in-out infinite; }
.orb::before { content: ""; position: absolute; inset: -20%; mix-blend-mode: screen; animation: orbspin 9s linear infinite;
  background: conic-gradient(from 180deg at 55% 60%, #05061A 0deg, #0B1BFF 60deg, #05061A 120deg, #C04BFF 200deg, #05061A 260deg, #7FF0FF 320deg, #05061A 360deg); }
.orb::after { content: ""; position: absolute; left: 18%; top: 14%; width: 34%; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, #FFFFFF, #CFD8FF 40%, #5A6BFF00); }
.orb.xl { width: 112px; height: 112px; animation: orbmorph 7s ease-in-out infinite, orbglow 5s ease-in-out infinite; }
.orb.thinking { animation-duration: 2.4s, 2s; }
@media (prefers-reduced-motion: reduce) { .orb, .orb::before, .orb.xl { animation: none; } }

.flash { border-radius: 14px; padding: 12px 14px; background: var(--teal-bg); color: var(--teal); }
.flash.bad { background: var(--red-bg); color: var(--red); }
.secret { font-family: var(--mono); background: #000; border-radius: 10px; padding: 12px 14px; overflow-wrap: anywhere; }
footer.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 32px 0 48px; font-size: 13px; color: var(--faint); }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
table.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
table.audit td { padding: 10px 8px; vertical-align: top; }
table.audit tr:nth-child(odd) td { background: var(--card); }
table.audit td:first-child { border-radius: 10px 0 0 10px; } table.audit td:last-child { border-radius: 0 10px 10px 0; }
.scroll-x { overflow-x: auto; }
@media (max-width: 640px) { .wrap, .narrow { padding: 0 16px; } .card { padding: 16px; } .stage { min-height: 520px; } }
