/* ═══════════════════════════════════════════════════════════════════════════
   AMP DOCUMENTATION — CRIMSON VOID THEME
   Dark mode with deep red and white accents
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   IMPORTS & FONTS
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   ROOT VARIABLES
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Void Palette */
  --amp-void: #080808;
  --amp-deep: #0c0c0c;
  --amp-surface: #141414;
  --amp-elevated: #1c1c1c;
  --amp-border: #2a2a2a;
  --amp-border-subtle: #1e1e1e;

  /* Crimson Accents */
  --amp-red: #dc2626;
  --amp-red-bright: #ef4444;
  --amp-red-deep: #991b1b;
  --amp-red-glow: rgba(220, 38, 38, 0.15);
  --amp-red-glow-strong: rgba(220, 38, 38, 0.25);

  /* White Accents */
  --amp-white: #ffffff;
  --amp-white-dim: #e5e5e5;
  --amp-white-glow: rgba(255, 255, 255, 0.1);

  /* Semantic Colors */
  --amp-green: #22c55e;
  --amp-amber: #f59e0b;
  --amp-blue: #3b82f6;

  /* Text */
  --amp-text: #f5f5f5;
  --amp-text-dim: #a3a3a3;
  --amp-text-dimmer: #666666;

  /* Gradients */
  --amp-gradient-primary: linear-gradient(135deg, var(--amp-red) 0%, var(--amp-red-deep) 100%);
  --amp-gradient-surface: linear-gradient(180deg, var(--amp-surface) 0%, var(--amp-deep) 100%);
  --amp-gradient-glow: linear-gradient(135deg, var(--amp-red-glow) 0%, transparent 100%);

  /* Shadows */
  --amp-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --amp-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.6);
  --amp-shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.7);
  --amp-shadow-glow-red: 0 0 30px rgba(220, 38, 38, 0.25);
  --amp-shadow-glow-white: 0 0 30px rgba(255, 255, 255, 0.1);

  /* Timing */
  --amp-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --amp-transition-medium: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --amp-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Material overrides */
  --md-primary-fg-color: var(--amp-red);
  --md-primary-fg-color--light: var(--amp-red-bright);
  --md-primary-fg-color--dark: var(--amp-red-deep);
  --md-accent-fg-color: var(--amp-white);
  --md-default-bg-color: var(--amp-deep);
  --md-default-fg-color: var(--amp-text);
  --md-default-fg-color--light: var(--amp-text-dim);
  --md-default-fg-color--lighter: var(--amp-text-dimmer);
  --md-code-bg-color: var(--amp-surface);
  --md-code-fg-color: var(--amp-text);
  --md-typeset-color: var(--amp-text);
  --md-typeset-a-color: var(--amp-red-bright);
}

