/* ==========================================================================
   Aeolian Wind Drone — site.css
   A sibling of the plugin editor. Every colour below is a token from
   Docs/DESIGN.md §3 (AeolianLookAndFeel constants) — no ad-hoc colours.
   Spacing rides a 4 px base unit throughout.
   ========================================================================== */

:root {
  /* Wood + accent (chrome) */
  --maple-mid:        #C8A96E;  /* kMapleMid — page ground            */
  --maple-hi:         #DEC48A;  /* kMapleHi — highlight ridge         */
  --maple-lo:         #B89254;  /* kMapleLo — trough                  */
  --cherry-frame:     #2B1A0D;  /* kCherryFrameDark — chrome, ink     */
  --cherry-divider:   #3D1A0E;  /* kCherryDivider — rules, dark text  */
  --cherry-mid:       #5A3A1E;  /* kCherryMid                         */
  --cherry-hi:        #9C4A32;  /* kCherryHi — hover warmth           */
  --cherry-glow:      #C85C3A;  /* kCherryGlow — top-lit cherry edge  */
  --brass:            #B8924A;  /* kBrass — rules, accents, underlines*/

  /* Preset-inset panel style (dark cards) */
  --inset-fill:       #2E1208;
  --inset-border:     #7A3520;

  /* Jewel red — the bulb. A rare accent ONLY (one glowing dot). */
  --lens-bulb:        #FF2A10;  /* kLensBulb    */
  --lens-hot-core:    #FFE3C4;  /* kLensHotCore */

  /* Type */
  --font-display: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Mono", ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--cherry-frame);
  background-color: var(--maple-mid);
  /* faint top-lit maple sheen, like the editor's grain highlight */
  background-image: linear-gradient(180deg, var(--maple-hi) 0, var(--maple-mid) 480px);
  background-repeat: no-repeat;
}

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--cherry-frame);
  color: var(--maple-hi);
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --------------------------------------------------------------------------
   Header — cherry chrome with a brass hairline, like the soundbox frame
   -------------------------------------------------------------------------- */

.site-header {
  background: linear-gradient(180deg, var(--cherry-mid), var(--cherry-frame));
  border-bottom: 2px solid var(--brass);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.brand-roundel {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.12em;      /* the nameplate's wide Cinzel tracking */
  text-transform: uppercase;
  color: var(--maple-hi);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

.site-nav a {
  display: inline-block;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--maple-hi);
  border-bottom: 2px solid transparent;
  opacity: 0.85;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  opacity: 1;
  border-bottom-color: var(--brass);
}

.site-nav a.active {
  opacity: 1;
  color: var(--maple-hi);
  border-bottom-color: var(--brass);
}

/* --------------------------------------------------------------------------
   Layout — content | versions (landing), toc | content | versions (guide)
   -------------------------------------------------------------------------- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.layout.with-toc {
  grid-template-columns: 220px minmax(0, 1fr) 280px;
}

main { min-width: 0; }

/* --------------------------------------------------------------------------
   Shared panel heading — the GUI's caps brass section header
   -------------------------------------------------------------------------- */

.panel-heading {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}

/* The one sanctioned jewel-red accent: a single glowing bulb dot. */
.jewel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  vertical-align: 1px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%,
              var(--lens-hot-core) 0,
              var(--lens-bulb) 55%,
              #7a1408 100%);
  box-shadow: 0 0 6px 1px rgba(255, 42, 16, 0.55);
}

/* --------------------------------------------------------------------------
   Version-history panel — the Preset-inset style, independently scrollable
   -------------------------------------------------------------------------- */

.versions {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px 20px 20px;
  background: rgba(46, 18, 8, 0.92);        /* preset-inset fill  */
  border: 1px solid var(--inset-border);     /* preset-inset border */
  border-radius: 6px;
  color: var(--maple-hi);
  scrollbar-width: thin;
  scrollbar-color: var(--brass) var(--inset-fill);   /* brass thumb, like #587 */
}

.versions::-webkit-scrollbar { width: 8px; }
.versions::-webkit-scrollbar-track { background: var(--inset-fill); }
.versions::-webkit-scrollbar-thumb {
  background: var(--brass);
  border-radius: 4px;
}

.release {
  padding: 16px 0;
  border-top: 1px solid rgba(184, 146, 74, 0.3);  /* brass hairline */
}

.release-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.release-version {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--brass);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.release-version:hover,
.release-version:focus-visible {
  border-bottom-color: var(--brass);
}

.release-date {
  font-size: 0.8rem;
  color: var(--maple-lo);
  white-space: nowrap;
}

.release-summary {
  font-size: 0.875rem;
  line-height: 1.55;
}

.release-summary p { margin: 8px 0; }

.release-summary ul {
  margin: 8px 0;
  padding-left: 20px;
}

.release-summary a,
.release-prs a {
  color: var(--maple-hi);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
}

.release-summary a:hover,
.release-prs a:hover { color: var(--lens-hot-core); }

.release-prs {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 0.8rem;
  color: var(--maple-lo);
}

.release-prs li { margin: 4px 0; }

.release-prs a {
  color: var(--brass);
  text-decoration: none;
}

.release-prs a:hover { text-decoration: underline; }

.no-releases {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--maple-lo);
}

/* --------------------------------------------------------------------------
   Guide TOC — sticky, brass-ruled
   -------------------------------------------------------------------------- */

