/* Flowing Code brand palette (mirrors docs.flowingcode.com) */
:root {
  --fc-purple: #911DC3;
  --fc-purple-light: #B441F9;
  --fc-purple-dark: #331a4e;
  --fc-purple-deeper: #1f0f30;
  --fc-pink: #C679FF;

  --bg: #ffffff;
  --bg-soft: #faf7fd;
  --bg-card: #ffffff;
  --bg-code: #1f0f30;
  --fg: #1c1226;
  --fg-muted: #5b4d6a;
  --border: #ece6f3;

  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(51, 26, 78, .06);
  --shadow-md: 0 8px 24px rgba(51, 26, 78, .08);

  --font-sans: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #160a23;
    --bg-soft: #1d1030;
    --bg-card: #251638;
    --bg-code: #0e0518;
    --fg: #f3eafa;
    --fg-muted: #b9a8cc;
    --border: #34234c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Disable the rubber-band overscroll bounce at the page edges. */
  overscroll-behavior: none;
}

img { max-width: 100%; display: block; }

a {
  color: var(--fc-purple);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
a:hover { color: var(--fc-purple-light); border-bottom-color: currentColor; }

code, pre {
  font-family: var(--font-mono);
  font-size: .92em;
}
:not(pre) > code {
  background: rgba(145, 29, 195, .08);
  color: var(--fc-purple);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(145, 29, 195, .15);
}
@media (prefers-color-scheme: dark) {
  :not(pre) > code {
    background: rgba(180, 65, 249, .15);
    color: #d8b3ff;
    border-color: rgba(180, 65, 249, .3);
  }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--fc-purple-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border: 0;
}
.brand img { height: 28px; }
.brand-suffix {
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .9;
}
.header-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.header-nav a {
  color: rgba(255, 255, 255, .85);
  font-weight: 500;
  font-size: .94rem;
  border: 0;
}
.header-nav a:hover { color: #fff; }

@media (max-width: 640px) {
  .header-nav { gap: 14px; }
  .header-nav a:nth-child(2) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 64px;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(180, 65, 249, .22), transparent 60%),
    radial-gradient(900px 480px at 10% 10%, rgba(116, 0, 151, .20), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--fc-purple);
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.grad {
  background: linear-gradient(90deg, #740097 0%, #911DC3 35%, #B441F9 60%, #C679FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 1.12rem;
  color: var(--fg-muted);
  max-width: 760px;
  margin: 0 0 28px;
}
.lede strong { color: var(--fg); font-weight: 600; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--fc-purple);
  color: #fff;
}
.btn-primary:hover { background: var(--fc-purple-light); color: #fff; border-bottom-color: transparent; }
.btn-ghost {
  background: transparent;
  color: var(--fc-purple);
  border-color: rgba(145, 29, 195, .35);
}
.btn-ghost:hover { background: rgba(145, 29, 195, .08); border-bottom-color: transparent; }

/* ---------- Feature cards ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  margin-bottom: 56px;
  position: relative;
  z-index: 1;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.feature h3 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}
.feature p { margin: 0; color: var(--fg-muted); font-size: .95rem; }
.feature-icon {
  font-size: 1.4rem;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(145, 29, 195, .1);
  color: var(--fc-purple);
  border-radius: 10px;
}
@media (max-width: 800px) {
  .features { grid-template-columns: 1fr; }
}

/* ---------- Section spacing ---------- */
section.container { padding-top: 32px; padding-bottom: 32px; }
section.container h2 {
  font-size: 1.7rem;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
section.container > p { color: var(--fg-muted); margin-top: 0; }

/* ---------- Code cards ---------- */
.code-card {
  background: var(--bg-code);
  color: #f4ecff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #2a1640;
  margin: 14px 0 18px;
  box-shadow: var(--shadow-md);
}
.code-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--font-mono);
  font-size: .82rem;
  color: #d8c4ee;
}
.code-card pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.55;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 65, 249, .35) transparent;
}
.code-card code { color: #f4ecff; }

/* WebKit scrollbar inside code blocks — transparent track so it blends with
   the dark code background instead of showing the default white. */
.code-card pre::-webkit-scrollbar {
  height: 8px;
  width: 8px;
  background: transparent;
}
.code-card pre::-webkit-scrollbar-track {
  background: transparent;
}
.code-card pre::-webkit-scrollbar-thumb {
  background: rgba(180, 65, 249, .35);
  border-radius: 6px;
}
.code-card pre::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 65, 249, .55);
}
.code-card pre::-webkit-scrollbar-corner {
  background: transparent;
}

.copy-btn {
  background: rgba(180, 65, 249, .15);
  color: #f0dfff;
  border: 1px solid rgba(180, 65, 249, .35);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background .15s ease, color .15s ease;
}
.copy-btn:hover { background: rgba(180, 65, 249, .3); color: #fff; }
.copy-btn.copied { background: #2ea043; border-color: #2ea043; color: #fff; }

.hint {
  font-size: .92rem;
  color: var(--fg-muted);
  background: rgba(145, 29, 195, .05);
  border-left: 3px solid var(--fc-purple);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}
@media (prefers-color-scheme: dark) {
  .hint { background: rgba(180, 65, 249, .08); }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .9rem;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--fg); background: rgba(145, 29, 195, .06); }
.tab.active {
  color: var(--fc-purple);
  background: var(--bg-card);
  border-color: var(--border);
  border-bottom-color: var(--bg-card);
  position: relative;
  top: 1px;
}
@media (prefers-color-scheme: dark) {
  .tab.active { color: #d8b3ff; }
}

.panel { display: none; }
.panel.active { display: block; }
.panel h3 {
  font-size: 1.25rem;
  margin: 8px 0 10px;
}
.panel p { margin: 8px 0; }
.panel ul.paths { padding-left: 18px; }
.panel ul.paths li { margin: 4px 0; color: var(--fg-muted); }

/* ---------- Verify section ---------- */
.verify blockquote {
  margin: 14px 0;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-left: 3px solid var(--fc-purple-light);
  border-radius: 0 8px 8px 0;
  color: var(--fg);
  font-style: italic;
}
@media (prefers-color-scheme: dark) {
  .verify blockquote { background: rgba(255,255,255,.04); }
}

/* ---------- Resources ---------- */
.resource-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.resource-grid a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--fg);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.resource-grid a:hover {
  border-color: var(--fc-purple-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--fc-purple-light);
}
.resource-grid strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}
.resource-grid span { color: var(--fg-muted); font-size: .93rem; }
@media (max-width: 700px) {
  .resource-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 28px 0;
  background: var(--fc-purple-dark);
  color: rgba(255,255,255,.75);
}
.site-footer a { color: #d8b3ff; border-bottom-color: transparent; }
.site-footer a:hover { color: #fff; border-bottom-color: currentColor; }
.footer-inner p { margin: 0; font-size: .9rem; }

.muted { color: var(--fg-muted); }