/* Force dark scheme */
[data-md-color-scheme="slate"],
[data-md-color-scheme="default"] {
  --md-default-bg-color: var(--amp-deep);
  --md-default-fg-color: var(--amp-text);
  --md-default-fg-color--light: var(--amp-text-dim);
  --md-default-fg-color--lighter: var(--amp-text-dimmer);
  --md-code-bg-color: var(--amp-surface);
  --md-typeset-table-color: var(--amp-border-subtle);
  --md-footer-bg-color: var(--amp-void);
  --md-footer-bg-color--dark: var(--amp-void);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BASE & BODY
   ───────────────────────────────────────────────────────────────────────────── */
body {
  background: var(--amp-deep);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle red glow in corners */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

/* Subtle grid pattern */
.md-main {
  background-image:
    linear-gradient(var(--amp-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--amp-border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: -1px -1px;
}

/* Main content area spacing */
.md-main__inner {
  margin-top: 0;
  padding-top: 1.5rem;
}

/* Full-width layout - sidebars push to edges */
.md-container {
  max-width: none;
}

.md-grid {
  max-width: none;
  margin: 0;
}

/* Standard 3-column layout with both sidebars */
.md-main__inner.md-grid {
  display: flex;
  max-width: none;
  margin: 0;
  padding: 0;
}

.md-main__inner .md-sidebar--primary {
  width: 15rem;
  flex-shrink: 0;
}

.md-main__inner .md-sidebar--secondary {
  width: 15rem;
  flex-shrink: 0;
}

.md-main__inner .md-content {
  flex: 1;
  min-width: 0;
}

@media screen and (min-width: 76.25em) {
  .md-main__inner .md-sidebar--primary,
  .md-main__inner .md-sidebar--secondary {
    width: 16rem;
  }
}

/* When navigation is hidden (homepage, etc) - full width centered */
[data-md-component="main"] > .md-main__inner:not(:has(.md-sidebar--primary)) {
  justify-content: center;
}

[data-md-component="main"] > .md-main__inner:not(:has(.md-sidebar--primary)) .md-content {
  max-width: 100%;
}

[data-md-component="main"] > .md-main__inner:not(:has(.md-sidebar--primary)) .md-content__inner {
  padding: 0;
  max-width: 100%;
}

@media screen and (max-width: 76.25em) {
  .md-main__inner .md-sidebar--primary {
    width: 14rem;
  }
}

@media screen and (max-width: 60em) {
  .md-main__inner.md-grid {
    flex-direction: column;
  }

  .md-main__inner .md-sidebar--primary,
  .md-main__inner .md-sidebar--secondary {
    width: 100%;
  }
}

.md-content {
  padding-bottom: 3rem;
  max-width: none;
}

.md-content__inner {
  margin: 0;
  padding: 1.5rem 2.5rem;
  max-width: none;
}

.md-content__inner > :first-child {
  margin-top: 0;
}

.md-content__inner > :last-child {
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--amp-text);
}

.md-typeset p {
  margin-bottom: 1.25rem;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: 'Outfit', 'Instrument Sans', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--amp-text);
}

.md-typeset h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 2rem;
  margin-top: 1rem;
  color: var(--amp-white);
}

.md-typeset h2 {
  font-size: 1.75rem;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--amp-border-subtle);
  color: var(--amp-white);
}

.md-typeset h3 {
  font-size: 1.35rem;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  color: var(--amp-red-bright);
}

.md-typeset h4 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--amp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Links */
.md-typeset a {
  color: var(--amp-red-bright);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--amp-transition-fast);
}

.md-typeset a:hover {
  color: var(--amp-white);
  border-bottom-color: var(--amp-red);
}

/* Strong text */
.md-typeset strong {
  color: var(--amp-white);
  font-weight: 600;
}

/* Lists */
.md-typeset ul,
.md-typeset ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.md-typeset li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.md-typeset li > ul,
.md-typeset li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Horizontal rules */
.md-typeset hr {
  margin: 3rem 0;
  border-color: var(--amp-border-subtle);
}

/* Blockquotes */
.md-typeset blockquote {
  background: var(--amp-surface);
  border-left: 4px solid var(--amp-red);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  border-radius: 0 12px 12px 0;
}

.md-typeset blockquote p {
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────────────────── */
.md-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--amp-border-subtle);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.md-header__inner {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  max-width: none;
}

/* Hide the logo icon in header */
.md-header__button.md-logo {
  display: none;
}

.md-header__title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* Header search */
.md-search__input {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 10px;
  transition: all var(--amp-transition-fast);
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-size: 0.9rem;
}

.md-search__input:focus {
  border-color: var(--amp-red);
  box-shadow: 0 0 0 3px var(--amp-red-glow);
}

.md-search__input::placeholder {
  color: var(--amp-text-dimmer);
}

/* ─────────────────────────────────────────────────────────────────────────────
   NAVIGATION TABS
   ───────────────────────────────────────────────────────────────────────────── */
.md-tabs {
  position: sticky;
  top: 52px;
  z-index: 99;
  background: var(--amp-void);
  border-bottom: 1px solid var(--amp-border-subtle);
}

.md-tabs__inner {
  max-width: none;
  padding: 0 2rem;
}

.md-tabs__list {
  padding: 0.5rem 0;
  display: flex;
  gap: 0;
}

