/* ============================================
   LAFFI — GitHub dark -inspired theme
   GitHub's exact dark palette (#0d1117 canvas).
   Micro-interactions + flat fills retained.
   ============================================ */

:root {
  /* --- surfaces (GitHub dark) --- */
  --bg: #0d1117;              /* page background / canvas */
  --bg-deep: #010409;         /* sidebar / footer / topbar (near-black) */
  --bg-raise: #161b22;        /* panels / cards / headers (canvas subtle) */
  --bg-input: #0d1117;        /* search / input field */
  --bg-glass: #161b22;        /* token-compat (flat) */

  /* --- borders (GitHub) --- */
  --border: #21262d;          /* border-default */
  --border-strong: #30363d;   /* border-muted (stronger) */

  /* --- text (GitHub) --- */
  --text: #f0f6fc;            /* fg-default */
  --text-dim: #c9d1d9;        /* fg-muted */
  --text-muted: #8b949e;      /* fg-subtle */

  /* --- accent: Github-green (no blue) --- */
  --accent: #2ea043;
  --accent-hover: #3fb950;
  --accent-deep: #1a7f37;
  --accent-2: #3fb950;        /* (legacy token) */
  --accent-3: #2ea043;        /* (legacy token) */
  --accent-ink: #010409;
  --brand-grad: linear-gradient(150deg, #1a7f37 0%, #3fb950 100%); /* legacy */

  /* --- effect tokens --- */
  --glow: 0 8px 24px -14px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 1px 0 rgba(27, 31, 36, 0.4);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
  --blur: 14px;

  /* --- radii / motion (kept) --- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ambient page depth: faint top glow + vignette so panels float */
body {
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* guard against any stray horizontal overflow (esp. narrow/mobile) */
  overflow-x: clip;
}

/* document page uses full-bleed gradient for sections like .grad-band */
.grad-text {
  color: var(--accent);
  background: none;
}

.glass {
  background: var(--bg-raise);
  border: 1px solid var(--border);
}

main {
  flex: 1;
  width: 100%;
}

/* content clears the fixed top bar  */
body > .wiki-layout {
  margin-top: 60px;
}

/* full-width content shell used on the home page + hero-front pages */
.wiki-body {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 10px 24px 48px;
}

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================
   TOP NAVBAR
   ============================================ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* white hairline along the topbar's lower edge */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #f0f6fc;
  opacity: 0.22;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
  white-space: nowrap;
}

.logo .mark {
  color: #f0f6fc;
}

.logo .logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(240, 246, 252, 0.45);
  box-shadow: none;
}

.logo .logo-txt {
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.nav > a,
.nav-item > a {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.12s ease;
  white-space: nowrap;
  text-decoration: none;
}

/* navbar links: hover & active change text colour only (green), no fill, no edge */
.nav > a:hover,
.nav-item > a:hover {
  color: #3fb950;
  background: transparent;
  text-decoration: none;
}
.nav > a.active,
.nav-item > a.active {
  color: #3fb950;                 /* current page = green text only */
  background: transparent;
  border-bottom: none;
  text-decoration: none;
}

.caret { font-size: 11px; margin-left: 3px; }

/* dropdown */
.nav-item { position: relative; }

/* hover bridge: fills the small gap between "Categories" and the panel so an
   accidental micro-leave doesn't collapse the dropdown while still moving into it */
.nav-item::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  pointer-events: auto;
}

/* the dropdown stays open longer: it only begins hiding ~0.32s after the
   pointer leaves, so quick moves across it don't close it early */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 250px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0s linear 0.32s;   /* grace period before it disappears */
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s, 0s, 0s;   /* open immediately, don't wait */
}

.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
}

.dropdown a:hover {
  background: var(--bg-input);
  color: var(--text);
  text-decoration: none;
}

/* ============================================
   WIKI LAYOUT: sidebar + content
   ============================================ */

.wiki-layout {
  flex: 1;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* left sidebar - fixed on scroll, flex: pinned head + scrollable nav */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  padding: 22px 14px 0;
  position: sticky;
  top: 62px;
  align-self: flex-start;
  height: calc(100vh - 62px);
  max-height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar .side-drawer-top { display: none; }  /* desktop only */

/* pinned header inside the sidebar: logo-row + search + fold stay on top */
.sidebar .side-head {
  flex: 0 0 auto;
  background: var(--bg-deep);
  padding-top: 0;
  z-index: 2;
}

/* only the link list scrolls; matches theme */
.sidebar .side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: -6px;          /* room for the themed scrollbar */
  padding-right: 6px;
  padding-bottom: 30px;
}

