/*
Theme Name: 4D Rhombus Chess
Theme URI: https://rhombuschess.example/
Author: 4D Rhombus Chess Team
Author URI: https://rhombuschess.example/
Description: A dark, cinematic theme for 4D Rhombus Chess — multi-level 3D chess. Deep space meets medieval chess.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rhombus-chess
Tags: dark, full-width-template, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   1. ROOT TOKENS
   ========================================================= */
:root {
  /* Color palette */
  --bg:            #020a14;
  --bg-2:          #050f1f;
  --panel:         #0d1b2a;
  --panel-2:       #11243a;
  --border:        rgba(0, 212, 255, 0.18);
  --border-strong: rgba(0, 212, 255, 0.45);

  --cyan:    #00d4ff;
  --purple:  #a855f7;
  --gold:    #f5a623;
  --text:    #e8eaf6;
  --muted:   #8a9bb8;
  --dim:     #5a6b85;

  /* Typography */
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body:    "Inter", "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Effects */
  --glow-cyan:   0 0 32px rgba(0, 212, 255, 0.35);
  --glow-purple: 0 0 32px rgba(168, 85, 247, 0.35);
  --glow-gold:   0 0 24px rgba(245, 166, 35, 0.4);

  --grad-primary: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  --grad-soft:    linear-gradient(135deg, rgba(0,212,255,0.15) 0%, rgba(168,85,247,0.15) 100%);

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Radii */
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px;

  --container: 1240px;
  --header-h: 72px;
}

/* =========================================================
   2. BASE / RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(168,85,247,0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(0,212,255,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  animation: pageFade 0.6s ease-out both;
}

@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: #7defff; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--s-4);
  color: #f5f7ff;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p  { margin: 0 0 var(--s-4); color: var(--text); }
p.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

::selection { background: var(--cyan); color: var(--bg); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  border-radius: 10px;
  border: 2px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   3. LAYOUT
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.section {
  padding: var(--s-9) 0;
  position: relative;
}
.section--tight { padding: var(--s-8) 0; }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--s-7);
}
.section-head .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.06);
  margin-bottom: var(--s-4);
}

/* Diagonal divider */
.divider {
  height: 80px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,212,255,0.04) 100%);
  position: relative;
  overflow: hidden;
}
.divider::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 18px,
    rgba(0, 212, 255, 0.08) 18px 19px
  );
  mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
}

/* =========================================================
   4. HEADER / NAV
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(2, 10, 20, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.is-scrolled {
  background: rgba(2, 10, 20, 0.85);
  border-bottom-color: var(--border);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}
.brand:hover { color: var(--text); }
.brand__diamond {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--grad-primary);
  transform: rotate(45deg);
  border-radius: 4px;
  box-shadow: var(--glow-cyan);
}
.brand__diamond span {
  transform: rotate(-45deg);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-body);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.nav__list {
  display: flex;
  gap: var(--s-5);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__link {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 2px;
  letter-spacing: 0.02em;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--cyan); }
.nav__link.is-active::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  border-radius: 2px;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--bg);
  background: var(--grad-primary);
  box-shadow: var(--glow-cyan);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav__cta:hover {
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(0,212,255,0.7), 0 0 48px rgba(168,85,247,0.4);
}

.hamburger {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.hamburger span {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--text);
  transition: 0.25s ease;
}
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 25px; }
.hamburger.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(2, 10, 20, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 99;
}
.mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: var(--s-4) var(--s-5) var(--s-6);
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.mobile-menu__list a {
  display: block;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.mobile-menu__list a.nav__cta {
  background: var(--grad-primary);
  color: var(--bg);
  text-align: center;
  border: none;
}

@media (max-width: 860px) {
  .nav__list, .nav__cta--desktop { display: none; }
  .hamburger { display: block; }
  .mobile-menu { display: block; }
}

/* =========================================================
   5. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: var(--grad-primary);
  color: var(--bg);
  box-shadow: var(--glow-cyan);
}
.btn--primary:hover {
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0,212,255,0.7), 0 0 56px rgba(168,85,247,0.4);
}
.btn--ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-strong);
  color: var(--text);
  position: relative;
}
.btn--ghost:hover {
  color: var(--text);
  background: rgba(0,212,255,0.08);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}
.btn--lg { padding: 18px 32px; font-size: 1.05rem; }
.btn__icon { font-size: 1.15em; line-height: 1; }

/* =========================================================
   6. HERO
   ========================================================= */
