/* gateway/style.css — standalone stylesheet for the server-rendered Feed
   Gateway landing page (/gateway/, issue #606). Deliberately independent of
   app.css, same reasoning as uk/style.css: this page ships only a small
   external script (script.js) for the "get a key" widget, no client-side
   theme switching, so it duplicates the small subset of design tokens it
   needs rather than depending on the SPA's stylesheet. Colors/fonts are
   kept in sync with app.css / uk/style.css by hand. */

:root {
  --paper:        #F7F8FA;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFC;
  --ink-900:      #16191F;
  --ink-700:      #353A43;
  --ink-500:      #6B7280;
  --line:         #E7E9EE;
  --line-strong:  #D6DAE1;
  --beam-50:      #EBF1FE;
  --beam-500:     #2F6BE4;
  --beam-600:     #1F55C6;
  --beam-700:     #18439B;

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-md: 0 4px 14px -4px rgba(22, 25, 31, 0.13), 0 2px 4px -2px rgba(22, 25, 31, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14161B;
    --surface:      #1C1F26;
    --surface-2:    #21242C;
    --ink-900:      #ECEEF2;
    --ink-700:      #CDD2DA;
    --ink-500:      #8E95A1;
    --line:         #282C34;
    --line-strong:  #353A44;
    --beam-50:      #15203A;
    --beam-500:     #4D86EE;
    --beam-600:     #6B9CF2;
    --beam-700:     #8FB4F5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-700);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

code, pre { font-family: var(--font-mono); }
a { color: var(--beam-700); }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.gw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}
.gw-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink-900);
}
.gw-brand img { width: 30px; height: 30px; display: block; }
.gw-brand__word {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
}
.gw-brand__word b { color: var(--beam-500); font-weight: 600; }
.gw-brand__tag {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-500);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.gw-header .btn { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn--accent { background: var(--beam-500); color: #fff; }
.btn--accent:hover { background: var(--beam-600); }
.btn--ghost { background: transparent; color: var(--ink-700); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Hero */
.gw-hero { padding: 2.5rem 0 3rem; max-width: 62ch; }
.gw-hero h1 { font-size: 2.6rem; margin-bottom: 1rem; }
.gw-hero__desc {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink-700);
  line-height: 1.6;
  margin: 0 0 1.75rem;
}
.gw-hero__actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.gw-keybox {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--beam-500);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  max-width: 52ch;
}
.gw-keybox__label { margin: 0 0 0.6rem; font-weight: 600; color: var(--ink-900); }
.gw-keybox__row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.gw-keybox__row code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  word-break: break-all;
}
.gw-keybox__note { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--ink-500); }

/* Sources */
.gw-sources { padding: 2rem 0; }
.gw-sources h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.gw-source-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}
.gw-source {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  font-weight: 600;
  color: var(--ink-900);
  font-size: 0.9375rem;
}

/* Usage */
.gw-usage { padding: 2.5rem 0; }
.gw-usage h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.gw-code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  color: var(--ink-900);
}
.gw-endpoints {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}
.gw-endpoints th, .gw-endpoints td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.gw-endpoints th { color: var(--ink-500); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Pricing */
.gw-pricing { padding: 2.5rem 0 3rem; }
.gw-pricing h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.gw-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.gw-tier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.gw-tier--supporter { border-color: var(--line-strong); }
.gw-tier h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.gw-tier__price { font-size: 1.6rem; font-weight: 700; color: var(--ink-900); margin: 0 0 1rem; }
.gw-tier ul { margin: 0 0 1.25rem; padding: 0 0 0 1.1rem; }
.gw-tier li { margin-bottom: 0.5rem; }
.gw-tier__soon { font-size: 0.875rem; color: var(--ink-500); }

/* Footer */
.gw-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
  color: var(--ink-500);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.gw-footer a { color: var(--ink-500); }

@media (max-width: 720px) {
  .gw-hero h1 { font-size: 2rem; }
  .gw-source-grid { grid-template-columns: repeat(2, 1fr); }
  .gw-pricing-grid { grid-template-columns: 1fr; }
  .gw-endpoints { font-size: 0.85rem; }
}

/* Dashboard (#607) */
.gw-dash { padding: 2.5rem 0 3rem; }
.gw-dash h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.gw-dash__intro { color: var(--ink-500); margin: 0 0 2rem; max-width: 60ch; }
.gw-dash__empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--ink-500);
}
.gw-dash__error {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  color: var(--ink-700);
  margin-bottom: 1.5rem;
}
.gw-keycard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.gw-keycard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.gw-keycard__title { font-weight: 600; color: var(--ink-900); font-family: var(--font-mono); }
.gw-keycard__tier {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-500);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.gw-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.gw-meter__fill { height: 100%; background: var(--beam-500); border-radius: 999px; }
.gw-meter__fill--warn { background: #C9873B; }
.gw-meter__fill--full { background: #C0392B; }
.gw-keycard__usage { font-size: 0.875rem; color: var(--ink-500); margin: 0 0 1rem; }
.gw-keycard__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.gw-keycard__example {
  margin-top: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Docs / playground (#608) */
.gw-docs { padding: 2.5rem 0 3rem; max-width: 72ch; }
.gw-docs h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.gw-docs h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.gw-docs__lede { color: var(--ink-700); margin: 0 0 1rem; }
.gw-docs .gw-endpoints--full td, .gw-docs .gw-endpoints--full th { font-size: 0.875rem; }

.gw-tabs { margin-top: 0.5rem; }
.gw-tabs__nav { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.gw-tabs__btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.gw-tabs__btn.is-active { color: #fff; background: var(--beam-500); border-color: var(--beam-500); }
.gw-tabs__panel { display: none; }
.gw-tabs__panel.is-active { display: block; }

.gw-playground {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 60ch;
}
.gw-field { margin-bottom: 1rem; }
.gw-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 0.35rem;
}
.gw-field input[type="text"],
.gw-field input[type="password"],
.gw-field select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-900);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
}
.gw-field__check {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 400 !important;
  color: var(--ink-500);
  margin-top: 0.5rem;
}
.gw-field__check input { width: auto; }
.gw-playground__params { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 0.25rem 0 0.75rem; margin-bottom: 1rem; }
.gw-playground__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }

.gw-response {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}
.gw-response__status { margin: 0 0 0.6rem; font-weight: 600; color: var(--ink-900); }
.gw-response__status--ok { color: #1E7B45; }
.gw-response__status--err { color: #C0392B; }
.gw-response__pre {
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 0.75rem;
  max-height: 240px;
  overflow-y: auto;
}
.gw-response__pre:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .gw-playground { padding: 1.1rem; }
}
