/* APIARY brand theme - reusable, dark-first website foundation aligned to Xore/theme. */
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --apiary-bg: #20201f;
  --apiary-sidebar: #1e1e1c;
  --apiary-surface: #2c2c2a;
  --apiary-surface-raised: #383835;
  --apiary-border: rgba(255, 255, 255, 0.09);
  --apiary-border-strong: rgba(255, 255, 255, 0.16);
  --apiary-text: #e9e6df;
  --apiary-text-secondary: #a8a49c;
  --apiary-text-muted: #a5a9a6;
  /* Split into -fill (paired with .apiary-button--primary's hardcoded dark
     #211a17 text, in both themes) and -text (standalone text color on the
     page background/card surface, e.g. .apiary-eyebrow/.apiary-card__index)
     -- one color can't satisfy both pairings at once in light mode (see
     Xore/APIARY#1044). Dark mode's original single value already passed
     -fill's contrast requirement; -text needed a touch brighter to clear
     4.5:1 against --apiary-surface specifically (4.48:1 before, its
     hardest case -- --apiary-bg/-sidebar had more headroom). */
  --apiary-copper-fill: #d97757;
  --apiary-copper-fill-hover: #e18768;
  --apiary-copper-fill-pressed: #c9684b;
  --apiary-copper-text: #dc8264;
  --apiary-copper-soft: rgba(217, 119, 87, 0.14);
  --apiary-link: #6da7ec;
  --apiary-success: #79c99e;
  --apiary-warning: #deb36a;
  --apiary-danger: #dc7774;
  --apiary-radius-sm: 9px;
  --apiary-radius: 14px;
  --apiary-radius-lg: 18px;
  --apiary-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 18px 56px rgba(0, 0, 0, 0.3);
  --apiary-content: 1180px;
  --apiary-font: "Fira Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --apiary-display: "Space Grotesk", "Fira Sans", "Segoe UI", system-ui, sans-serif;
  --apiary-mono: "Fira Code", "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --apiary-bg: #f7f6f2;
  --apiary-sidebar: #f0efeb;
  --apiary-surface: #f4f2ed;
  --apiary-surface-raised: #fffefa;
  --apiary-border: rgba(34, 31, 28, 0.10);
  --apiary-border-strong: rgba(34, 31, 28, 0.19);
  --apiary-text: #2f2b27;
  --apiary-text-secondary: #68615a;
  --apiary-text-muted: #66615b;
  /* Xore/APIARY#1044: the original single --apiary-copper failed WCAG AA
     in both its usages here, in opposite directions -- lightened for -fill
     (paired with hardcoded dark #211a17 button text: old base measured
     4.40:1 against that text, needs 4.5:1) and darkened for -text
     (standalone text on this theme's light background: old value measured
     3.49-3.61:1 against --apiary-bg/-surface, also below 4.5:1). Verified:
     -fill now clears 4.5:1 against #211a17 (6.38/5.65/4.93:1
     base/hover/pressed) and -text clears 4.5:1 against both
     --apiary-bg/--apiary-surface (5.24/5.06:1). */
  --apiary-copper-fill: #d58c76;
  --apiary-copper-fill-hover: #ca826d;
  --apiary-copper-fill-pressed: #bd7866;
  --apiary-copper-text: #9f513a;
  --apiary-copper-soft: rgba(199, 101, 72, 0.12);
  --apiary-link: #2a78d6;
  --apiary-success: #3f8764;
  --apiary-warning: #9b6b25;
  --apiary-danger: #b34f4c;
  --apiary-shadow: 0 1px 2px rgba(48, 42, 36, 0.06), 0 18px 56px rgba(48, 42, 36, 0.13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--apiary-bg);
  color: var(--apiary-text);
  font: 15px/1.6 var(--apiary-font);
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--apiary-display); }

a { color: inherit; }
button, input { font: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--apiary-link) 62%, transparent);
  outline-offset: 3px;
}

.apiary-container {
  width: min(var(--apiary-content), calc(100% - 40px));
  margin-inline: auto;
}

.apiary-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--apiary-border);
  background: color-mix(in srgb, var(--apiary-bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.apiary-nav__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.apiary-nav__brand { display: inline-flex; align-items: center; margin-right: auto; }
.apiary-nav__brand img { display: block; width: 210px; height: auto; }
.apiary-nav__links { display: flex; align-items: center; gap: 24px; }
.apiary-nav__links a { color: var(--apiary-text-secondary); text-decoration: none; font-weight: 650; }
.apiary-nav__links a:hover { color: var(--apiary-text); }

.apiary-theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--apiary-border);
  border-radius: 50%;
  background: var(--apiary-surface);
  color: var(--apiary-text-secondary);
  cursor: pointer;
}

