/* ── ScriptVault – Main Stylesheet ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:         #0d1117;
  --surface:    #161b22;
  --surface-2:  #1c2128;
  --surface-3:  #21262d;
  --border:     #30363d;
  --border-2:   #3d444d;
  --cyan:       #39d0d8;
  --cyan-dark:  #2aa8af;
  --cyan-faint: rgba(57,208,216,0.1);
  --green:      #3fb950;
  --orange:     #ff7b35;
  --purple:     #a78bfa;
  --yellow:     #e3b341;
  --text:       #e6edf3;
  --text-2:     #8b949e;
  --text-3:     #484f58;
  --success:    #3fb950;
  --danger:     #f85149;
  --warning:    #d29922;
  --info:       #39d0d8;
  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  16px;
  --mono:       'JetBrains Mono', 'Courier New', monospace;
  --sans:       'Inter', system-ui, sans-serif;
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.75rem,4vw,2.5rem); }
h2 { font-size: clamp(1.4rem,3vw,2rem); }
h3 { font-size: 1.15rem; }
p  { line-height: 1.75; }
a  { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 0.85em; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.container  { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section-dark { background: var(--surface); }
.section-cta  {
  background: linear-gradient(180deg, var(--bg) 0%, #0a0f16 100%);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6rem 0;
}
.section-cta h2 { font-size: clamp(1.6rem,3vw,2.4rem); margin-bottom: 1rem; }
.section-cta p  { color: var(--text-2); margin-bottom: 2rem; font-size: 1.05rem; }
.cta-code { font-family: var(--mono); color: var(--text-3); font-size: 0.9rem; margin-bottom: 1rem; }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: rgba(13,17,23,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.02em;
}
.logo span { color: var(--text-3); }
.logo em   { font-style: normal; color: var(--cyan); }

.main-nav { display: flex; align-items: center; gap: 0.15rem; }
.main-nav a {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-3); }
.nav-admin { color: var(--cyan) !important; }
.cart-link { display: flex; align-items: center; gap: 3px; }
.cart-badge {
  background: var(--cyan); color: #000;
  border-radius: 50%; width: 17px; height: 17px;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.mobile-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-toggle span { display: block; width: 20px; height: 2px; background: var(--text-2); border-radius: 2px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  font-family: var(--sans); font-weight: 600; font-size: 0.875rem;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.15s; white-space: nowrap;
}
.btn-lg  { padding: 0.7rem 1.6rem; font-size: 0.95rem; }
.btn-sm  { padding: 0.3rem 0.75rem; font-size: 0.775rem; }
.btn-cyan { background: var(--cyan); color: #000; font-weight: 700; }
.btn-cyan:hover { background: var(--cyan-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(57,208,216,0.3); }
.btn-primary { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); }
.btn-primary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); }
.btn-danger { background: rgba(248,81,73,0.12); color: var(--danger); border: 1px solid rgba(248,81,73,0.25); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-light { background: transparent; color: var(--text); border: 1.5px solid rgba(255,255,255,0.2); }
.btn-outline-light:hover { background: rgba(255,255,255,0.07); }
.w-100 { width: 100%; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}
.d-block{display:block}.d-flex{display:flex}
.gap-1{gap:.5rem}.gap-2{gap:1rem}
.text-center{text-align:center}.text-muted{color:var(--text-2)}.small{font-size:.8rem}
.text-3{color:var(--text-3)}

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 0.825rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }
input[type=text],input[type=email],input[type=password],
input[type=number],input[type=url],input[type=color],select,textarea {
  width: 100%; padding: 0.6rem 0.875rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,select:focus,textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-faint); }
textarea { resize: vertical; min-height: 120px; }
.file-input { padding: 0.45rem; font-size: 0.825rem; color: var(--text-2); }
.form-check  { margin-bottom: 0.75rem; }
.check-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; color: var(--text-2); text-transform: none; letter-spacing: 0; }
.check-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--cyan); flex-shrink: 0; }
.price-inputs { display: flex; align-items: center; gap: 0.5rem; }
.price-inputs input { flex: 1; }
.price-inputs span { color: var(--text-3); }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; font-size: 0.875rem; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: rgba(63,185,80,0.1);  color: #3fb950; border-color: rgba(63,185,80,0.25); }
.alert-danger  { background: rgba(248,81,73,0.1);  color: #f85149; border-color: rgba(248,81,73,0.25); }
.alert-info    { background: rgba(57,208,216,0.1); color: #39d0d8; border-color: rgba(57,208,216,0.25); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; }
.badge-success { background: rgba(63,185,80,0.15);  color: #3fb950; }
.badge-danger  { background: rgba(248,81,73,0.15);  color: #f85149; }
.badge-warning { background: rgba(210,153,34,0.15); color: #d29922; }
.badge-primary { background: rgba(255,255,255,0.08);color: var(--text-2); }
.badge-cyan    { background: var(--cyan-faint);      color: var(--cyan); }

/* ── Language badges ───────────────────────────────────────────────────── */
.lang-badge { display: inline-block; padding: 0.18rem 0.6rem; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; }
.lang-badge-lg { font-size: 0.85rem; padding: 0.3rem 0.875rem; }
.lang-badge-sm { font-size: 0.7rem; padding: 0.15rem 0.5rem; }
.lang-php    { background: rgba(167,139,250,0.15); color: #a78bfa; }
.lang-python { background: rgba(57,130,246,0.15);  color: #60a5fa; }
.lang-js     { background: rgba(234,179,8,0.15);   color: #fbbf24; }
.lang-ts     { background: rgba(49,120,198,0.15);  color: #5b9bd5; }
.lang-bash   { background: rgba(63,185,80,0.15);   color: #3fb950; }
.lang-ruby   { background: rgba(248,81,73,0.15);   color: #f85149; }
.lang-go     { background: rgba(57,208,216,0.15);  color: #39d0d8; }
.lang-rust   { background: rgba(255,123,53,0.15);  color: #ff7b35; }
.lang-java   { background: rgba(249,115,22,0.15);  color: #f97316; }
.lang-csharp { background: rgba(129,140,248,0.15); color: #818cf8; }
.lang-ps     { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.lang-default{ background: rgba(255,255,255,0.08); color: var(--text-2); }
.lang-dot    { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 2px; vertical-align: middle; }
.lang-dot.lang-php    { background: #a78bfa; }
.lang-dot.lang-python { background: #60a5fa; }
.lang-dot.lang-js     { background: #fbbf24; }
.lang-dot.lang-bash   { background: #3fb950; }
.lang-dot.lang-ruby   { background: #f85149; }
.lang-dot.lang-go     { background: #39d0d8; }
.lang-dot.lang-rust   { background: #ff7b35; }
.lang-dot.lang-default{ background: var(--text-3); }

.tag { display: inline-block; padding: 0.18rem 0.65rem; background: var(--surface-3); border-radius: 999px; font-size: 0.775rem; color: var(--text-2); margin: 0.2rem; font-family: var(--mono); }
.tag:hover { background: var(--cyan-faint); color: var(--cyan); }

/* ── Card ──────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }

/* ── Table ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); background: var(--surface-2); }
td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 5rem 1.5rem 6rem;
  min-height: 580px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(57,208,216,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(63,185,80,0.06) 0%, transparent 50%),
    var(--bg);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
  opacity: 0.3;
}
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.hero-terminal {
  display: inline-block; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 2rem; width: 100%; max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.terminal-bar {
  background: var(--surface-2); padding: 0.5rem 0.875rem;
  display: flex; gap: 6px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.terminal-bar span:nth-child(1) { background: #f85149; }
.terminal-bar span:nth-child(2) { background: #e3b341; }
.terminal-bar span:nth-child(3) { background: #3fb950; }
.terminal-body { padding: 0.875rem 1rem; font-family: var(--mono); font-size: 0.825rem; line-height: 2; }
.t-prompt { color: #3fb950; }
.t-cmd    { color: var(--cyan); }
.t-arg    { color: var(--yellow); }
.t-out    { color: var(--text-2); }
.t-cursor { color: var(--cyan); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero h1 { font-size: clamp(2.2rem,5vw,4rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p  { font-size: 1.1rem; color: var(--text-2); margin-bottom: 1.5rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-langs { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.875rem; justify-content: center; flex-wrap: wrap; }

/* ── Section Titles ────────────────────────────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.section-title { font-size: clamp(1.3rem,2.5vw,1.75rem); }
.section-link { color: var(--cyan); font-size: 0.875rem; font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* ── Script Grid ───────────────────────────────────────────────────────── */
.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.25rem; }

.script-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.script-card:hover { border-color: var(--border-2); transform: translateY(-3px); box-shadow: var(--shadow); }

.script-card-img-wrap { display: block; position: relative; overflow: hidden; aspect-ratio: 16/9; }
.script-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.script-card:hover .script-card-img { transform: scale(1.03); }
.script-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); position: relative; overflow: hidden;
}
.script-card-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
}
/* Language-tinted placeholders */
.lang-php.script-card-placeholder    { background: linear-gradient(135deg,#1a1030 0%,#0d1117 100%); }
.lang-python.script-card-placeholder { background: linear-gradient(135deg,#0d1a2e 0%,#0d1117 100%); }
.lang-js.script-card-placeholder     { background: linear-gradient(135deg,#1a1500 0%,#0d1117 100%); }
.lang-bash.script-card-placeholder   { background: linear-gradient(135deg,#0a1a10 0%,#0d1117 100%); }
.lang-ruby.script-card-placeholder   { background: linear-gradient(135deg,#1a0a0a 0%,#0d1117 100%); }
.lang-go.script-card-placeholder     { background: linear-gradient(135deg,#051a1a 0%,#0d1117 100%); }
.lang-rust.script-card-placeholder   { background: linear-gradient(135deg,#1a0e05 0%,#0d1117 100%); }
.placeholder-lang {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700;
  color: rgba(255,255,255,0.2); letter-spacing: 0.05em;
}
.script-card-docs {
  position: absolute; bottom: 0.6rem; right: 0.6rem;
  background: rgba(13,17,23,0.85); backdrop-filter: blur(6px);
  color: var(--text); padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
  opacity: 0; transform: translateY(4px); transition: all 0.2s;
}
.script-card:hover .script-card-docs { opacity: 1; transform: translateY(0); }
.script-card-body { padding: 1.1rem; }
.script-card-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.cat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.script-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.script-card-title a:hover { color: var(--cyan); }
.script-card-desc { font-size: 0.825rem; color: var(--text-2); margin-bottom: 0.6rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.script-card-ver  { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); margin-bottom: 0.75rem; }
.ver-icon { margin-right: 3px; }
.script-card-footer { display: flex; align-items: center; justify-content: space-between; }
.script-price { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--cyan); }

/* ── Category Grid ─────────────────────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 0.875rem; }
.cat-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1rem;
  text-align: center; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.cat-card:hover {
  border-color: var(--cat-color, var(--cyan));
  background: rgba(var(--cat-color, 57,208,216), 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.cat-icon  { font-size: 1.75rem; }
.cat-name  { font-weight: 700; font-size: 0.875rem; }
.cat-count { font-size: 0.72rem; color: var(--text-3); font-family: var(--mono); }

/* ── Page Banner ───────────────────────────────────────────────────────── */
.page-banner { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2rem 1.5rem; }
.page-banner .container h1 { margin-bottom: 0.3rem; font-size: 1.75rem; }
.page-banner .container p  { color: var(--text-2); font-size: 0.875rem; font-family: var(--mono); }

/* ── Browse Layout ─────────────────────────────────────────────────────── */
.browse-layout { display: flex; gap: 2rem; align-items: flex-start; }
.filter-sidebar {
  width: 230px; flex-shrink: 0;
  position: sticky; top: 76px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.filter-group { margin-bottom: 1.25rem; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); font-weight: 700; margin-bottom: 0.6rem; }
.filter-options { display: flex; flex-direction: column; gap: 0.3rem; max-height: 220px; overflow-y: auto; }
.filter-radio { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.825rem; color: var(--text-2); padding: 0.25rem 0; }
.filter-radio.checked { color: var(--cyan); }
.filter-radio input { accent-color: var(--cyan); }
.browse-content { flex: 1; min-width: 0; }

/* ── Script Detail ─────────────────────────────────────────────────────── */
.script-detail { padding: 2rem 0 4rem; }
.breadcrumb { font-size: 0.775rem; color: var(--text-3); margin-bottom: 2rem; font-family: var(--mono); }
.breadcrumb a { color: var(--text-3); } .breadcrumb a:hover { color: var(--cyan); }

.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.preview-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.preview-placeholder {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); padding: 2rem;
}
.lang-php.preview-placeholder    { background: linear-gradient(135deg,#1a1030,#0d1117); }
.lang-python.preview-placeholder { background: linear-gradient(135deg,#0d1a2e,#0d1117); }
.lang-js.preview-placeholder     { background: linear-gradient(135deg,#1a1500,#0d1117); }
.lang-bash.preview-placeholder   { background: linear-gradient(135deg,#0a1a10,#0d1117); }
.lang-go.preview-placeholder     { background: linear-gradient(135deg,#051a1a,#0d1117); }
.lang-rust.preview-placeholder   { background: linear-gradient(135deg,#1a0e05,#0d1117); }
.lang-default.preview-placeholder{ background: var(--surface-2); }
.placeholder-code { font-size: 0.875rem; line-height: 2; width: 100%; }
.t-comment { color: var(--text-3); }
.t-kw  { color: #ff7b35; }
.t-fn  { color: #d2a8ff; }
.t-str { color: #a5d6ff; }

.detail-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.875rem; }
.detail-title  { font-size: clamp(1.4rem,3vw,2rem); margin-bottom: 0.625rem; }
.detail-short-desc { color: var(--text-2); margin-bottom: 1rem; }
.detail-req { display: flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.875rem; margin-bottom: 1.25rem; }
.req-icon { color: var(--cyan); }
.detail-price { font-family: var(--mono); font-size: 2.25rem; font-weight: 700; color: var(--cyan); margin-bottom: 1.25rem; }
.detail-note  { text-align: center; font-size: 0.775rem; color: var(--text-3); margin-top: 0.625rem; font-family: var(--mono); }
.detail-meta  { margin: 1.25rem 0; border-top: 1px solid var(--border); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.meta-row     { display: flex; justify-content: space-between; font-size: 0.85rem; }
.meta-row span { color: var(--text-3); font-family: var(--mono); font-size: 0.775rem; }
.meta-row strong { color: var(--text); }
.detail-tags  { margin-top: 0.75rem; }
.prose { font-size: 0.925rem; color: var(--text-2); line-height: 1.85; }

/* ── Cart ──────────────────────────────────────────────────────────────── */
.page-title { font-size: clamp(1.4rem,3vw,1.875rem); margin-bottom: 2rem; }
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.cart-row { display: flex; gap: 0.875rem; align-items: center; padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
.cart-row:last-of-type { border-bottom: none; }
.cart-img { width: 76px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.cart-img-placeholder {
  width: 76px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
  color: rgba(255,255,255,0.25); flex-shrink: 0;
  border: 1px solid var(--border);
}
.lang-php.cart-img-placeholder    { background: #1a1030; }
.lang-python.cart-img-placeholder { background: #0d1a2e; }
.lang-js.cart-img-placeholder     { background: #1a1500; }
.lang-bash.cart-img-placeholder   { background: #0a1a10; }
.lang-default.cart-img-placeholder{ background: var(--surface-2); }
.cart-row-info { flex: 1; }
.cart-row-title { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.25rem; }
.cart-row-title:hover { color: var(--cyan); }
.cart-row-price { font-family: var(--mono); font-weight: 700; color: var(--cyan); font-size: 1rem; flex-shrink: 0; margin: 0 0.75rem; }
.btn-remove { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 0.9rem; padding: 0.25rem; border-radius: 4px; transition: color 0.15s; }
.btn-remove:hover { color: var(--danger); }
.cart-actions { display: flex; gap: 0.625rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.cart-summary h3 { margin-bottom: 1.1rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--text-2); margin-bottom: 0.6rem; }
.summary-row.total { font-size: 1rem; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.summary-note { font-size: 0.775rem; color: var(--text-3); text-align: center; margin-top: 0.875rem; font-family: var(--mono); }

/* ── Checkout ──────────────────────────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }
.checkout-item { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); gap: 0.5rem; }
.checkout-item > div { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.checkout-item-name  { font-size: 0.875rem; color: var(--text-2); }
.checkout-item-price { font-family: var(--mono); font-weight: 700; color: var(--cyan); white-space: nowrap; }
.checkout-total { display: flex; justify-content: space-between; padding: 0.875rem 0 1.25rem; font-size: 1rem; font-weight: 700; }
.checkout-perks { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.perk { font-size: 0.8rem; color: var(--text-3); font-family: var(--mono); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth ──────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem; position: relative; overflow: hidden; background: var(--bg);
}
.auth-page::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(57,208,216,0.07) 0%, transparent 60%);
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.15;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 400px; position: relative; z-index: 1;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}
.auth-logo { display: block; text-align: center; font-family: var(--mono); font-size: 1.25rem; font-weight: 700; margin-bottom: 1.75rem; }
.auth-logo span { color: var(--text-3); }
.auth-logo em   { font-style: normal; color: var(--cyan); }
.auth-title    { font-size: 1.35rem; margin-bottom: 0.35rem; }
.auth-subtitle { color: var(--text-2); font-size: 0.875rem; margin-bottom: 1.75rem; }
.auth-footer   { text-align: center; margin-top: 1.25rem; font-size: 0.825rem; color: var(--text-3); }
.auth-footer a { color: var(--cyan); font-weight: 600; }

/* ── Account ───────────────────────────────────────────────────────────── */
.account-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; }
.account-stats { display: flex; gap: 1rem; }
.acc-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; text-align: center; }
.acc-stat span { display: block; font-family: var(--mono); font-size: 1.875rem; font-weight: 700; color: var(--cyan); }
.acc-stat small { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.tab { padding: 0.7rem 1.1rem; font-weight: 600; font-size: 0.875rem; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.tab.active, .tab:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.1rem; }
.download-card-img         { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.download-card-placeholder {
  width: 100%; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
  color: rgba(255,255,255,0.2);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.lang-php.download-card-placeholder    { background: linear-gradient(135deg,#1a1030,#0d1117); }
.lang-python.download-card-placeholder { background: linear-gradient(135deg,#0d1a2e,#0d1117); }
.lang-js.download-card-placeholder     { background: linear-gradient(135deg,#1a1500,#0d1117); }
.lang-bash.download-card-placeholder   { background: linear-gradient(135deg,#0a1a10,#0d1117); }
.lang-default.download-card-placeholder{ background: var(--surface-2); }
.download-card { padding: 0; overflow: hidden; }
.download-card-body { padding: 1rem; }
.download-card-body h3 { font-size: 0.95rem; margin: 0.35rem 0 0.4rem; }
.download-meta { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-3); margin: 0.625rem 0; font-family: var(--mono); }

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon  { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p  { color: var(--text-2); margin-bottom: 1.5rem; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: auto; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p   { color: var(--text-3); font-size: 0.825rem; margin-top: 0.625rem; }
.footer-langs     { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.875rem; }
.footer-links h4  { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 0.875rem; }
.footer-links a   { display: block; font-size: 0.825rem; color: var(--text-3); margin-bottom: 0.4rem; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.1rem; font-size: 0.775rem; color: var(--text-3); text-align: center; font-family: var(--mono); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .detail-layout   { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .footer-inner    { grid-template-columns: 1fr 1fr; }
  .footer-brand    { grid-column: 1/-1; }
}
@media (max-width: 768px) {
  .browse-layout  { flex-direction: column; }
  .filter-sidebar { width: 100%; position: static; }
  .cart-layout    { grid-template-columns: 1fr; }
  .main-nav       { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.875rem; gap: 0.2rem; z-index: 100; }
  .main-nav.open  { display: flex; }
  .mobile-toggle  { display: flex; }
  .header-inner   { position: relative; }
  .account-header { flex-direction: column; gap: 1rem; }
  .footer-inner   { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; }
  .cat-grid  { grid-template-columns: repeat(2,1fr); }
  .script-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .account-stats { flex-direction: row; }
}
