/* ===========================================================================
   Air Token - cyberpunk HUD reskin.
   Pure visual replacement of the previous amber/industrial theme. No class
   names or structural selectors changed, so behaviour and layout are intact.

   Locked design system:
   - Theme:   pure black -> #0a0a0a, dark mode only (brief-driven override of
              the usual "no pure black" rule).
   - Accent:  one neon lime (--neon) used identically across both views.
              A single semantic red (--alert) is reserved ONLY for real
              error/revoked state on status badges.
   - Shape:   panels/tiles = chamfered cut-corner frames (clip-path);
              primary CTAs = 4px sharp rect; ghost/outline/badges = pill.
              Documented mixed rule, applied everywhere.
   - Type:    Chakra Petch (display, uppercase) / Space Grotesk (body) /
              JetBrains Mono (technical labels + code).
   =========================================================================== */

:root {
  color-scheme: dark;

  --bg: #000000;
  --bg-2: #0a0a0a;
  --panel: rgba(10, 12, 7, 0.72);
  --panel-solid: #0a0c07;

  --neon: #d4ff00;
  --neon-soft: rgba(212, 255, 0, 0.4);
  --neon-faint: rgba(212, 255, 0, 0.16);
  --neon-line: rgba(212, 255, 0, 0.32);

  --text: #f5f5f5;
  --muted: #8a8a8a; /* nudged up from spec #6b6b6b to clear WCAG AA on pure black */
  --alert: #ff3b6b;

  --line: rgba(212, 255, 0, 0.22);
  --shadow: rgba(0, 0, 0, 0.66);

  --radius: 3px;       /* sharp cyber rect for inputs/CTAs */
  --notch: 14px;       /* chamfer size for cut-corner frames */

  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 255, 0, 0.07), transparent 26rem),
    linear-gradient(180deg, #000000, #060806 60%, #000000);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* --- Fixed cityscape backdrop (home only) --------------------------------- */
/* Pinned to the viewport (position: fixed) so it never moves while the home
   content scrolls over it — the background is identical before/after scroll,
   and matches the first screen exactly. Opaque image hides the grid/HUD/scan
   layers behind it, just like the original hero did. */
.hero-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 46%, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.82) 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.88)),
    url("./background.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
body[data-view="home"] .hero-backdrop {
  display: block;
}

/* --- Background: blueprint grid + neon orbit guides ------------------------ */

.industrial-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(212, 255, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 255, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.industrial-bg::before,
.industrial-bg::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(212, 255, 0, 0.1);
  border-radius: 50%;
}

.industrial-bg::before {
  width: 560px;
  height: 560px;
  left: calc(50% - 280px);
  top: calc(50% - 280px);
}

.industrial-bg::after {
  width: 340px;
  height: 340px;
  left: calc(50% - 170px);
  top: calc(50% - 170px);
}

/* --- Decorative HUD layer (pure decoration, aria-hidden) ------------------- */

.hud-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hud-cross {
  position: absolute;
  color: var(--neon);
  opacity: 0.55;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1;
}

.hud-cross.tl { top: 16px; left: 16px; }
.hud-cross.tr { top: 16px; right: 16px; }
.hud-cross.bl { bottom: 16px; left: 16px; }
.hud-cross.br { bottom: 16px; right: 16px; }

.hud-session {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  color: var(--neon);
  opacity: 0.22;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Subtle CRT scanline shimmer (motion, gated by reduced-motion). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(212, 255, 0, 0.025) 0px,
    rgba(212, 255, 0, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { background-position-y: 0; }
  100% { background-position-y: 6px; }
}

/* Page 2 (API access): plain black background — drop the blueprint grid, the
   neon spotlight/orbit rings, the HUD decoration and the scanline shimmer. */
body[data-view="api"] {
  background: #000;
}
body[data-view="api"] .industrial-bg,
body[data-view="api"] .hud-deco,
body[data-view="api"]::before {
  display: none;
}

/* --- Header ---------------------------------------------------------------- */

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 54px);
}

.brand-link,
.text-button,
.outline-button,
.get-api-button {
  border: 0;
  color: var(--text);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
}

/* Brand logo mark before the wordmark. */
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px var(--neon-soft));
}

.brand-link span {
  color: var(--neon);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 14px var(--neon-soft);
}

/* Header brand switches by view: home = logo only, other pages = wordmark only. */
body[data-view="home"] .brand-link span {
  display: none;
}
body:not([data-view="home"]) .brand-logo {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  background: transparent;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: box-shadow 0.18s, border-color 0.18s, color 0.18s;
}

