/* 4klyft design tokens, taken from glacia-route-ui/src/shared/theme/index.ts.
   Dark is the app's production default; light follows the visitor's OS. */
:root {
  --bg: #0E1116;
  --paper: #1A1F26;
  --fg: #FFFFFF;
  --fg-muted: rgba(255, 255, 255, 0.72);
  --divider: rgba(255, 255, 255, 0.10);
  --hover: rgba(255, 255, 255, 0.08);
  --primary: #00BCD4;
  --primary-dark: #0097A7;
  --primary-selected: rgba(0, 188, 212, 0.16);
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;
  --unknown: rgba(255, 255, 255, 0.38);

  --radius: 8px;
  --radius-chip: 6px;
  --radius-input: 4px;
  --header-h: 64px;
  --font: "Roboto", "Helvetica", "Arial", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F6F8;
    --paper: #FFFFFF;
    --fg: #0E1116;
    --fg-muted: rgba(14, 17, 22, 0.64);
    --divider: rgba(14, 17, 22, 0.12);
    --hover: rgba(14, 17, 22, 0.04);
    --primary: #0097A7;
    --primary-dark: #006064;
    --primary-selected: rgba(0, 151, 167, 0.12);
    --unknown: rgba(14, 17, 22, 0.38);
  }
}

/* --- app bar ----------------------------------------------------------- */
.masthead {
  background: var(--paper); border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 10;
}
/* Out-specifies `.wrap`, which the site stylesheet defines after this file
   and which would otherwise win the padding at equal specificity. */
.masthead .masthead-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
  padding: 0 16px;
}
.masthead picture { display: flex; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; flex: 0 0 auto; }
.brand .mark { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; display: block; }
.brand .name {
  font-family: "Manrope", "Roboto", sans-serif;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap;
}
.brand .chip {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  height: 18px; display: inline-flex; align-items: center; padding: 0 6px;
  border-radius: var(--radius-chip); background: var(--primary-selected); color: var(--primary);
}

.nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; }
.nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--fg-muted); text-decoration: none;
  padding: 7px 10px; border-radius: var(--radius); line-height: 1; white-space: nowrap;
}
.nav-link:hover { color: var(--fg); background: var(--hover); }
.nav-link.is-current { color: var(--primary); background: var(--primary-selected); }
.masthead-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* --- calls to action ---------------------------------------------------- */
/* Shared: the app bar renders a CTA on BOTH sites, so these cannot live in
   one site's stylesheet. */
.cta {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--divider);
  font-size: 0.875rem; font-weight: 500; color: var(--fg); text-decoration: none;
}
.cta:hover { background: var(--hover); border-color: var(--primary); }
.cta-primary { background: var(--primary); border-color: var(--primary); color: #06232a; }
.cta-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #06232a; }
/* Compact variant for the app bar, which is denser than page content. */
.cta-sm { min-height: 32px; padding: 0 12px; font-size: 0.8125rem; }

/* Only ever rendered by the internal build. Loud on purpose — it must be
   impossible to mistake this page for what customers see. */
.internal-banner {
  background: rgba(255, 152, 0, 0.14);
  color: var(--warning);
  border-bottom: 1px solid rgba(255, 152, 0, 0.35);
  font-size: 0.8125rem; font-weight: 500;
  text-align: center; padding: 9px 16px;
}

/* --- site footer -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--divider); background: var(--paper);
  margin-top: 64px; padding: 48px 0 32px;
}
.footer-cols {
  display: grid; gap: 32px;
  grid-template-columns: 1.6fr repeat(4, 1fr);
}
.footer-brand picture { display: flex; }
.footer-brand .mark { width: 30px; height: 30px; object-fit: contain; display: block; }
.footer-tagline { color: var(--fg-muted); font-size: 0.875rem; margin: 12px 0 0; max-width: 24ch; }
.footer-col h2 {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg); margin: 0 0 12px; text-align: left;
}
.footer-col a {
  display: block; font-size: 0.875rem; color: var(--fg-muted);
  text-decoration: none; margin-bottom: 8px;
}
.footer-col a:hover { color: var(--primary); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 0.8125rem; color: var(--fg-muted); text-decoration: none;
  border: 1px solid var(--divider); border-radius: 999px; padding: 5px 12px;
}
/* A class `display` beats the UA stylesheet's [hidden], so say it explicitly
   or the pill renders empty until its fetch resolves. */
.status-pill[hidden] { display: none; }
.status-pill:hover { border-color: var(--primary); color: var(--fg); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--unknown); }
.status-pill[data-state="operational"] .dot { background: var(--success); }
.status-pill[data-state="degraded"] .dot { background: var(--warning); }
.status-pill[data-state="down"] .dot { background: var(--error); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--divider); margin-top: 40px; padding-top: 20px;
  font-size: 0.75rem; color: var(--fg-muted);
}
.footer-bottom a { color: var(--fg-muted); text-decoration: none; margin-left: 16px; }
.footer-bottom a:hover { color: var(--primary); }
.footer-bottom p { margin: 0; }

