/* ============================================================
   GlymeraCraft Plugin Homepage — dark, glowing, per-plugin accents
   ============================================================ */
:root {
  --bg: #0a0d17;
  --bg-2: #0d1120;
  --panel: rgba(19, 25, 44, 0.72);
  --panel-solid: #131a2c;
  --panel-2: #182136;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9edf7;
  --muted: #97a1ba;
  --faint: #6b7590;
  --acc: #4da3ff;      /* site accent (overridden per card/page) */
  --acc-2: #8f6bff;
  --ok: #43d98a;
  --danger: #ff5d6c;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-head: "Rajdhani", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before { /* fixed ambient glow */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(77, 163, 255, 0.14), transparent 60%),
    radial-gradient(900px 700px at 95% 10%, rgba(143, 107, 255, 0.11), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(77, 163, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 13, 23, 0.78);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.brand a { color: var(--text); text-decoration: none; }
.brand .b1 { color: var(--acc); }
.topbar-spacer { flex: 1; }
.top-links { display: flex; gap: 16px; align-items: center; }
.top-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.top-links a:hover { color: var(--text); text-decoration: none; }

.lang-switch { display: flex; gap: 4px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lang-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  letter-spacing: 0.5px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--acc); color: #06101f; }

/* ---------------- hero ---------------- */
.hero { position: relative; padding: 96px 0 70px; text-align: center; overflow: hidden; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--acc));
}
.hero-eyebrow::after { background: linear-gradient(90deg, var(--acc), transparent); }
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 700;
  line-height: 1.02;
  margin: 14px 0 10px;
  letter-spacing: 1px;
}
.hero h1 .g1 {
  background: linear-gradient(120deg, #6fb6ff, #4da3ff 40%, #8f6bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 .g2 { color: var(--text); }
.hero-sub { color: var(--muted); font-size: clamp(16px, 2.4vw, 20px); max-width: 640px; margin: 0 auto; }
.hero-stats {
  display: flex; justify-content: center; gap: clamp(22px, 6vw, 64px);
  margin: 44px 0 8px; flex-wrap: wrap;
}
.stat { min-width: 120px; }
.stat b {
  display: block; font-family: var(--font-head); font-size: clamp(34px, 5vw, 48px);
  font-weight: 700; color: var(--text); line-height: 1.1;
}
.stat span { color: var(--faint); font-size: 12.5px; letter-spacing: 2.4px; text-transform: uppercase; font-weight: 600; }
.stat b em { font-style: normal; color: var(--acc); }

/* ---------------- toolbar (search / filter / sort) ---------------- */
.toolbar { margin: 26px auto 6px; display: grid; gap: 14px; }
.toolbar-row1 { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.search {
  flex: 1; min-width: 240px; position: relative;
}
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search input {
  width: 100%; padding: 12px 16px 12px 44px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.search input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.15); }
.search input::placeholder { color: var(--faint); }
select.sort {
  padding: 12px 14px; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-size: 14px; outline: none; cursor: pointer;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.fbtn {
  border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted);
  padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.fbtn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.fbtn.active { background: var(--acc); border-color: var(--acc); color: #06101f; font-weight: 600; }
.result-count { color: var(--faint); font-size: 13px; }

/* ---------------- plugin grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
  padding: 26px 0 80px;
}
.card {
  --acc: #4da3ff;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  backdrop-filter: blur(8px);
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--acc) 65%, transparent);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--acc) 35%, transparent),
              0 0 42px -8px color-mix(in srgb, var(--acc) 45%, transparent);
}
.card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--panel-2); }
.card-media img.shot { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img.shot { transform: scale(1.045); }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 13, 23, 0.9));
}
.card-icon {
  position: absolute; left: 16px; bottom: -10px; z-index: 2;
  width: 58px; height: 58px; border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--acc) 80%, #fff 0%);
  background: var(--panel-solid);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.card-dl {
  position: absolute; right: 12px; bottom: 8px; z-index: 2;
  font-size: 12.5px; color: #cdd5e6; display: flex; align-items: center; gap: 6px;
  background: rgba(10, 13, 23, 0.55); padding: 3px 10px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-dl svg { width: 13px; height: 13px; }
.card-body { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title-row { display: flex; align-items: baseline; gap: 10px; }
.card h3 { font-family: var(--font-head); font-size: 23px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.15; }
.card h3 .pre { color: var(--muted); font-weight: 600; }
.card h3 .main { color: var(--acc); }
.ver {
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.card-title-row { flex-wrap: wrap; row-gap: 4px; }
.ver.hy { color: var(--acc); border-color: var(--acc); opacity: .8; }
.ver.hy-old, .meta-chip.hy-old { color: #e0a84a; border-color: rgba(224,168,74,.6); opacity: 1; }
.meta-chip.hy-old b, .kv b.hy-old { color: #e0a84a; }
.hy-note { margin-top: 12px; font-size: 13.5px; color: #e0a84a; max-width: 720px; line-height: 1.5; }
.hero-note {
  margin-top: 16px; font-size: 14px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: rgba(255,255,255,0.04);
}
.card p.sum {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; color: var(--faint); background: rgba(255, 255, 255, 0.05);
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
}
.card-actions { display: flex; gap: 10px; margin-top: 6px; }
.stretch::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card-actions { position: relative; z-index: 3; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .18s; text-decoration: none !important;
  line-height: 1.2;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-acc {
  background: var(--acc); color: #06101f;
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--acc) 70%, transparent);
}
.btn-acc:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--acc) 60%, transparent); color: var(--acc); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------------- detail page ---------------- */
.detail-hero {
  position: relative; padding: 40px 0 34px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(700px 340px at 18% 0%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%),
    radial-gradient(700px 340px at 90% 20%, color-mix(in srgb, var(--acc) 7%, transparent), transparent 70%);
}
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.back:hover { color: var(--acc); text-decoration: none; }
.detail-head { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.detail-icon {
  width: 108px; height: 108px; border-radius: 22px; overflow: hidden; flex: none;
  border: 2px solid color-mix(in srgb, var(--acc) 75%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 40px -10px color-mix(in srgb, var(--acc) 55%, transparent);
}
.detail-tit { flex: 1; min-width: 260px; }
.detail-tit h1 { font-family: var(--font-head); font-size: clamp(34px, 5vw, 50px); font-weight: 700; line-height: 1.05; }
.detail-tit h1 .pre { color: var(--muted); font-weight: 600; }
.detail-tit h1 .main { color: var(--acc); }
.detail-sum { color: var(--muted); font-size: 16px; margin-top: 8px; max-width: 720px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.meta-chip {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  padding: 3px 11px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center;
}
.meta-chip b { color: var(--text); font-weight: 600; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding: 40px 0 80px; }
@media (max-width: 980px) { .detail-cols { grid-template-columns: 1fr; } }

/* gallery */
.gallery-main {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); cursor: zoom-in;
  aspect-ratio: 16/9; background: var(--panel-2);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.gallery-thumbs img {
  aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; cursor: pointer;
  border: 2px solid transparent; opacity: 0.65; transition: all .15s;
}
.gallery-thumbs img:hover { opacity: 1; }
.gallery-thumbs img.active { border-color: var(--acc); opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(4, 6, 12, 0.92);
  display: none; align-items: center; justify-content: center; padding: 4vh 4vw; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow); }

/* description typography */
.section-h {
  font-family: var(--font-head); font-size: 24px; font-weight: 700; letter-spacing: 0.4px;
  margin: 38px 0 16px; display: flex; align-items: center; gap: 12px;
}
.section-h::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--acc); }
.desc { color: #c3cadb; font-size: 15.5px; }
.desc h1, .desc h2, .desc h3 { font-family: var(--font-head); color: var(--text); line-height: 1.25; margin: 30px 0 12px; }
.desc h1 { font-size: 28px; } .desc h2 { font-size: 24px; } .desc h3 { font-size: 19px; }
.desc h1:first-child { margin-top: 0; }
.desc p { margin: 12px 0; }
.desc ul, .desc ol { margin: 12px 0 12px 24px; }
.desc li { margin: 5px 0; }
.desc strong { color: var(--text); }
.desc em { color: #d6dcea; }
.desc a { color: var(--acc); }
.desc hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.desc code {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
  padding: 1.5px 7px; border-radius: 7px; font-size: 13.5px; color: #cfe3ff;
  font-family: "SFMono-Regular", Consolas, "DejaVu Sans Mono", monospace;
}
.desc pre {
  background: #0c101d; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 14px 0;
}
.desc pre code { background: none; border: 0; padding: 0; }
.desc-tables, .desc { max-width: 100%; }
.desc table { border-collapse: collapse; margin: 16px 0; width: 100%; display: block; overflow-x: auto; }
.desc th, .desc td { border: 1px solid var(--line); padding: 8px 13px; text-align: left; font-size: 14px; }
.desc th { background: rgba(255, 255, 255, 0.05); color: var(--text); font-weight: 600; white-space: nowrap; }
.desc img { border-radius: 10px; margin: 10px 0; }

/* changelog */
details.changelog { margin-top: 34px; }
details.changelog summary { cursor: pointer; list-style: none; user-select: none; }
details.changelog summary::-webkit-details-marker { display: none; }
details.changelog summary::after {
  content: "▸"; color: var(--acc); font-size: 18px; transition: transform .2s; display: inline-block;
}
details.changelog[open] summary::after { transform: rotate(90deg); }
details.changelog > .desc {
  border-left: 2px solid var(--line); padding-left: 20px; margin-top: 6px;
  max-height: 460px; overflow-y: auto;
}

/* sidebar */
.side { display: flex; flex-direction: column; gap: 18px; }
.side-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; backdrop-filter: blur(8px);
}
.side-panel h4 {
  font-family: var(--font-head); font-size: 17px; letter-spacing: 0.5px; margin-bottom: 12px;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--faint); }
.kv b { color: var(--text); font-weight: 600; text-align: right; }

/* ---------------- comments & PM ---------------- */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.comment {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
}
.comment-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment-head b { color: var(--acc); font-size: 14.5px; }
.comment-head time { color: var(--faint); font-size: 12px; }
.comment p { font-size: 14.5px; color: #c3cadb; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-empty { color: var(--faint); font-size: 14px; margin-top: 14px; }

.cform { margin-top: 22px; display: grid; gap: 10px; }
.cform input[type="text"], .cform textarea {
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 11px 14px; font-size: 14.5px; outline: none; font-family: inherit;
  transition: border-color .2s;
}
.cform input:focus, .cform textarea:focus { border-color: var(--acc); }
.cform textarea { min-height: 90px; resize: vertical; }
.cform .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cform .row input { flex: 1; min-width: 180px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-note { color: var(--faint); font-size: 12.5px; }
.form-msg { font-size: 13.5px; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }

.pm-toggle-wrap { margin-top: 34px; }
.pm-box { margin-top: 14px; display: none; }
.pm-box.open { display: block; }

/* tabs (Comments | Message) */
.tabs { display: flex; gap: 8px; margin-top: 40px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; color: var(--muted); font-size: 15px; font-weight: 600;
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--acc); border-bottom-color: var(--acc); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---------------- footer ---------------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 50px; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer .brand { font-size: 21px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--faint); font-size: 12.5px; margin-top: 14px; }

/* ---------------- misc ---------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
::selection { background: rgba(77, 163, 255, 0.35); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #232c45; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .topbar-inner { padding: 10px 16px; gap: 12px; }
  .top-links { display: none; }
  .hero { padding: 64px 0 46px; }
  .grid { grid-template-columns: 1fr; }
  .detail-head { gap: 18px; }
  .detail-icon { width: 84px; height: 84px; }
}
