/* FourCore documentation — a restrained, product-led layer on Starlight. */
:root {
  --fc-blue: #3f66ff;
  --fc-blue-bright: #6285ff;
  --fc-cyan: #63dcff;
  --fc-ink: #0b1020;
  --fc-border: rgba(65, 87, 140, 0.17);
  --fc-radius: 12px;
  --sl-font: "Inter Tight", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sl-content-width: 48rem;
  --sl-sidebar-width: 18rem;
  --sl-nav-height: 4.25rem;
  --sl-content-gap-y: 1.15rem;
}

:root[data-theme="light"] {
  color-scheme: light;
  --sl-color-accent-high: #223ebd;
  --sl-color-accent: var(--fc-blue);
  --sl-color-accent-low: #e8edff;
  --sl-color-text-accent: #3157e7;
  --sl-color-white: #0b1020;
  --sl-color-gray-1: #222b41;
  --sl-color-gray-2: #49536a;
  --sl-color-gray-3: #687289;
  --sl-color-gray-4: #99a2b5;
  --sl-color-gray-5: #d7ddea;
  --sl-color-gray-6: #e9edf5;
  --sl-color-gray-7: #f7f9fd;
  --sl-color-black: #ffffff;
  --sl-color-bg: #f7f9fd;
  --sl-color-bg-nav: rgba(255, 255, 255, 0.96);
  --sl-color-bg-sidebar: #f4f7fc;
  --sl-color-bg-inline-code: #edf1fa;
  --sl-color-hairline: #dce2ee;
  --sl-color-hairline-light: #e8ecf3;
  --sl-color-hairline-shade: #d4dbe8;
  --fc-surface: #ffffff;
  --fc-muted-surface: #eef3fb;
  --fc-shadow: 0 16px 42px rgba(17, 31, 68, 0.08);
  --fc-shadow-soft: 0 8px 24px rgba(17, 31, 68, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sl-color-accent-high: #d8e1ff;
  --sl-color-accent: var(--fc-blue-bright);
  --sl-color-accent-low: #172556;
  --sl-color-text-accent: #88a4ff;
  --sl-color-white: #f6f8ff;
  --sl-color-gray-1: #dce2f0;
  --sl-color-gray-2: #aeb8cc;
  --sl-color-gray-3: #858fa5;
  --sl-color-gray-4: #667087;
  --sl-color-gray-5: #343e55;
  --sl-color-gray-6: #20293d;
  --sl-color-gray-7: #11182a;
  --sl-color-black: #070b16;
  --sl-color-bg: #090e1c;
  --sl-color-bg-nav: rgba(9, 14, 28, 0.96);
  --sl-color-bg-sidebar: #0b1121;
  --sl-color-bg-inline-code: #151e32;
  --sl-color-hairline: #242e44;
  --sl-color-hairline-light: #1b2539;
  --sl-color-hairline-shade: #2d3850;
  --fc-border: rgba(137, 158, 211, 0.18);
  --fc-surface: #0d1426;
  --fc-muted-surface: #121c31;
  --fc-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
  --fc-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.22);
}

html { background: var(--sl-color-bg); }

body {
  letter-spacing: -0.006em;
  background: radial-gradient(circle at 50% -14rem, rgba(71, 104, 255, 0.09), transparent 32rem), var(--sl-color-bg);
}

/* Header and search */
.page > header {
  border-bottom: 1px solid var(--sl-color-hairline-light);
  background: var(--sl-color-bg-nav);
  box-shadow: 0 1px 0 rgba(7, 16, 39, 0.02);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.page > header::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent 8%, rgba(76, 111, 255, 0.55) 50%, transparent 92%);
  pointer-events: none;
}

.site-title { gap: 0.65rem !important; }

.site-title::after {
  content: "DOCS";
  padding: 0.3rem 0.48rem 0.27rem;
  border: 1px solid var(--fc-border);
  border-radius: 5px;
  color: var(--sl-color-gray-3);
  font-family: Unbounded, sans-serif;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
}

.site-title img {
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--fc-border), 0 6px 18px rgba(63, 102, 255, 0.18);
}