.md-tabs__link {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--amp-text-dim);
  padding: 0.75rem 1.25rem;
  transition: all var(--amp-transition-fast);
  position: relative;
}

.md-tabs__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--amp-red);
  transition: width var(--amp-transition-medium);
}

.md-tabs__link:hover {
  color: var(--amp-white);
}

.md-tabs__link:hover::after,
.md-tabs__link--active::after {
  width: calc(100% - 1.5rem);
}

.md-tabs__link--active {
  color: var(--amp-white);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SIDEBAR NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */
.md-sidebar {
  background: var(--amp-deep);
  padding: 1rem 0;
  position: sticky;
  top: 95px;
  height: calc(100vh - 95px);
  overflow-y: auto;
  width: 100%;
}

.md-sidebar--primary {
  border-right: 1px solid var(--amp-border-subtle);
  justify-self: start;
}

.md-sidebar--secondary {
  border-left: 1px solid var(--amp-border-subtle);
  justify-self: end;
}

.md-sidebar__inner {
  padding: 0 0.25rem;
}

.md-nav__title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amp-text-dim);
  padding: 0.75rem 0.75rem 0.5rem;
}

.md-nav__list {
  padding: 0;
}

.md-nav__item {
  margin: 0.1rem 0;
}

.md-nav__link {
  font-size: 0.825rem;
  color: var(--amp-text-dim);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin: 0 0.25rem;
  transition: all var(--amp-transition-fast);
  border-left: 2px solid transparent;
  display: block;
}

.md-nav__link:hover {
  color: var(--amp-white);
  background: var(--amp-surface);
}

.md-nav__link--active {
  color: var(--amp-white);
  background: var(--amp-red-glow);
  border-left-color: var(--amp-red);
  font-weight: 500;
}

/* Expand icons */
.md-nav__icon {
  color: var(--amp-text-dimmer);
}

/* Nested navigation */
.md-nav--primary .md-nav__item--nested > .md-nav {
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--amp-border-subtle);
}

/* TOC */
.md-nav--secondary .md-nav__link {
  font-size: 0.775rem;
  padding: 0.4rem 0.65rem;
  margin: 0.1rem 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CODE BLOCKS
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset code,
.md-typeset pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  font-variant-ligatures: common-ligatures;
}

.md-typeset code {
  background: var(--amp-surface);
  color: var(--amp-red-bright);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  border: 1px solid var(--amp-border-subtle);
  white-space: nowrap;
}

.md-typeset pre {
  position: relative;
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  box-shadow: var(--amp-shadow-md);
  overflow: hidden;
  margin: 1.75rem 0;
}

.md-typeset pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--amp-red);
}

.md-typeset pre > code {
  background: transparent;
  border: none;
  padding: 1.5rem 1.75rem;
  display: block;
  overflow-x: auto;
  color: var(--amp-text);
  line-height: 1.65;
}

/* Code block language label */
.code-lang-label {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--amp-text-dimmer);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  background: var(--amp-elevated);
  border-radius: 4px;
  z-index: 1;
}

/* Line numbers */
.md-typeset pre code .linenos {
  color: var(--amp-text-dimmer);
  padding-right: 1rem;
  border-right: 1px solid var(--amp-border-subtle);
  margin-right: 1rem;
  user-select: none;
}

/* Copy button */
.md-clipboard {
  color: var(--amp-text-dim);
  transition: all var(--amp-transition-fast);
}

.md-clipboard:hover {
  color: var(--amp-red-bright);
}

/* Code highlighting */
.highlight .hll { background: var(--amp-red-glow); }
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: var(--amp-text-dimmer); font-style: italic; }
.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kd { color: var(--amp-red-bright); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd { color: var(--amp-green); }
.highlight .n, .highlight .na, .highlight .nb, .highlight .nc { color: var(--amp-text); }
.highlight .nf, .highlight .fm { color: var(--amp-white); }
.highlight .no, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: var(--amp-amber); }
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo { color: var(--amp-red-bright); }
.highlight .o, .highlight .p { color: var(--amp-text-dim); }
.highlight .nt { color: var(--amp-red-bright); }

