/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Dark theme (default) ──────────────────────── */
:root {
  --primary:       #ff5800;
  --primary-glow:  rgba(255,88,0,.35);
  --bg:            #000;
  --surface:       #0d0d0d;
  --surface-hover: #141414;
  --text:          #fff;
  --text-secondary:rgba(255,255,255,.75);
  --muted:         rgba(255,255,255,.45);
  --border:        rgba(255,255,255,.1);
  --border-hover:  rgba(255,255,255,.22);
  --code-bg:       rgba(255,255,255,.06);
  --nav-bg:        rgba(0,0,0,.75);
  --nav-h:         58px;
  --hero-glow:     rgba(255,88,0,.28);
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Light theme ───────────────────────────────── */
[data-theme="light"] {
  --bg:            #f9f9f9;
  --surface:       #fff;
  --surface-hover: #f5f5f5;
  --text:          #0a0a0a;
  --text-secondary:rgba(0,0,0,.75);
  --muted:         rgba(0,0,0,.45);
  --border:        rgba(0,0,0,.1);
  --border-hover:  rgba(0,0,0,.22);
  --code-bg:       rgba(0,0,0,.04);
  --nav-bg:        rgba(249,249,249,.85);
  --hero-glow:     rgba(255,88,0,.32);
}

/* ── Base ──────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Entrance animations ───────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* hero children stagger */
.hero-badge  { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .05s; }
.hero h1     { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .15s; }
.hero-sub    { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .25s; }
#cce-dl-hero { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .35s; }
#cce-dl-alts { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .42s; }
.hero-free   { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; animation-delay: .47s; }

/* scroll-triggered sections */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* accordion open animation */
details.accordion[open] .accordion-body {
  animation: fadeUp .2s ease both;
}

/* ── Top nav ───────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; padding: 0 1.75rem;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, border-color .3s ease;
}
.nav-brand {
  display: flex; align-items: center;
  text-decoration: none !important; flex-shrink: 0;
}
.nav-brand .logo-dark  { display: block; }
.nav-brand .logo-light { display: none; }
[data-theme="light"] .nav-brand .logo-dark  { display: none; }
[data-theme="light"] .nav-brand .logo-light { display: block; }

.nav-links {
  display: flex; align-items: center;
  flex: 1; padding: 0 1.5rem;
}
.nav-links .nav-link {
  padding: .35rem .75rem;
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none !important;
  transition: color .15s;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-links .nav-link:hover  { color: var(--text); }
.nav-links .nav-link.active { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem; line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface); }
.icon-sun  { display: flex; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: flex; }

.nav-cta {
  display: inline-flex; align-items: center;
  padding: .4rem 1.1rem;
  font-size: .875rem; font-weight: 600;
  background: var(--primary); color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: opacity .15s, box-shadow .15s;
  box-shadow: 0 0 0 0 var(--primary-glow);
}
.nav-cta:hover {
  opacity: .9;
  box-shadow: 0 0 16px var(--primary-glow);
  text-decoration: none !important;
}

/* ── Hero ──────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 5rem) 2rem 6rem;
  overflow: hidden;
}
/* radial glow behind hero content */
.hero::before {
  content: '';
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  width: 120vw; height: 120vw;
  max-width: 1400px; max-height: 1400px;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 55%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero-badge {
  display: inline-block;
  font-size: .76rem; font-weight: 500; letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3em 1.1em;
  margin-bottom: 1.75rem;
  transition: border-color .3s;
}
.hero h1 {
  font-size: clamp(2.8rem, 7.5vw, 5.25rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  /* gradient text */
  background: linear-gradient(160deg, #fff 40%, rgba(255,255,255,.55) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .hero h1 {
  background: linear-gradient(160deg, #0a0a0a 40%, rgba(0,0,0,.5) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(.95rem, 1.8vw, 1.1rem);
  color: var(--muted);
  max-width: 460px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.hero-dl-btn {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: .875rem 1.9rem;
  background: var(--primary); color: #fff !important;
  border-radius: 12px;
  font-size: 1rem; font-weight: 600;
  text-decoration: none !important;
  line-height: 1.2;
  transition: opacity .15s, box-shadow .2s, transform .15s;
  box-shadow: 0 4px 24px rgba(255,88,0,.25);
}
.hero-dl-btn:hover {
  opacity: 1;
  box-shadow: 0 8px 36px rgba(255,88,0,.45);
  transform: translateY(-1px);
  text-decoration: none !important;
}
.hero-dl-icon  { font-size: 1.3rem; line-height: 1; }
.hero-dl-label { display: block; }
.hero-dl-ver   { display: block; font-size: .72rem; font-weight: 400; opacity: .65; }

.hero-dl-fallback {
  display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center;
  margin-bottom: .65rem;
}
.hero-dl-fallback .hero-dl-btn:not(:first-child) {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.75) !important;
  box-shadow: none;
}
[data-theme="light"] .hero-dl-fallback .hero-dl-btn:not(:first-child) {
  border-color: rgba(0,0,0,.15);
  color: rgba(0,0,0,.6) !important;
}

.hero-alts { font-size: .82rem; color: var(--muted); margin-bottom: .4rem; }
.hero-alts a {
  color: var(--muted);
  text-decoration: none !important;
  transition: color .15s;
}
.hero-alts a:hover { color: var(--text); }
.hero-free { font-size: .82rem; color: var(--muted); }

/* ── Page sections ─────────────────────────────── */
.page-section { border-top: 1px solid var(--border); }

/* ── Prose wrapper ─────────────────────────────── */
.prose-wrap { max-width: 740px; margin: 0 auto; padding: 4rem 2rem 6rem; }
.prose h1 {
  font-size: 1.875rem; font-weight: 700; line-height: 1.2;
  margin-bottom: .4rem; letter-spacing: -.02em;
}
.prose h2 {
  font-size: 1.05rem; font-weight: 700; line-height: 1.3;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  margin: 2.5rem 0 .75rem;
}
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose p  { margin-bottom: .75rem; color: var(--text-secondary); }
.prose strong { font-weight: 600; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.prose li { margin-bottom: .2rem; color: var(--text-secondary); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: .84em;
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}
.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.prose pre code { background: none; border: none; padding: 0; font-size: .875rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .9rem; }
.prose th { background: var(--code-bg); font-weight: 600; text-align: left; padding: .5rem .75rem; border: 1px solid var(--border); }
.prose td { padding: .5rem .75rem; border: 1px solid var(--border); vertical-align: top; color: var(--text-secondary); }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 1rem 0; display: block; }
figure { margin: 1.25rem 0; }
figcaption { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.page-desc { color: var(--muted); font-size: .95rem; margin-bottom: 2.5rem; }

/* ── Callouts ──────────────────────────────────── */
.callout {
  display: flex; gap: .75rem;
  padding: .9rem 1rem;
  border-radius: 10px;
  margin: 1.25rem 0;
  font-size: .9rem; line-height: 1.65;
  border-left: 3px solid;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.65; }
.callout-note { background: rgba(255,88,0,.08);   border-color: var(--primary); }
.callout-warn { background: rgba(245,158,11,.08); border-color: #f59e0b; }
.callout-tip  { background: rgba(34,197,94,.08);  border-color: #22c55e; }

/* ── Steps ─────────────────────────────────────── */
.steps { margin: 1.25rem 0; }
.step { display: flex; gap: 1rem; margin-bottom: 1.25rem; position: relative; }
.step::after {
  content: '';
  position: absolute;
  left: 15px; top: 32px; bottom: -16px;
  width: 1px; background: var(--border);
}
.step:last-child::after { display: none; }
.step-num {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  z-index: 1; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255,88,0,.3);
}
.step-body { flex: 1; padding-top: 4px; }
.step-title { font-weight: 600; margin-bottom: .3rem; }
.step-body p, .step-body ul { margin-bottom: .4rem; }

/* ── Cards ─────────────────────────────────────── */
.card-grid { display: grid; gap: .75rem; margin: 1.25rem 0; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none !important;
  color: var(--text) !important;
  display: block;
  background: var(--surface);
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: rgba(255,88,0,.4);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.card-title { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.card-desc  { font-size: .84rem; color: var(--muted); line-height: 1.5; }

/* ── Inline download buttons ───────────────────── */
.dl-buttons { display: flex; flex-wrap: wrap; gap: .65rem; }
.dl-btn {
  display: inline-flex; align-items: center; gap: .65rem;
  border-radius: 10px; padding: .7rem 1.25rem;
  font-size: .9rem; font-weight: 600;
  text-decoration: none !important; line-height: 1.25;
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.dl-btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary {
  background: var(--primary); color: #fff !important;
  box-shadow: 0 4px 16px rgba(255,88,0,.3);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(255,88,0,.45); }
.btn-outline  { border: 1.5px solid var(--border-hover); color: var(--text-secondary) !important; background: transparent; }
.dl-icon  { font-size: 1.2rem; line-height: 1; }
.dl-label { display: block; }
.dl-ver   { display: block; font-size: .71rem; font-weight: 400; opacity: .7; }

/* ── Accordion ─────────────────────────────────── */
details.accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: .4rem;
  overflow: hidden;
  background: var(--surface);
  transition: border-color .2s, background .2s;
}
details.accordion:hover { border-color: var(--border-hover); }
details.accordion[open] { border-color: rgba(255,88,0,.3); }
details.accordion summary {
  padding: 1rem 1.1rem;
  font-weight: 500; font-size: .925rem;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none; gap: 1rem;
  color: var(--text);
  transition: color .15s;
}
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary::after {
  content: '+'; font-size: 1.15rem; line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s cubic-bezier(.22,1,.36,1), color .15s;
  font-weight: 300;
}
details.accordion[open] summary::after { transform: rotate(45deg); color: var(--primary); }
details.accordion[open] summary { color: var(--text); }
.accordion-body {
  padding: .85rem 1.1rem 1.1rem;
  font-size: .9rem; line-height: 1.7;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}
.accordion-body p   { margin: .4rem 0; }
.accordion-body ul  { padding-left: 1.25rem; margin: .4rem 0; }
.accordion-body li  { margin-bottom: .15rem; }

/* ── Releases ──────────────────────────────────── */
.release { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.release:last-child { border-bottom: none; }
.release-header { display: flex; align-items: center; gap: .65rem; margin-bottom: .65rem; }
.release-ver { font-size: 1.1rem; font-weight: 700; }
.release-badge { font-size: .68rem; font-weight: 600; padding: .2em .65em; border-radius: 999px; background: var(--primary); color: #fff; }
.release-badge.old { background: var(--code-bg); color: var(--muted); border: 1px solid var(--border); }
.release-downloads { display: flex; flex-wrap: wrap; gap: .45rem; margin: .6rem 0; }
.release-dl {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .84rem; padding: .3rem .75rem;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  background: var(--surface);
  transition: border-color .15s, color .15s, background .15s;
}
.release-dl:hover { border-color: var(--primary); color: var(--text) !important; background: var(--surface-hover); }
.release-notes { font-size: .9rem; color: var(--text-secondary); }
.release-notes ul { padding-left: 1.25rem; margin-top: .4rem; }
.release-notes li { margin-bottom: .2rem; }

/* ── Tabs ──────────────────────────────────────── */
.tab-group { margin: 1.25rem 0; }
.tab-btns { display: flex; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab-btn {
  padding: .4rem .85rem;
  font-size: .875rem; font-weight: 500;
  font-family: var(--font);
  border: none; background: none; cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Footer ────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  transition: border-color .3s;
}
.site-footer a { color: var(--muted); transition: color .15s; }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ── Mobile toggle ─────────────────────────────── */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; padding: 0;
  transition: border-color .15s;
}
.mobile-toggle:hover { border-color: var(--border-hover); }
.mobile-toggle span { display: block; width: 16px; height: 1.5px; background: var(--muted); transition: background .15s; }
.mobile-toggle:hover span { background: var(--text); }

.mobile-menu {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: .5rem 0;
  animation: fadeIn .15s ease;
}
.mobile-menu .nav-link {
  display: block; padding: .7rem 1.75rem;
  font-size: .95rem; color: var(--muted);
  text-decoration: none !important; transition: color .12s;
}
.mobile-menu .nav-link:hover { color: var(--text); }

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 98;
}
.menu-open .mobile-menu { display: block; }
.menu-open .overlay     { display: block; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links       { display: none; }
  .nav-cta         { display: none; }
  .mobile-toggle   { display: flex; }
  .hero { padding: calc(var(--nav-h) + 3rem) 1.25rem 4rem; }
  .hero h1 { font-size: 2.5rem; letter-spacing: -.025em; }
  .hero-dl-fallback { flex-direction: column; align-items: center; }
  .prose-wrap { padding: 2.5rem 1.25rem 4rem; }
  .card-grid.cols-2,
  .card-grid.cols-3 { grid-template-columns: 1fr; }
  .dl-buttons { flex-direction: column; align-items: flex-start; }
}
