/* =========================================================
   CodeRunner — shared stylesheet (home + admin)
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root,
[data-theme="dark"] {
  --bg: #0a0e15;
  --bg-2: #0e141d;
  --surface: #111923;
  --surface-2: #16212d;
  --border: rgba(0, 255, 157, 0.14);
  --border-strong: rgba(0, 255, 157, 0.32);
  --text: #e6f2ec;
  --muted: #8fa39a;
  --accent: #00ff9d;
  --accent-ink: #04140d;
  --accent-soft: rgba(0, 255, 157, 0.12);
  --orange: #ff6b35;
  --orange-soft: rgba(255, 107, 53, 0.14);
  --glow: 0 0 24px rgba(0, 255, 157, 0.35);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(0, 255, 157, 0.045);
  --header-bg: rgba(10, 14, 21, 0.72);
  --danger: #ff5a6a;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f7f4;
  --bg-2: #eaf1ec;
  --surface: #ffffff;
  --surface-2: #f2f7f4;
  --border: rgba(4, 80, 52, 0.12);
  --border-strong: rgba(0, 140, 88, 0.35);
  --text: #0c1a14;
  --muted: #52665d;
  --accent: #00a066;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 160, 102, 0.1);
  --orange: #e8571f;
  --orange-soft: rgba(232, 87, 31, 0.1);
  --glow: 0 6px 20px -6px rgba(0, 160, 102, 0.45);
  --shadow: 0 20px 45px -25px rgba(10, 40, 28, 0.35);
  --grid-line: rgba(0, 120, 80, 0.06);
  --header-bg: rgba(243, 247, 244, 0.78);
  --danger: #d6293e;
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}

img, video, iframe { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.accent { color: var(--accent); }
[data-theme="dark"] .accent { text-shadow: 0 0 22px rgba(0, 255, 157, .35); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Background grid like the logo */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
.bg-grid::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 85% 10%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 360px at 5% 40%, var(--orange-soft), transparent 70%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.35rem; border-radius: 12px;
  font-weight: 600; font-size: .98rem; border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 0 34px rgba(0, 255, 157, .5); }
.btn-ghost { border-color: var(--border-strong); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-sm { padding: .55rem .95rem; font-size: .88rem; border-radius: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong), var(--glow); }
.brand-name { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { position: relative; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--accent); transition: width .25s ease; border-radius: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: .75rem; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: transform .3s ease, border-color .2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(18deg); }
.theme-toggle svg { color: var(--accent); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--accent-soft);
  font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--accent);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }

.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); font-weight: 700; margin: 1.2rem 0 1.2rem; }
.cursor-block {
  display: inline-block; width: .42em; height: .78em; margin-left: .12em;
  background: var(--orange); border-radius: 3px; vertical-align: -.04em;
  box-shadow: 0 0 18px rgba(255, 107, 53, .6); animation: blink 1.05s steps(1) infinite;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin: 2rem 0 2.4rem; }

.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 2.4rem; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: "JetBrains Mono", monospace; font-size: 1.7rem; color: var(--accent); }
.hero-stats span { color: var(--muted); font-size: .88rem; }

.hero-visual {
  position: relative; min-height: 420px; display: grid; place-items: center;
  --mx: 0; --my: 0;               /* pointer position, -1 … 1 (set by JS) */
  perspective: 1200px;
}

/* ---- Animated logo orb ---- */
.logo-orb {
  position: absolute; top: -10px; right: 0; width: 210px; aspect-ratio: 1; z-index: 1;
  translate: calc(var(--mx) * -18px) calc(var(--my) * -14px);
  transition: translate .6s cubic-bezier(.2,.7,.2,1);
  animation: float 6s ease-in-out infinite, orbIn 1s cubic-bezier(.2,.8,.2,1) both;
}
.orb-img {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 60px rgba(0, 255, 157, .25);
  animation: orbGlow 3.2s ease-in-out infinite, orbFlicker 7s steps(1) infinite;
}
.orb-img img { width: 100%; height: 100%; object-fit: cover; animation: orbBreath 6s ease-in-out infinite; }
/* radar sweep across the logo */
.orb-scan {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: conic-gradient(from 0deg, transparent 0 300deg, rgba(0,255,157,.05) 320deg, rgba(0,255,157,.32) 358deg, transparent 360deg);
  animation: spin 4.5s linear infinite;
}
.orb-ring { position: absolute; border-radius: 50%; pointer-events: none; }
.orb-ring.r1 { inset: -12px; border: 1.5px dashed rgba(0, 255, 157, .45); animation: spin 22s linear infinite; }
.orb-ring.r2 {
  inset: -26px; padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(0,255,157,.9) 75%, transparent 76% 88%, rgba(255,107,53,.95) 96%, transparent 97%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 9s linear infinite reverse;
}
.orb-orbit { position: absolute; inset: -40px; border-radius: 50%; animation: spin 6s linear infinite; pointer-events: none; }
.orb-dot {
  position: absolute; top: 50%; left: -4px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 2px;
  background: var(--orange); box-shadow: 0 0 12px var(--orange), 0 0 24px rgba(255,107,53,.6);
}
.logo-orb:hover .orb-ring.r1 { animation-duration: 4s; }
.logo-orb:hover .orb-orbit { animation-duration: 1.6s; }