.text-button:hover,
.text-button:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 14px var(--neon-soft);
  color: var(--text);
  outline: none;
}

.outline-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  background: rgba(212, 255, 0, 0.04);
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: box-shadow 0.18s, border-color 0.18s;
}

/* User Management is admin-only — hidden by default; JS reveals it for admins
   once logged in. Prevents it flashing in for logged-out/mobile visitors. */
.top-actions [data-view="users"] {
  display: none;
}

/* "models" nav link — same look as Login, scrolls to the home pricing section.
   Only meaningful on the home view (that's where the pricing section lives). */
.nav-models {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
body:not([data-view="home"]) .nav-models {
  display: none;
}

/* "or" divider in the login dialog */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* "Continue with Google" — same neon block as Continue, with the Google mark. */
.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.google-g {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Subtle legal links, bottom-left of the landing page only. */
.site-footer {
  position: fixed;
  left: 40px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  gap: 18px;
}
.site-footer a {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.18s;
}
.site-footer a:hover {
  color: var(--text);
}
.footer-copy {
  position: fixed;
  right: 40px;
  bottom: 18px;
  z-index: 5;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
body:not([data-view="home"]) .site-footer {
  display: none;
}

/* Support contact line at the bottom of the API page. */
.support-note {
  margin-top: 28px;
  text-align: left;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.support-note a {
  color: var(--neon);
  text-decoration: none;
}
.support-note a:hover {
  text-decoration: underline;
}
@media (max-width: 760px) {
  .site-footer {
    left: 18px;
    bottom: 14px;
    gap: 14px;
  }
  /* On narrow screens the long copyright would collide with the left-side
     links, so lift it onto its own line just above them. */
  .footer-copy {
    right: 18px;
    bottom: 40px;
  }
}

/* Standalone legal pages (/terms, /privacy). */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
  position: relative;
  z-index: 1;
}
.legal-back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.legal-page h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.04em;
}
.legal-updated {
  margin: 8px 0 32px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.legal-page h2 {
  margin: 34px 0 10px;
  color: var(--neon);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}
.legal-page p,
.legal-page li {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.98rem;
}
.legal-page ul {
  margin: 8px 0;
  padding-left: 20px;
}
.legal-page a {
  color: var(--neon);
}

.outline-button:hover,
.outline-button:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 14px var(--neon-soft);
  outline: none;
}

main {
  position: relative;
  z-index: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* --- Hero ------------------------------------------------------------------ */

/* Home is now a scroll container: a full-height hero stage, then the pricing
   section below it. The cityscape backdrop lives on the stage only. */
.hero-view.active {
  display: block;
}

.hero-stage {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 112px 24px 72px;
  /* Backdrop is the fixed .hero-backdrop layer behind — keep this transparent. */
}

.hero-copy {
  width: min(920px, 100%);
  text-align: center;
}

/* Scroll cue inviting the visitor down to Models & Prices. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.18s;
}
.scroll-cue:hover {
  color: var(--neon);
}
.scroll-arrow {
  font-size: 1.1rem;
  animation: scrollBob 1.8s ease-in-out infinite;
}
@keyframes scrollBob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* --- Home: Models & Prices showcase --------------------------------------- */

.pricing-section {
  scroll-margin-top: 80px;
  padding: 80px 24px 130px;
  /* Transparent — sits over the fixed .hero-backdrop, same as the hero. */
}
.pricing-inner {
  width: min(1040px, 100%);
  margin: 0 auto;
}

/* Hero: left-aligned two-column (60% copy / 40% visual). Flat, high-contrast,
   no glow/shadow/gradient. Geometric sans headline vs. the mono table. */
.pricing-head {
  display: grid;
  grid-template-columns: 60% 40%;
  align-items: center;
  gap: 32px;
  margin-bottom: 56px;
}

.hero-text {
  text-align: left;
}

.hero-title {
  margin: 0;
  text-align: left;
  font-family: var(--font-body); /* Space Grotesk — geometric sans */
  font-weight: 800;
  /* 1.4× the previous h2 size */
  font-size: clamp(2.8rem, 6.16vw, 5.04rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #ffffff;
}
.hero-title .accent {
  color: #d4ff3a;
}

.pricing-sub {
  margin: 24px 0 0;
  max-width: 520px;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  color: #a0a0a0;
}

/* ½ anchor mark — outlined (stroke only), slightly rotated. */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.half-mark {
  font-family: var(--font-body);
  font-size: 240px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px #d4ff3a;
  text-stroke: 2px #d4ff3a;
  transform: rotate(-8deg);
  user-select: none;
}
.half-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d4ff3a;
}

/* Minimal table — same treatment as the page-2 "Supported models" table:
   no boxed frame, just rows separated by faint neon hairlines. */
.price-table {
  display: grid;
  gap: 2px;
}

.price-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--neon-faint);
}

.price-row.price-head {
  border-top: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.price-row.price-head .col-model {
  color: var(--text);
}
.price-row.price-head small {
  opacity: 0.7;
}

/* Category divider row (Claude / GPT / DeepSeek). */
.price-cat {
  padding: 16px 0 8px;
  border-top: 1px solid var(--neon-line);
}
.price-cat span {
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.price-row .col-model {
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-row .col-model code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* Copy-model button: same pill/neon style as the API-key Copy button,
   sized a touch smaller to sit neatly inside a price row. */
.copy-model {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 11px;
  font-size: 0.72rem;
}

/* Each price cell: official rate struck through, our rate bold + neon. */
.price {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.price s {
  color: var(--muted);
  opacity: 0.7;
  font-size: 0.82rem;
  text-decoration-thickness: 1px;
}
.price b {
  color: var(--neon);
  font-weight: 600;
  font-size: 0.98rem;
  text-shadow: 0 0 12px var(--neon-faint);
}

.price-foot {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}
.price-foot s { opacity: 0.7; }
.price-foot b { color: var(--neon); }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.eyebrow::before { content: "[ "; color: var(--neon-soft); }
.eyebrow::after { content: " ]"; color: var(--neon-soft); }

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 18px;
  color: var(--neon);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap; /* keep "AIR TOKEN" on a single horizontal line */
  text-shadow:
    0 0 22px rgba(212, 255, 0, 0.55),
    0 0 60px rgba(212, 255, 0, 0.22);
}

.tagline {
  max-width: 620px;
  margin: 28px auto 0;
  color: var(--text);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.5;
}

/* Primary CTA - solid neon block, sharp cyber rect, glow + arrow. */
.get-api-button {
  position: relative;
  min-height: 56px;
  margin-top: 34px;
  padding: 0 30px;
  border-radius: var(--radius);
  background: var(--neon);
  color: #0a0c00;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 26px rgba(212, 255, 0, 0.4);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}

.get-api-button:not(.small)::after,
.primary-head-action::after {
  content: " \2192"; /* decorative right arrow */
  display: inline-block;
  margin-left: 8px;
}

.get-api-button:hover,
.get-api-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 38px rgba(212, 255, 0, 0.6);
  outline: none;
}

.get-api-button:active {
  transform: translateY(0) scale(0.985);
}

.get-api-button.small {
  min-height: 44px;
  margin: 0;
  padding: 0 20px;
  font-size: 0.88rem;
}

.primary-head-action {
  flex: 0 0 auto;
  min-width: 176px;
}

/* --- Workspace (API access + Users) --------------------------------------- */

.workspace-view {
  width: min(1060px, calc(100% - 36px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 128px 0 70px;
}

.workspace-view.active {
  display: block;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-top: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h3 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-head p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.simple-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  margin-top: 34px;
}

.simple-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.simple-section.wide {
  margin-top: 18px;
}

.section-line,
.section-title,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-line + .section-line {
  margin-top: 16px;
}

.section-line span,
.section-title span,
.list-row small,
label,
output {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title > span:first-child {
  color: var(--text);
}

.section-line strong {
  color: var(--text);
  font-size: 1.5rem;
}

.section-title {
  margin-bottom: 14px;
}

.inline-form,
.user-form,
.stack-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 24px;
}

.user-form {
  grid-template-columns: 1fr 1.4fr 0.8fr;
}

label {
  display: grid;
  gap: 8px;
}

input,
select,
output {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 10, 5, 0.8);
  color: var(--text);
}

input,
select {
  padding: 0 13px;
  font-family: var(--font-mono);
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus {
  border-color: var(--neon);
  outline: none;
  box-shadow: 0 0 0 1px var(--neon), 0 0 14px var(--neon-faint);
}

output {
  display: flex;
  align-items: center;
  margin-top: 14px;
  padding: 10px 13px;
  overflow-wrap: anywhere;
  text-transform: none;
  letter-spacing: 0;
}

.list {
  display: grid;
  gap: 2px;
}

.list-row {
  min-height: 74px;
  padding: 14px 0;
  border-top: 1px solid var(--neon-faint);
}

.list-row strong {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
}

.list-row code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

/* --- Status badges (pills; neon = active, red = real error state) --------- */

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  color: var(--neon);
  background: rgba(212, 255, 0, 0.08);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status.revoked,
.status.paused,
.status.expired,
.status.exhausted {
  border-color: rgba(255, 59, 107, 0.5);
  color: var(--alert);
  background: rgba(255, 59, 107, 0.1);
}

.row-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  background: transparent;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.row-action.danger {
  border-color: rgba(255, 59, 107, 0.45);
  color: var(--alert);
}

.row-action:hover,
.row-action:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 14px var(--neon-soft);
  outline: none;
}

.row-action.danger:hover,
.row-action.danger:focus-visible {
  border-color: var(--alert);
  box-shadow: 0 0 14px rgba(255, 59, 107, 0.4);
}

/* --- Login dialog ---------------------------------------------------------- */

.login-dialog {
  width: min(430px, calc(100% - 32px));
  border: 1px solid var(--neon-line);
  background: var(--panel-solid);
  color: var(--text);
  clip-path: polygon(
    0 0, calc(100% - var(--notch)) 0, 100% var(--notch),
    100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch))
  );
  filter: drop-shadow(0 0 20px rgba(212, 255, 0, 0.18));
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
}

.login-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-error {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  min-height: 0;
  color: var(--alert);
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: 0;
}

.auth-error:empty {
  display: none;
}

/* "Reset password?" link under the login button — only shown after a wrong
   password on an existing email account. Quiet, underlined, neon on hover. */
.reset-link {
  justify-self: center;
  margin: -4px 0 0;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s;
}
.reset-link:hover,
.reset-link:focus-visible {
  color: var(--neon);
  outline: none;
}

/* Confirmation line in the reset-request dialog (and the standalone reset page). */
.reset-success {
  margin: 0;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.4;
}
.reset-success[hidden] {
  display: none;
}

/* --- Balance + top-up focal panel (cut-corner HUD frame) ------------------ */

.balance-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 30px;
  padding: 22px;
  border: 1px solid var(--neon-line);
  background:
    linear-gradient(135deg, rgba(212, 255, 0, 0.05), rgba(6, 8, 4, 0.92)),
    var(--panel);
  clip-path: polygon(
    0 0, calc(100% - var(--notch)) 0, 100% var(--notch),
    100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch))
  );
  filter: drop-shadow(0 0 16px rgba(212, 255, 0, 0.12));
}

