/* =========================================================
   Foreboding Studios - stylesheet
   Theme: fog-inspired. Soft greys, muted blues/whites, haze.
   ========================================================= */

@font-face {
  font-family: 'Minecraft';
  src: url('../fonts/Minecraft.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Minecraft';
  src: url('../fonts/Minecraft-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Miracode';
  src: url('../fonts/Miracode.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'StandardGalactic';
  src: url('../fonts/StandardGalactic.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}

:root {
  /* palette (light theme, default) */
  --fog-bg: #e6ebee;
  --fog-bg-deep: #d6dde2;
  --fog-panel: #f2f5f6;
  --fog-mist: #c3ced4;
  --fog-ink: #3a434b;
  --fog-ink-soft: #5c6870;
  --fog-accent: #7a8b99;
  --fog-accent-deep: #56707f;
  --fog-glow: #f7f9fa;
  --fog-line: rgba(58, 67, 75, 0.14);
  --fog-shadow: rgba(58, 67, 75, 0.16);
  --fog-bg-rgb: 230, 235, 238;

  /* fixed tones that don't flip with the theme - used for chrome that's
     always a dark surface (footer, hover states, lightbox close button) */
  --ink-fixed: #3a434b;
  --mist-fixed: #c3ced4;

  --font-display: 'Miracode', monospace;
  --font-body: 'Minecraft', sans-serif;

  --radius: 3px;
  --container: 1180px;
}

/* Dark theme: applied automatically from OS preference (as long as the
   visitor hasn't explicitly chosen "light"), and always when the visitor
   has explicitly chosen "dark" via the nav toggle (js/main.js writes
   data-theme to <html> and remembers it in localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fog-bg: #1b2024;
    --fog-bg-deep: #14171a;
    --fog-panel: #23282e;
    --fog-mist: #3b444c;
    --fog-ink: #e8ecef;
    --fog-ink-soft: #a7b1b8;
    --fog-accent: #8ea0ad;
    --fog-accent-deep: #9fc0d1;
    --fog-glow: #eef1f3;
    --fog-line: rgba(233, 238, 240, 0.12);
    --fog-shadow: rgba(0, 0, 0, 0.45);
    --fog-bg-rgb: 27, 32, 36;
  }
}
:root[data-theme="dark"] {
  --fog-bg: #1b2024;
  --fog-bg-deep: #14171a;
  --fog-panel: #23282e;
  --fog-mist: #3b444c;
  --fog-ink: #e8ecef;
  --fog-ink-soft: #a7b1b8;
  --fog-accent: #8ea0ad;
  --fog-accent-deep: #9fc0d1;
  --fog-glow: #eef1f3;
  --fog-line: rgba(233, 238, 240, 0.12);
  --fog-shadow: rgba(0, 0, 0, 0.45);
  --fog-bg-rgb: 27, 32, 36;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fog-bg);
  color: var(--fog-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand, nav a, .btn, .version-tag, .eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

a { color: var(--fog-accent-deep); }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* focus visibility */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--fog-accent-deep);
  outline-offset: 3px;
}

/* =========================================================
   Nav
   ========================================================= */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--fog-bg-rgb), 0.86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--fog-line);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  font-size: 1.1rem;
  color: var(--fog-ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { height: 28px; width: auto; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--fog-ink-soft);
  font-size: 0.85rem;
}
.nav-links a:hover { color: var(--fog-accent-deep); }
.nav-toggle { display: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--fog-line);
  border-radius: 50%;
  background: transparent;
  color: var(--fog-ink);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--fog-accent-deep); color: var(--fog-accent-deep); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* =========================================================
   Hero - drifting fog banks (signature element)
   ========================================================= */
.hero {
  position: relative;
  min-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--fog-bg) 0%, var(--fog-bg-deep) 100%);
}