.fourcore-docs-wordmark {
  color: var(--sl-color-white) !important;
  font-size: 0.92rem;
  letter-spacing: 0.055em;
}

site-search button {
  min-height: 2.65rem;
  border: 1px solid var(--fc-border) !important;
  border-radius: 9px !important;
  background: var(--fc-surface) !important;
  box-shadow: 0 1px 2px rgba(13, 23, 48, 0.04) !important;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

site-search button:hover {
  border-color: color-mix(in srgb, var(--fc-blue) 48%, var(--fc-border)) !important;
  box-shadow: 0 4px 18px rgba(63, 102, 255, 0.1) !important;
}

/* Sidebar navigation */
#starlight__sidebar {
  border-inline-end: 1px solid var(--sl-color-hairline-light);
  background: var(--sl-color-bg-sidebar);
}

.sidebar-content { padding-top: 1.4rem !important; }
.sidebar-content .top-level > li + li { margin-top: 1.15rem; }

.sidebar-content .large,
.sidebar-content .group-label {
  color: var(--sl-color-gray-2);
  font-size: 0.71rem !important;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.sidebar-content a {
  margin-block: 0.12rem;
  padding-block: 0.46rem !important;
  border-radius: 7px !important;
  color: var(--sl-color-gray-2) !important;
  font-size: 0.88rem !important;
  font-weight: 480;
  transition: color 130ms ease, background-color 130ms ease, transform 130ms ease;
}

.sidebar-content a:hover {
  color: var(--sl-color-white) !important;
  background: color-mix(in srgb, var(--sl-color-accent-low) 62%, transparent);
}

.sidebar-content [aria-current="page"] {
  color: var(--sl-color-accent-high) !important;
  background: var(--sl-color-accent-low) !important;
  box-shadow: inset 3px 0 0 var(--fc-blue);
  font-weight: 650 !important;
}

/* Article and content hierarchy */
.main-pane main { padding-bottom: 5rem; }
.content-panel { border-color: var(--sl-color-hairline-light) !important; }

main h1[data-page-title] {
  max-inline-size: 18ch;
  margin-top: 0.5rem !important;
  color: var(--sl-color-white);
  font-size: clamp(2.25rem, 5vw, 3.45rem) !important;
  font-weight: 690 !important;
  letter-spacing: -0.045em;
  line-height: 1.03 !important;
}

.sl-markdown-content {
  color: var(--sl-color-gray-2);
  font-size: 1.035rem;
  line-height: 1.72;
}

.sl-markdown-content :is(h2, h3, h4):not(:where(.not-content *)) {
  color: var(--sl-color-white);
  font-weight: 670;
  letter-spacing: -0.026em;
}

.sl-markdown-content h2:not(:where(.not-content *)) {
  padding-top: 0.35rem;
  font-size: clamp(1.58rem, 3vw, 2rem);
}

.sl-markdown-content h3:not(:where(.not-content *)) { font-size: clamp(1.22rem, 2vw, 1.4rem); }
.sl-markdown-content strong { color: var(--sl-color-gray-1); font-weight: 670; }

.sl-markdown-content a:not(:where(.not-content *)) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.sl-markdown-content a:hover:not(:where(.not-content *)) { color: var(--sl-color-accent-high); }
.sl-markdown-content :is(ul, ol):not(:where(.not-content *)) { padding-inline-start: 1.35rem; }
.sl-markdown-content li::marker { color: var(--fc-blue); font-weight: 650; }
.sl-markdown-content hr:not(:where(.not-content *)) { margin-block: 2.5rem; }

.sl-markdown-content code:not(:where(.not-content *)) {
  border: 1px solid var(--fc-border);
  border-radius: 5px;
}

.starlight-aside {
  border: 1px solid var(--fc-border) !important;
  border-inline-start: 3px solid var(--sl-color-asides-border) !important;
  border-radius: 10px;
  box-shadow: none;
}

/* Product screenshots: deliberate frame, predictable size, full-size link. */
.fc-shot {
  max-inline-size: 46rem;
  margin: clamp(1.5rem, 3vw, 2.25rem) auto;
  padding: clamp(0.4rem, 1vw, 0.65rem);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  background: linear-gradient(135deg, rgba(99, 220, 255, 0.07), transparent 42%), var(--fc-surface);
  box-shadow: var(--fc-shadow);
}

.fc-shot__open {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--fc-muted-surface);
}