/* ---- Animated code window ---- */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

.terminal {
  position: relative; z-index: 2; width: 100%; max-width: 470px; margin-top: 165px; margin-right: 60px;
  background: #0b1118; border: 1px solid rgba(0, 255, 157, .18); border-radius: 16px;
  box-shadow: var(--shadow), 0 0 40px rgba(0, 255, 157, .12);
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--my) * -6deg)) rotateY(calc(var(--mx) * 8deg));
  translate: calc(var(--mx) * 10px) calc(var(--my) * 8px);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), translate .5s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
  animation: termIn 1s .25s cubic-bezier(.2,.8,.2,1) both, termFloat 7s 1.3s ease-in-out infinite;
}
/* travelling neon border */
.terminal::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--angle), transparent 0 62%, rgba(0,255,157,.95) 78%, transparent 80% 92%, rgba(255,107,53,.9) 98%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: angle 5s linear infinite;
}
/* CRT scan bar */
.terminal-body::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 70px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(0,255,157,.06), transparent);
  animation: scanDown 5.5s linear infinite;
}
.terminal.running { box-shadow: var(--shadow), 0 0 70px rgba(0, 255, 157, .28); }
.terminal.done::before { animation-duration: 1.4s; }

.terminal-bar { position: relative; display: flex; align-items: center; gap: 7px; padding: .7rem 1rem; background: #0f1821; border-bottom: 1px solid rgba(0,255,157,.12); border-radius: 16px 16px 0 0; }
.tl { width: 11px; height: 11px; border-radius: 50%; transition: transform .2s; }
.terminal:hover .tl { transform: scale(1.15); }
.tl.r { background: #ff5f57; } .tl.y { background: #febc2e; } .tl.g { background: #28c840; }
.terminal-title { margin-left: .6rem; font-family: "JetBrains Mono", monospace; font-size: .76rem; color: #6f8a7e; }

.run-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  padding: .15rem .55rem; border-radius: 999px; font-family: "JetBrains Mono", monospace; font-size: .68rem; font-weight: 700;
  border: 1px solid rgba(255,107,53,.4); color: #ff8a5c; background: rgba(255,107,53,.08);
  transition: color .3s, border-color .3s, background .3s;
}
.run-status b { font-weight: 700; }
.run-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite; }
.run-status[data-state="running"] { color: #00ff9d; border-color: rgba(0,255,157,.45); background: rgba(0,255,157,.08); }
.run-status[data-state="running"] i { width: 9px; height: 9px; background: none; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.run-status[data-state="done"] { color: #00ff9d; border-color: rgba(0,255,157,.45); background: rgba(0,255,157,.12); }
.run-status[data-state="done"] i { animation: none; box-shadow: 0 0 8px currentColor; }

.terminal-body {
  position: relative; margin: 0; padding: 1.2rem 1.3rem 1.4rem; min-height: 250px; font-size: .9rem; line-height: 1.75; color: #cfe9dc; white-space: pre-wrap;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  border-radius: 0 0 16px 16px; overflow: hidden;
}
.terminal-body .k { color: #ff8a5c; }
.terminal-body .s { color: #00ff9d; }
.terminal-body .c { color: #5d7a6d; font-style: italic; }
.terminal-body .f { color: #7cc7ff; }
.terminal-body .o { color: #e6f2ec; font-weight: 700; }
.terminal-body .out { display: block; color: #00ff9d; text-shadow: 0 0 10px rgba(0,255,157,.55); animation: outIn .45s ease both; }
.terminal-body .out::before { content: "› "; color: #ff6b35; }
.caret { display: inline-block; width: 9px; height: 1.05em; background: #ff6b35; vertical-align: -3px; animation: blink 1s steps(1) infinite; box-shadow: 0 0 10px rgba(255,107,53,.7); }
.terminal.running .caret { opacity: 0; animation: none; }

@keyframes spin { to { rotate: 360deg; } }
@keyframes angle { to { --angle: 360deg; } }
@keyframes orbIn { from { opacity: 0; scale: .6; rotate: -90deg; } }
@keyframes orbGlow {
  0%,100% { box-shadow: 0 0 0 1px var(--border-strong), 0 0 40px rgba(0,255,157,.2); }
  50%     { box-shadow: 0 0 0 1px var(--border-strong), 0 0 80px rgba(0,255,157,.45); }
}
@keyframes orbBreath { 0%,100% { scale: 1; } 50% { scale: 1.04; } }
@keyframes orbFlicker { 0%,95.5%,97%,100% { filter: none; } 96% { filter: brightness(1.6) hue-rotate(-25deg); } 96.5% { filter: brightness(.7); } }
@keyframes termIn { from { opacity: 0; translate: 0 40px; } }
@keyframes termFloat { 0%,100% { top: 0; } 50% { top: -10px; } }
@keyframes scanDown { from { top: -70px; } to { top: 100%; } }
@keyframes outIn { from { opacity: 0; transform: translateX(-8px); filter: blur(3px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-head { max-width: 46rem; margin-bottom: 3rem; }
.kicker { font-family: "JetBrains Mono", monospace; color: var(--orange); font-size: .9rem; margin-bottom: .8rem; }
.section-head h2, .cta-copy h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
.section-sub { color: var(--muted); font-size: 1.08rem; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature {
  position: relative; padding: 1.7rem 1.5rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  overflow: hidden;
}
.feature::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px 160px at 0% 0%, var(--accent-soft), transparent 70%);
}
.feature:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature:hover::before { opacity: 1; }
.feature > * { position: relative; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 1.2rem; border: 1px solid var(--border-strong); }
.feature h3 { font-size: 1.2rem; }
.feature p { color: var(--muted); margin: 0; font-size: .97rem; }

.roadmap {
  list-style: none; margin: 3rem 0 0; padding: 1.5rem; border-radius: 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  background: var(--surface); border: 1px dashed var(--border-strong);
}
.roadmap li { display: flex; gap: .9rem; align-items: flex-start; padding: .4rem; }
.roadmap .step { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--orange); font-size: 1.1rem; padding-top: .1rem; }
.roadmap strong { display: block; }
.roadmap p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Library / Tabs ---------- */
.library { background: linear-gradient(180deg, transparent, var(--bg-2) 20%, var(--bg-2) 80%, transparent); }

.tabs-wrap { position: relative; margin-bottom: 1.4rem; }
.tabs {
  display: flex; gap: .6rem; overflow-x: auto; padding: .4rem; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.15rem; border-radius: 11px; border: 1px solid transparent; background: transparent;
  font-family: "JetBrains Mono", monospace; font-weight: 500; font-size: .92rem; color: var(--muted);
  transition: background .2s, color .2s, border-color .2s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.tab .count { font-size: .74rem; padding: .05rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tab[aria-selected="true"] .count { background: rgba(0,0,0,.18); color: inherit; }
.tab.skeleton { width: 110px; height: 42px; background: var(--surface-2); animation: shimmer 1.4s infinite; }

.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.chips { display: flex; gap: .5rem; }
.chip { padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .88rem; transition: all .2s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.search { display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); min-width: 260px; }
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; width: 100%; }

/* Gallery grid */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }
.card {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0;
  border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  animation: cardIn .45s ease both;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.05); }
.card-media .play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #00ff9d;
  border: 1px solid rgba(0, 255, 157, .6); backdrop-filter: blur(4px); transition: transform .25s, background .25s;
}
.card:hover .play { transform: scale(1.1); background: #00ff9d; color: #04140d; }
.badge {
  position: absolute; top: .7rem; right: .7rem; padding: .2rem .55rem; border-radius: 6px;
  font-family: "JetBrains Mono", monospace; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(4, 12, 9, .75); color: #00ff9d; border: 1px solid rgba(0, 255, 157, .35);
}
.badge.yt { color: #ff6b6b; border-color: rgba(255, 90, 90, .45); }
.badge.img { color: #ffb38f; border-color: rgba(255, 140, 90, .45); }
.card-body { padding: 1rem 1.1rem 1.15rem; }
.card-body h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.playlist-thumb { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #0e1a16, #13261f); color: #00ff9d; font-family: "JetBrains Mono", monospace; }

.empty { text-align: center; padding: 4rem 1rem; border: 1px dashed var(--border-strong); border-radius: 20px; }
.empty-icon { font-family: "JetBrains Mono", monospace; font-size: 2.4rem; color: var(--accent); margin-bottom: .4rem; }
.empty p { color: var(--muted); margin: 0; }

/* ---------- Community ---------- */
.cta-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem); border-radius: 26px;
  background:
    radial-gradient(500px 300px at 100% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(400px 260px at 0% 100%, var(--orange-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--border-strong);
}
.cta-copy p:last-child { color: var(--muted); margin: 0; font-size: 1.05rem; }
.socials { display: grid; gap: .9rem; }
.social {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--border); transition: transform .25s, border-color .25s, box-shadow .25s;
}
.social:hover { transform: translateX(6px); box-shadow: var(--shadow); }
.social strong { display: block; }
.social span { color: var(--muted); font-size: .88rem; font-family: "JetBrains Mono", monospace; }
.social.yt svg { color: #ff3d3d; } .social.yt:hover { border-color: #ff3d3d; }
.social.tt svg { color: var(--text); } .social.tt:hover { border-color: #25f4ee; }
.social.fb svg { color: #1877f2; } .social.fb:hover { border-color: #1877f2; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-top: 3.5rem; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand p { color: var(--muted); max-width: 26rem; margin-top: 1rem; }
.footer-col { display: flex; flex-direction: column; gap: .55rem; }
.footer-col h4 { font-family: "JetBrains Mono", monospace; font-size: .85rem; color: var(--orange); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.footer-col a { color: var(--muted); transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.3rem 0 1.6rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.admin-link { display: inline-flex; align-items: center; gap: .4rem; font-family: "JetBrains Mono", monospace; font-size: .8rem; opacity: .75; transition: opacity .2s, color .2s; }
.admin-link:hover { opacity: 1; color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.2rem; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 6, .86); backdrop-filter: blur(6px); animation: fade .25s ease; }
.lightbox-panel { position: relative; width: min(1000px, 100%); animation: pop .3s ease; }
.lightbox-media { border-radius: 16px; overflow: hidden; background: #000; border: 1px solid rgba(0,255,157,.25); box-shadow: 0 0 60px rgba(0,255,157,.15); }
.lightbox-media img { width: 100%; max-height: 76vh; object-fit: contain; margin: auto; }
.lightbox-media video { width: 100%; max-height: 76vh; }
.lightbox-media .ratio { position: relative; aspect-ratio: 16/9; }
.lightbox-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-caption { color: #e6f2ec; padding: 1rem .2rem 0; }
.lightbox-caption h3 { margin: 0 0 .25rem; font-size: 1.2rem; }
.lightbox-caption p { margin: 0; color: #9fb4aa; }
.lightbox-close { position: absolute; top: -46px; right: 0; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; font-size: 1.5rem; line-height: 1; }
.lightbox-nav { position: absolute; top: 40%; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0,255,157,.35); background: rgba(5, 15, 11, .7); color: #00ff9d; font-size: 1.8rem; line-height: 1; z-index: 2; }
.lightbox-nav.prev { left: -60px; } .lightbox-nav.next { right: -60px; }
.lightbox-nav:hover { background: #00ff9d; color: #04140d; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 200; display: grid; gap: .6rem; }
.toast { padding: .85rem 1.1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: .93rem; animation: pop .25s ease; max-width: 360px; }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ---------- Keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes shimmer { 50% { opacity: .5; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav.prev { left: 6px; } .lightbox-nav.next { right: 6px; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: auto; }
  .terminal { margin: 110px auto 0; }
  .logo-orb { width: 150px; right: 6%; top: 0; }
  .cta-panel { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .hide-sm { display: none; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 300px; }
  .nav-links a { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
  .nav-links a::after { display: none; }
}
@media (max-width: 560px) {
  .features, .roadmap { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  .hero-stats { gap: 1.5rem; }
  .terminal-body { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
