/* =========================================================================
   CarbodiumMc — shared stylesheet
   Dark navy, cyan accent, sharp edges. Mobile-first.
   ========================================================================= */

:root {
  --bg: #040b16;
  --bg-2: #07111f;
  --surface: #0a1626;
  --surface-2: #0d1c30;
  --line: #16283f;
  --line-2: #1f3a5a;
  --cyan: #22e4ff;
  --blue: #0fb8ff;
  --text: #dbe7f3;
  --muted: #8396ab;
  --white: #ffffff;
  --radius: 4px;
  --head: "Russo One", "Segoe UI", system-ui, sans-serif;
  --body: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --nav-h: 64px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(15, 184, 255, .10), transparent 70%),
    linear-gradient(rgba(34, 228, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 228, 255, .025) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  overflow-x: hidden;
}
img, svg, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--cyan); text-decoration: none; transition: color .15s; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
strong { color: var(--white); font-weight: 600; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: .05em .35em;
  word-break: break-word;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--cyan); color: var(--bg); padding: 8px 14px; font-weight: 700; }
.skip-link:focus { top: 8px; color: var(--bg); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; color: var(--white); letter-spacing: 0; }
h1 { font-size: clamp(1.85rem, 6.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); }
h3 { font-size: 1.1rem; }
.accent { color: var(--cyan); }
.muted { color: var(--muted); }
.label { display: inline-block; font-weight: 600; font-size: .9rem; color: var(--cyan); margin-bottom: .4em; }
.lead { font-size: 1.08rem; color: #b9cbdc; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow > * { max-width: 820px; }
main { display: block; padding-top: var(--nav-h); }
.section { padding: 52px 0; }
.section + .section { border-top: 1px solid rgba(22, 40, 63, .6); }
.section-head { margin-bottom: 26px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 24px; }
.section-head h2 { margin: 0; }
.section-head p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.count { font-size: .85rem; color: var(--muted); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: .65em 1.2em; border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--body); font-weight: 700; font-size: .95rem; letter-spacing: .02em; line-height: 1.2;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; text-align: center;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--cyan); color: #02121f; }
.btn-primary:hover { background: #6af0ff; color: #02121f; box-shadow: 0 0 0 4px rgba(34, 228, 255, .15); }
.btn-secondary { background: transparent; color: var(--white); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-yt { background: #e62117; color: #fff; }
.btn-yt:hover { background: #ff3b30; color: #fff; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #6f7bff; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  background: rgba(4, 11, 22, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.brand:hover { color: var(--white); }
.brand img { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); }
.brand-name { font-family: var(--head); font-size: 1.1rem; }
.brand-name span { color: var(--cyan); }
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 11px; background: transparent;
  border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--white); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-nav {
  position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg);
  border-bottom: 1px solid var(--line-2); max-height: 0; overflow: hidden; visibility: hidden;
  transition: max-height .25s ease, visibility .25s;
}
.site-nav.open { max-height: 85vh; visibility: visible; }
.site-nav ul { list-style: none; margin: 0; padding: 6px var(--gutter) 16px; }
.site-nav a { display: block; padding: 12px 2px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--cyan); }
.site-nav .nav-cta { margin-top: 14px; }
.site-nav .nav-cta .btn { display: flex; width: 100%; border-bottom: 0; padding: .65em 1.2em; color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 24px 0 8px; }
.hero-banner { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-banner img { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.hero-copy { margin-top: 30px; max-width: 760px; }
.hero-copy h1 { margin-bottom: .3em; }
.tagline { font-family: var(--head); font-size: clamp(1rem, 3.6vw, 1.2rem); color: var(--white); margin-bottom: .2em; }
.tagline .dot { color: var(--cyan); margin: 0 .4em; }
.subtitle { color: var(--muted); margin-bottom: 1.4em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 34px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 16px 18px; }
.stat b { display: block; font-family: var(--head); font-weight: 400; font-size: 1.5rem; color: var(--white); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Category links ---------- */
.cat-links { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cat-link {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.cat-link:hover { border-color: var(--cyan); color: var(--text); background: var(--surface-2); }
.cat-link svg { width: 28px; height: 28px; color: var(--cyan); flex: none; }
.cat-link b { display: block; font-family: var(--head); font-weight: 400; color: var(--white); font-size: 1.05rem; }
.cat-link small { color: var(--muted); font-size: .85rem; }
.cat-link .arrow { margin-left: auto; color: var(--muted); }

/* ---------- Project cards ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text); transition: border-color .15s, transform .15s;
}
.card { position: relative; will-change: transform; transition: border-color .2s, transform .2s ease-out, box-shadow .2s; }
.card:hover { border-color: rgba(34, 228, 255, .4); color: var(--text); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.card { animation: cardIn .35s ease-out both; }
.card:nth-child(2) { animation-delay: .04s; } .card:nth-child(3) { animation-delay: .08s; } .card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; } .card:nth-child(6) { animation-delay: .2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.card:hover .card-title { color: var(--cyan); }
.media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.media .blur { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); max-width: none; object-fit: cover; filter: blur(18px) brightness(.45); }
.media .fg { position: relative; width: 100%; height: 100%; object-fit: contain; }
.tag {
  position: absolute; top: 10px; left: 10px; z-index: 1; font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  padding: 3px 8px; border-radius: 3px; background: var(--cyan); color: #02121f;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-meta { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-meta .sep { margin: 0 .45em; color: var(--line-2); }
.card-title { font-family: var(--head); font-size: 1.15rem; color: var(--white); margin: 0; transition: color .15s; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.card-foot { margin-top: auto; padding-top: 10px; font-size: .88rem; font-weight: 700; color: var(--cyan); }
.coming-soon { grid-column: 1 / -1; text-align: center; padding: 34px 22px; }
.coming-soon p { color: var(--muted); }
.coming-soon .btn-row { justify-content: center; }

/* ---------- Why list ---------- */
.why-grid { display: grid; gap: 22px 32px; grid-template-columns: 1fr; }
.why-item { display: flex; gap: 14px; }
.why-item svg { width: 22px; height: 22px; color: var(--cyan); flex: none; margin-top: 3px; }
.why-item h3 { margin: 0 0 .25em; font-size: 1rem; }
.why-item p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- CTA band ---------- */
.cta-band { display: grid; gap: 16px; grid-template-columns: 1fr; }
.cta-band .panel { display: flex; flex-direction: column; align-items: flex-start; }
.cta-band h2 { font-size: 1.35rem; }
.cta-band p { color: var(--muted); }
.cta-band .btn { margin-top: auto; }

/* ---------- Project page ---------- */
.breadcrumb { font-size: .86rem; color: var(--muted); padding-top: 22px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.project-hero { padding: 20px 0 44px; }
.project-hero-grid { display: grid; gap: 26px; grid-template-columns: 1fr; align-items: start; }
.project-hero .media { border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.project-hero h1 { margin-bottom: .2em; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 20px 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.specs div { background: var(--surface); padding: 10px 14px; }
.specs dt { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 2px 0 0; color: var(--white); font-weight: 600; }
.downloads { display: grid; gap: 10px; grid-template-columns: 1fr; }
.note { font-size: .86rem; color: var(--muted); margin-top: 12px; }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; grid-template-columns: 1fr; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-list li { background: var(--surface); padding: 16px 18px 16px 46px; position: relative; }
.feature-list li::before {
  content: ""; position: absolute; left: 18px; top: 21px; width: 12px; height: 7px;
  border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg);
}
.feature-list strong { display: block; margin-bottom: 2px; }
.feature-list span { color: var(--muted); font-size: .95rem; }

.video-wrap { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps > li { counter-increment: step; position: relative; padding: 14px 16px 14px 58px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before {
  content: counter(step); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px;
  display: grid; place-items: center; font-family: var(--head); font-size: .9rem; color: var(--cyan);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 15px 46px 15px 18px; position: relative; font-weight: 700; color: var(--white); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--cyan); font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 16px; color: #b9cbdc; }
.faq details > div p:last-child { margin: 0; }

/* ---------- Content pages ---------- */
.page-hero { padding: 44px 0 8px; }
.page-hero p { color: var(--muted); max-width: 680px; }
.prose h2 { font-size: clamp(1.2rem, 4vw, 1.5rem); margin-top: 1.7em; }
.prose li { margin-bottom: .4em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.callout { border-left: 3px solid var(--cyan); background: var(--surface); padding: 14px 16px; margin: 16px 0; color: #b9cbdc; border-radius: 0 var(--radius) var(--radius) 0; }
.platform-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.platform-head svg { width: 28px; height: 28px; color: var(--cyan); flex: none; }
.platform-head h2 { margin: 0; }

.about-grid { display: grid; gap: 26px; grid-template-columns: 1fr; align-items: center; }
.about-logo { width: min(240px, 60vw); border-radius: 50%; border: 1px solid var(--line-2); }

.social-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.social-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.social-card:hover { color: var(--text); border-color: var(--line-2); }
.social-card .icon { flex: none; width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; }
.social-card .icon svg { width: 22px; height: 22px; }
.social-card h3 { margin: 0; font-size: 1.02rem; }
.social-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.social-card .go { margin-left: auto; color: var(--muted); }
.ic-yt { background: #e62117; } .ic-cf { background: #f16436; } .ic-mcpedl { background: #2a9d4b; } .ic-discord { background: #5865f2; }

/* ---------- 404 ---------- */
.notfound { padding: 80px 0; }
.notfound .code { font-family: var(--head); font-size: clamp(4rem, 20vw, 8rem); line-height: 1; color: var(--cyan); margin-bottom: 10px; }

/* ---------- Ad slots: hidden while empty ---------- */
.ad-slot:empty, .ad-slot.ad-unfilled { display: none; }
/* Reserved space so the page doesn't jump when an ad loads */
.ad-slot.ad-on {
  display: block; max-width: 1000px; margin: 28px auto; padding: 8px var(--gutter) 12px;
  min-height: 300px; text-align: center; position: relative; z-index: 1;
}
.ad-slot.ad-on::before {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.ad-label {
  display: block; margin: 4px 0 8px; font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: #5f7389;
}
.ad-slot ins { min-height: 250px; }
@media (min-width: 768px) {
  .ad-slot.ad-on { min-height: 130px; }
  .ad-slot ins { min-height: 90px; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 30px; padding: 44px 0 24px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: .94rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { color: var(--muted); margin: .7em 0 0; max-width: 340px; }
.footer-col h2 { font-family: var(--body); font-weight: 700; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .9em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.footer-col a { color: var(--text); }
.footer-col a:hover { color: var(--cyan); }
.footer-social { display: flex; gap: 8px; margin-top: 16px; }
.footer-social a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); }
.footer-social a:hover { color: var(--cyan); border-color: var(--cyan); }
.footer-social svg { width: 18px; height: 18px; }
.disclaimer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); display: grid; gap: 6px; }
.disclaimer strong { color: #a9bccf; font-weight: 600; letter-spacing: .03em; }

/* ---------- Fade-in (only with JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .cat-links { grid-template-columns: repeat(3, 1fr); }
  .card-grid, .why-grid, .social-grid, .cta-band { grid-template-columns: repeat(2, 1fr); }
  .feature-list { grid-template-columns: repeat(2, 1fr); }
  .downloads { grid-template-columns: repeat(2, 1fr); }
  .specs { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}
/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  :root { --nav-h: 70px; --gutter: 24px; }
  .section { padding: 72px 0; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(3, 1fr); }
  .project-hero-grid { grid-template-columns: 1fr 1fr; gap: 44px; }
  .project-hero .specs { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 260px 1fr; gap: 48px; }
}
@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; max-height: none; overflow: visible; visibility: visible; background: none; border: 0; }
  .site-nav ul { display: flex; align-items: center; gap: 2px; padding: 0; }
  .site-nav a { border: 0; padding: 8px 12px; font-size: .93rem; }
  .site-nav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--cyan); }
  .site-nav .nav-cta { margin: 0 0 0 10px; }
  .site-nav .nav-cta .btn { width: auto; min-height: 38px; padding: 7px 14px; font-size: .88rem; }
}


/* =========================================================================
   EFFECTS
   ========================================================================= */
main, .site-footer { position: relative; z-index: 1; }

/* Scroll progress bar + header on scroll */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 10px var(--cyan); pointer-events: none;
}
.site-header { transition: background .25s, box-shadow .25s; }
.site-header.scrolled { background: rgba(4, 11, 22, .97); box-shadow: 0 1px 0 rgba(34, 228, 255, .22), 0 10px 30px rgba(0, 0, 0, .45); }

/* Cursor spotlight on cards and panels (position set by script.js) */
.card::before, .cat-link::before, .panel::before, .social-card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 228, 255, .13), transparent 60%);
}
.card:hover::before, .cat-link:hover::before, .panel:hover::before, .social-card:hover::before { opacity: 1; }
.cat-link, .panel, .social-card { position: relative; overflow: hidden; }

.card .media .fg { transition: transform .5s ease; }
.card:hover .media .fg { transform: scale(1.04); }

/* Shine sweep on buttons */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn:hover::after { left: 130%; }
.btn-secondary::after { background: linear-gradient(100deg, transparent, rgba(34, 228, 255, .25), transparent); }

/* =========================================================================
   SEARCH
   ========================================================================= */
kbd {
  font-family: ui-monospace, Consolas, monospace; font-size: .72rem; line-height: 1; color: var(--muted);
  padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; background: var(--bg-2);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 12px;
  background: transparent; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 600 .9rem var(--body); cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s;
}
.search-btn svg { width: 18px; height: 18px; }
.search-btn span, .search-btn kbd { display: none; }
.search-btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 14px rgba(34, 228, 255, .2); }

.hero-search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; height: 52px; padding: 0 14px; margin: 4px 0 18px;
  background: rgba(10, 22, 38, .85); border: 1px solid var(--line-2); border-radius: var(--radius); cursor: text;
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:hover, .hero-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 228, 255, .1), 0 0 24px rgba(34, 228, 255, .15); }
.hero-search svg { width: 20px; height: 20px; color: var(--cyan); flex: none; }
.hero-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--white); font: 1rem var(--body); }
.hero-search input::placeholder { color: var(--muted); }
.hero-search kbd { display: none; }

html.search-open { overflow: hidden; }
.search-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; justify-content: center; align-items: flex-start;
  padding: 12px; background: rgba(2, 6, 14, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .16s;
}
.search-overlay[hidden] { display: none; }
.search-overlay.show { opacity: 1; }
.search-panel {
  width: 100%; max-width: 640px; max-height: calc(100vh - 24px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid rgba(34, 228, 255, .35); border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(34, 228, 255, .08), 0 0 40px rgba(34, 228, 255, .15), 0 30px 80px rgba(0, 0, 0, .6);
  transform: translateY(-8px) scale(.98); transition: transform .16s ease-out;
}
.search-overlay.show .search-panel { transform: none; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.search-field svg { width: 20px; height: 20px; color: var(--cyan); flex: none; }
.search-field input { flex: 1; min-width: 0; height: 56px; background: none; border: 0; outline: 0; color: var(--white); font: 1.05rem var(--body); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-close { font: .72rem ui-monospace, Consolas, monospace; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 5px 7px; cursor: pointer; }
.search-results { overflow-y: auto; padding: 6px; }
.search-label { margin: 6px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.search-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 4px; color: var(--text); border-left: 2px solid transparent; }
.search-item:hover { color: var(--text); background: var(--surface-2); }
.search-item.active { background: var(--surface-2); border-left-color: var(--cyan); }
.search-item img { width: 64px; height: 36px; object-fit: cover; border-radius: 3px; flex: none; background: var(--bg-2); }
.search-icon { width: 64px; height: 36px; display: grid; place-items: center; flex: none; color: var(--cyan); background: var(--bg-2); border-radius: 3px; }
.search-text { min-width: 0; }
.search-text b { display: block; color: var(--white); font-weight: 700; }
.search-text small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item mark { background: none; color: var(--cyan); }
.search-empty { padding: 22px 12px; text-align: center; color: var(--muted); margin: 0; }
.search-hint { display: none; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

@media (min-width: 640px) {
  .search-overlay { padding-top: 12vh; }
  .search-hint { display: flex; }
  .hero-search kbd { display: inline-block; }
}
@media (min-width: 1100px) {
  .nav-inner .brand { margin-right: auto; }
  .site-nav { order: 2; }
  .nav-actions { order: 3; margin-left: 8px; }
  .search-btn span, .search-btn kbd { display: inline-block; }
  .search-btn { height: 38px; }
}


/* =========================================================================
   HOME — hero, tally, latest update
   ========================================================================= */
.hero-grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 26px; }
.hero-copy h1 { font-size: clamp(1.7rem, 5.5vw, 2.6rem); margin-bottom: .4em; }
.intro-text { font-size: 1.08rem; color: #c3d3e2; max-width: 640px; }
.intro-text a { color: var(--white); text-decoration: underline; text-decoration-color: rgba(34, 228, 255, .6); text-underline-offset: 3px; }
.intro-text a:hover { color: var(--cyan); }
.jump { font-size: .92rem; color: var(--muted); margin: 0; }
.jump a { margin-left: 10px; color: var(--text); border-bottom: 1px dashed var(--line-2); }
.jump a:hover { color: var(--cyan); border-color: var(--cyan); }

.hero-side { display: grid; gap: 12px; align-content: start; }
.tally { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tally b { display: block; font-family: var(--head); font-weight: 400; font-size: 2rem; line-height: 1.1; color: var(--white); }
.tally > span { color: var(--muted); font-size: .92rem; }
.latest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.side-head { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.latest-link { display: flex; gap: 12px; align-items: center; color: var(--text); }
.latest-link img { width: 96px; height: 54px; object-fit: cover; border-radius: 3px; flex: none; }
.latest-link b { display: block; color: var(--white); }
.latest-link small { color: var(--muted); }
.latest-link:hover b { color: var(--cyan); }
.latest p { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.fine { margin: 0; font-size: .78rem; color: #6b7f94; }

/* Toolbar: category chips + sort */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 20px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; max-width: 100%; }
.chip {
  flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font: 600 .85rem var(--body); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--cyan); }
.chip.on { background: var(--cyan); border-color: var(--cyan); color: #02121f; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.sort select {
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 7px 10px; font: 600 .88rem var(--body); cursor: pointer;
}

/* Card facts: downloads, stars, footer line */
.card-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .86rem; color: var(--text); margin-top: 4px; min-height: 1.4em; }
.card-facts .dl::before { content: "↓ "; color: var(--cyan); font-weight: 700; }
.card-facts .rt { display: inline-flex; align-items: center; gap: 5px; }
.card-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-weight: 600; font-size: .8rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.card-body { gap: 8px; }

/* Star ratings */
.stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 1px; font-size: .95em; white-space: nowrap; }
.stars-bg { color: #2a3b50; }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: #ffc23a; }
.rating-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rating-cell b { color: var(--white); }
.meta-line { font-size: .88rem; color: var(--muted); margin: -8px 0 18px; }

/* Maps + skins side by side */
.split { display: grid; gap: 40px; grid-template-columns: 1fr; padding-top: 52px; padding-bottom: 52px; }
.card-grid.one { grid-template-columns: 1fr; }

/* About strip */
.about-strip-grid { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: center; }
.about-strip-grid img { width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--line-2); }
.about-strip-grid p { color: #c3d3e2; max-width: 680px; }

@media (min-width: 640px) {
  .about-strip-grid { grid-template-columns: 140px 1fr; }
  .about-strip-grid img { width: 140px; height: 140px; }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.6fr 1fr; gap: 40px; margin-top: 34px; }
  .split { grid-template-columns: 1fr 1fr; padding-top: 72px; padding-bottom: 72px; }
}

/* =========================================================================
   SHARE, TOAST, BACK TO TOP
   ========================================================================= */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 .85rem var(--body); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.share-btn svg { width: 15px; height: 15px; }
.share-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.share-btn.bug { margin-left: auto; border-style: dashed; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translate(-50%, 20px); opacity: 0;
  background: var(--white); color: #02121f; font-weight: 700; padding: 10px 16px; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 90; width: 46px; height: 46px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(10, 22, 38, .92); cursor: pointer; opacity: 0; transform: translateY(12px);
  pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.to-top path { transform: rotate(90deg); transform-origin: 22px 22px; fill: none; stroke: var(--white); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.to-top circle { fill: none; stroke-width: 2.5; }
.to-top .ring-bg { stroke: var(--line-2); }
.to-top .ring { stroke: var(--cyan); transition: stroke-dashoffset .1s linear; }
.to-top:hover .ring-bg { stroke: rgba(34, 228, 255, .3); }

.hero-banner { overflow: hidden; }
.hero-banner img { will-change: transform; transform: scale(1.04); }