.balance-display {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 12px;
  min-height: 164px;
  padding: 24px;
  border: 1px solid var(--neon-faint);
  background: linear-gradient(180deg, rgba(212, 255, 0, 0.05), rgba(4, 6, 3, 0.9));
  clip-path: polygon(
    0 0, calc(100% - var(--notch)) 0, 100% var(--notch),
    100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch))
  );
  overflow: hidden;
  text-align: right;
}

.balance-label,
.topup-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topup-label {
  color: var(--neon);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: none;
  text-shadow: 0 0 16px var(--neon-soft);
}

.balance-amount {
  display: block;
  max-width: 100%;
  color: var(--neon);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.6vw, 3.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(212, 255, 0, 0.4);
}

.topup {
  display: grid;
  align-content: stretch;
  gap: 14px;
  min-width: 0;
}

.topup-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  height: 100%;
}

.topup-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--neon-line);
  background: linear-gradient(160deg, rgba(212, 255, 0, 0.04), rgba(5, 7, 3, 0.95));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  clip-path: polygon(
    0 0, calc(100% - 11px) 0, 100% 11px,
    100% 100%, 11px 100%, 0 calc(100% - 11px)
  );
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.18s;
}

.topup-card:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
  box-shadow: 0 0 22px var(--neon-faint);
}