.fog-layer {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background-repeat: no-repeat;
  opacity: 0.65;
  filter: blur(2px);
}
.fog-layer--1 {
  background-image: radial-gradient(ellipse 60% 40% at 20% 30%, var(--fog-glow) 0%, transparent 70%),
                     radial-gradient(ellipse 50% 35% at 80% 60%, var(--fog-mist) 0%, transparent 70%);
  animation: driftA 34s ease-in-out infinite alternate;
}
.fog-layer--2 {
  background-image: radial-gradient(ellipse 45% 30% at 70% 20%, var(--fog-glow) 0%, transparent 70%),
                     radial-gradient(ellipse 55% 40% at 30% 80%, var(--fog-mist) 0%, transparent 70%);
  animation: driftB 46s ease-in-out infinite alternate;
}
@keyframes driftA {
  from { transform: translate(-4%, -2%) scale(1); }
  to   { transform: translate(4%, 3%) scale(1.06); }
}
@keyframes driftB {
  from { transform: translate(3%, 2%) scale(1.04); }
  to   { transform: translate(-3%, -3%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fog-layer--1, .fog-layer--2 { animation: none; }
}

/* Fog "hiccups" - brightens/sharpens briefly - in sync with the logo
   glitch below, via transitions rather than touching the drift
   animation itself, so the slow drift underneath is never interrupted. */
.fog-layer { transition: opacity 0.15s ease, filter 0.15s ease; }
.hero.is-glitching .fog-layer { opacity: 1; filter: blur(1px) brightness(1.4); }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  padding: 0 20px;
}
.hero { padding: 32px 0; }
.hero-logo { height: 46px; margin: 0 auto 12px; cursor: pointer; }
@keyframes logoGlitch {
  0%   { transform: translate(0, 0) skew(0deg); filter: none; }
  10%  { transform: translate(-2px, 1px) skew(-3deg); filter: hue-rotate(15deg) contrast(1.3); }
  20%  { transform: translate(2px, -1px) skew(2deg); filter: hue-rotate(-20deg) brightness(1.4); }
  30%  { transform: translate(-3px, 0) skew(-2deg); filter: contrast(1.6) saturate(0); }
  40%  { transform: translate(2px, 1px) skew(3deg); filter: hue-rotate(30deg); }
  50%  { transform: translate(-1px, -2px) skew(-1deg); filter: brightness(0.6); }
  60%  { transform: translate(1px, 1px) skew(1deg); filter: hue-rotate(-15deg) contrast(1.2); }
  75%  { transform: translate(-1px, 0) skew(0deg); filter: none; }
  100% { transform: translate(0, 0) skew(0deg); filter: none; }
}
.hero-logo.is-glitching { animation: logoGlitch 380ms steps(2, end); }
@media (prefers-reduced-motion: reduce) {
  .hero-logo.is-glitching { animation: none; }
}
.hero h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  margin: 0 0 8px;
  color: var(--fog-ink);
}
.hero .tagline {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fog-ink-soft);
  margin: 0;
}

/* galactic-alphabet intro reveal targets.
   StandardGalactic maps the plain a-z/A-Z codepoints to enchantment-table
   glyphs directly, so the real text never changes - only the rendered
   font does. That also means screen readers always get the real text.
   Every [data-intro-text] element gets the per-character 3D flip below,
   regardless of length - see splitIntoFlipChars() in main.js. */

/* ---------------------------------------------------------
   Per-character 3D flip (short [data-intro-text] elements).
   Each character is a tiny flip-card: both faces are absolutely
   overlaid. Relying on CSS alone to swap faces (backface-visibility,
   or a delayed visibility transition timed to the rotation's
   midpoint) proved unreliable in Firefox - both faces stayed visible
   simultaneously no matter how it was wired up. So this is now
   explicitly two JS-driven phases instead of one continuous 0-180deg
   spin: rotate 0->90deg (galactic shrinks to edge-on), then at that
   exact moment (see flipChar() in main.js) JS swaps which face is
   visible - a plain instant class toggle, imperceptible since the
   card is edge-on/invisible right then - and rotates back 90->0deg
   to reveal the Latin face. A separate invisible .flip-size span
   (normal flow, visibility: hidden) sizes the box from real text
   layout instead of a hardcoded width/height.
--------------------------------------------------------- */
.flip-word {
  display: inline-block;
  white-space: nowrap;
}
.flip-char-wrap {
  display: inline-block;
  -webkit-perspective: 240px;
  perspective: 240px;
}
.flip-char {
  position: relative;
  display: inline-block;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.65, 0, 0.35, 1);
}
.flip-char.is-flipping-out {
  -webkit-transform: rotateX(90deg);
  transform: rotateX(90deg);
}
.flip-size { visibility: hidden; }
.flip-face {
  position: absolute;
  inset: 0;
  visibility: hidden;
}
.flip-face--galactic {
  font-family: 'StandardGalactic', monospace;
  visibility: visible;
}
.flip-char.is-swapped .flip-face--galactic { visibility: hidden; }
.flip-char.is-swapped .flip-face--latin { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .flip-char { transition: none; }
}

/* =========================================================
   Section scaffolding
   ========================================================= */
