/* ========== GLOBAL VARIABLES & RESET (Shared with navigation) ========== */
:root {
    --bg: #f0ece4;
    --card-bg: #ffffff;
    --text: #1e1d1b;
    --text-light: #8b8170;
    --border: #dbd1bf;
    --accent: #c9af86;
    --accent-hover: #c0ad8a;
    --nav-bg: rgba(245, 241, 235, 0.94);
    --shadow: 0 6px 20px rgba(0,0,0,0.035);
    --radius: 20px;
    --transition: 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    --nav-text: #1e1d1b;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #191714;
        --card-bg: #25221d;
        --text: #e8dfcd;
        --text-light: #b3a892;
        --border: #5b5140;
        --accent: #b9986b;
        --accent-hover: #c8a87a;
        --nav-bg: rgba(25, 23, 20, 0.94);
        --shadow: 0 6px 20px rgba(0,0,0,0.25);
        --nav-text: #e8dfcd;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0ece4;
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
    padding: 0;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(165deg, #f5f1e8 0%, #ece5d8 30%, #f2ede3 60%, #e8e1d3 100%);
    background-attachment: fixed;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #191714;
        background: linear-gradient(165deg, #1f1c17 0%, #171410 30%, #1d1a14 60%, #14110e 100%);
    }
}

/* ========== NAVIGATION ========== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    width: 100%;
    transition: box-shadow 0.3s;
}
.site-nav.scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    gap: 1rem;
}
.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.75; }
.nav-logo .logo-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-links a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
.nav-links a:hover,
.nav-links a.active {
    background: rgba(180, 160, 130, 0.12);
    color: var(--accent);
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.1px;
    user-select: none;
    color: var(--nav-text);
    background: none;
    border: none;
    font-family: inherit;
}
.nav-dropdown-toggle:hover {
    background: rgba(180, 160, 130, 0.12);
    color: var(--accent);
}
.nav-dropdown-toggle .arrow {
    font-size: 0.6rem;
    transition: transform 0.25s;
}
.nav-dropdown.open .nav-dropdown-toggle .arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 1001;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 0;
    white-space: nowrap;
    color: var(--nav-text);
    text-decoration: none;
    transition: background 0.15s;
}
.nav-dropdown-menu a:hover {
    background: rgba(180, 160, 130, 0.1);
    color: var(--accent);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    flex-direction: column;
    gap: 5px;
    z-index: 1002;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    padding: 1rem;
    overflow-y: auto;
    flex-direction: column;
    gap: 0.25rem;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    display: block;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}
.mobile-menu a:hover,
.mobile-menu a.active {
    background: rgba(180, 160, 130, 0.12);
    color: var(--accent);
}
.mobile-menu .mobile-divider { height: 1px; background: var(--border); margin: 0.4rem 0; }
.mobile-menu .mobile-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    padding: 0.5rem 1rem 0.2rem;
}

/* ========== PAGE SPECIFIC STYLES (Vol.3) ========== */
.container {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.8rem;
}

header {
    text-align: center;
    margin-bottom: 2.6rem;
    position: relative;
}

.volume-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffffdd;
    backdrop-filter: blur(10px);
    color: #6b5e4f;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 0.4rem 1.6rem;
    border-radius: 40px;
    margin-bottom: 1rem;
    border: 1px solid #d9cebc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.volume-badge span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9a87c;
}

h1 {
    font-size: 2.7rem;
    font-weight: 580;
    letter-spacing: 1.2px;
    color: #383327;
    margin-bottom: 0.3rem;
    line-height: 1.25;
}

.subtitle {
    font-size: 0.98rem;
    color: var(--text-light);
    font-weight: 370;
    border-bottom: 1.5px solid #dbd1bf;
    display: inline-block;
    padding-bottom: 0.55rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
    letter-spacing: 0.4px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.9rem;
    margin-top: 0.4rem;
}

.palette-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 1px 4px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: transform var(--transition), box-shadow 0.35s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(190, 178, 158, 0.3);
}

.palette-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(0,0,0,0.07), 0 5px 14px rgba(0,0,0,0.04);
}

