/* ── Theme Variables (dark default) ────────────────── */

:root {
    --bg-body: #111111;
    --bg-header: #161616;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --bg-preview: #141414;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --text-faint: #444444;
    --text-icon: #555555;
    --text-label: #cccccc;
    --text-hover: #ffffff;
    --border-header: #222222;
    --border-card: #222222;
    --border-card-hover: #444444;
    --accent-blue: #cccccc;
    --accent-magenta: #888888;
    --shadow-card: none;
    --shadow-card-hover: none;
    --badge-bg: rgba(0,0,0,0.5);
    --badge-text: #666666;
}

body.light-mode {
    --bg-body: #f5f5f5;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --bg-preview: #ebebeb;
    --text-primary: #111111;
    --text-secondary: #333333;
    --text-muted: #666666;
    --text-faint: #999999;
    --text-icon: #888888;
    --text-label: #222222;
    --text-hover: #000000;
    --border-header: #e0e0e0;
    --border-card: #e0e0e0;
    --border-card-hover: #aaaaaa;
    --accent-blue: #333333;
    --accent-magenta: #666666;
    --shadow-card: none;
    --shadow-card-hover: none;
    --badge-bg: rgba(255,255,255,0.8);
    --badge-text: #888888;
}

/* ── Base ──────────────────────────────────────────── */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-secondary);
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
}

/* ── Header / Nav ─────────────────────────────────── */

header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-header);
    padding: 0 24px;
}

nav {
    display: flex;
    align-items: center;
    height: 48px;
    position: relative;
    gap: 24px;
}

/* ── Hamburger (hidden on wide screens) ───────────── */

.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    color: var(--text-hover);
    border-color: var(--border-card-hover);
}

/* ── Site Brand (center column) ───────────────────── */

.site-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-label);
    text-decoration: none;
    z-index: 1;
}

.site-brand:hover {
    color: var(--text-hover);
}

/* ── Nav links (between brand and toggle) ───────── */

nav ul {
    list-style: none;
    display: flex;
    gap: 36px;
    align-items: center;
    margin-left: auto;
}

nav ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.15s;
}

nav ul li a:hover {
    color: var(--text-hover);
}

/* ── Theme Toggle (right column) ──────────────────── */

.theme-toggle {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    font-size: 16px;
}

.theme-toggle:hover {
    color: var(--text-hover);
    border-color: var(--border-card-hover);
}

/* ── Responsive: hamburger dropdown ───────────────── */

@media (max-width: 600px) {
    nav {
        justify-content: space-between;
    }

    .nav-hamburger {
        display: flex;
    }

    .site-brand {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    nav ul {
        display: none;
        position: absolute;
        top: 48px;
        left: 0;
        flex-direction: column;
        background: var(--bg-header);
        border: 1px solid var(--border-header);
        border-top: none;
        padding: 8px 16px;
        gap: 4px;
        width: 160px;
        z-index: 100;
    }

    nav ul.open {
        display: flex;
    }

    nav ul li a {
        display: block;
        padding: 6px 0;
        font-size: 14px;
    }
}

/* ── Hero Grid ────────────────────────────────────── */

.hero {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 16px 32px 32px;
    flex: 1;
    min-height: calc(100vh - 52px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Left card spans both rows */
.hero-samples {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* Top right */
.hero-viewer {
    grid-column: 2;
    grid-row: 1;
}

/* Bottom right */
.hero-about {
    grid-column: 2;
    grid-row: 2;
}

/* ── Card base ────────────────────────────────────── */

.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--border-card);
    background-color: var(--bg-card);
    text-decoration: none;
    color: var(--text-muted);
    transition: background-color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.hero-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-card-hover);
}

.hero-card:hover .card-label {
    color: var(--text-hover);
}

.hero-card:hover .card-icon {
    color: var(--text-secondary);
}

.card-icon {
    color: var(--text-icon);
    display: flex;
}

.card-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-label);
    transition: color 0.15s;
}

.card-desc {
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
    line-height: 1.4;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 560px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }

    .hero-samples {
        grid-column: 1;
        grid-row: 1;
        min-height: 160px;
    }

    .hero-viewer {
        grid-column: 1;
        grid-row: 2;
        min-height: 120px;
    }

    .hero-about {
        grid-column: 1;
        grid-row: 3;
        min-height: 120px;
    }
}

/* ── Iframe (subpages) ────────────────────────────── */

iframe {
    display: block;
    width: 100%;
    border: none;
}

/* ── Samples Page ─────────────────────────────────── */

.samples-page {
    padding: 48px 24px;
    max-width: 900px;
    margin: 0 auto;
}

.samples-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.samples-sub {
    font-size: 14px;
    color: var(--text-faint);
    margin-bottom: 32px;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.sample-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-secondary);
    transition: border-color 0.15s;
}

.sample-card:hover {
    border-color: var(--border-card-hover);
}

.sample-preview {
    position: relative;
    height: 160px;
    background-color: var(--bg-preview);
    background-size: cover;
    background-position: center;
}

.sample-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.sample-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sample-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-label);
}

.sample-card:hover .sample-name {
    color: var(--text-hover);
}

.sample-desc {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.4;
}

/* ── About Page ───────────────────────────────────── */

.about-page {
    padding: 48px 24px;
    max-width: 640px;
    margin: 0 auto;
}

.about-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.about-section {
    margin-bottom: 28px;
}

.about-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-label);
    margin-bottom: 8px;
}

.about-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.about-section ul {
    list-style: none;
    padding: 0;
}

.about-section ul li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    padding: 2px 0 2px 14px;
    position: relative;
}

.about-section ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--text-faint);
}

.about-section ul li strong {
    color: var(--text-label);
}