/* ─────────────────────────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset table:not([class]) {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--amp-shadow-sm);
  margin: 2rem 0;
  width: 100%;
}

.md-typeset table:not([class]) th {
  background: var(--amp-elevated);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amp-text-dim);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--amp-border);
}

.md-typeset table:not([class]) td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--amp-border-subtle);
  line-height: 1.6;
}

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: none;
}

.md-typeset table:not([class]) tr:hover td {
  background: var(--amp-elevated);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ADMONITIONS
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  box-shadow: var(--amp-shadow-sm);
  overflow: hidden;
  border-left: none;
  margin: 2rem 0;
}

.md-typeset .admonition::before,
.md-typeset details::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.md-typeset .admonition-title,
.md-typeset details > summary {
  background: var(--amp-elevated);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--amp-border-subtle);
}

.md-typeset .admonition > .admonition-title + p,
.md-typeset details > summary + p {
  padding-top: 1.25rem;
}

.md-typeset .admonition > p,
.md-typeset details > p {
  padding: 0 1.5rem;
  margin-bottom: 1rem;
}

.md-typeset .admonition > p:last-child,
.md-typeset details > p:last-child {
  margin-bottom: 0;
  padding-bottom: 1.25rem;
}

.md-typeset .admonition > ul,
.md-typeset .admonition > ol,
.md-typeset details > ul,
.md-typeset details > ol {
  padding-left: 2.5rem;
  padding-right: 1.5rem;
  margin-bottom: 1.25rem;
}

/* Admonition types */
.md-typeset .admonition.note::before,
.md-typeset .admonition.info::before { background: var(--amp-blue); }
.md-typeset .admonition.note .admonition-title,
.md-typeset .admonition.info .admonition-title { color: var(--amp-blue); }

.md-typeset .admonition.tip::before,
.md-typeset .admonition.hint::before { background: var(--amp-green); }
.md-typeset .admonition.tip .admonition-title,
.md-typeset .admonition.hint .admonition-title { color: var(--amp-green); }

.md-typeset .admonition.warning::before,
.md-typeset .admonition.caution::before { background: var(--amp-amber); }
.md-typeset .admonition.warning .admonition-title,
.md-typeset .admonition.caution .admonition-title { color: var(--amp-amber); }

.md-typeset .admonition.danger::before,
.md-typeset .admonition.error::before { background: var(--amp-red); }
.md-typeset .admonition.danger .admonition-title,
.md-typeset .admonition.error .admonition-title { color: var(--amp-red-bright); }

.md-typeset .admonition.abstract::before,
.md-typeset .admonition.summary::before { background: var(--amp-white); }
.md-typeset .admonition.abstract .admonition-title,
.md-typeset .admonition.summary .admonition-title { color: var(--amp-white); }

/* ─────────────────────────────────────────────────────────────────────────────
   CONTENT TABS
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset .tabbed-set {
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--amp-surface);
  margin: 2rem 0;
}

.md-typeset .tabbed-labels {
  background: var(--amp-elevated);
  border-bottom: 1px solid var(--amp-border);
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}

.md-typeset .tabbed-labels > label {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--amp-text-dim);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  transition: all var(--amp-transition-fast);
  border: 1px solid transparent;
}

.md-typeset .tabbed-labels > label:hover {
  color: var(--amp-white);
  background: var(--amp-surface);
}

.md-typeset .tabbed-set > input:checked + label {
  color: var(--amp-white);
  background: var(--amp-red-glow);
  border-color: var(--amp-red);
}

.md-typeset .tabbed-content {
  padding: 1.75rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MERMAID DIAGRAMS
   ───────────────────────────────────────────────────────────────────────────── */
.mermaid {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  padding: 2.5rem;
  margin: 2rem 0;
  text-align: center;
}

/* Mermaid theme overrides */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon {
  fill: var(--amp-elevated) !important;
  stroke: var(--amp-red) !important;
  stroke-width: 2px !important;
}

