@font-face {
  font-family: "JF Open Huninn";
  src: url("/fonts/jf-openhuninn-2.1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --ink: #14212b;
  --muted: #5c6c78;
  --line: #d8e1e8;
  --line-strong: #bccbd6;
  --green: #178255;
  --green-dark: #0f6241;
  --blue: #245b8f;
  --cyan: #1b7f8f;
  --code: #101922;
  --code-line: #263644;
}

body {
  margin: 0;
  font-family: "JF Open Huninn", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 420px),
    var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 225, 232, 0.84);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-size: 12px;
  font-weight: 800;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  color: #31424f;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 11px;
  border-radius: 7px;
}

nav a:last-child {
  color: #ffffff;
  background: var(--ink);
}

nav a:hover {
  text-decoration: none;
  background: #e8eef3;
}

nav a:last-child:hover { background: #263541; }

nav a:last-child:hover {
  color: #ffffff;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 46px 0 72px;
}

.hero {
  min-height: min(640px, calc(100vh - 110px));
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 22px 0 46px;
}

.hero > *,
.code-section > *,
.band > *,
.content-grid > *,
.metrics > * {
  min-width: 0;
}

.hero-copy {
  display: grid;
  gap: 18px;
  max-width: 650px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  margin: 0;
  max-width: 610px;
  color: #425665;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.actions .button {
  flex: 0 0 auto;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 12px 18px;
  background: var(--green);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 130, 85, 0.18);
}

button:hover,
.button:hover {
  background: var(--green-dark);
  text-decoration: none;
}

.danger {
  min-height: 36px;
  padding: 8px 12px;
  background: #b42318;
  box-shadow: none;
}

.danger:hover {
  background: #8f1d14;
}