section { padding: 72px 0; }
.section-alt { background: var(--fog-panel); }
.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}
.eyebrow {
  display: block;
  font-size: 0.72rem;
  color: var(--fog-accent-deep);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head h2 { font-size: 1.7rem; margin: 0 0 10px; }
.section-head p { color: var(--fog-ink-soft); margin: 0; }

/* =========================================================
   Moving gallery
   ========================================================= */
.gallery-wrap {
  position: relative;
  padding: 0 56px;
}
.gallery-scroll {
  overflow-x: auto;
  /* No scroll-behavior: smooth here - the autoplay loop in gallery.js
     already animates scrollLeft manually every frame. Layering the
     browser's own smooth-scroll on top of that fights with it (each
     frame's write kicks off a competing "smooth scroll to X" request),
     which Chrome and Firefox resolve differently - Chrome visibly
     stutters, Firefox doesn't. The prev/next arrows still animate
     smoothly since step() passes behavior: 'smooth' per call. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  scrollbar-width: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-track {
  display: flex;
  gap: 8px;
  width: max-content;
}
@media (prefers-reduced-motion: reduce) {
  .gallery-scroll { scroll-snap-type: x proximity; }
  .gallery-item { scroll-snap-align: start; }
}

/* Nav arrows */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--fog-line);
  background: var(--fog-glow);
  color: var(--ink-fixed);
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--fog-shadow);
}
.gallery-nav:hover { background: var(--ink-fixed); color: var(--fog-glow); }
.gallery-nav--prev { left: 4px; }
.gallery-nav--next { right: 4px; }

/* Frame: a mat-board border around each photo */
.gallery-item {
  position: relative;
  flex: 0 0 auto;
  width: 460px;
  padding: 10px;
  background: var(--fog-glow);
  border: 1px solid var(--fog-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--fog-shadow);
  cursor: pointer;
}
.gallery-item-inner {
  position: relative;
  width: 100%;
  height: 290px;
  overflow: hidden;
  border-radius: 2px;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* Caption sits as a bar along the bottom of the image, hidden by default */
.gallery-item figcaption {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  text-align: center;
  padding: 10px 14px;
  margin: 0;
  color: var(--fog-glow);
  background: linear-gradient(0deg, rgba(30, 36, 40, 0.88), rgba(30, 36, 40, 0.1));
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}
.gallery-item figcaption .caption-text { display: block; font-size: 0.85rem; }
.gallery-item figcaption .caption-addon {
  display: block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-top: 3px;
}
.gallery-item:hover figcaption,
.gallery-item.show-caption figcaption {
  opacity: 1;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 33, 37, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox-overlay.is-open { opacity: 1; pointer-events: auto; }
.lightbox-box {
  position: relative;
  max-width: min(90vw, 900px);
  max-height: 86vh;
  background: var(--fog-panel);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  text-align: center;
}
.lightbox-box img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 2px;
  margin: 0 auto;
}
.lightbox-box .lightbox-addon {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--fog-accent-deep);
  margin: 14px 0 4px;
}
.lightbox-box .lightbox-caption {
  color: var(--fog-ink-soft);
  margin: 0;
}
.lightbox-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--ink-fixed);
  color: var(--fog-glow);
  font-family: var(--font-display);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* =========================================================
   Catalog
   ========================================================= */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}
