/* ==========================================================================
   Exploiters — dark phosphor-green design system (site-wide)
   Hand-crafted, no build step. Tokens → primitives → components.
   Green reskin: primary accent = terminal green, CTA/active = signal orange.
   ========================================================================== */

:root {
    /* Palette — pure-black surfaces, neutral white-alpha (green is accent only) */
    --bg-0: #000000;
    --bg-1: #070707;
    --bg-2: #0d0d0d;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);

    --text: #e9e9ec;
    --text-dim: #a2a6ad;
    --text-faint: #6b7079;

    /* Accent ramp (var names kept for compatibility; hues remapped to green/orange) */
    --violet: #16a34a;   /* primary accent (was violet) */
    --indigo: #0d7a3a;   /* deep green */
    --cyan: #22c55e;     /* secondary accent / links (was cyan) */
    --pink: #ff4105;     /* signal orange (was pink) — CTA emphasis */
    --green: #34d399;    /* success */
    --amber: #fbbf24;    /* warning */
    --red: #f87171;      /* danger */

    --grad-primary: linear-gradient(135deg, #16a34a 0%, #0d7a3a 45%, #22c55e 100%);
    --grad-pink: linear-gradient(135deg, #ff6a3d 0%, #ff4105 100%);
    --grad-text: linear-gradient(120deg, #86efac 0%, #4ade80 30%, #22c55e 100%);

    --glow: 0 0 40px rgba(22, 163, 74, 0.38);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    --shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.6);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, 'Cascadia Code', monospace;

    --maxw: 1240px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 50% at 15% -5%, rgba(22, 163, 74, 0.10), transparent 60%),
        radial-gradient(50% 45% at 100% 0%, rgba(34, 197, 94, 0.06), transparent 55%),
        radial-gradient(60% 60% at 50% 110%, rgba(13, 122, 58, 0.07), transparent 60%);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
    opacity: 0.5;
}

a { color: var(--cyan); text-decoration: none; transition: color .15s ease; }
a:hover { color: #86efac; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.main { flex: 1 0 auto; padding: 40px 0 80px; }
.section { padding: 56px 0; }
.stack > * + * { margin-top: 16px; }

.text-grad {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.muted { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-sans); font-weight: 600; font-size: .95rem;
    padding: 11px 22px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--grad-primary); color: #041008;
    box-shadow: 0 10px 30px -10px rgba(22, 163, 74, .7);
}
.btn-primary:hover { color: #041008; box-shadow: 0 14px 40px -8px rgba(22, 163, 74, .9); transform: translateY(-2px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: #fff; border-color: var(--violet); }
.btn-danger { background: rgba(248,113,113,.12); color: var(--red); border-color: rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.2); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* ---------- Badges / chips ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
    padding: 4px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}
.badge-accent { color: #bbf7d0; border-color: rgba(22,163,74,.45); background: rgba(22,163,74,.14); }
.badge-green { color: #a7f3d0; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.badge-amber { color: #fde68a; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.1); }
.badge-red { color: #fecaca; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); }
.badge-cyan { color: #bbf7d0; border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); }

/* ---------- Cards / glass ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
}
.card-pad { padding: 24px; }
.glass {
    background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
}

/* ---------- Navbar ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(0, 0, 0, 0.75);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.03em; color: #fff; }
.brand .logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--grad-primary); box-shadow: var(--glow); font-family: var(--font-mono); font-weight: 800; color: #041008;
}
.brand:hover { color: #fff; }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.nav-links a {
    color: var(--text-dim); font-weight: 500; font-size: .93rem; padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: var(--surface); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-right .nav-form { display: inline-flex; align-items: center; margin: 0; }
/* every header action shares one height regardless of a/button element */
.nav-right .btn { height: 36px; padding-top: 0; padding-bottom: 0; }

.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.cart-count {
    position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 999px;
    background: var(--grad-pink); color: #fff; font-size: .68rem; font-weight: 700; font-family: var(--font-mono);
}

/* mobile nav toggle */
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 90px 0 70px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 600; margin-bottom: 20px; }
.hero p.lead { font-size: 1.2rem; color: var(--text-dim); max-width: 620px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero-stat .n { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); }
.hero-stat .l { color: var(--text-faint); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }

.terminal {
    font-family: var(--font-mono); font-size: .86rem;
    background: rgba(0,0,0,.85); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.terminal-bar { display: flex; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.terminal-bar span { width: 12px; height: 12px; border-radius: 50%; }
.term-body { padding: 20px; white-space: pre-wrap; color: #b8f7d4; line-height: 1.7; }
.term-body .c { color: var(--text-faint); }
.term-body .p { color: var(--cyan); }
.term-body .g { color: #4ade80; }

/* ---------- Section head ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--text-dim); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Product card ---------- */
.product-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
    transition: transform .18s ease, border-color .18s ease, box-shadow .25s ease;
}
.product-card:hover { transform: translateY(-6px); border-color: rgba(22,163,74,.5); box-shadow: 0 26px 50px -20px rgba(22,163,74,.4); }
.product-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--grad-primary); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .placeholder {
    width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem;
    background: linear-gradient(135deg, rgba(22,163,74,.35), rgba(34,197,94,.22));
}
.product-thumb .type-badge { position: absolute; top: 12px; left: 12px; }
.product-thumb .feat-badge { position: absolute; top: 12px; right: 12px; }
.product-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-family: var(--font-mono); font-size: .74rem; color: var(--cyan); margin-bottom: 8px; letter-spacing: .03em; }
.product-title { font-size: 1.08rem; font-weight: 600; margin: 0 0 8px; color: #fff; }
.product-title a { color: inherit; }
.product-title a:hover { color: #86efac; }
.product-desc { color: var(--text-dim); font-size: .88rem; flex: 1; margin-bottom: 16px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-family: var(--font-mono); font-weight: 800; font-size: 1.3rem; color: #fff; }
.price .cur { color: var(--green); }
.rating { color: var(--amber); font-size: .85rem; }

/* ---------- Category tile ---------- */
.cat-tile {
    display: block; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.cat-tile:hover { transform: translateY(-4px); border-color: var(--violet); background: var(--surface-2); }
.cat-tile .ic { font-size: 2rem; margin-bottom: 12px; }
.cat-tile h3 { font-size: 1.1rem; margin: 0 0 6px; color: #fff; }
.cat-tile p { color: var(--text-dim); font-size: .85rem; margin: 0; }
.cat-tile .count { margin-top: 14px; font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
    width: 100%; padding: 12px 14px; font-size: .95rem; font-family: var(--font-sans);
    color: var(--text); background: rgba(255,255,255,.03); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(22,163,74,.28);
}
.textarea { min-height: 130px; resize: vertical; }
select.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239fb4a6' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field .val { color: var(--red); font-size: .8rem; margin-top: 6px; display: block; }
.text-danger, .validation-summary-errors { color: var(--red); font-size: .85rem; }
.text-danger ul, .validation-summary-errors ul { margin: 0; padding-left: 18px; }

.auth-wrap { max-width: 440px; margin: 30px auto; }
.auth-card { padding: 36px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 28px; }
.toolbar .input, .toolbar .select { width: auto; }
.toolbar .grow { flex: 1; min-width: 200px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
    font-size: .85rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
    color: var(--text-dim); background: var(--surface); transition: all .15s ease;
}
.pill:hover { color: #fff; border-color: var(--violet); }
.pill.active { background: var(--grad-primary); color: #041008; border-color: transparent; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
table.tbl th { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); background: rgba(255,255,255,.02); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface); }

/* ---------- Alerts ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 20px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.4); color: #a7f3d0; }
.alert-error { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.4); color: #fecaca; }
.alert-info { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.4); color: #bbf7d0; }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-hero-img { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; background: var(--grad-primary); }
.detail-hero-img .placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 5rem; }
.buy-box { position: sticky; top: 90px; padding: 28px; }
.buy-box .price { font-size: 2.4rem; }
.feature-list { list-style: none; padding: 0; margin: 18px 0; }
.feature-list li { padding: 8px 0 8px 28px; position: relative; color: var(--text-dim); border-bottom: 1px dashed var(--border); }
.feature-list li::before { content: "▹"; position: absolute; left: 0; color: var(--cyan); }
.prose { color: var(--text-dim); line-height: 1.8; }
.prose h3 { color: #fff; margin-top: 28px; }

/* ---------- Course curriculum & progress ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--grad-primary); border-radius: 999px; transition: width .35s ease; }
.lesson-row { padding: 16px 18px; }
.lesson-row.lesson-locked { opacity: .72; }
.lesson-row video { display: block; }

/* ---------- Cart / checkout ---------- */
.cart-line { display: flex; gap: 16px; align-items: center; padding: 16px; }
.cart-line img, .cart-line .ph { width: 84px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--grad-primary); flex-shrink: 0; display: grid; place-items: center; }
.cart-line .info { flex: 1; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text-dim); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; color: #fff; font-size: 1.2rem; font-weight: 700; }

.coin-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.coin {
    font-family: var(--font-mono); font-size: .8rem; padding: 8px 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); display: inline-flex; gap: 7px; align-items: center;
}

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side { position: sticky; top: 90px; padding: 16px; }
.admin-side a { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; color: var(--text-dim); font-weight: 500; font-size: .92rem; }
.admin-side a:hover, .admin-side a.active { background: var(--surface-2); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat { padding: 22px; }
.stat .label { color: var(--text-faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); margin-top: 6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 32px; margin-top: auto; background: rgba(0,0,0,.5); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); margin-bottom: 14px; }
.footer a { display: block; color: var(--text-dim); font-size: .9rem; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-faint); font-size: .85rem; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty .ic { font-size: 3.5rem; margin-bottom: 14px; opacity: .7; }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; } .gap { gap: 16px; }
.mt-sm { margin-top: 8px; } .mt { margin-top: 20px; } .mt-lg { margin-top: 40px; }
.mb { margin-bottom: 20px; }
.wrap { flex-wrap: wrap; }
.hide-mobile { }

@media (max-width: 760px) {
    .nav-links, .hide-mobile { display: none; }
    .nav-toggle { display: block; }
    .hero-stats { gap: 28px; }
    .admin-side { position: static; }
}

/* pager */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pager a, .pager span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-mono); font-size: .85rem; }
.pager a:hover { border-color: var(--violet); color: #fff; }
.pager .current { background: var(--grad-primary); color: #041008; border-color: transparent; }