/* theme-matched (dark) scrollbars - kill the white scroll slip */
.all-scroll::-webkit-scrollbar,
.side-scroll::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.wiki-main::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.all-scroll::-webkit-scrollbar-track,
.side-scroll::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.wiki-main::-webkit-scrollbar-track {
  background: transparent;
}
.all-scroll::-webkit-scrollbar-thumb,
.side-scroll::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.wiki-main::-webkit-scrollbar-thumb {
  background: #4b4f57;          /* muted grey thumb, matches theme */
  border-radius: 8px;
  border: 2px solid var(--bg);  /* inset gap so the thumb floats */
}
.all-scroll::-webkit-scrollbar-thumb:hover,
.side-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-deep);
}
.scrollable,
.side-scroll,
.sidebar,
.wiki-main {
  scrollbar-color: #4b4f57 transparent;
  scrollbar-width: thin;
}

.sidebar h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin: 18px 8px 8px;
  font-weight: 600;
}

.sidebar h4:first-child { margin-top: 0; }

.sidebar ul {
  list-style: none;
}

.sidebar li a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
}

.sidebar li a:hover,
.sidebar li a.active {
  background: var(--bg-raise);
  color: var(--text);
  text-decoration: none;
}

.sidebar li a.active {
  background: rgba(46, 160, 67, 0.14);
  color: #3fb950;
  box-shadow: inset 2px 0 0 0 var(--accent);
}

.sidebar .side-cat {
  font-weight: 600;
  color: var(--text);
}

/* main content column */
.wiki-main {
  flex: 1;
  min-width: 0;
  padding: 24px 30px 60px;
}

/* ============================================
   COLLAPSIBLE SIDEBAR
   ============================================ */

.sidebar {
  position: sticky;   /* keep the desktop left column pinned on scroll */
  transition: width 0.22s ease, min-width 0.22s ease, max-height 0.22s ease;
}

.side-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  margin: 2px 0 6px;
  padding: 6px 8px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.side-toggle:hover {
  color: var(--text);
  background: var(--bg-raise);
}

.side-toggle .glyph {
  transition: transform 0.22s ease;
}

/* collapsed state: shrink the sidebar away */
.wiki-layout.side-collapsed {
  position: relative;
}

.wiki-layout.side-collapsed .sidebar {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
  padding: 0;
}

.wiki-layout.side-collapsed .side-toggle {
  display: none;
}

.wiki-layout.side-collapsed .sidebar-open-btn {
  display: flex;   /* show reopen button now */
}

/* on large screens reopen button floats over content left edge */
.sidebar-open-btn {
  display: none;   /* hidden until sidebar is collapsed */
  position: fixed;
  left: 12px;
  top: 70px;
  z-index: 1500;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: all 0.12s ease;
  align-items: center;
  justify-content: center;
}

.sidebar-open-btn:hover {
  color: #fff;
  background: #238636;          /* whole button turns green on hover */
  border-color: #1a7f37;
}

/* mobile: handled centrally in the RESPONSIVE section below */

/* search box */
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 14px;
  margin-bottom: 26px;
}

.sidebar .searchbar {
  margin-bottom: 4px;
}

.searchbar svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.searchbar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.searchbar input::placeholder { color: var(--text-muted); }

.sidebar .searchbar input {
  width: 100%;
  font-size: 13px;
}

/* ============================================
   SHARED PIECES
   ============================================ */

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 34px;
  color: var(--text);
  margin-bottom: 8px;
}

h2 {
  font-size: 24px;
  color: var(--text);
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 19px;
  color: var(--text);
  margin: 20px 0 8px;
}

