/* Forever Addons — dark parchment and gold, matching the addons' look. Both palettes are deliberate. */

:root,
:root[data-theme="light"] {
  --bg: #f7f1e4;
  --bg-alt: #efe5d0;
  --panel: #fffaf0;
  --panel-2: #f8efdc;
  --border: #dcc8a0;
  --text: #2a2118;
  --muted: #6b5a43;
  --gold: #8f600c;
  --gold-strong: #6e4705;
  --gold-soft: rgba(176, 124, 26, 0.14);
  --link: #8a4f00;
  --button-text: #fffaf0;
  --button-bg: #9a6a12;
  --button-bg-hover: #7d540a;
  --code-bg: #efe4cc;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.08), 0 8px 24px rgba(60, 40, 10, 0.08);
  --hero-glow: radial-gradient(1100px 420px at 75% 0%, rgba(214, 160, 54, 0.22), transparent 70%);
  --discord: #5865f2;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0c0a;
  --bg-alt: #15110d;
  --panel: #1b1612;
  --panel-2: #221b15;
  --border: #3d3123;
  --text: #ece3d2;
  --muted: #b2a48c;
  --gold: #e8b54a;
  --gold-strong: #ffd36b;
  --gold-soft: rgba(232, 181, 74, 0.12);
  --link: #f0c060;
  --button-text: #1a1206;
  --button-bg: #e3ad3c;
  --button-bg-hover: #f2c55c;
  --code-bg: #241c14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
  --hero-glow: radial-gradient(1100px 420px at 75% 0%, rgba(232, 181, 74, 0.16), transparent 70%);
  --discord: #8891f7;
  color-scheme: dark;
}

/* Without JavaScript the OS decides. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e0c0a; --bg-alt: #15110d; --panel: #1b1612; --panel-2: #221b15; --border: #3d3123;
    --text: #ece3d2; --muted: #b2a48c; --gold: #e8b54a; --gold-strong: #ffd36b; --gold-soft: rgba(232, 181, 74, 0.12);
    --link: #f0c060; --button-text: #1a1206; --button-bg: #e3ad3c; --button-bg-hover: #f2c55c; --code-bg: #241c14;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
    --hero-glow: radial-gradient(1100px 420px at 75% 0%, rgba(232, 181, 74, 0.16), transparent 70%);
    --discord: #8891f7;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
  line-height: 1.2;
  color: var(--gold-strong);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; color: var(--gold); margin-top: 1em; }

p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--gold-strong); }
img, video { max-width: 100%; height: auto; }
code { background: var(--code-bg); border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.92em; font-family: Consolas, "Cascadia Mono", monospace; overflow-wrap: anywhere; }
pre { overflow-x: auto; }
pre code { padding: 0; background: none; overflow-wrap: normal; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; }
.skip:focus { left: 8px; }

.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }
.gold { color: var(--gold); }
.center { text-align: center; }

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-strong); font-family: Georgia, serif; font-size: 1.2rem; font-weight: 700; min-height: 44px; }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px var(--border); }
.brand.small { font-size: 1rem; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold-strong); background: var(--gold-soft); }

.menu-button { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; align-items: center; justify-content: center; }

.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 2px; background: var(--panel); }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.85rem; }
.theme-switch button span { display: none; }
.theme-switch button[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold-strong); }
.theme-switch button:hover { color: var(--text); }

@media (max-width: 860px) {
  .menu-button { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 12px;
    padding: 12px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { width: 100%; }
  .theme-switch { align-self: flex-start; }
  .theme-switch button span { display: inline; }
}

/* ------------------------------------------------------------ buttons, chips */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--gold); border-radius: 10px;
  color: var(--gold-strong); background: transparent;
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--gold-soft); color: var(--gold-strong); }
.button.primary { background: var(--button-bg); border-color: var(--button-bg); color: var(--button-text); }
.button.primary:hover { background: var(--button-bg-hover); border-color: var(--button-bg-hover); color: var(--button-text); }
.button.small { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }
.button.big { min-height: 52px; font-size: 1.05rem; }
.button.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; color: var(--muted); background: var(--panel); }
.chip.small { font-size: 0.75rem; padding: 0 8px; color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

/* ------------------------------------------------------------ hero */

.hero { background: var(--hero-glow), linear-gradient(var(--bg-alt), var(--bg)); border-bottom: 1px solid var(--border); padding: 48px 0 40px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.25fr 1fr; padding: 24px 24px; } .hero { padding: 64px 0; } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; color: var(--gold); margin-bottom: 0.6em; }
.lead { font-size: 1.15rem; color: var(--text); }
.hero .lead { max-width: 40em; }
.hero-icons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 360px; justify-self: center; }
.hero-icons img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); }
@media (max-width: 899px) { .hero-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: none; gap: 8px; } .hero-icons img:nth-child(n+7) { display: none; } }
.title-icon { vertical-align: middle; margin-right: 14px; border-radius: 12px; }

/* ------------------------------------------------------------ sections and cards */

