/* Page background */
body {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(0,0,0,0.035), transparent 60%),
    radial-gradient(900px 700px at 100% 110%, rgba(0,0,0,0.05), transparent 55%),
    linear-gradient(135deg, #F4F1EB 0%, #EFEAE2 50%, #E9E3D9 100%);
}

/* ====== DOCS (unchanged) ================================================= */
#docs {
  font-family: "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
  background: #FAF9F6;
  color: #1F2933;
  margin: 2rem auto;
  max-width: 800px;
  padding: 0 1rem 3rem 1rem;
}

#docs h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(90deg, #B45309, #D97706, #B45309);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 6s linear infinite;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
}

@keyframes shine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#docs h1:hover {
  transform: scale(1.05);
  text-shadow: 3px 3px 10px rgba(180,83,9,0.6);
  transition: all 0.3s ease;
}

#docs h2 {
  color: #444;
  margin-top: 2rem;
  border-left: 4px solid #B45309;
  padding-left: 0.5rem;
}

#docs p { margin: 1rem 0; }
#docs ul { margin: 0.5rem 0 1.5rem 1.2rem; }

#docs code {
  background: #F3EEE4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.95em;
}

#docs pre {
  background: #1e1e1e;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  margin: 1rem 0;
}

#docs pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ====== SIDEBAR (outside #docs) ========================================= */
:root {
  --docs-max: 800px;  /* match #docs max-width */
  --sidebar-w: 180px;
  --sidebar-gap: 120px;
}

/* floating parchment panel */
#sidebar {
  position: fixed;
  top: 128px;
  left: max(
    16px,
    calc(50vw - (var(--docs-max) / 2 + var(--sidebar-gap) + var(--sidebar-w)))
  );
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: .35rem;

  background: #EFEAE2;                     /* NEW: panel color */
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: .6rem .75rem;                   /* uniform padding */
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 10;
}

/* sidebar links */
#sidebar a {
  display: block;
  padding: .35rem .5rem;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;                          /* darker for contrast on panel */
  white-space: nowrap;
}
#sidebar a:hover {
  background: rgba(180,83,9,.10);          /* rust tint */
  color: #B45309;
}
#sidebar a.active {
  background: rgba(180,83,9,.16);
  color: #8A4B21;
  font-weight: 600;
}

/* Collapse sidebar to a top bar on narrow viewports */
@media (max-width: 1200px) {
  #sidebar {
    position: static;
    width: auto;
    padding: 0.5rem 0 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex-direction: row;
    gap: .75rem;
    justify-content: center;
  }
}



/* ===== Feature Carousel ===== */

.carousel {
  position: relative;
  margin: 2rem 0;
  max-width: 820px;
  margin-inline: auto;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.carousel .viewport {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  background: #FAF9F6;                  /* parchment panel background */
  border: 1px solid rgba(0,0,0,.08);
}

.carousel .track {
  display: flex;
  transition: transform 380ms ease;
  will-change: transform;
}

.carousel .slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* fixed-ratio media frame */
.carousel .frame {
  width: min(100%, 900px);
  aspect-ratio: 16 / 9;
  background: #EFEAE2;                  /* soft parchment background */
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.carousel .frame > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel .slide p {
  margin: 0;
  font-weight: 600;
  text-align: center;
  color: #374151;                       /* matches sidebar text color */
  min-height: 2rem;
}

/* arrows */
.carousel .nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  border: none;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(180,83,9,.8);         /* rust accent */
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: background 0.2s ease;
}
.carousel .nav:hover { background: rgba(180,83,9,1); }
.carousel .prev { left: 8px; }
.carousel .next { right: 8px; }

/* dots */
.carousel .dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.carousel .dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(180,83,9,.35);        /* muted rust */
  cursor: pointer;
  padding: 0;
  line-height: 0;
  display: inline-block;
  transition: transform 0.25s ease, background 0.25s ease;
}

.carousel .dots button:hover {
  background: rgba(180,83,9,.55);
}

.carousel .dots button[aria-current="true"] {
  background: #B45309;                   /* solid rust when active */
  transform: scale(1.3);
}

/* responsive tweaks */
@media (max-width: 640px) {
  .carousel .frame { width: 100%; }
}
@media (max-width: 380px) {
  .carousel .frame { width: 92vw; }
}

/* option to force crop instead of letterbox */
.carousel .frame.cover > img { object-fit: cover; }
