:root {
  --black: #000;
  --near: #111;
  --panel: #151515;
  --line: rgba(82, 82, 82, .72);
  --line-soft: rgba(82, 82, 82, .38);
  --volt: #f6ff65;
  --volt-soft: #f2f6a0;
  --green: #166534;
  --white: #fff;
  --silver: #a0a0a0;
  --danger: #ff675c;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Avenir Next", "DIN Alternate", "Helvetica Neue", sans-serif;
  --max: 1500px;
}

* { box-sizing: border-box; }
html { background: var(--black); color: var(--white); min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--black);
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  font-family: var(--sans);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 72% 18%, rgba(246, 255, 101, .055), transparent 26%);
  z-index: 0;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .16;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.025) 3px 4px);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--volt); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
code, pre { font-family: var(--mono); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 78px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .93);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 235px; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; width: 31px; height: 31px; }
.brand-mark i { width: 6px; background: var(--volt); display: block; animation: boot 800ms ease both; }
.brand-mark i:nth-child(1) { height: 14px; }
.brand-mark i:nth-child(2) { height: 25px; animation-delay: 60ms; }
.brand-mark i:nth-child(3) { height: 19px; animation-delay: 120ms; }
.brand-mark i:nth-child(4) { height: 30px; animation-delay: 180ms; }
.brand strong { display: block; font-size: 17px; letter-spacing: .08em; font-weight: 900; }
.brand small { display: block; margin-top: 2px; color: var(--silver); font: 10px/1.2 var(--mono); letter-spacing: .12em; }

.independence-stamp {
  justify-self: start;
  color: var(--silver);
  font: 10px/1 var(--mono);
  letter-spacing: .13em;
}
.independence-stamp span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--volt); box-shadow: 0 0 15px rgba(246,255,101,.65); }

.nav { display: flex; align-items: center; gap: 26px; font: 600 11px/1 var(--mono); letter-spacing: .08em; }
.nav a, .nav-signout { position: relative; color: var(--silver); padding: 10px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: var(--volt); transition: right 180ms ease; }
.nav a:hover::after, .nav a.active::after { right: 0; }
.nav a.active { color: var(--white); }
.nav form { margin: 0; }
.nav-signout { background: none; border: 0; }
.nav-signout:hover { color: var(--volt); }
.nav-toggle { display: none; }

