/* ==========================================================
   tanso.biz - Victorian Carbon Exhibition Catalog
   ========================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    display: flex;
    min-height: 100vh;
    background-color: #f0e8d8;
    color: #2a1e18;
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
}

/* --- Fixed Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #1a1414;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.aurora-accent-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #d47aa0 0%, #7aa0d4 50%, #d47aa0 100%);
    background-size: 2px 200%;
    animation: auroraShift 6s ease-in-out infinite;
}

@keyframes auroraShift {
    0%, 100% { background-position: 0 0; }
    50% { background-position: 0 100%; }
}

/* Sidebar Ornament SVGs */
.sidebar-ornament-top,
.sidebar-ornament-bottom {
    width: 100%;
    flex-shrink: 0;
}

.sidebar-ornament-top {
    margin-bottom: 20px;
}

.sidebar-ornament-bottom {
    margin-top: auto;
    padding-top: 20px;
}

.scrollwork-border {
    width: 100%;
    height: auto;
    opacity: 0;
    animation: ornamentDraw 2s ease-out 0.5s forwards;
}

@keyframes ornamentDraw {
    0% {
        opacity: 0;
        stroke-dashoffset: 600;
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

.ornament-stroke {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: strokeDraw 2.5s ease-out 0.3s forwards;
}

@keyframes strokeDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Sidebar Title */
.sidebar-title {
    text-align: center;
    margin-bottom: 35px;
    flex-shrink: 0;
}

.sidebar-title-jp {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 28px;
    color: #c4a040;
    letter-spacing: 6px;
    margin-bottom: 4px;
}

.sidebar-title-en {
    display: block;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 700;
    font-size: 22px;
    color: #f0e8d8;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.sidebar-title-sub {
    display: block;
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: #c4a040;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.8;
}

/* Sidebar Navigation */
.sidebar-nav-items {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #f0e8d8;
    border-radius: 2px;
    transition: transform 0.3s ease, text-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.nav-item:hover {
    transform: scale(1.05);
    text-shadow: 0 0 8px rgba(196, 160, 64, 0.3);
    background-color: rgba(196, 160, 64, 0.06);
}

.nav-item.active {
    text-shadow: 0 0 12px rgba(196, 160, 64, 0.5);
    background-color: rgba(196, 160, 64, 0.1);
}

.nav-item.active .nav-numeral,
.nav-item.active .nav-label {
    color: #c4a040;
}

.nav-numeral {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 14px;
    color: #c4a040;
    min-width: 28px;
    transition: color 0.3s ease;
}

.nav-label {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

/* --- Main Content Area --- */
#content {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    padding: 60px 80px;
    max-width: calc(100vw - 280px);
}

/* --- Content Sections --- */
.content-section {
    margin-bottom: 70px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.content-section:nth-child(1) { animation-delay: 0.6s; }
.content-section:nth-child(2) { animation-delay: 0.8s; }
.content-section:nth-child(3) { animation-delay: 0.2s; }
.content-section:nth-child(4) { animation-delay: 0.2s; }
.content-section:nth-child(5) { animation-delay: 0.2s; }
.content-section:nth-child(6) { animation-delay: 0.2s; }
.content-section:nth-child(7) { animation-delay: 0.2s; }
.content-section:nth-child(8) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Hero Section --- */
#hero {
    text-align: center;
    padding: 80px 40px;
    position: relative;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 700;
    font-size: clamp(32px, 4.5vw, 56px);
    color: #1a1414;
    letter-spacing: 3px;
    line-height: 1.2;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.hero-title-accent {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    color: #6a2a2a;
    text-transform: none;
    letter-spacing: 4px;
}

.hero-subtitle {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    color: #6a2a2a;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.hero-epigraph {
    margin-top: 30px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Aurora Divider --- */
.aurora-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #d47aa0 20%, #7aa0d4 50%, #d47aa0 80%, transparent 100%);
    margin: 40px auto;
    max-width: 500px;
    opacity: 0.7;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-numeral {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 16px;
    color: #c4a040;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.section-title {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 44px);
    color: #1a1414;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-flourish {
    display: flex;
    justify-content: center;
}

.section-flourish svg {
    width: 200px;
    height: 20px;
}

/* --- Section Body & Victorian Frame --- */
.section-body {
    max-width: 720px;
    margin: 0 auto;
}

.victorian-frame {
    position: relative;
    padding: 40px 45px;
    border: 1px solid rgba(196, 160, 64, 0.3);
    border-radius: 2px;
    background-color: rgba(240, 232, 216, 0.5);
}

.victorian-frame::before,
.victorian-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #c4a040;
    opacity: 0.6;
}

.victorian-frame::before {
    top: 8px;
    left: 8px;
    border-top: 1px solid;
    border-left: 1px solid;
}

.victorian-frame::after {
    bottom: 8px;
    right: 8px;
    border-bottom: 1px solid;
    border-right: 1px solid;
}

.victorian-frame p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.victorian-frame p:last-child {
    margin-bottom: 0;
}

/* --- Pull Quotes --- */
.pull-quote {
    margin: 35px 0;
    padding: 25px 30px;
    border-left: 3px solid #c4a040;
    background: linear-gradient(90deg, rgba(196, 160, 64, 0.05) 0%, transparent 100%);
    text-indent: 0 !important;
}

.ornamental-text {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(17px, 1.8vw, 21px);
    color: #6a2a2a;
    line-height: 1.6;
}

/* --- Section Ornament Frames --- */
.section-ornament-frame {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.section-ornament-frame-bottom {
    margin-bottom: 0;
    margin-top: 20px;
}

.section-frame-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

/* --- Footer --- */
#footer {
    text-align: center;
    padding: 60px 20px 40px;
    margin-bottom: 0;
}

.footer-ornament {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.footer-ornament svg {
    width: 300px;
    height: 40px;
}

.footer-text {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #2a1e18;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.6;
}

.footer-year {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 13px;
    color: #c4a040;
    letter-spacing: 6px;
    margin-top: 8px;
    opacity: 0.5;
}

/* --- Scroll-triggered visibility (JS will add .visible) --- */
.content-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar-ornament-top,
    .sidebar-ornament-bottom {
        display: none;
    }

    .aurora-accent-line {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, #d47aa0 0%, #7aa0d4 50%, #d47aa0 100%);
    }

    .sidebar-title {
        width: 100%;
        margin-bottom: 15px;
    }

    .sidebar-nav-items {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .nav-item {
        padding: 6px 12px;
    }

    #content {
        margin-left: 0;
        padding: 40px 30px;
        max-width: 100vw;
    }

    body {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    #content {
        padding: 30px 20px;
    }

    .victorian-frame {
        padding: 25px 20px;
    }

    .hero-title {
        font-size: 28px;
    }
}