.fc-shot img {
  inline-size: auto !important;
  max-inline-size: 100%;
  max-block-size: min(46rem, 72vh);
  margin-inline: auto;
  object-fit: contain;
  object-position: top center;
}

.fc-shot figcaption {
  max-inline-size: 68ch;
  margin: 0;
  padding: 0.72rem 0.45rem 0.2rem;
  color: var(--sl-color-gray-3);
  font-size: 0.84rem;
  line-height: 1.48;
  text-align: left;
}

.fc-shot--pending { display: none; }

/* Landing page */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: 1.25rem;
  padding: 5.25rem clamp(2rem, 5vw, 4rem) 3.75rem !important;
  border: 1px solid rgba(127, 154, 255, 0.24);
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(77, 113, 255, 0.48), transparent 21rem),
    radial-gradient(circle at 72% 115%, rgba(63, 219, 255, 0.16), transparent 20rem),
    linear-gradient(132deg, #070b18 0%, #0b1430 56%, #101b46 100%);
  box-shadow: 0 18px 50px rgba(10, 20, 55, 0.18);
}

.hero::before {
  position: absolute;
  inset: 2.2rem auto auto clamp(2rem, 5vw, 4rem);
  content: "FOURCORE SUPPORT";
  color: #8ca4ff;
  font-family: Unbounded, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.hero::after {
  position: absolute;
  inset: -11rem -7rem auto auto;
  inline-size: 28rem;
  block-size: 28rem;
  border: 1px solid rgba(137, 165, 255, 0.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 5rem rgba(109, 140, 255, 0.035), 0 0 0 10rem rgba(109, 140, 255, 0.025);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }
.hero h1 {
  max-inline-size: 14ch;
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(2.65rem, 5.5vw, 4.6rem) !important;
  font-weight: 660 !important;
  letter-spacing: -0.052em;
  line-height: 0.98 !important;
}

.hero .tagline {
  max-inline-size: 39rem;
  color: #bdc8df;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.58;
}

.hero .actions { margin-top: 0.35rem; }

.sl-link-button {
  min-height: 2.9rem;
  border-radius: 8px !important;
  font-weight: 650;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.hero .sl-link-button.primary {
  border-color: var(--fc-blue) !important;
  color: #fff !important;
  background: linear-gradient(135deg, #4a70ff, #3155e5) !important;
  box-shadow: 0 8px 22px rgba(49, 85, 229, 0.24);
}

.hero .sl-link-button.secondary {
  border-color: var(--fc-border) !important;
  background: var(--fc-surface) !important;
}

.hero .sl-link-button.minimal {
  color: #e2e8f6 !important;
}

.sl-link-button:hover { transform: translateY(-2px); }
.hero + .sl-markdown-content { margin-top: 2.25rem; }

.hero + .sl-markdown-content > .sl-heading-wrapper:first-child {
  margin-bottom: 1.25rem;
}

.hero + .sl-markdown-content > .sl-heading-wrapper:first-child h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.card-grid {
  counter-reset: fc-guide;
  gap: 0.85rem !important;
}

.card-grid .card {
  position: relative;
  min-height: 9rem;
  counter-increment: fc-guide;
  border: 1px solid var(--fc-border) !important;
  border-radius: 10px !important;
  background: var(--fc-surface) !important;
  box-shadow: none !important;
  padding: 1.4rem 1.45rem 1.35rem 4.7rem !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.card-grid .card::before {
  position: absolute;
  inset: 1.45rem auto auto 1.45rem;
  content: "0" counter(fc-guide);
  color: var(--fc-blue);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.card-grid .card::after {
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 3px;
  border-radius: 10px 0 0 10px;
  content: "";
  background: var(--fc-blue);
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity 160ms ease, transform 160ms ease;
}

.card-grid .card:hover {
  border-color: color-mix(in srgb, var(--fc-blue) 48%, var(--fc-border)) !important;
  box-shadow: var(--fc-shadow-soft) !important;
  transform: translateY(-2px);
}

.card-grid .card:hover::after {
  opacity: 1;
  transform: scaleY(1);
}

.card-grid .card .icon { display: none !important; }

.card-grid .card .title {
  color: var(--sl-color-white);
  font-size: 1.08rem;
  font-weight: 670;
}

.card-grid .card .body {
  color: var(--sl-color-gray-2);
  font-size: 0.98rem !important;
  line-height: 1.58;
}

/* On-page navigation and pagination */
.right-sidebar,
.right-sidebar-panel { border-color: var(--sl-color-hairline-light) !important; }

.right-sidebar-panel h2 {
  color: var(--sl-color-gray-3);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.right-sidebar-panel a {
  border-inline-start: 2px solid transparent;
  color: var(--sl-color-gray-3) !important;
  line-height: 1.45;
}

.right-sidebar-panel a:hover,
.right-sidebar-panel a[aria-current="true"] {
  border-inline-start-color: var(--fc-blue);
  color: var(--sl-color-white) !important;
}

.pagination-links a {
  border: 1px solid var(--fc-border) !important;
  border-radius: var(--fc-radius) !important;
  background: var(--fc-surface) !important;
  box-shadow: none !important;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.pagination-links a:hover {
  border-color: color-mix(in srgb, var(--fc-blue) 48%, var(--fc-border)) !important;
  box-shadow: var(--fc-shadow-soft) !important;
  transform: translateY(-2px);
}

.meta { color: var(--sl-color-gray-3); font-size: 0.82rem; }

:where(a, button, summary, select):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--fc-blue) 68%, transparent) !important;
  outline-offset: 3px;
}

@media (width >= 50rem) {
  .header:where(.astro-by6fddyj) {
    grid-template-columns: minmax(13rem, 1fr) minmax(20rem, 36rem) minmax(10rem, 1fr);
    column-gap: 1.5rem;
  }

  .hero { margin-inline: auto; }
}

@media (max-width: 49.99rem) {
  :root { --sl-nav-height: 4rem; }

  .page > header {
    background: var(--sl-color-bg-nav) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-title::after { display: none; }

  mobile-starlight-toc {
    border-bottom: 1px solid var(--sl-color-hairline-light);
    background: var(--fc-surface) !important;
    box-shadow: 0 6px 16px rgba(17, 31, 68, 0.05);
  }

  mobile-starlight-toc summary {
    min-height: 3rem;
    color: var(--sl-color-gray-2);
    font-size: 0.82rem;
    font-weight: 650;
  }

  main h1[data-page-title] { max-inline-size: none; font-size: clamp(2.1rem, 11vw, 2.85rem) !important; }
  .sl-markdown-content { font-size: 1rem; line-height: 1.68; }

  .hero {
    margin-top: 0.75rem;
    padding: 4.65rem 1.4rem 2.5rem !important;
    border-radius: 12px;
  }

  .hero::before {
    inset: 1.8rem auto auto 1.4rem;
    font-size: 0.62rem;
  }

  .hero::after {
    inset: -14rem -13rem auto auto;
  }

  .hero h1 {
    max-inline-size: 10ch;
    font-size: clamp(2.35rem, 12vw, 3.2rem) !important;
  }

  .hero .actions {
    gap: 0.25rem 1rem;
  }

  .card-grid .card {
    min-height: 0;
    padding: 1.25rem 1.25rem 1.25rem 3.9rem !important;
  }

  .card-grid .card::before {
    inset: 1.3rem auto auto 1.2rem;
  }

  .fc-shot {
    margin-block: 1.35rem 1.85rem;
    padding: 0.3rem;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(17, 31, 68, 0.08);
  }

  .fc-shot__open { border-radius: 7px; }
  .fc-shot img { max-block-size: 54svh; }
  .fc-shot img[width="585"] { max-inline-size: min(15rem, 76vw); }

  .fc-shot figcaption {
    padding: 0.65rem 0.45rem 0.25rem;
    font-size: 0.8rem;
  }

  .pagination-links { gap: 0.65rem; }
}

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

@media print {
  .page > header::after, .hero::before { display: none; }
  .fc-shot { box-shadow: none; }
}