/* Between the full bar and a phone the nav scrolls rather than vanishing —
   losing every link at 1000px is worse than a little horizontal scroll. */
@media (max-width: 1099px) {
  .nav { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .nav::-webkit-scrollbar { display: none; }
  .masthead-actions .nav-link { display: none; }
}

@media (max-width: 699px) {
  /* The bar cannot hold brand, nav and CTA on one line, so the nav wraps to
     its own scrollable row. No disclosure widget: the status page must work
     with no JavaScript, and a hidden menu is a link nobody finds. */
  .masthead .masthead-inner {
    flex-wrap: wrap; align-items: center;
    padding: 12px 16px 0; row-gap: 10px; gap: 12px;
  }
  .brand { flex: 1 1 auto; }
  .masthead-actions { flex: 0 0 auto; }
  .nav {
    order: 3; flex: 1 0 100%; width: 100%;
    margin: 0 -16px; padding: 2px 16px 10px;
    gap: 2px;
  }
  .nav-link { padding: 6px 9px; font-size: 0.8125rem; }
}

@media (max-width: 899px) {
  main { padding-top: 32px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-bottom a { margin: 0 16px 0 0; }
  .brand .chip { display: none; }
  .masthead-inner { gap: 12px; }
}

/* Site-specific styles. shared/tokens.css and shared/chrome.css are
   prepended at build time — do not restate them here. */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--fg-muted); }

/* --- hero -------------------------------------------------------------- */
.hero-block { text-align: center; padding: 72px 0 64px; max-width: 640px; margin: 0 auto; }
.eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 12px;
}
.hero-block h1 {
  font-family: "Manrope", "Roboto", sans-serif; font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 16px;
}
.hero-block .lede { color: var(--fg-muted); font-size: 1.0625rem; margin: 0; }

/* --- timeline ---------------------------------------------------------- */
.month { border-top: 1px solid var(--divider); padding-top: 8px; }
.month-heading {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted); margin: 24px 0 0;
}

.entry { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding: 40px 0; }
.entry + .entry { border-top: 1px solid var(--divider); }
.entry-rail { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.entry-rail time { font-size: 0.8125rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.entry-body { min-width: 0; max-width: 640px; }
.entry-body .eyebrow { font-size: 0.6875rem; margin-bottom: 8px; }
.entry-body h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; margin: 0 0 8px; line-height: 1.25; }
.entry-body h2 a { color: inherit; text-decoration: none; }
.entry-body h2 a:hover { color: var(--primary); }
.summary { color: var(--fg-muted); margin: 0 0 16px; }
.availability { color: var(--warning); font-size: 0.875rem; margin: 0 0 16px; }
.withheld {
  font-size: 0.8125rem; color: var(--warning); background: rgba(255, 152, 0, 0.10);
  border-radius: var(--radius-input); padding: 6px 10px; margin: 0 0 12px; display: inline-block;
}

.tag, .badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  height: 18px; display: inline-flex; align-items: center; padding: 0 6px;
  border-radius: var(--radius-chip); background: var(--hover); color: var(--fg-muted);
}
.badge { margin: 0 6px 12px 0; }
.badge-early { background: rgba(0, 188, 212, 0.16); color: var(--primary); }
.badge-deprecated { background: rgba(255, 152, 0, 0.16); color: var(--warning); }
.badge-internal { background: rgba(255, 152, 0, 0.16); color: var(--warning); }

