/* ============================================
   Warpzon Market — Terminal/Matrix Aesthetic
   Pixel-matched to reference design
   ============================================ */

/* --- CSS Tokens --- */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0d0d0d;
    --bg-card: #111111;
    --bg-elevated: #141414;
    --bg-input: #1a1a1a;
    --border-green: #00cc00;
    --text-green: #00ff00;
    --text-gold: #daa520;
    --text-orange: #ffa500;
    --text-muted: #7a9a3a;
    --text-light: #cccccc;
    --text-dim: #888888;
    --font-mono: 'Courier New', Courier, monospace;
    --fs-h1: 26px;
    --fs-h2: 16px;
    --fs-h3: 14px;
    --fs-nav: 13px;
    --fs-body: 13px;
    --fs-small: 11px;
    --fs-price: 15px;
    --lh: 1.5;
    --lh-tight: 1.2;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--fs-body);
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-light);
    font-family: var(--font-mono);
    font-size: var(--fs-body);
    line-height: var(--lh);
    min-height: 100vh;
    border-top: 1px solid var(--text-green);
}

a {
    color: var(--text-green);
    text-decoration: none;
    transition: color 0.15s, opacity 0.15s;
}

a:hover {
    color: #fff;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

strong {
    color: var(--text-green);
    font-weight: bold;
}

/* --- Onion Bar --- */
.onion-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-green);
    padding: 0;
    overflow: hidden;
}

.onion-bar-inner {
    max-width: 100%;
    margin: 0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.onion-bar-label {
    color: var(--text-gold);
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.onion-bar-url {
    color: var(--text-green);
    font-size: 13px;
    background: var(--bg-primary);
    border: 1px solid var(--border-green);
    padding: 6px 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
    -webkit-user-select: all;
    cursor: text;
}

.onion-bar-copy {
    background: none;
    border: 1px solid var(--border-green);
    color: var(--text-green);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
}

.onion-bar-copy:hover {
    background: var(--border-green);
    color: var(--bg-primary);
}

.onion-bar-copy.copied {
    background: var(--text-green);
    color: var(--bg-primary);
    border-color: var(--text-green);
}

.onion-bar-copy.copied::after {
    content: none;
}

/* --- Header --- */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-green);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px;
    height: 50px;
}

.logo {
    color: var(--text-green);
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid var(--border-green);
    padding: 6px 14px;
    background: var(--bg-secondary);
    line-height: var(--lh-tight);
}

.logo:hover {
    color: #fff;
    border-color: var(--text-green);
}

/* --- Navigation --- */
#mainNav {
    flex: 1;
    margin-left: 20px;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: flex-end;
}

nav ul li {
    position: relative;
}

nav ul li::before {
    content: none;
}

nav ul li a {
    display: block;
    padding: 6px 18px;
    color: var(--text-green);
    font-size: var(--fs-nav);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: var(--lh-tight);
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}

nav ul li a:hover {
    border-color: var(--border-green);
    background: var(--bg-card);
    color: #fff;
    opacity: 1;
}

nav ul li a.active {
    border: 1px solid var(--border-green);
    background: var(--bg-elevated);
    color: var(--text-green);
}

/* --- Hamburger --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    background: none;
    border: 1px solid var(--border-green);
    cursor: pointer;
    padding: 7px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-green);
    transition: transform 0.25s, opacity 0.25s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- Main Layout --- */
main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 15px 60px;
}

/* --- Article Content --- */
article {
    max-width: 100%;
    margin: 0;
}

/* --- Sections --- */
section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-green);
    padding: 20px 25px;
    margin-bottom: 20px;
}

/* --- Headings --- */
h1 {
    color: var(--text-gold);
    font-size: var(--fs-h1);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-bottom: 15px;
    margin-bottom: 20px;
    line-height: var(--lh-tight);
    border-bottom: 1px solid var(--border-green);
}

h2 {
    color: var(--text-green);
    font-size: var(--fs-h2);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a1a1a;
    line-height: var(--lh-tight);
}

h3 {
    color: var(--text-gold);
    font-size: var(--fs-h3);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 20px;
    line-height: var(--lh-tight);
}

/* --- Paragraphs --- */
p {
    margin-bottom: 13px;
    color: var(--text-light);
    font-size: var(--fs-body);
    line-height: var(--lh);
}

/* --- Lists inside sections --- */
section > ul,
section > ol {
    margin-bottom: 15px;
    padding-left: 0;
}

section > ul li,
section > ol li {
    padding: 6px 0 6px 18px;
    border-bottom: 1px solid #1a1a1a;
    position: relative;
    font-size: var(--fs-body);
    color: var(--text-light);
}

section > ul li::before {
    content: '>';
    color: var(--text-green);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: var(--fs-body);
}

section > ul li:last-child,
section > ol li:last-child {
    border-bottom: none;
}

section > ul li a,
section > ol li a {
    color: var(--text-green);
}

section > ul li a:hover,
section > ol li a:hover {
    color: #fff;
}

/* --- Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.gallery-item {
    display: block;
    border: 1px solid var(--border-green);
    overflow: hidden;
    background: var(--bg-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
    border-color: var(--text-green);
    box-shadow: 0 0 12px rgba(0, 204, 0, 0.25);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.2s;
}

.gallery-item:hover img {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mirror Link Blocks --- */
.mirror-links-block {
    background: var(--bg-card);
    border: 1px solid var(--border-green);
    padding: 15px 20px;
    margin-bottom: 12px;
    min-height: 50px;
}

