:root {
  --ink: #11130f;
  --surface: #171a15;
  --surface-raised: #1d211a;
  --paper: #e8eadf;
  --muted: #929a88;
  --line: #343a30;
  --acid: #c7ff45;
  --danger: #ff6d55;
  --warning: #ffca57;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 82% 8%, rgba(199, 255, 69, 0.07), transparent 28rem),
    linear-gradient(135deg, #10120e 0%, #151811 50%, #0d0f0c 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

button, input { font: inherit; }
button { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 36px;
}

.masthead {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}

.brand > span:last-child span { color: var(--acid); }

.brand-mark { display: flex; gap: 3px; align-items: flex-end; height: 19px; }
.brand-mark i { display: block; width: 4px; background: var(--acid); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; }

.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .15em;
}

.signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 14px var(--acid);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero {
  min-height: 420px;
  padding: 76px 0 64px;
  position: relative;
}

.hero::after {
  content: "USAGE / 01";
  position: absolute;
  right: 0;
  top: 80px;
  writing-mode: vertical-rl;
  color: #3f453a;
  font: 500 10px/1 var(--mono);
  letter-spacing: .2em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: .16em;
}

.eyebrow span { color: var(--acid); }

h1 {
  max-width: 900px;
  margin: 28px 0 22px;
  font-size: clamp(50px, 8.6vw, 112px);
  line-height: .94;
  font-weight: 600;
  letter-spacing: -.065em;
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px #808878;
}

.intro {
  width: min(520px, 78%);
  margin: 0 0 0 auto;
  color: #aeb5a5;
  font-size: 14px;
  line-height: 1.9;
}

.query-panel {
  position: relative;
  display: grid;
  grid-template-columns: 80px 260px 1fr;
  gap: 28px;
  align-items: center;
  padding: 30px;
  border: 1px solid #48503f;
  background: rgba(29, 33, 26, .8);
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(18px);
  animation: enter .7s .15s cubic-bezier(.2,.8,.2,1) forwards;
}

.panel-index {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--acid);
  font: 500 30px/1 var(--mono);
}

.query-copy h2, .section-heading h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.query-copy p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.query-copy code { color: var(--acid); font-family: var(--mono); }

.key-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.input-wrap { position: relative; }

.input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 52px 0 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  color: var(--paper);
  background: #10130e;
  font: 13px/1 var(--mono);
  transition: border-color .2s, box-shadow .2s;
}

.input-wrap input:focus {
  border-color: var(--acid);
  box-shadow: inset 3px 0 0 var(--acid);
}

.input-wrap input::placeholder { color: #5d6457; }

.reveal-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 54px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reveal-button svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.reveal-button:hover svg { stroke: var(--paper); }

.submit-button {
  min-width: 180px;
  height: 54px;
  padding: 0 8px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--acid);
  background: var(--acid);
  color: #10130e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .2s, background .2s;
}

.submit-button:hover { transform: translateY(-2px); background: #d5ff70; }
.submit-button:disabled { cursor: wait; opacity: .72; transform: none; }

.button-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(16,19,14,.25);
  font: 20px/1 var(--mono);
}

.message {
  position: absolute;
  left: 396px;
  bottom: -26px;
  min-height: 18px;
  color: var(--danger);
  font: 500 11px/1.5 var(--mono);
}

.message.success { color: var(--acid); }

.dashboard { padding: 116px 0 100px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
}

.section-heading h2 { margin-top: 14px; font-size: 34px; }
.updated-at { color: var(--muted); font: 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.usage-card {
  min-height: 342px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(30,34,27,.94), rgba(19,22,17,.94));
  transition: transform .25s, border-color .25s;
}

.usage-card:hover { transform: translateY(-5px); border-color: #5c6552; }
.usage-card.loaded { animation: cardFlash .6s ease both; }
.usage-card.warning .meter span { background: var(--warning); }
.usage-card.danger .meter span { background: var(--danger); }

.card-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  letter-spacing: .14em;
}

.status-pill {
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: #71786c;
  letter-spacing: 0;
}

.loaded .status-pill { color: var(--acid); border-color: rgba(199,255,69,.35); }

.metric-row { margin: 54px 0 27px; display: flex; align-items: flex-start; }
.metric-value { font: 500 82px/.78 var(--mono); letter-spacing: -.09em; }
.metric-unit { margin: -3px 0 0 8px; color: var(--acid); font: 500 20px/1 var(--mono); }

.meter { height: 3px; overflow: hidden; background: #34382f; }
.meter span { display: block; width: 0; height: 100%; background: var(--acid); transition: width .9s cubic-bezier(.2,.8,.2,1); }

.card-footer {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.card-footer div:last-child { border-left: 1px solid var(--line); padding-left: 20px; }
.label { display: block; margin-bottom: 9px; color: #697063; font: 500 9px/1 var(--mono); letter-spacing: .12em; }
.card-footer strong { color: #c6ccbe; font: 500 12px/1.4 var(--mono); }

footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #697063;
  font: 500 9px/1 var(--mono);
  letter-spacing: .14em;
}

.footer-note { letter-spacing: .04em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes pulse { 50% { opacity: .38; box-shadow: 0 0 4px var(--acid); } }
@keyframes enter { to { opacity: 1; transform: translateY(0); } }
@keyframes cardFlash { 0% { border-color: var(--acid); } 100% { border-color: var(--line); } }

@media (max-width: 900px) {
  .query-panel { grid-template-columns: 52px 1fr; }
  .key-form { grid-column: 2; }
  .panel-index { grid-row: 1 / 3; }
  .message { left: 110px; }
  .usage-grid { grid-template-columns: 1fr; }
  .usage-card { min-height: 300px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1180px); }
  .masthead { height: 72px; }
  .hero { min-height: 360px; padding-top: 58px; }
  .hero::after { display: none; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .intro { width: 100%; margin-top: 36px; }
  .query-panel { display: block; padding: 22px; }
  .panel-index { display: none; }
  .query-copy { margin-bottom: 20px; }
  .key-form { display: block; }
  .submit-button { width: 100%; margin-top: 10px; }
  .message { position: static; padding-top: 12px; }
  .dashboard { padding: 88px 0 72px; }
  .section-heading { display: block; }
  .updated-at { margin-top: 18px; }
  .footer-note { display: none; }
}

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