.apiary-hero {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--apiary-border);
  background:
    linear-gradient(90deg, rgba(32, 32, 31, 0.36), rgba(32, 32, 31, 0.72) 42%, rgba(32, 32, 31, 0.52)),
    url("assets/backgrounds/apiary-hero-background.webp") center / cover;
}

[data-theme="light"] .apiary-hero {
  background:
    linear-gradient(rgba(247, 246, 242, 0.93), rgba(247, 246, 242, 0.93)),
    url("assets/backgrounds/apiary-hero-background.webp") center / cover;
}

.apiary-hero__content { max-width: 820px; padding-block: 96px; text-align: center; }

.apiary-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--apiary-copper-text);
  font: 700 12px/1.2 var(--apiary-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.apiary-eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; }

.apiary-hero h1 {
  max-width: 780px;
  margin: 0 auto 22px;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.apiary-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--apiary-text-secondary);
  font-size: clamp(17px, 2vw, 21px);
}

.apiary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.apiary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border: 1px solid var(--apiary-border-strong);
  border-radius: var(--apiary-radius-sm);
  background: var(--apiary-surface);
  color: var(--apiary-text);
  text-decoration: none;
  font-weight: 750;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.apiary-button:hover { transform: translateY(-1px); border-color: var(--apiary-copper-fill); }
.apiary-button--primary { border-color: transparent; background: var(--apiary-copper-fill); color: #211a17; }
.apiary-button--primary:hover { background: var(--apiary-copper-fill-hover); }

.apiary-section { padding-block: 88px; }
.apiary-section--tinted { border-block: 1px solid var(--apiary-border); background: var(--apiary-sidebar); }
.apiary-section__header { max-width: 670px; margin-bottom: 34px; }
.apiary-section h2 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.035em; }
.apiary-section__header p { margin: 0; color: var(--apiary-text-secondary); font-size: 17px; }

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

.apiary-card {
  min-height: 205px;
  padding: 26px;
  border: 1px solid var(--apiary-border);
  border-radius: var(--apiary-radius);
  background: var(--apiary-surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

.apiary-card__index { color: var(--apiary-copper-text); font: 700 12px/1 var(--apiary-mono); letter-spacing: 0.08em; }
.apiary-card h3 { margin: 34px 0 8px; font-size: 20px; letter-spacing: -0.015em; }
.apiary-card p { margin: 0; color: var(--apiary-text-secondary); }

.apiary-panel {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  overflow: hidden;
  border: 1px solid var(--apiary-border);
  border-radius: var(--apiary-radius-lg);
  background: var(--apiary-surface);
  box-shadow: var(--apiary-shadow);
}

.apiary-panel__copy { padding: 46px; }
.apiary-panel__copy h2 { margin-top: 0; }
.apiary-panel__copy p { color: var(--apiary-text-secondary); }

.apiary-terminal { min-width: 0; padding: 30px; background: #161715; color: #d9d5ce; font: 13px/1.75 var(--apiary-mono); }
.apiary-terminal__bar { display: flex; gap: 7px; margin-bottom: 22px; }
.apiary-terminal__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--apiary-text-muted); }
.apiary-terminal__bar i:first-child { background: var(--apiary-copper-fill); }
.apiary-terminal code { color: var(--apiary-success); }
.apiary-terminal .muted { color: #777a75; }

.apiary-statuses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.apiary-status { padding: 5px 10px; border: 1px solid var(--apiary-border); border-radius: 999px; color: var(--apiary-text-secondary); font: 700 11px/1.2 var(--apiary-mono); text-transform: uppercase; }
.apiary-status--live { border-color: color-mix(in srgb, var(--apiary-success) 48%, transparent); color: var(--apiary-success); }

.apiary-footer { padding-block: 36px; border-top: 1px solid var(--apiary-border); color: var(--apiary-text-muted); }
.apiary-footer__inner { display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 820px) {
  .apiary-nav__links { display: none; }
  .apiary-hero { min-height: 570px; }
  .apiary-grid, .apiary-panel { grid-template-columns: 1fr; }
  .apiary-panel__copy { padding: 30px; }
}

@media (max-width: 520px) {
  .apiary-container { width: min(100% - 28px, var(--apiary-content)); }
  .apiary-nav__brand img { width: 175px; }
  .apiary-hero__content { padding-block: 72px; }
  .apiary-section { padding-block: 64px; }
  .apiary-footer__inner { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