.hero { display: block; text-decoration: none; }

/* --- media ------------------------------------------------------------- */
.media { margin: 0 0 20px; }
.media img, .media video {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--divider); border-radius: var(--radius); background: var(--paper);
}
.media figcaption { font-size: 0.8125rem; color: var(--fg-muted); margin-top: 8px; }

/* --- calls to action (the base .cta lives in shared/chrome.css) -------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; }

/* --- article ----------------------------------------------------------- */
.article { max-width: 720px; padding-bottom: 32px; }
.back { display: inline-block; font-size: 0.875rem; color: var(--fg-muted); text-decoration: none; margin: 32px 0 28px; }
.back:hover { color: var(--primary); }
.article h1 {
  font-family: "Manrope", "Roboto", sans-serif; font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 12px;
}
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.article-meta time { font-size: 0.8125rem; color: var(--fg-muted); }
.article-meta .badge { margin: 0; }

.prose { font-size: 1.0625rem; }
.prose h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; margin: 36px 0 10px; }
.prose h4 { font-size: 1rem; font-weight: 500; margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; color: var(--fg-muted); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--fg-muted); }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--primary); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875em;
  background: var(--hover); border: 1px solid var(--divider);
  border-radius: var(--radius-input); padding: 1px 5px;
}
.prose pre {
  background: var(--paper); border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 14px; overflow-x: auto; margin: 0 0 20px;
}
.prose pre code { border: 0; background: none; padding: 0; font-size: 0.8125rem; line-height: 1.6; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--divider); }
.prose th { font-weight: 500; font-size: 0.8125rem; color: var(--fg-muted); }
.prose td { color: var(--fg-muted); }

/* --- callouts ---------------------------------------------------------- */
.callout {
  border: 1px solid var(--divider); border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; background: var(--paper);
}
.callout-label {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 6px !important;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warning); }
.callout-warning .callout-label { color: var(--warning); }
.callout-tip { border-left-color: var(--success); }
.callout-tip .callout-label { color: var(--success); }

/* --- collapsible steps ------------------------------------------------- */
.steps {
  border: 1px solid var(--divider); border-radius: var(--radius);
  margin: 0 0 20px; background: var(--paper);
}
.steps summary {
  cursor: pointer; padding: 14px 16px; font-weight: 500; font-size: 0.9375rem;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.steps summary::-webkit-details-marker { display: none; }
.steps summary::after { content: "+"; color: var(--primary); font-size: 1.25rem; line-height: 1; }
.steps[open] summary::after { content: "\2212"; }
.steps summary:hover { color: var(--primary); }
.steps-body { padding: 0 16px 4px; border-top: 1px solid var(--divider); padding-top: 14px; }
.steps-body p, .steps-body li { font-size: 0.9375rem; }

/* --- prev/next --------------------------------------------------------- */
.entry-nav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--divider); margin-top: 40px; padding-top: 20px;
}
.entry-nav a { font-size: 0.875rem; color: var(--fg-muted); text-decoration: none; max-width: 46%; }
.entry-nav a:hover { color: var(--primary); }
.entry-nav .next { margin-left: auto; text-align: right; }

footer { padding: 48px 16px; font-size: 0.75rem; color: var(--fg-muted); border-top: 1px solid var(--divider); margin-top: 48px; }
footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (min-width: 900px) {
  .entry-rail { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
}

@media (max-width: 899px) {
  :root { --header-h: 56px; }
  .entry { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
  .entry-rail { flex-direction: row; align-items: center; gap: 10px; }
  .hero-block { padding: 48px 0 40px; }
  .brand .chip { display: none; }
}