p {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

p b, p strong { color: var(--text); }

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* buttons (GitHub-green primary) */
.btn {
  display: inline-block;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0px;
  color: #ffffff;
  background: #238636;
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.16s var(--ease), transform 0.1s var(--ease), box-shadow 0.16s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  background: #2ea043;
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn:active { transform: translateY(0); }

.btn-ghost {
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: #238636;         /* whole button turns green on hover */
  border-color: #2ea043;
  color: #fff;
  text-decoration: none;
}

/* content panel */
.panel {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

ul, ol {
  padding-left: 22px;
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 14px;
}

li { margin-bottom: 6px; }

/* ============================================
   HOME HERO (kept simple + clean)
   ============================================ */

.hero {
  text-align: center;
  padding: 46px 0 10px;
}

.hero h1 {
  font-size: 40px;
}

.hero .tagline {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================
   CARDS
   ============================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  position: relative;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

/* blurple trim along the top edge on hover (kept micro-interaction) */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.card:hover {
  border-color: #c9d1d9;           /* less-bright neutral white edge (was green) */
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card:hover::before { opacity: 0.6; box-shadow: none; }

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 14px;
  flex: 1;
}

.card .btn {
  font-size: 13px;
  padding: 8px 16px;
}

/* ============================================
   TIER TABLES
   ============================================ */

.tbl-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.tier-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
}

.tier-table th {
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-raise);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.tier-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
  font-size: 14px;
}

.tier-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tier {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  padding: 3px 9px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
}

.tier-S { color: #fff; background: var(--accent); }
.tier-A { color: #fff; background: #3ba55c; }
.tier-B { color: #fff; background: #faa81a; }
.tier-C { color: #fff; background: #ed4245; }

/* ============================================
   BLOG POST CARDS
   ============================================ */

.post-list {
  display: grid;
  gap: 14px;
}

.post {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
}

.post h3 { margin: 0 0 6px; }
.post h3 a { color: var(--text); }
.post h3 a:hover { color: #c9d1d9; text-decoration: none; }

.post .date {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.post p { margin-bottom: 0; }

/* ============================================
   FOOTER
   ============================================ */

.footer {
  width: 100%;
  position: relative;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* white hairline along the footer's upper edge */
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: #f0f6fc;
  opacity: 0.22;
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  text-align: center;
}

.footer-top h3 {
  font-size: 20px;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.footer-top p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 18px;
}

.socials a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.12s ease;
}

.socials a:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  transform: translateY(-2px);
}

.socials svg { width: 19px; height: 19px; }

.contact a {
  color: #3fb950;
}

.contact a:hover { color: #f0f6fc; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
   RESPONSIVE + MOBILE DRAWER
   ============================================ */

/* ----- desktop: keep the collapse control visible only on wide screens ----- */
@media (min-width: 861px) {
  .menu-btn,
  .side-drawer-top,
  .drawer-backdrop {
    display: none !important;
  }
}

/* ----- navigation hamburger (mobile only) ----- */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-dim);
  transition: background 0.12s ease;
}

.menu-btn:hover span { background: #fff; }

/* drawer top bar (logo + LAFFI + X) shown when drawer opens on mobile */
.side-drawer-top {
  display: none;
}

/* dim backdrop behind the open drawer */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1090;
}

/* ============================================================
   MOBILE (< 861px): sidebar becomes a Discord-style drawer that
   slides in from the left behind a hamburger menu.
   ============================================================ */
@media (max-width: 860px) {
  .menu-btn { display: flex; }

  /* topbar stays as one row on phones (drawer holds the extra links) */
  .topbar {
    flex-wrap: nowrap;
    padding: 8px 12px;
  }

  /* nav bar is hidden redundantly behind the drawer */
  .topbar .nav { display: none; }

  .logo {
    font-size: 18px;
    gap: 8px;
  }

  .logo .logo-img { width: 30px; height: 30px; }

  /* ----- sidebar -> slide-out drawer (flex: pinned head + scroll nav) ----- */
  .sidebar {
    position: fixed !important;
    top: 58px;                    /* clear the fixed top bar */
    left: 0;
    height: calc(100dvh - 58px);
    width: min(300px, 84vw);
    z-index: 1100;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 14px 12px 0;
    margin: 0 !important;
    transform: translateX(-102%);
    transition: transform 0.24s ease;
    box-shadow: none;
    display: flex;               /* flex column: no whole-drawer scroll */
    flex-direction: column;
    overflow: hidden;
  }

  body.mobile-drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
  }

  .sidebar .side-head { background: var(--bg-deep); }

  /* drawer header stays pinned at top of the drawer (logo + LAFFI + X) */
  .side-drawer-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    flex: 0 0 auto;
    background: var(--bg-deep);
  }

  .side-drawer-top .logo-img { width: 32px; height: 32px; }
  .side-drawer-top .drawer-title { font-weight: 700; letter-spacing: 1px; flex: 1; }
  .side-close {
    width: 30px; height: 30px; flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-raise);
    color: var(--text-dim);
    cursor: pointer;
  }
  .side-close:hover { color: #fff; background: #238636; border-color: #1a7f37; }

  /* hide the desktop fold control inside the drawer; search stays on top */
  .sidebar .side-toggle,
  .sidebar .side-scroll .side-toggle { display: none; }
  .sidebar-open-btn { display: none !important; }

  /* only the link groups scroll inside the drawer */
  .sidebar .side-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* backdrop visible only when drawer open */
  .drawer-backdrop { display: block; opacity: 0; pointer-events: none; }
  body.mobile-drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* keep the page scrollable behind the fixed drawer so it stays on screen;
     the opened sidebar is a fixed overlay and does NOT scroll away. */
  body.mobile-drawer-open { overflow: visible; }

  /* prevent the desktop 'side-collapsed' persisted state from hiding the drawer */
  .wiki-layout.side-collapsed .sidebar {
    width: min(300px, 84vw);
    min-width: auto;
    overflow: hidden;
    padding: 14px 12px 0;
    display: flex;
  }

  /* sidebar section headings inside the drawer */
  .sidebar h4 { margin: 16px 8px 6px; }

  /* content sits full width, no top margin from a sidebar column */
  .wiki-layout { flex-direction: column; }
  .wiki-main { padding: 20px 16px 48px; width: 100%; }

  h1 { font-size: 28px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .ship-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ----- Phones (< 560px) ----- */
@media (max-width: 560px) {
  .wiki-main { padding: 16px 12px 44px; }
  .ship-list { grid-template-columns: 1fr; }
  .card { padding: 16px 14px; }
  .grid { gap: 12px; margin-top: 14px; }
  .classtabs .tab { flex: 1 1 auto; text-align: center; font-size: 13px; padding: 8px 8px; }
  .ship-detail .sheet { padding: 18px 14px 22px; max-height: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .footer-top, .footer-bottom { padding-left: 14px; padding-right: 14px; }
}

/* ============================================
   YOUTUBE CHANNEL PREVIEW (home)
   ============================================ */
.yt-panel {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

.yt-panel .yt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.yt-panel .yt-head .eyebrow { margin-bottom: 4px; }
.yt-panel .yt-head h2 { margin: 0; }

.yt-btn { flex-shrink: 0; }

/* wide, responsive 16:9 rectangle like a mini video preview */
.yt-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

.yt-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-note {
  margin: 10px 2px 0;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .yt-panel { padding: 12px 12px 10px; }
  .yt-video-wrap { border-radius: 8px; }
}

/* ============================================
   HOME welcome band (clean, non-animated)
   ============================================ */
.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px 92px;
  min-height: 320px;
  border-bottom: 1px solid var(--border);
  /* "Welcome to LAFFI" background image behind a scrim for readability */
  background-image:
    linear-gradient(180deg, rgba(8, 12, 18, 0.40), rgba(10, 13, 18, 0.78)),
    url("media/welcome-bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.home-hero .hero-content { max-width: 700px; }

.hero-overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #e9edf2;
  margin-bottom: 16px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.hero-overline .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.hero-title {
  margin: 0 0 16px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -1px;
  font-weight: 700;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55);
}
.hero-name { color: #ffffff; }
.hero-sub { color: #dfe4eb; margin: 0 auto 26px; font-size: 17px; max-width: 560px; text-shadow: 0 1px 10px rgba(0,0,0,0.6); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .home-hero { padding: 52px 16px 34px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
/* ============================================================
   MOBILE LEGIBILITY - raise contrast and floor font sizes
   on phones (dark bg + small/dim text is harder to read narrow)
   ============================================================ */
@media (max-width: 700px) {
  :root {
    --text: #ffffff;
    --text-dim: #e4e7ee;
    --text-muted: #bcc2cf;
  }
  body { font-size: 16px; line-height: 1.7; }
  .eyebrow { font-size: 13px; }
  .card, .panel, .post, .change-card { font-size: 15px; }
  .card p, .panel p, .post p, .md-article p { font-size: 15px; }
  ul, ol { font-size: 16px; }
  li { margin-bottom: 7px; }
  .date, .meta, .change-date { color: var(--text-muted); }
}