.mermaid .edgePath .path {
  stroke: var(--amp-text-dim) !important;
  stroke-width: 2px !important;
}

.mermaid .edgeLabel {
  background-color: var(--amp-surface) !important;
  color: var(--amp-text-dim) !important;
}

.mermaid .cluster rect {
  fill: var(--amp-surface) !important;
  stroke: var(--amp-border) !important;
}

.mermaid text {
  fill: var(--amp-text) !important;
  font-family: 'Instrument Sans', sans-serif !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset .md-button {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 1rem 2rem;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all var(--amp-transition-fast);
  text-transform: none;
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.md-typeset .md-button--primary {
  background: var(--amp-red);
  color: var(--amp-white);
  box-shadow: var(--amp-shadow-glow-red);
}

.md-typeset .md-button--primary:hover {
  background: var(--amp-red-bright);
  transform: translateY(-2px);
  box-shadow: var(--amp-shadow-glow-red), 0 8px 25px rgba(220, 38, 38, 0.3);
}

.md-typeset .md-button:not(.md-button--primary) {
  background: transparent;
  color: var(--amp-white);
  border-color: var(--amp-border);
}

.md-typeset .md-button:not(.md-button--primary):hover {
  border-color: var(--amp-red);
  color: var(--amp-white);
  background: var(--amp-red-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.md-footer {
  background: var(--amp-void);
  border-top: 1px solid var(--amp-border-subtle);
  margin-top: 6rem;
}

.md-footer-nav {
  padding: 2rem 0;
}

.md-footer-nav__inner {
  padding: 1.5rem 2rem;
  max-width: none;
}

.md-footer-meta {
  background: var(--amp-void);
  padding: 1.5rem 0;
}

.md-footer__link {
  transition: all var(--amp-transition-fast);
  padding: 1rem 0;
}

.md-footer__link:hover {
  color: var(--amp-red-bright);
}

.md-footer__title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.md-footer__direction {
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

/* Social links */
.md-footer__inner .md-social {
  padding: 1.5rem 0;
}

.md-footer__inner .md-social__link {
  color: var(--amp-text-dim);
  transition: all var(--amp-transition-fast);
  padding: 0.5rem;
  margin: 0 0.25rem;
}

.md-footer__inner .md-social__link:hover {
  color: var(--amp-red-bright);
}

/* ─────────────────────────────────────────────────────────────────────────────
   API REFERENCE STYLES
   ───────────────────────────────────────────────────────────────────────────── */
.api-method {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.8em;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.8em;
}

.api-method.get {
  background: rgba(34, 197, 94, 0.15);
  color: var(--amp-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.api-method.post {
  background: rgba(59, 130, 246, 0.15);
  color: var(--amp-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.api-method.put {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amp-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.api-method.patch {
  background: var(--amp-white-glow);
  color: var(--amp-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.api-method.delete {
  background: var(--amp-red-glow);
  color: var(--amp-red-bright);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  padding: 0.6em 1.2em;
  border-radius: 8px;
  display: inline-block;
  margin: 0.5em 0;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.required {
  background: var(--amp-red-glow);
  color: var(--amp-red-bright);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.status-badge.optional {
  background: var(--amp-elevated);
  color: var(--amp-text-dim);
  border: 1px solid var(--amp-border);
}
.status-badge.deprecated {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amp-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Version badge */
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.7em;
  background: var(--amp-red);
  color: var(--amp-white);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7em;
  font-weight: 600;
  margin-left: 0.6em;
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content fade-in */
.md-content__inner {
  animation: fade-in-up 0.5s ease-out;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--amp-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--amp-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--amp-text-dimmer);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SELECTION
   ───────────────────────────────────────────────────────────────────────────── */
::selection {
  background: var(--amp-red);
  color: var(--amp-white);
}

::-moz-selection {
  background: var(--amp-red);
  color: var(--amp-white);
}

/* ─────────────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
  body::before,
  .md-sidebar,
  .md-tabs,
  .md-header {
    display: none !important;
  }

  .md-main {
    background: white;
  }

  .md-typeset h1 {
    color: #000;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   GRID CARDS (Material Extension)
   ───────────────────────────────────────────────────────────────────────────── */
.md-typeset .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.md-typeset .grid.cards > ul {
  display: contents;
  list-style: none;
  padding: 0;
  margin: 0;
}

.md-typeset .grid.cards > ul > li {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  padding: 1.75rem;
  transition: all var(--amp-transition-fast);
  display: flex;
  flex-direction: column;
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--amp-red);
  box-shadow: var(--amp-shadow-md), 0 0 20px var(--amp-red-glow);
  transform: translateY(-2px);
}

.md-typeset .grid.cards > ul > li > p:first-child {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--amp-white);
}

.md-typeset .grid.cards > ul > li > p:first-child .twemoji,
.md-typeset .grid.cards > ul > li > p:first-child .emojione,
.md-typeset .grid.cards > ul > li > p:first-child svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.md-typeset .grid.cards > ul > li > hr {
  margin: 0.75rem 0;
  border-color: var(--amp-border-subtle);
}

.md-typeset .grid.cards > ul > li > p:not(:first-child) {
  color: var(--amp-text-dim);
  font-size: 0.925rem;
  line-height: 1.65;
  margin: 0 0 1rem 0;
  flex-grow: 1;
}

.md-typeset .grid.cards > ul > li > p:last-child {
  margin-bottom: 0;
}

.md-typeset .grid.cards > ul > li a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--amp-red-bright);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--amp-transition-fast);
}

.md-typeset .grid.cards > ul > li a:hover {
  color: var(--amp-white);
  gap: 0.5rem;
}

/* Grid cards responsive */
@media screen and (max-width: 60em) {
  .md-typeset .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
  }

  .md-typeset .grid.cards > ul > li {
    padding: 1.5rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .md-typeset .grid.cards > ul > li {
    padding: 1.25rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────────────────────── */
@media screen and (max-width: 76.25em) {
  .md-nav--primary .md-nav__link--active {
    border-left-color: transparent;
  }

  .md-content__inner {
    padding: 1.5rem 2rem;
  }

  .md-sidebar {
    top: 48px;
    height: calc(100vh - 48px);
  }

  .md-header__inner {
    padding: 0.875rem 1.5rem;
  }

  .md-tabs__inner {
    padding: 0 1.5rem;
  }
}

@media screen and (max-width: 60em) {
  .md-typeset h1 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
  }

  .md-typeset h2 {
    font-size: 1.35rem;
    margin-top: 2rem;
  }

  .md-typeset h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
  }

  .md-content__inner {
    padding: 1.25rem 1.5rem;
  }

  .md-tabs {
    top: 40px;
  }

  .md-sidebar {
    top: 80px;
    height: calc(100vh - 80px);
  }

  .md-header__inner {
    padding: 0.75rem 1rem;
  }

  .md-tabs__inner {
    padding: 0 1rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .md-content__inner {
    padding: 1rem;
  }

  .md-typeset h1 {
    font-size: 1.5rem;
  }

  .md-typeset h2 {
    font-size: 1.2rem;
  }

  /* Mobile header */
  .md-header__inner {
    padding: 0.5rem 0.75rem;
  }

  .md-header__title {
    font-size: 0.95rem;
  }

  /* Mobile typography */
  .md-typeset {
    font-size: 0.9rem;
  }

  .md-typeset p {
    margin-bottom: 1rem;
  }

  /* Mobile code blocks */
  .md-typeset pre > code {
    padding: 1rem;
    font-size: 0.75rem;
  }

  .code-lang-label {
    font-size: 0.55rem;
    padding: 0.15rem 0.35rem;
  }

  /* Mobile tables */
  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  /* Mobile admonitions */
  .md-typeset .admonition,
  .md-typeset details {
    margin: 1.5rem 0;
  }

  .md-typeset .admonition-title,
  .md-typeset details > summary {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  /* Mobile buttons */
  .md-typeset .md-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }

  /* Mobile search */
  .md-search__input {
    font-size: 1rem;
  }
}