.topup-card:focus-visible {
  border-color: var(--neon);
  outline: none;
  box-shadow: 0 0 0 1px var(--neon), 0 0 20px var(--neon-faint);
}

.topup-amount {
  color: var(--neon);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1;
}

.topup-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- API keys list --------------------------------------------------------- */

.section-title-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

#liveKeyCount,
#activeUserCount {
  display: inline-block;
  color: var(--muted);
}

#liveKeyCount::first-letter {
  color: var(--neon);
}

.new-key-output {
  margin: 14px 0;
  border: 1px solid var(--neon-line);
  background: var(--panel-solid);
  clip-path: polygon(
    0 0, calc(100% - 11px) 0, 100% 11px,
    100% 100%, 11px 100%, 0 calc(100% - 11px)
  );
  text-transform: none;
  letter-spacing: 0;
}

.new-key-output code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.copied-note {
  margin-left: 10px;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) minmax(92px, auto);
  align-items: center;
  gap: 20px;
  min-height: 88px;
  padding: 18px 0;
}

.key-name-cell {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.key-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.key-name {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
}

.key-code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  background: rgba(212, 255, 0, 0.06);
  color: var(--neon);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: border-color 0.15s, box-shadow 0.18s;
}

.icon-button:hover {
  border-color: var(--neon);
  box-shadow: 0 0 12px var(--neon-soft);
}