.toc-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--brass);
  scrollbar-width: thin;
  scrollbar-color: var(--brass) transparent;
}

.toc-panel .toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-panel .toc ul ul { padding-left: 12px; }

.toc-panel .toc li { margin: 6px 0; }

.toc-panel .toc a {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--cherry-divider);
  text-decoration: none;
}

.toc-panel .toc a:hover,
.toc-panel .toc a:focus-visible {
  color: var(--cherry-hi);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
}

/* Multi-page guide: cross-page section nav (sidebar) + prev/next pager */
.guide-nav .guide-sections,
.guide-nav .guide-subsections {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-nav .guide-subsections {
  padding-left: 12px;
  margin: 4px 0 8px;
}

.guide-nav li { margin: 6px 0; }

.guide-nav a {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--cherry-divider);
  text-decoration: none;
}

.guide-nav .guide-sections > li > a { font-weight: 600; }

.guide-nav .guide-subsections a {
  font-weight: 400;
  color: var(--cherry-mid);
}

.guide-nav a.active { color: var(--cherry-hi); }

.guide-nav a:hover,
.guide-nav a:focus-visible {
  color: var(--cherry-hi);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
}

.guide-index-list li { margin: 10px 0; }

.guide-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--brass);
}

.guide-pager .pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  max-width: 48%;
}

.guide-pager .pager-next { text-align: right; margin-left: auto; }

.guide-pager .pager-dir {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cherry-mid);
}

.guide-pager .pager-title {
  font-weight: 600;
  color: var(--cherry-divider);
}

.guide-pager .pager-link:hover .pager-title,
.guide-pager .pager-link:focus-visible .pager-title {
  color: var(--cherry-hi);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Hero (landing)
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero-title {
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cherry-frame);
  /* the nameplate's incised etch: light catching the lower groove wall */
  text-shadow: 0 1px 0 var(--maple-hi);
}

.hero-tagline {
  margin: 0 auto 32px;
  max-width: 620px;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--cherry-mid);
}

/* Screenshots framed like the cherry soundbox with a brass hairline */
.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  border: 6px solid var(--cherry-frame);
  outline: 1px solid var(--brass);
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(43, 26, 13, 0.35);
}

.hero-shot {
  max-width: 860px;
  margin: 0 auto;
}

.feature-shot {
  max-width: 860px;
  margin: 56px auto 0;
}

.feature-shot figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--cherry-mid);
}

/* --------------------------------------------------------------------------
   Prose — rendered markdown (landing copy + user guide)
   -------------------------------------------------------------------------- */

.prose {
  max-width: 72ch;
}

.hero + .prose,
.prose.guide-content { margin: 0 auto; }

.prose h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--cherry-frame);
  margin: 0 0 24px;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--cherry-frame);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brass);
}

.prose h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cherry-divider);
  margin: 32px 0 12px;
}

.prose h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cherry-mid);
  margin: 24px 0 8px;
}

.prose p { margin: 0 0 16px; }

.prose a {
  color: var(--cherry-divider);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--cherry-hi);
  text-decoration-thickness: 2px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 28px;
}

.prose li { margin: 6px 0; }

.prose li::marker { color: var(--brass); }

.prose strong { color: var(--cherry-divider); }

.prose blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--brass);
  color: var(--cherry-mid);
  font-style: italic;
}

.prose hr {
  margin: 40px 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

/* Code — dark cherry inset, maple ink (the preset-inset panel again) */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(43, 26, 13, 0.12);
  border-radius: 3px;
  padding: 1px 5px;
}

.prose pre {
  margin: 0 0 20px;
  padding: 16px 20px;
  overflow-x: auto;
  background: var(--inset-fill);
  border: 1px solid var(--inset-border);
  border-radius: 6px;
  color: var(--maple-hi);
  scrollbar-width: thin;
  scrollbar-color: var(--brass) var(--inset-fill);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Tables — brass hairlines on a light maple field */
.prose table {
  display: block;              /* long guide tables scroll, never overflow */
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 0.9rem;
}

.prose th {
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--maple-hi);
  background: var(--cherry-mid);
  padding: 8px 12px;
  border: 1px solid var(--cherry-frame);
}

.prose td {
  padding: 8px 12px;
  border: 1px solid var(--maple-lo);
  background: rgba(222, 196, 138, 0.35);   /* faint maple-hi wash */
  vertical-align: top;
}

.prose img {
  display: block;
  margin: 24px auto;
  border: 4px solid var(--cherry-frame);
  outline: 1px solid var(--brass);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Footer — cherry chrome mirroring the header
   -------------------------------------------------------------------------- */

.site-footer {
  background: linear-gradient(180deg, var(--cherry-frame), var(--cherry-divider));
  border-top: 2px solid var(--brass);
  padding: 32px 24px 40px;
  text-align: center;
}

.footer-tagline {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

.footer-legal {
  margin: 0;
  font-size: 0.85rem;
  color: var(--maple-lo);
}

/* --------------------------------------------------------------------------
   Responsive — below 900 px the columns stack: (toc) → content → versions
   -------------------------------------------------------------------------- */

@media (max-width: 899px) {
  .layout,
  .layout.with-toc {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 16px 48px;
  }

  .versions,
  .toc-panel {
    position: static;
    max-height: 40vh;          /* still independently scrollable when long */
  }

  .header-inner {
    justify-content: center;
    text-align: center;
  }

  .hero-title { letter-spacing: 0.08em; }
}