.hero {
  position: relative;
  padding: var(--s-9) 0 var(--s-9);
  overflow: hidden;
  isolation: isolate;
}
.hero__starfield {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
}
.hero__starfield canvas { width: 100%; height: 100%; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-8);
  align-items: center;
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s-7); }
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,212,255,0.05);
  margin-bottom: var(--s-5);
}
.hero__eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.hero h1 {
  margin-bottom: var(--s-5);
}
.hero h1 .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: var(--s-6);
}
.hero__ctas {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.hero__meta {
  display: flex; gap: var(--s-5); flex-wrap: wrap;
  color: var(--dim);
  font-size: 0.88rem;
  font-family: var(--font-mono);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta .dot { color: var(--cyan); }

.hero__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
}
.hero__visual canvas {
  width: 100%; height: 100%;
  filter: drop-shadow(0 30px 60px rgba(0,212,255,0.25));
}
.hero__rings {
  position: absolute; inset: 5%;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.12);
  animation: spin 60s linear infinite;
  pointer-events: none;
}
.hero__rings::before, .hero__rings::after {
  content: ""; position: absolute; inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(168,85,247,0.18);
}
.hero__rings::after { inset: 18%; border-color: rgba(245,166,35,0.18); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   7. CARDS / FEATURES
   ========================================================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(13,27,42,0.65) 0%, rgba(13,27,42,0.35) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-primary);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); }
.card:hover::before { opacity: 1; }

.card__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  margin-bottom: var(--s-4);
  color: var(--cyan);
}
.card__title { margin: 0 0 var(--s-3); }
.card__body { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* Mode cards (two-up) */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}
@media (max-width: 800px) { .mode-grid { grid-template-columns: 1fr; } }

.mode-card {
  padding: var(--s-7);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(13,27,42,0.7), rgba(5,15,31,0.7));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.mode-card--gold { border-color: rgba(245,166,35,0.35); }
.mode-card__badge {
  position: absolute; top: var(--s-4); right: var(--s-4);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,212,255,0.1);
  color: var(--cyan);
  border: 1px solid var(--border);
}
.mode-card--gold .mode-card__badge {
  background: rgba(245,166,35,0.12);
  color: var(--gold);
  border-color: rgba(245,166,35,0.35);
}
.mode-card__levels {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: var(--s-3);
}
.mode-card--gold .mode-card__levels {
  background: linear-gradient(135deg, var(--gold), #fff5d6);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.mode-card__list {
  list-style: none;
  margin: var(--s-5) 0 0;
  padding: 0;
  display: grid; gap: 10px;
}
.mode-card__list li {
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text);
  font-size: 0.95rem;
}
.mode-card__list li::before {
  content: "◆";
  color: var(--cyan);
  font-size: 0.7rem;
  margin-top: 5px;
}
.mode-card--gold .mode-card__list li::before { color: var(--gold); }

/* Showcase (phone + desktop) */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--s-6);
  align-items: center;
}
@media (max-width: 880px) { .showcase { grid-template-columns: 1fr; } }
.device {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--glow-cyan);
}
.device--phone {
  max-width: 280px; margin: 0 auto;
  aspect-ratio: 9 / 19;
  border-radius: 36px;
}
.device--desktop {
  aspect-ratio: 16 / 10;
}
.device canvas { width: 100%; height: 100%; }

/* Testimonials */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; } }
.quote {
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: rgba(13,27,42,0.5);
  border: 1px solid var(--border);
  position: relative;
}
.quote__piece {
  position: absolute;
  top: -16px; left: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 1.4rem;
  color: var(--cyan);
}
.quote p {
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  margin: var(--s-3) 0 var(--s-4);
}
.quote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--dim);
  letter-spacing: 0.05em;
}

/* CTA Banner */
.cta-banner {
  position: relative;
  padding: var(--s-8);
  border-radius: var(--r-xl);
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(0,212,255,0.25), transparent 70%),
    radial-gradient(600px 200px at 80% 100%, rgba(168,85,247,0.25), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border-strong);
  text-align: center;
  overflow: hidden;
}
.cta-banner h2 { margin-bottom: var(--s-3); }
.cta-banner__badges {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: center;
  margin-top: var(--s-5);
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
}
.store-badge:hover {
  color: var(--text);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}