.mirror-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.mirror-badge {
    background: var(--border-green);
    color: var(--bg-primary);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 3px 8px;
    text-transform: uppercase;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.mirror-url {
    color: var(--text-green);
    font-size: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-green);
    padding: 4px 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
    -webkit-user-select: all;
    cursor: text;
}

.mirror-meta {
    margin-top: 8px;
    font-size: var(--fs-small);
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .mirror-link-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mirror-badge {
        font-size: 9px;
    }

    .mirror-url {
        width: 100%;
        flex: none;
        font-size: 10px;
        order: 2;
    }

    .mirror-link-row .onion-bar-copy {
        font-size: 9px;
        padding: 3px 8px;
    }

    .mirror-meta {
        font-size: 10px;
    }
}

/* --- YouTube Embeds --- */
iframe {
    display: block;
    width: 100%;
    max-width: 560px;
    height: 315px;
    border: 1px solid var(--border-green);
    margin: 20px 0;
    background: var(--bg-primary);
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

th, td {
    border: 1px solid #1a1a1a;
    padding: 8px 12px;
    text-align: left;
    font-size: var(--fs-body);
}

th {
    background: var(--bg-card);
    color: var(--text-green);
    text-transform: uppercase;
    font-size: var(--fs-small);
    letter-spacing: 1px;
}

td {
    background: var(--bg-secondary);
    color: var(--text-light);
}

/* --- Code / Pre --- */
code:not(.onion-bar-url):not(.mirror-url) {
    background: var(--bg-input);
    color: var(--text-green);
    padding: 1px 5px;
    font-size: var(--fs-body);
}

pre {
    background: var(--bg-card);
    border: 1px solid var(--bg-input);
    padding: 14px;
    overflow-x: auto;
    margin-bottom: 15px;
    font-size: var(--fs-body);
    color: var(--text-green);
}

/* --- Horizontal Rules --- */
hr {
    border: none;
    border-top: 1px solid var(--border-green);
    margin: 20px 0;
}

/* --- Footer --- */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-green);
    padding: 20px 0;
    margin-top: 0;
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
}

footer nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin-bottom: 15px;
}

footer nav ul li {
    padding: 0;
    border-bottom: none;
    position: static;
}

footer nav ul li::before {
    content: none;
}

footer nav ul li a {
    display: block;
    padding: 5px 14px;
    border: 1px solid transparent;
    font-size: var(--fs-nav);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-green);
    transition: border-color 0.15s, color 0.15s;
}

footer nav ul li a:hover {
    border-color: var(--border-green);
    color: #fff;
}

footer p {
    color: var(--text-dim);
    font-size: var(--fs-small);
    margin-bottom: 4px;
    line-height: var(--lh);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-green);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-green);
}

/* --- Selection --- */
::selection {
    background: var(--text-green);
    color: var(--bg-primary);
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 1024px) {
    section {
        padding: 18px 20px;
    }

    h1 {
        font-size: 22px;
    }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 768px) {
    .onion-bar-inner {
        padding: 6px 10px;
        gap: 6px;
    }

    .onion-bar-label {
        font-size: 10px;
    }

    .onion-bar-url {
        font-size: 10px;
        padding: 3px 6px;
    }

    .onion-bar-copy {
        font-size: 10px;
        padding: 3px 10px;
    }

    .hamburger {
        display: flex;
    }

    #mainNav {
        display: none;
        position: absolute;
        top: 46px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-green);
        padding: 0;
        z-index: 999;
    }

    #mainNav.open {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav ul li a {
        padding: 10px 20px;
        border-bottom: 1px solid #1a1a1a;
        font-size: 14px;
        letter-spacing: 1px;
    }

    nav ul li:last-child a {
        border-bottom: none;
    }

    footer nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    footer nav ul li a {
        padding: 8px 16px;
        font-size: 12px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 14px;
    }

    h3 {
        font-size: 13px;
    }

    section {
        padding: 15px;
        margin-bottom: 15px;
    }

    iframe {
        height: 200px;
        max-width: 100%;
    }

    .header-inner {
        padding: 0 10px;
        height: 46px;
    }

    .logo {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .onion-bar-inner {
        padding: 5px 8px;
        gap: 5px;
    }

    .onion-bar-label {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .onion-bar-url {
        font-size: 9px;
        padding: 2px 5px;
    }

    .onion-bar-copy {
        font-size: 9px;
        padding: 2px 8px;
        letter-spacing: 1px;
    }

    .header-inner {
        height: 42px;
    }

    #mainNav {
        top: 42px;
    }

    .logo {
        font-size: 11px;
        letter-spacing: 1px;
        padding: 4px 8px;
    }

    h1 {
        font-size: 15px;
        letter-spacing: 1px;
    }

    h2 {
        font-size: 13px;
    }

    section {
        padding: 12px 10px;
        margin-bottom: 12px;
    }

    iframe {
        height: 170px;
    }

    p {
        font-size: 12px;
    }

    section > ul li,
    section > ol li {
        font-size: 12px;
        padding: 5px 0 5px 15px;
    }

    nav ul li a {
        padding: 9px 15px;
        font-size: 12px;
    }
}