.section { padding: 48px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-lead { color: var(--muted); max-width: 46em; }

.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 24px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.addon-card { display: flex; flex-direction: column; gap: 12px; transition: border-color 0.15s, transform 0.15s; }
.addon-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.addon-card p { margin: 0; color: var(--muted); flex: 1; }
.card-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.card-link h3 { margin: 0; }
.card-version { margin: 0; font-size: 0.85rem; color: var(--muted); }
.addon-logo { border-radius: 12px; flex: none; box-shadow: 0 0 0 1px var(--border); }
.addon-logo.big { width: 128px; height: 128px; border-radius: 18px; box-shadow: var(--shadow); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.1fr; } }
.framed img { display: block; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.price-tag { font-family: Georgia, serif; font-size: 1.4rem; color: var(--gold-strong); font-weight: 700; }
.price-tag small { font-family: inherit; font-size: 0.85rem; color: var(--muted); font-weight: 400; }

.discord-box { display: grid; gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 760px) { .discord-box { grid-template-columns: auto 1fr auto; padding: 28px 32px; } }
.discord-box p { margin: 0; color: var(--muted); }
.discord-mark { color: var(--discord); }

/* ------------------------------------------------------------ content pages */

.page { padding-top: 24px; padding-bottom: 48px; }
.page.narrow { max-width: 820px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { display: inline-block; min-height: 40px; line-height: 40px; }

.addon-head { display: grid; gap: 20px; align-items: start; padding-bottom: 8px; }
@media (min-width: 640px) { .addon-head { grid-template-columns: 128px 1fr; gap: 28px; } }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }

.toc { display: flex; gap: 4px; flex-wrap: wrap; margin: 24px 0 8px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.92rem; }
.toc a:hover { background: var(--gold-soft); color: var(--gold-strong); }

.block { margin-top: 40px; }
.block > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.prose { max-width: 820px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose h3 { margin-top: 1.4em; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1em 0; font-size: 0.93rem; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--panel-2); color: var(--gold-strong); }

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.shot { margin: 0; }
.shot img, .compare img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--panel-2); }
.shot-link { display: block; cursor: zoom-in; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.compare { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.compare figure { margin: 0; }
.video { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #000; }

.changelog { display: grid; gap: 10px; }
.release, .faq-item { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; }
.release summary, .faq-item summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 10px; font-weight: 700; list-style: none; }
.release summary::-webkit-details-marker, .faq-item summary::-webkit-details-marker { display: none; }
.release summary::before, .faq-item summary::before { content: "▸"; color: var(--gold); transition: transform 0.15s; }
.release[open] summary::before, .faq-item[open] summary::before { transform: rotate(90deg); }
.release[open], .faq-item[open] { padding-bottom: 12px; }
.release-version { font-family: Georgia, serif; color: var(--gold-strong); font-size: 1.1rem; }
.release ul { margin: 0 0 0.6em; padding-left: 1.3em; }
.release li { margin: 0.35em 0; }
.release h4:first-of-type { margin-top: 0.2em; }
.faq { display: grid; gap: 10px; }
.faq-item p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; }
.steps > li { counter-increment: step; position: relative; padding: 20px 20px 4px 72px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 20px; top: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; color: var(--button-text); background: var(--button-bg); }
.steps h2 { font-size: 1.25rem; }
@media (max-width: 480px) { .steps > li { padding: 64px 16px 4px; } .steps > li::before { left: 16px; top: 16px; } }
.path { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 1em; }
.note { border-left: 3px solid var(--gold); padding: 8px 12px; background: var(--gold-soft); border-radius: 0 8px 8px 0; }

/* ------------------------------------------------------------ AddonStudio */

.price-card { background: var(--panel); border: 1px solid var(--gold); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.price { font-family: Georgia, serif; font-size: 3rem; font-weight: 700; color: var(--gold-strong); margin: 0; line-height: 1; }
.price-note { color: var(--muted); margin: 6px 0 16px; }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; }
.ticks li { position: relative; padding-left: 28px; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; color: var(--gold); font-weight: 700; }
.stack { display: grid; gap: 10px; margin-bottom: 12px; }
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.feature p { margin: 0; color: var(--muted); }
.tool-list { display: flex; flex-wrap: wrap; gap: 6px; }
.credits p { color: var(--muted); }

/* ------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 32px 0 24px; margin-top: 24px; }
.footer-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr auto; align-items: start; } }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; color: var(--text); }
.legal { margin-top: 16px; font-size: 0.85rem; color: var(--muted); }
.legal p { margin: 0.3em 0; }
.site-version { font-family: Consolas, monospace; }

/* ------------------------------------------------------------ lightbox */

.lightbox { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--panel); color: var(--text); max-width: min(96vw, 1600px); max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.8); }
.lightbox img { display: block; max-width: 100%; max-height: calc(94vh - 90px); margin: 0 auto; border-radius: 8px; }
.lightbox-caption { margin: 8px 0 0; text-align: center; color: var(--muted); }
.lightbox form { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.lightbox-close { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 1.5rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* An addon's own web tool in its page (Forever Fone's picture maker); site.js sets the height to its content. */
.embed { display: block; width: 100%; min-height: 640px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); margin: 12px 0 8px; }