.store-badge__icon { font-size: 1.6rem; line-height: 1; }
.store-badge__small { display: block; font-size: 0.7rem; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.store-badge__big { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

/* =========================================================
   8. RULES PAGE
   ========================================================= */
.rules-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-7);
  align-items: start;
}
@media (max-width: 1000px) { .rules-layout { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: rgba(13,27,42,0.5);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
@media (max-width: 1000px) { .toc { position: static; } }
.toc h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--s-3);
}
.toc ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 4px;
}
.toc a {
  display: block;
  padding: 8px 10px;
  font-size: 0.92rem;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero) ".  ";
  font-family: var(--font-mono);
  color: var(--dim);
  font-size: 0.8em;
}
.toc a:hover { color: var(--text); border-left-color: var(--purple); background: rgba(168,85,247,0.06); }
.toc a.is-active { color: var(--cyan); border-left-color: var(--cyan); background: rgba(0,212,255,0.06); }

.rule {
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(13,27,42,0.55), rgba(5,15,31,0.4));
  border: 1px solid var(--border);
  margin-bottom: var(--s-5);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.rule__head {
  display: flex; align-items: center; gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.rule__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.7rem;
  background: var(--grad-soft);
  border: 1px solid var(--border);
}
.rule__head h3 { margin: 0; }
.rule__head .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 4px;
}
.rule__body { color: var(--muted); font-size: 1rem; }
.rule__body strong { color: var(--text); }
.rule__diagram {
  margin-top: var(--s-4);
  border-radius: var(--r-md);
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.04), transparent 70%), var(--bg-2);
  border: 1px solid var(--border);
  padding: var(--s-4);
  position: relative;
  min-height: 320px;
}
.rule__diagram canvas {
  width: 100%;
  height: 320px;
  cursor: crosshair;
}
.rule__diagram .skeleton {
  position: absolute; inset: var(--s-4);
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.06), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
  pointer-events: none;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.rule__diagram .tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(2,10,20,0.95);
  border: 1px solid var(--cyan);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 5;
}
.rule__diagram .tooltip.is-visible { opacity: 1; }

/* =========================================================
   9. DOWNLOAD PAGE
   ========================================================= */
.download-hero {
  text-align: center;
  padding: var(--s-9) 0 var(--s-7);
}
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
}
@media (max-width: 800px) { .download-grid { grid-template-columns: 1fr; } }

.download-card {
  padding: var(--s-7);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(13,27,42,0.7), rgba(5,15,31,0.7));
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  transition: all 0.3s;
}
.download-card:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-4px);
}
.download-card__icon {
  width: 80px; height: 80px;
  margin: 0 auto var(--s-4);
  border-radius: 20px;
  display: grid; place-items: center;
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
  font-size: 2.4rem;
}
.download-card__platform {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--s-2);
}
.download-card .btn { margin-top: var(--s-4); width: 100%; }
.download-card__meta {
  margin-top: var(--s-4);
  font-size: 0.85rem;
  color: var(--dim);
  font-family: var(--font-mono);
}

.specs {
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: rgba(13,27,42,0.5);
  border: 1px solid var(--border);
}
.specs__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3) var(--s-5);
  margin: 0; padding: 0;
  list-style: none;
}
@media (max-width: 600px) { .specs__list { grid-template-columns: 1fr; } }
.specs__list li {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.specs__list .label { color: var(--dim); font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; }
.specs__list .value { color: var(--text); font-weight: 500; }

/* Accordion */
.accordion { margin-top: var(--s-6); }
.acc-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
  background: rgba(13,27,42,0.4);
  overflow: hidden;
}
.acc-item__head {
  width: 100%;
  background: transparent;
  border: none;
  padding: var(--s-4) var(--s-5);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  font-weight: 500;
  text-align: left;
}
.acc-item__head .ver { color: var(--cyan); font-family: var(--font-mono); font-size: 0.85rem; margin-right: var(--s-3); }
.acc-item__head .date { color: var(--dim); font-family: var(--font-mono); font-size: 0.82rem; }
.acc-item__chev { color: var(--cyan); transition: transform 0.25s; }
.acc-item.is-open .acc-item__chev { transform: rotate(180deg); }
.acc-item__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 var(--s-5);
  color: var(--muted);
}
.acc-item.is-open .acc-item__body {
  max-height: 600px;
  padding-bottom: var(--s-4);
}
.acc-item__body ul { padding-left: 20px; }