.card {
  background: var(--fog-panel);
  border: 1px solid var(--fog-line);
  border-top: 3px solid var(--fog-accent);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--fog-line);
}
.card .card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}
.card.featured { border-top-color: var(--fog-accent-deep); }
.card.is-discontinued { opacity: 0.7; }
.card h3 { margin: 0; font-size: 1.05rem; color: var(--fog-ink); }
.status-badge {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius);
}
.status-release { background: rgba(62, 125, 84, 0.16); color: #2f6a44; }
.status-beta { background: rgba(184, 121, 15, 0.18); color: #8f5c0b; }
.status-in-production { background: rgba(47, 106, 168, 0.16); color: #295a8c; }
.status-discontinued { background: rgba(138, 59, 59, 0.16); color: #7a3434; }
:root[data-theme="dark"] .status-release { background: rgba(94, 176, 126, 0.22); color: #8fdba8; }
:root[data-theme="dark"] .status-beta { background: rgba(224, 158, 62, 0.22); color: #f0c179; }
:root[data-theme="dark"] .status-in-production { background: rgba(90, 150, 214, 0.22); color: #9dc4ee; }
:root[data-theme="dark"] .status-discontinued { background: rgba(199, 101, 101, 0.22); color: #eaa0a0; }
.card .desc { color: var(--fog-ink-soft); font-size: 0.92rem; margin: 0; flex-grow: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--fog-line);
  color: var(--fog-ink-soft);
}
.card .meta {
  display: flex; flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.75rem; color: var(--fog-ink-soft);
}
.version-tag { color: var(--fog-accent-deep); }
.card .actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px;
}
.btn {
  display: inline-block;
  border: 1px solid var(--fog-accent-deep);
  background: var(--fog-accent-deep);
  color: var(--fog-glow);
  padding: 9px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn:hover { background: var(--ink-fixed); border-color: var(--ink-fixed); }
.btn:active { transform: translateY(1px); }
/* In dark mode --fog-accent-deep becomes a light tone (so it still reads as
   link/text color elsewhere) - that's too light to hold white .btn text as a
   background, so the primary button gets its own fixed dark accent instead. */
:root[data-theme="dark"] .btn:not(.secondary) { background: #3f6c86; border-color: #3f6c86; }
:root[data-theme="dark"] .btn:not(.secondary):hover { background: #4f7f9a; border-color: #4f7f9a; }
.btn.secondary {
  background: transparent;
  color: var(--fog-accent-deep);
}
.btn.secondary:hover { background: var(--fog-mist); color: var(--fog-ink); }
.btn.is-cooling-down {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}
.download-status {
  font-size: 0.75rem;
  color: var(--fog-accent-deep);
}

/* =========================================================
   Team
   ========================================================= */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.team-card {
  flex: 0 1 220px;
  background: var(--fog-panel);
  border: 1px solid var(--fog-line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.team-card .avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  background: var(--fog-mist);
  border: 2px solid var(--fog-glow);
  box-shadow: 0 0 0 2px var(--fog-accent);
}
.team-card h3 { margin: 0 0 2px; font-size: 0.95rem; }
.team-card .role {
  font-size: 0.72rem;
  color: var(--fog-accent-deep);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.team-card .bio { font-size: 0.85rem; color: var(--fog-ink-soft); margin: 0 0 10px; }
.team-card .socials { display: flex; justify-content: center; gap: 10px; }
.team-card .socials a { font-size: 0.78rem; }

/* =========================================================
   Donations / Discord+YouTube / About
   ========================================================= */
.callout {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.callout p { color: var(--fog-ink-soft); }

/* Override Buy Me a Coffee widget's injected font (it hardcodes !important) */
#donate .bmc-btn,
#donate .bmc-btn-text {
  font-family: var(--font-body) !important;
}

/* Shrink the Buy Me a Coffee button; zoom scales layout size too, avoiding leftover whitespace */
#donate .bmc-btn {
  zoom: 0.75;
}

.icon-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.icon-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--fog-line);
  border-radius: var(--radius);
  background: var(--fog-panel);
  text-decoration: none;
  color: var(--fog-ink);
  font-size: 0.85rem;
}
.icon-link:hover { border-color: var(--fog-accent-deep); color: var(--fog-accent-deep); }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; }

.about-body {
  max-width: 720px;
  margin: 0 auto;
  color: var(--fog-ink-soft);
  text-align: center;
}
.about-body + .about-body { margin-top: 14px; }

/* =========================================================
   Footer
   ========================================================= */
footer {
  background: var(--ink-fixed);
  color: var(--mist-fixed);
  padding: 46px 0 28px;
  font-size: 0.85rem;
}
footer a { color: var(--fog-glow); }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  margin-bottom: 24px;
}
.footer-nav ul { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-nav li { margin-bottom: 6px; }
.footer-socials { display: flex; gap: 14px; margin-top: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--mist-fixed);
  opacity: 0.85;
}

/* =========================================================
   Changelog page
   ========================================================= */
.changelog-header {
  text-align: center;
  padding: 56px 0 30px;
}
.version-entry {
  background: var(--fog-panel);
  border: 1px solid var(--fog-line);
  border-left: 3px solid var(--fog-accent-deep);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
}
.version-entry .version-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.version-entry .version-heading h2 { margin: 0; font-size: 1.2rem; }
.version-entry .date { color: var(--fog-ink-soft); font-size: 0.8rem; }
.version-download { margin: 10px 0 4px; }
.tag-pill {
  font-family: var(--font-display);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--fog-mist);
  color: var(--fog-ink);
  text-transform: uppercase;
}
.version-entry h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--fog-accent-deep);
  margin: 14px 0 6px;
}
.version-entry ul { margin: 0; padding-left: 20px; color: var(--fog-ink-soft); }
.creator-notes {
  font-style: italic;
  color: var(--fog-ink-soft);
  border-top: 1px solid var(--fog-line);
  margin-top: 14px;
  padding-top: 12px;
}
.changelog-empty, .catalog-empty, .team-empty {
  text-align: center;
  color: var(--fog-ink-soft);
  padding: 30px 0;
}
.back-link { display: inline-block; margin-bottom: 18px; }

/* =========================================================
   Addon details page
   ========================================================= */
.details-header { padding: 40px 0 0; text-align: center; }
.details-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.details-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
}
.discontinued-banner {
  background: var(--fog-mist);
  color: var(--fog-ink-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  text-align: center;
}
.chip-row { justify-content: center; margin-bottom: 28px; }

/* Carousel: reuses .gallery-wrap's side padding/positioning context so
   the .gallery-nav arrows (already styled) sit correctly either side. */
.details-carousel { margin-bottom: 40px; }
.carousel-frame {
  padding: 12px;
  background: var(--fog-glow);
  border: 1px solid var(--fog-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--fog-shadow);
}
.carousel-frame-inner {
  position: relative;
  width: 100%;
  height: clamp(260px, 46vw, 520px);
  overflow: hidden;
  border-radius: 2px;
}
.carousel-frame-inner img {
  width: 100%; height: 100%; object-fit: cover;
}
.carousel-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  text-align: center;
  padding: 14px 18px;
  margin: 0;
  color: var(--fog-glow);
  background: linear-gradient(0deg, rgba(30, 36, 40, 0.88), rgba(30, 36, 40, 0.1));
  font-size: 0.9rem;
}
.carousel-caption.is-empty { display: none; }

.features-section { max-width: 720px; margin: 0 auto 40px; }
.features-section h2 { font-size: 1.2rem; margin: 0 0 16px; text-align: center; }
.features-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;
}
.features-grid li {
  position: relative;
  padding-left: 22px;
  color: var(--fog-ink-soft);
  font-size: 0.92rem;
}
.features-grid li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--fog-accent-deep);
}
@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
}

