/* Gradium theme for external pages. CI ships theme/ with every site at /_gradium/.
 *
 * Source of truth: gradium.ai (proto-website app/globals.css @theme and
 * docs/design-system.md). Same tokens as the gitops oauth2-proxy pages and the
 * Superset theme:
 *   - dark-first: ink page #121314, raised surface #18191b, hairline #37383a rules
 *   - bright text #f2f2f2, never pure white (white is hover only)
 *   - muted text #7e7e7e; the logo is #707070 IN THE ASSET and is never recoloured
 *   - blue #1ca0ff is for figures and focus, not an interaction colour
 *   - IBM Plex Sans / Mono (ABC Favorit, the site's display face, is licensed)
 *   - titles tracked -0.015em, weight 400–500, never bold
 * The light palette is ours (the site has none), shared with gitops. */

:root {
  --gr-ink: #121314;
  --gr-surface: #18191b;
  --gr-bright: #f2f2f2;
  --gr-hairline: #37383a;
  --gr-muted: #7e7e7e;
  --gr-btn-bg: #f2f2f2;
  --gr-btn-fg: #121314;
  --gr-btn-hover: #ffffff;
  --gr-link: #f2f2f2;
  --gr-dot-opacity: 1;

  /* Accent ramp: brand fills, charts, figures. Same in both schemes. */
  --gr-blue: #1ca0ff;
  --gr-lightblue: #aed2ff;
  --gr-purple: #d895ff;
  --gr-pink: #ff95e5;
  --gr-orange: #ffb592;
  --gr-yellow: #daff52;
  --gr-green: #60e21a;
  --gr-cyan: #91fffa;
  --gr-red: #f55142;

  --gr-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gr-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gr-container: 1176px;
  --gr-radius: 12px;
  --gr-radius-sm: 8px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --gr-ink: #f6f6f6;
    --gr-surface: #ffffff;
    --gr-bright: #121314;
    --gr-hairline: #dcdcdc;
    --gr-muted: #6b6b6b;
    --gr-red: #d6301f;
    --gr-btn-bg: #121314;
    --gr-btn-fg: #f6f6f6;
    --gr-btn-hover: #2a2c2e;
    --gr-link: #0069c2;
    --gr-dot-opacity: 0.85;
    color-scheme: light;
  }
}

/* Pages that must stay dark (the website is dark-only) set <html data-theme="dark">. */
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gr-ink);
  color: var(--gr-bright);
  font-family: var(--gr-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Layout ------------------------------------------------------------- */

.gr-container {
  width: 100%;
  max-width: calc(var(--gr-container) + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

.gr-header {
  padding: 24px 0;
}

.gr-section {
  padding: 64px 0;
}
@media (min-width: 1024px) {
  .gr-section { padding: 96px 0; }
}

.gr-hairline {
  height: 1px;
  width: 100%;
  border: 0;
  margin: 0;
  background: var(--gr-hairline);
}

.gr-footer {
  padding: 32px 0;
  color: var(--gr-muted);
  font-family: var(--gr-mono);
  font-size: 12px;
}

/* ---- Brand -------------------------------------------------------------- */

/* <img class="gr-logo" src="/_gradium/logo-large.svg" alt="Gradium">
   The fill is in the asset. No filter, no currentColor, no override. */
.gr-logo {
  display: block;
  height: 22px;
  width: auto;
}

/* ---- Type --------------------------------------------------------------- */

.gr-eyebrow {
  margin: 0 0 16px;
  font-family: var(--gr-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gr-muted);
}

.gr-display,
.gr-title,
.gr-lead {
  margin: 0 0 16px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
}
/* Website type scale (lib/type-scale.ts): base / sm / lg. */
.gr-display { font-size: 28px; }
.gr-title { font-size: 28px; }
.gr-lead { font-size: 22px; }
@media (min-width: 640px) {
  .gr-display { font-size: 48px; }
  .gr-title { font-size: 44px; }
  .gr-lead { font-size: 32px; }
}
@media (min-width: 1024px) {
  .gr-display { font-size: 60px; }
  .gr-title { font-size: 56px; }
  .gr-lead { font-size: 40px; }
}

.gr-subtitle {
  margin: 0 0 24px;
  max-width: 40rem;
  font-size: 18px;
  line-height: 1.5;
  color: var(--gr-muted);
}
.gr-subtitle b, .gr-subtitle strong { color: var(--gr-bright); font-weight: 500; }

.gr-mono { font-family: var(--gr-mono); }
.gr-muted { color: var(--gr-muted); }

code, kbd, pre { font-family: var(--gr-mono); font-size: 0.9em; }

/* The site's link treatment: a faint track that fills on hover. */
.gr-link {
  color: var(--gr-link);
  text-decoration: none;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(rgba(127, 127, 127, 0.35), rgba(127, 127, 127, 0.35)) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.25s ease;
}
.gr-link:hover { background-size: 100% 1px, 100% 1px; }

/* ---- Components --------------------------------------------------------- */

.gr-card {
  background: var(--gr-surface);
  border: 1px solid var(--gr-hairline);
  border-radius: var(--gr-radius);
  padding: 28px 24px;
}
@media (min-width: 640px) {
  .gr-card { padding: 36px 32px; }
}

.gr-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* Big figure: mono, tight. Colour it with an accent if it is THE number. */
.gr-figure {
  margin: 0 0 8px;
  font-family: var(--gr-mono);
  font-size: 40px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) { .gr-figure { font-size: 60px; } }

.gr-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--gr-radius-sm);
  background: var(--gr-btn-bg);
  color: var(--gr-btn-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gr-btn:hover { background: var(--gr-btn-hover); }
.gr-btn.secondary { background: transparent; color: var(--gr-bright); border-color: var(--gr-hairline); }
.gr-btn.secondary:hover { border-color: var(--gr-muted); }

.gr-btn:focus-visible,
.gr-link:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gr-blue);
  outline-offset: 2px;
}

.gr-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--gr-hairline);
  border-radius: 999px;
  font-family: var(--gr-mono);
  font-size: 12px;
  color: var(--gr-muted);
}

/* ---- Dot-matrix waveform (website VoiceWaveform motif) ------------------- */
/* <div data-gradium-wave></div> + <script src="/_gradium/wave.js" defer></script>
   Sits in the page flow (put it last, as a closing motif). On a page that fits
   one screen, add class "fixed" to pin it to the viewport bottom behind the
   content, and wrap the content in .gr-above-wave. */
.gr-wave {
  position: relative;
  height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 0 8px 32px;
  opacity: var(--gr-dot-opacity);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 70%, transparent);
  mask-image: linear-gradient(to top, #000 70%, transparent);
}
.gr-wave.fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; }
.gr-wave i {
  flex: 0 1 8px;
  min-width: 2px;
  height: calc(var(--h) * 1.7);
  color: var(--c);
  background: radial-gradient(circle, currentColor 1.6px, transparent 1.9px) 50% 100% / 8px 8px repeat-y;
  animation: gr-pulse 2.4s ease-in-out infinite alternate;
  animation-delay: var(--d);
}
@keyframes gr-pulse {
  from { height: calc(var(--h) * 1.7); }
  to { height: calc(var(--h) * 0.8); }
}
@media (prefers-reduced-motion: reduce) { .gr-wave i { animation: none; } }
/* 72 bars at min 2px: a 4px gap overflows a 375px phone, 2px fits 320px. */
.gr-wave { overflow: hidden; }
@media (max-width: 480px) { .gr-wave { gap: 2px; height: 180px; } }

/* Content above a .fixed wave. */
.gr-above-wave { position: relative; z-index: 1; padding-bottom: 200px; }