/* Carousel */
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s-4);
}
.carousel::-webkit-scrollbar { height: 6px; }
.carousel-slide {
  scroll-snap-align: start;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.carousel-slide canvas { width: 100%; height: 100%; }
.carousel-slide__caption {
  position: absolute; bottom: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  background: rgba(2,10,20,0.85);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* =========================================================
   10. ABOUT / TIMELINE
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-7);
  align-items: start;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.dev-card {
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(13,27,42,0.7), rgba(5,15,31,0.5));
  border: 1px solid var(--border);
  text-align: center;
}
.dev-card__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin: 0 auto var(--s-4);
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 2.4rem;
  color: var(--cyan);
}
.dev-card__name { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 4px; }
.dev-card__role { color: var(--cyan); font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: var(--s-3); }

.timeline {
  position: relative;
  padding-left: var(--s-6);
}
.timeline::before {
  content: ""; position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--purple), transparent);
  border-radius: 2px;
}
.tl-item {
  position: relative;
  margin-bottom: var(--s-5);
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: rgba(13,27,42,0.5);
  border: 1px solid var(--border);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -28px; top: 22px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.tl-item--done::before { background: var(--cyan); }
.tl-item--progress::before { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.tl-item--planned::before { border-color: var(--dim); box-shadow: none; }

.tl-item__status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: var(--s-2);
}
.tl-item--done .tl-item__status { color: var(--cyan); background: rgba(0,212,255,0.1); border: 1px solid var(--border); }
.tl-item--progress .tl-item__status { color: var(--gold); background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.3); }
.tl-item--planned .tl-item__status { color: var(--dim); background: rgba(90,107,133,0.1); border: 1px solid rgba(90,107,133,0.3); }
.tl-item h4 { margin: 0 0 var(--s-2); }
.tl-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* =========================================================
   11. STANDARD PAGE / POST CONTENT
   ========================================================= */
.entry {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--s-8) 0;
}
.entry-header {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--border);
}
.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.entry-content > * + * { margin-top: var(--s-4); }
.entry-content h2, .entry-content h3 { margin-top: var(--s-6); }
.entry-content blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-5);
  border-left: 3px solid var(--cyan);
  background: rgba(0,212,255,0.04);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--text);
}
.entry-content code {
  font-family: var(--font-mono);
  background: rgba(0,212,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--cyan);
}
.entry-content pre {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: var(--s-4);
  border-radius: var(--r-md);
  overflow-x: auto;
}
.entry-content img {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.entry-content a { text-decoration: underline; text-decoration-color: rgba(0,212,255,0.4); text-underline-offset: 4px; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-5);
}
.post-card {
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: rgba(13,27,42,0.5);
  border: 1px solid var(--border);
  transition: all 0.25s;
}
.post-card:hover { border-color: var(--cyan); transform: translateY(-3px); box-shadow: var(--glow-cyan); }
.post-card h3 { font-size: 1.15rem; margin-bottom: var(--s-2); }
.post-card h3 a { color: var(--text); }
.post-card .meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--dim); letter-spacing: 0.1em; }

/* =========================================================
   12. FOOTER
   ========================================================= */
.site-footer {
  margin-top: var(--s-9);
  padding: var(--s-8) 0 var(--s-5);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-6);
  margin-bottom: var(--s-6);
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: var(--s-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); font-size: 0.92rem; }
.footer-col a:hover { color: var(--text); }
.footer-col p { color: var(--muted); font-size: 0.92rem; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--s-3);
}
.footer-bottom small { color: var(--dim); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; }
.social {
  display: flex; gap: var(--s-2);
}
.social a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.social a:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* =========================================================
   13. ANIMATIONS / UTILITIES
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Fallback: if JS doesn't run, force-show reveals after a brief delay */
.no-js .reveal,
html.reveal-fallback .reveal {
  opacity: 1;
  transform: none;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.08s; }
.reveal--delay-2 { transition-delay: 0.16s; }
.reveal--delay-3 { transition-delay: 0.24s; }
.reveal--delay-4 { transition-delay: 0.32s; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* WordPress core */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: var(--dim); text-align: center; margin-top: 6px; }
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px; width: 1px; overflow: hidden;
}

/* =========================================================
   14. PRINT
   ========================================================= */
@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .mobile-menu, .hero__starfield,
  .nav, .hamburger, .cta-banner, .toc { display: none !important; }
  .rule { break-inside: avoid; border: 1px solid #ccc; background: white; color: black; }
  .rule h3, .rule__head h3 { color: black; }
  .rule__body, .rule__body strong { color: black; }
  a { color: black; text-decoration: underline; }
}