.desc-sections { margin-bottom: 40px; }
.desc-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 0;
  border-top: 1px solid var(--fog-line);
  display: flex;
  align-items: center;
  gap: 36px;
}
/* Set once the section's actual rendered heights are known (see
   wireDescAlignment() in addon-details.js) - text taller than its
   paired image top-aligns instead, so the (comparatively short) sticky
   image doesn't just center-float with dead space above/below it. */
.desc-section.text-taller { align-items: flex-start; }
.desc-section:first-child { border-top: none; padding-top: 0; }
.desc-section.image-right { flex-direction: row-reverse; }
.desc-section.no-image { display: block; }
.desc-image {
  flex: 0 0 42%;
  position: sticky;
  /* Clears the sticky site-nav (64px) plus breathing room. */
  top: 88px;
}
.desc-image img {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px var(--fog-shadow);
}
.desc-text { flex: 1 1 auto; }
.desc-section.no-image .desc-text {
  max-width: 700px;
  margin: 0 auto;
}
.desc-text h3 {
  font-size: 1.05rem;
  color: var(--fog-ink);
  margin: 0 0 12px;
}
.desc-text p {
  color: var(--fog-ink-soft);
  line-height: 1.75;
  margin: 0 0 14px;
}
.desc-text p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
  .desc-section, .desc-section.image-right {
    flex-direction: column;
    align-items: stretch;
  }
  .desc-image {
    flex: 0 0 auto;
    position: static;
  }
  .desc-image img { max-height: none; }
}

.details-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 48px;
}
.action-link {
  color: var(--fog-ink-soft);
  font-size: 0.85rem;
  text-decoration: underline;
}
.action-link:hover { color: var(--fog-accent-deep); }

/* =========================================================
   404 page
   ========================================================= */
.error-hero {
  position: relative;
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  /* Static fallback if js/error-page.js doesn't run - it normally
     overrides this with a random pick from the orientation-matched
     pool (see that file). */
  background-image: url('../images/background/sleepwalking.jpg');
  background-size: cover;
  background-position: center;
}
.error-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 24, 0.6);
}
.error-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding: 40px 24px;
}
.error-content .eyebrow { color: #fff; opacity: 0.85; }
.error-content h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  margin: 10px 0 14px;
}
.error-content p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 28px;
}