.page { position: relative; z-index: 1; width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 54px 0 96px; }
.footer { position: relative; z-index: 1; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px max(24px, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); color: #686868; font: 9px/1.4 var(--mono); letter-spacing: .12em; }

.reveal { animation: rise 520ms cubic-bezier(.2,.8,.2,1) both; }
.delay-1 { animation-delay: 90ms; }
.delay-2 { animation-delay: 170ms; }
.delay-3 { animation-delay: 250ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes boot { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

.eyebrow { margin: 0 0 11px; color: var(--silver); font: 600 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 38px; }
.page-head h1 { margin: 0; font-size: clamp(42px, 5vw, 76px); line-height: .96; letter-spacing: -.045em; font-weight: 900; }
.page-head h1 span { color: #5f5f5f; font: 500 14px/1 var(--mono); letter-spacing: .05em; }

.identity-chip { display: grid; gap: 7px; min-width: 260px; padding: 14px 16px; border: 1px solid var(--line); color: var(--silver); font: 12px/1.3 var(--mono); }
.identity-chip span { color: var(--volt); font-size: 9px; letter-spacing: .16em; }
.identity-chip.owner { border-color: var(--volt); }

.alert { position: relative; margin: 0 0 24px; padding: 14px 16px 14px 45px; border: 1px solid; font: 13px/1.5 var(--mono); }
.alert::before { content: "!"; position: absolute; left: 15px; top: 13px; font-weight: 900; }
.alert.error { color: #ff928b; border-color: rgba(255,103,92,.5); background: rgba(255,103,92,.075); }
.alert.success { color: var(--volt-soft); border-color: rgba(246,255,101,.45); background: rgba(246,255,101,.055); }
.alert.success::before { content: "✓"; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 17px; border: 1px solid var(--line); border-radius: 4px; background: var(--near); color: var(--white); font: 700 11px/1 var(--mono); letter-spacing: .06em; transition: background 150ms, color 150ms, border-color 150ms, transform 150ms; }
.button:hover { color: var(--volt); border-color: var(--volt); transform: translateY(-1px); }
.button.primary { background: var(--volt); border-color: var(--volt); color: #101010; }
.button.primary:hover { background: #1d1d1d; color: var(--volt); }
.button.ghost { background: transparent; border-color: #4f5100; }
.button.danger { color: var(--danger); background: transparent; border-color: rgba(255,103,92,.45); }
.button.full { width: 100%; }
.text-danger { padding: 0; border: 0; background: none; color: var(--danger); font: 10px var(--mono); }
.text-action { padding: 0; border: 0; background: none; color: var(--volt); font: 10px var(--mono); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; }

.auth-page { width: min(1380px, calc(100% - 48px)); min-height: calc(100vh - 142px); display: grid; align-items: center; padding-top: 58px; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(370px, .65fr); gap: 10vw; align-items: center; }
.auth-shell.compact { max-width: 1180px; margin-inline: auto; }
.auth-intro { position: relative; padding: 45px 0 55px; }
.auth-intro::after { content: "08"; position: absolute; z-index: -1; right: -3vw; bottom: -10px; color: #0d0d0d; font: 900 clamp(180px, 28vw, 420px)/.7 var(--sans); letter-spacing: -.08em; }
.auth-intro h1 { margin: 0; max-width: 850px; font-size: clamp(50px, 7vw, 104px); line-height: .93; letter-spacing: -.055em; font-weight: 900; }
.auth-intro h1 em { color: var(--volt); font-style: normal; }
.lede { max-width: 620px; margin: 28px 0 0; color: var(--silver); font-size: 18px; line-height: 1.65; }
.signal-strip { display: flex; gap: 28px; margin-top: 54px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--silver); font: 10px/1.3 var(--mono); }
.signal-strip b { color: var(--volt); margin-right: 8px; }
.auth-panel { position: relative; padding: 31px; border: 1px solid var(--line); background: rgba(15,15,15,.92); box-shadow: inset 0 0 35px rgba(0,0,0,.55); }
.auth-panel::before { content: ""; position: absolute; inset: -1px auto auto -1px; width: 70px; height: 3px; background: var(--volt); }
.panel-index { display: flex; justify-content: space-between; margin-bottom: 48px; color: var(--silver); font: 9px var(--mono); letter-spacing: .12em; }
.panel-index span { color: var(--volt); }
.auth-panel h2 { margin: 0 0 10px; font-size: 31px; letter-spacing: -.03em; }
.auth-panel > p { color: var(--silver); font-size: 14px; line-height: 1.55; }
.stack-form { display: grid; gap: 18px; margin-top: 29px; }
.stack-form label { display: grid; gap: 8px; color: var(--silver); font: 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #090909; color: var(--white); padding: 13px 14px; caret-color: var(--volt); }
input::placeholder, textarea::placeholder { color: #585858; }
input:hover, textarea:hover { border-color: #717171; }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.microcopy { margin: 22px 0 0 !important; color: #656565 !important; font: 10px/1.55 var(--mono) !important; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 24px; }
.metric-card { min-height: 166px; display: flex; flex-direction: column; justify-content: space-between; padding: 21px; border-right: 1px solid var(--line); background: rgba(8,8,8,.66); }
.metric-card:last-child { border-right: 0; }
.metric-card.accent { border-top: 3px solid var(--volt); padding-top: 19px; }
.metric-card > span { color: var(--silver); font: 10px var(--mono); letter-spacing: .14em; }
.metric-card strong { margin: auto 0 5px; font-size: clamp(38px, 4vw, 64px); line-height: .9; letter-spacing: -.055em; font-weight: 900; }
.metric-card strong i { color: #666; font: 500 14px var(--mono); letter-spacing: 0; }
.metric-card small { color: #676767; font: 10px var(--mono); }

.card { border: 1px solid var(--line); background: rgba(10,10,10,.76); padding: 24px; margin-bottom: 24px; box-shadow: inset 0 0 32px rgba(0,0,0,.25); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.card-head h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.card-head > a { color: var(--silver); font: 10px var(--mono); }
.corner-code, .queue-count { color: #656565; font: 9px var(--mono); letter-spacing: .14em; }
.workflow-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; }

.status-rail { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 32px 0; padding: 0; }
.status-rail li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; min-width: 0; padding-right: 14px; color: #656565; }
.status-rail li::after { content: ""; position: absolute; top: 12px; left: 26px; right: 3px; height: 1px; background: #353535; z-index: 0; }
.status-rail b { position: relative; z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #494949; background: #080808; font: 10px var(--mono); }
.status-rail span { position: relative; z-index: 1; padding-top: 35px; margin-left: -36px; font-size: 12px; }
.status-rail small { display: block; margin-top: 5px; color: #5d5d5d; font: 8px/1.4 var(--mono); }
.status-rail .done b { color: #111; border-color: var(--volt); background: var(--volt); }
.status-rail .done::after { background: var(--volt); }
.status-rail .done span, .status-rail .current span { color: var(--white); }
.status-rail .current b { border-color: var(--volt); color: var(--volt); box-shadow: 0 0 15px rgba(246,255,101,.13); }
.application-form { border-top: 1px solid var(--line-soft); padding-top: 22px; }
.waiting-block { border: 1px dashed #444; padding: 17px; color: var(--silver); font: 11px var(--mono); }
.pulse { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--volt); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.key-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line-soft); }
.key-row > div:first-child { display: flex; align-items: center; gap: 12px; }
.key-row code { color: var(--volt-soft); font-size: 13px; }
.key-row dl { grid-column: 1; display: grid; grid-template-columns: auto auto auto auto; gap: 7px 13px; margin: 0; color: #777; font: 9px var(--mono); }
.key-row dt { color: #4f4f4f; }
.key-row.revoked { opacity: .56; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border: 1px solid #484848; color: var(--silver); font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.badge.active, .badge.approved { border-color: rgba(246,255,101,.55); color: var(--volt); }
.badge.pending { border-color: #706d2f; color: #e7dc83; }
.badge.revoked, .badge.rejected { border-color: rgba(255,103,92,.5); color: var(--danger); }
.code-sample { margin-top: 23px; border: 1px solid var(--line-soft); background: #050505; }
.code-sample > div, .mini-code { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); color: #6d6d6d; font: 8px var(--mono); letter-spacing: .12em; }
.code-sample button, .mini-code button { border: 0; background: none; color: var(--volt); font: 8px var(--mono); }
.code-sample pre { overflow-x: auto; margin: 0; padding: 17px; color: #cfcfcf; font-size: 11px; line-height: 1.55; }
.empty-state { display: grid; place-items: center; min-height: 150px; padding: 24px; border: 1px dashed #353535; color: #555; text-align: center; }
.empty-state strong { font: 11px var(--mono); letter-spacing: .14em; }
.empty-state p { max-width: 420px; color: #666; font-size: 12px; }
.empty-state.horizontal { min-height: 90px; display: flex; justify-content: center; gap: 18px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #666; font: 9px var(--mono); letter-spacing: .12em; text-align: left; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); color: #b7b7b7; font-size: 12px; }
td code { color: var(--volt-soft); font-size: 10px; }
tr:hover td { background: rgba(246,255,101,.025); }

.key-reveal { display: grid; grid-template-columns: .6fr 1.4fr; gap: 28px; align-items: center; margin-bottom: 24px; padding: 23px; border: 1px solid var(--volt); background: rgba(246,255,101,.045); box-shadow: inset 0 0 35px rgba(246,255,101,.035); }
.key-reveal h2 { margin: 0; font-size: 21px; }
.secret-line { display: flex; align-items: stretch; min-width: 0; }
.secret-line code { flex: 1; min-width: 0; overflow-x: auto; padding: 13px 15px; border: 1px solid var(--line); border-right: 0; background: #050505; color: var(--volt-soft); white-space: nowrap; font-size: 12px; }

.catalog-search { display: grid; grid-template-columns: auto minmax(210px, 330px); align-items: center; gap: 14px; color: #6b6b6b; font: 9px var(--mono); letter-spacing: .14em; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.catalog-card { position: relative; display: flex; flex-direction: column; min-height: 360px; padding: 20px; border: 1px solid var(--line); background: rgba(8,8,8,.78); transition: border-color 160ms, transform 160ms, background 160ms; }
.catalog-card:hover { transform: translateY(-3px); border-color: var(--volt); background: #0d0d0d; }
.catalog-card[hidden] { display: none; }
.catalog-top { display: flex; justify-content: space-between; align-items: center; }
.namespace { color: var(--volt); font: 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.catalog-card h2 { margin: 28px 0 10px; font: 700 17px/1.25 var(--mono); word-break: break-word; }
.catalog-card > p { min-height: 58px; color: var(--silver); font-size: 12px; line-height: 1.55; }
.spec-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 8px 10px; margin: 16px 0; padding: 14px 0; border-block: 1px solid var(--line-soft); font: 9px var(--mono); }
.spec-grid dt { color: #535353; }
.spec-grid dd { margin: 0; color: #aaa; overflow: hidden; text-overflow: ellipsis; }
.filter-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 18px; }
.filter-list span { padding: 3px 5px; border: 1px solid #353535; color: #777; font: 8px var(--mono); }
.mini-code { margin-top: auto; padding: 10px; border: 1px solid var(--line-soft); }
.mini-code code { overflow: hidden; color: #898989; white-space: nowrap; text-overflow: ellipsis; font-size: 8px; }

.admin-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.compact-list { margin-top: 20px; border-top: 1px solid var(--line-soft); }
.compact-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.compact-list small { color: #666; font: 8px var(--mono); }
.pool-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.pool-metrics > div { min-height: 100px; padding: 15px; background: #080808; }
.pool-metrics dt { color: #5d5d5d; font: 8px var(--mono); letter-spacing: .12em; }
.pool-metrics dd { margin: 17px 0 0; font-size: 25px; font-weight: 800; }
.pool-metrics small { color: #666; font: 9px var(--mono); }
.application-list { display: grid; }
.application-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.application-row > div { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.application-row p, .application-row small { grid-column: 1 / -1; margin: 0; }
.application-row p { max-width: 720px; color: var(--silver); font-size: 12px; }
.application-row small { color: #5d5d5d; font: 9px var(--mono); }
.application-row form { display: flex; gap: 7px; align-items: center; }
.application-row input { width: 190px; padding: 10px; font-size: 11px; }
.muted { color: #666; font-size: 12px; }

@media (max-width: 1100px) {
  .independence-stamp { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .auth-shell { grid-template-columns: 1fr 390px; gap: 5vw; }
  .auth-intro h1 { font-size: clamp(50px, 7.3vw, 78px); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workflow-grid, .admin-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .key-reveal { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 18px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .nav-toggle { display: block; padding: 10px; border: 1px solid var(--line); background: #080808; color: var(--white); font: 10px var(--mono); }
  .nav { display: none; position: absolute; top: 67px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); background: #050505; }
  .nav.open { display: flex; }
  .nav a, .nav-signout { display: block; width: 100%; padding: 13px 0; text-align: left; }
  .page { width: min(100% - 28px, var(--max)); padding-top: 35px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 45px; }
  .identity-chip { min-width: 100%; }
  .auth-page { width: min(100% - 28px, 620px); padding-top: 30px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { padding-bottom: 10px; }
  .auth-intro h1 { font-size: 50px; }
  .auth-intro::after { display: none; }
  .lede { font-size: 15px; }
  .signal-strip { flex-direction: column; gap: 10px; margin-top: 30px; }
  .auth-panel { padding: 22px; }
  .panel-index { margin-bottom: 30px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card, .metric-card:nth-child(2) { min-height: 130px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-card:last-child { border-bottom: 0; }
  .status-rail { grid-template-columns: 1fr; gap: 14px; }
  .status-rail li { grid-template-columns: 26px 1fr; align-items: center; }
  .status-rail li::after { top: 26px; bottom: -14px; left: 12px; width: 1px; height: auto; right: auto; }
  .status-rail span { margin: 0; padding: 0; }
  .status-rail small { margin-top: 3px; }
  .key-row { grid-template-columns: 1fr; }
  .key-row dl { grid-template-columns: auto 1fr; }
  .catalog-search { width: 100%; grid-template-columns: auto 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-card { min-height: 330px; }
  .inline-form { grid-template-columns: 1fr; }
  .application-row { grid-template-columns: 1fr; }
  .application-row form { width: 100%; }
  .application-row input { flex: 1; width: auto; }
  .secret-line { flex-direction: column; }
  .secret-line code { border-right: 1px solid var(--line); border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