.rename-key {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

/* --- Supported models + pricing table ------------------------------------- */

.models-note {
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: none;
}

.models-table {
  display: grid;
  gap: 2px;
}

.model-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--neon-faint);
}

.model-row.model-head {
  border-top: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.model-row code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

/* prices: neon for emphasis */
.model-row:not(.model-head) span:not(:first-child) {
  color: var(--neon);
  font-family: var(--font-mono);
}

.models-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.models-hint code {
  color: var(--neon);
}

/* --- Quickstart code example ---------------------------------------------- */

.code-example {
  border: 1px solid var(--neon-line);
  overflow: hidden;
  background: #040603;
  clip-path: polygon(
    0 0, calc(100% - var(--notch)) 0, 100% var(--notch),
    100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch))
  );
}

.code-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(212, 255, 0, 0.03);
}

.code-tab {
  padding: 6px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--neon);
  border-bottom-color: var(--neon);
  text-shadow: 0 0 10px var(--neon-soft);
}

.code-copy {
  margin-left: auto;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid var(--neon-line);
  border-radius: 999px;
  background: transparent;
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.code-copy:hover {
  border-color: var(--neon);
  box-shadow: 0 0 12px var(--neon-soft);
}

.code-block {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
}

.code-block code {
  color: #d7e3c8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre;
}

/* --- Balance bump on credit ----------------------------------------------- */

@keyframes balanceBump {
  0% { transform: scale(1); color: var(--neon); }
  35% { transform: scale(1.08); text-shadow: 0 0 28px rgba(212, 255, 0, 0.8); }
  100% { transform: scale(1); color: var(--neon); }
}

.balance-amount.balance-bump {
  animation: balanceBump 1.4s ease;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 760px) {
  .site-header {
    min-height: 64px;
    padding: 14px 16px;
  }

  .brand-link span {
    font-size: 1.3rem;
  }

  .top-actions {
    gap: 6px;
  }

  .text-button,
  .outline-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .hud-session {
    display: none;
  }

  .hero-view {
    padding-inline: 18px;
  }

  /* Keep "AIR TOKEN" on one horizontal line without overflowing narrow screens. */
  h1 {
    font-size: clamp(1.9rem, 9vw, 3.2rem);
    letter-spacing: 0.05em;
  }

  .tagline {
    font-size: 1.02rem;
  }

  .workspace-view {
    width: min(100% - 28px, 1060px);
    padding-top: 104px;
  }

  .workspace-head,
  .section-line,
  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .simple-grid,
  .user-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .get-api-button.small,
  .inline-form .outline-button {
    width: 100%;
  }

  .balance-panel,
  .topup-options {
    grid-template-columns: 1fr;
  }

  .balance-display {
    order: -1;
    justify-items: start;
    min-height: 132px;
    text-align: left;
  }

  .key-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .key-title-line {
    flex-wrap: wrap;
    white-space: normal;
  }

  .model-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* Home pricing table: stack each row, label the price cells. */
  .pricing-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Hero stacks: copy first, ½ mark below (smaller). Still left-aligned. */
  .pricing-head {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 44px;
  }
  .hero-visual {
    align-items: flex-start;
  }
  .half-mark {
    font-size: 150px;
  }
  .price-row.price-head {
    display: none;
  }
  .price-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 16px 0;
  }
  .price-row .col-model {
    margin-bottom: 4px;
  }
  .price-row .col-model code {
    font-size: 1rem;
  }
  .price-row .price {
    justify-content: space-between;
    width: 100%;
  }
  .price-row > .price::before {
    margin-right: auto;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .price-row > .price:nth-child(2)::before { content: "Input"; }
  .price-row > .price:nth-child(3)::before { content: "Cached"; }
  .price-row > .price:nth-child(4)::before { content: "Output"; }
}

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before {
    animation: none;
  }

  .get-api-button,
  .topup-card,
  .text-button,
  .outline-button,
  .row-action,
  .icon-button,
  .code-copy {
    transition: none;
  }

  .balance-amount.balance-bump {
    animation: none;
  }
}