.secondary {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.secondary:hover { background: #edf3f7; }

.compact {
  min-height: 36px;
  padding: 8px 12px;
  box-shadow: none;
}

.terminal-shot,
.code-section pre,
pre {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
  background: var(--code);
  color: #e5eef5;
  box-shadow: 0 24px 60px rgba(16, 25, 34, 0.18);
}

.terminal-shot {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #203241;
}

.terminal-head {
  display: flex;
  gap: 7px;
  height: 38px;
  align-items: center;
  padding: 0 15px;
  border-bottom: 1px solid var(--code-line);
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6c7c89;
}

.terminal-head span:first-child { background: #d8685d; }
.terminal-head span:nth-child(2) { background: #d7a94b; }
.terminal-head span:nth-child(3) { background: #52a06a; }

.terminal-shot pre,
.code-section pre,
pre {
  margin: 0;
  padding: 22px;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: -18px 0 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metrics div {
  display: grid;
  gap: 5px;
  min-height: 108px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.9);
}

.metrics strong {
  font-size: 23px;
  line-height: 1;
}

.metrics span,
.muted {
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 54px;
}

.pricing-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 54px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(20, 33, 43, 0.06);
}

.pricing-band h2 {
  margin-bottom: 8px;
}

.pricing-band p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.feature,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(20, 33, 43, 0.06);
}

.feature {
  padding: 24px;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 30px;
  margin-bottom: 20px;
  border-radius: 7px;
  color: var(--green-dark);
  background: #dff2e9;
  font-size: 12px;
  font-weight: 900;
}

h1,
h2 {
  margin: 0 0 14px;
  letter-spacing: 0;
}

h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }

p {
  margin: 0 0 16px;
  line-height: 1.65;
}

.feature p,
.band p,
.code-section p {
  color: var(--muted);
}

.code-section,
.band {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: start;
  margin-bottom: 54px;
}

.code-section pre {
  border: 1px solid #203241;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0c5739;
  background: #e8f5ee;
  border-radius: 4px;
  padding: 1px 4px;
}

pre code {
  color: inherit;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.band {
  align-items: center;
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #edf5f2);
}

.route-list {
  display: grid;
  gap: 10px;
}

.route-list div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.route-list span {
  grid-row: span 2;
  color: var(--blue);
  font-weight: 900;
}

.route-list strong { font-size: 15px; }
.route-list em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.auth-wrap {
  display: grid;
  place-items: start center;
  padding-top: 34px;
}

.panel {
  width: min(720px, 100%);
  padding: clamp(24px, 4vw, 34px);
}

.dashboard {
  width: 100%;
  overflow-x: visible;
}

.success-panel {
  display: grid;
  gap: 14px;
}

.success-panel h1,
.success-panel p {
  margin-bottom: 0;
}

.key-box {
  display: grid;
  gap: 9px;
  margin: 8px 0 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.key-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-box code {
  display: block;
  padding: 13px 14px;
  overflow-wrap: anywhere;
  color: #e5eef5;
  background: var(--code);
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.delete-form {
  display: block;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  color: #0f6241;
  background: #dff2e9;
}

.status-pill.inactive {
  color: #6a737d;
  background: #edf1f4;
}

.status-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.confirm-dialog {
  width: min(460px, calc(100% - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(20, 33, 43, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(16, 25, 34, 0.46);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 26px;
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

.dialog-key {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-summary strong {
  display: block;
  margin-bottom: 8px;
}

.billing-wrap .panel {
  display: grid;
  gap: 16px;
}

#payment-element {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

label {
  display: grid;
  gap: 7px;
  color: #263743;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(36, 91, 143, 0.16);
  border-color: var(--blue);
}

.alert {
  width: min(720px, 100%);
  padding: 13px 15px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #842029;
  background: #fff1f0;
  border: 1px solid #ffc9c4;
}

.notice {
  width: min(720px, 100%);
  padding: 13px 15px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #0f6241;
  background: #e6f5ed;
  border: 1px solid #b9e4ce;
}

.form-link {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 800;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 10px 0 28px;
  border-radius: 8px;
}

thead {
  background: #edf3f7;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th:nth-child(1),
td:nth-child(1) { width: 18%; }

th:nth-child(3),
td:nth-child(3) { width: 15%; }

th:nth-child(4),
td:nth-child(4) { width: 17%; }

th:nth-child(5),
td:nth-child(5) { width: 13%; }

.api-keys-table {
  min-width: 820px;
  table-layout: auto;
}

.api-keys-table th:nth-child(1),
.api-keys-table td:nth-child(1) { width: 16%; }

.api-keys-table th:nth-child(2),
.api-keys-table td:nth-child(2) { width: 34%; }

.api-keys-table th:nth-child(3),
.api-keys-table td:nth-child(3) { width: 10%; }

.api-keys-table th:nth-child(4),
.api-keys-table td:nth-child(4) { width: 15%; }

.api-keys-table th:nth-child(5),
.api-keys-table td:nth-child(5) { width: 15%; }

.api-keys-table th:nth-child(6),
.api-keys-table td:nth-child(6) { width: 10%; }

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

.usage-stats div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.usage-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.usage-stats strong {
  font-size: 24px;
}

tr:last-child td { border-bottom: 0; }

.legal {
  width: min(880px, 100%);
}

.legal h2 {
  margin-top: 30px;
  font-size: 22px;
}

.legal p {
  color: #465866;
}

footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer div {
  display: grid;
  gap: 4px;
}

footer strong {
  color: var(--ink);
}

footer nav {
  gap: 8px;
}

footer nav a {
  padding: 7px 9px;
  color: #31424f;
  background: transparent;
}

footer nav a:last-child {
  color: #31424f;
  background: transparent;
}

footer nav a:hover,
footer nav a:last-child:hover {
  color: #ffffff;
  background: #263541;
}

footer p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .code-section,
  .band,
  .pricing-band {
    grid-template-columns: 1fr;
  }

  .metrics,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  header {
    height: 64px;
    min-height: 64px;
    padding: 12px 16px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .brand { font-size: 17px; }

  nav {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  nav a {
    padding: 8px 9px;
    font-size: 13px;
    white-space: nowrap;
  }

  main {
    width: calc(100% - 28px);
    padding-top: 28px;
  }

  .hero {
    min-height: auto;
    padding-top: 10px;
  }

  .terminal-shot pre,
  .code-section pre,
  pre {
    padding: 16px;
    font-size: 12px;
    line-height: 1.58;
  }

  .actions {
    align-items: stretch;
  }

  .actions .button {
    width: 100%;
  }

  .pricing-band .button {
    width: 100%;
  }

  .metrics,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .billing-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .route-list div {
    grid-template-columns: 1fr;
  }

  .route-list span {
    grid-row: auto;
  }

  .band {
    padding: 20px;
  }

  footer {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
  }

  footer nav {
    justify-content: flex-start;
  }
}