.color-strip {
    display: flex;
    width: 100%;
    height: 108px;
    cursor: pointer;
    position: relative;
}

.color-swatch {
    flex: 1;
    position: relative;
    transition: filter 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 7px;
}

.color-swatch:hover {
    filter: brightness(0.88);
    transform: scaleY(1.06);
    z-index: 3;
    box-shadow: 0 8px 18px rgba(0,0,0,0.13);
    border-radius: 2px;
}

.swatch-hex {
    font-size: 0.64rem;
    font-weight: 550;
    color: rgba(255,255,255,0.93);
    background: rgba(18,18,18,0.42);
    padding: 3px 10px;
    border-radius: 16px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.22s;
    pointer-events: none;
    white-space: nowrap;
}

.color-swatch:hover .swatch-hex {
    opacity: 1;
}

.swatch-hex.light-text {
    color: rgba(25,25,25,0.88);
    background: rgba(255,255,255,0.7);
}

.palette-info {
    padding: 1.2rem 1.25rem 1rem 1.25rem;
    background: var(--card-bg);
}

.palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.palette-name {
    font-weight: 650;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
    color: #353026;
    position: relative;
}

.palette-name::after {
    content: '';
    display: block;
    width: 28px;
    height: 2.5px;
    background: #c9af86;
    border-radius: 4px;
    margin-top: 4px;
    opacity: 0.55;
}

.copy-group-btn {
    background: #f7f3eb;
    border: none;
    padding: 0.48rem 1.1rem;
    border-radius: 26px;
    font-size: 0.75rem;
    font-weight: 530;
    color: #524b3e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.26s;
    border: 0.5px solid #dbd0bb;
    letter-spacing: 0.35px;
    background: #fdfaf5;
}

.copy-group-btn:hover {
    background: #e5dac8;
    border-color: #c0ad8a;
    color: #2c2519;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.color-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    align-items: center;
    margin-top: 0.2rem;
}

.color-tag {
    font-size: 0.72rem;
    background: #f5f2ea;
    color: #544f44;
    padding: 0.32rem 0.85rem;
    border-radius: 24px;
    font-weight: 440;
    letter-spacing: 0.2px;
    white-space: nowrap;
    border: 0.5px solid #e4dccb;
    display: inline-flex;
    align-items: center;
    transition: all 0.22s;
    cursor: pointer;
}

.color-tag:hover {
    background: #e7dfce;
    border-color: #c8b896;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 7px;
    opacity: 0.9;
}

.footer-note {
    margin-top: 3.4rem;
    text-align: center;
    color: #9f9786;
    font-size: 0.85rem;
    font-weight: 360;
    border-top: 1px solid #ddd5c4;
    padding-top: 1.8rem;
    width: 100%;
    max-width: 620px;
    letter-spacing: 0.4px;
    line-height: 1.6;
}

.toast-message {
    position: fixed;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    background: #28241e;
    color: #f5efe4;
    padding: 0.7rem 2.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 470;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.4px;
}
.toast-message.show { opacity: 1; }

/* Dark mode overrides for page elements */
@media (prefers-color-scheme: dark) {
    .palette-name { color: #ece4d5; }
    .palette-name::after { background: #b9986b; }
    .color-tag { background: #37322a; color: #dbd3c2; border-color: #4f473b; }
    .color-tag:hover { background: #484236; border-color: #7d705a; }
    .copy-group-btn { background: #37322a; border-color: #554d3f; color: #dbd1bc; }
    .copy-group-btn:hover { background: #4b4338; color: #efe5d2; }
    h1 { color: #e8dfcd; }
    .subtitle { color: #b3a892; border-bottom-color: #5b5140; }
    .volume-badge { background: #2a2620dd; color: #c4b69c; border-color: #5b5140; }
    .footer-note { color: #958c79; border-top-color: #474031; }
    .palette-card { border-color: rgba(120,108,88,0.28); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .container { padding: 1.4rem 1rem; }
    h1 { font-size: 2rem; }
    .palette-grid { grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 1.3rem; }
}
@media (min-width: 769px) {
    .mobile-menu { display: none !important; }
}