/* ==========================================================
   yesang.org - Bauhaus Chrome-Metallic Design System
   ========================================================== */

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

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

body {
    background-color: #F5F5F0;
    color: #1A1A1A;
    font-family: 'Source Sans 3', 'Inter', sans-serif;
    line-height: 1.72;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Grain Overlay System --- */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: multiply;
}

.grain-overlay.grain-heavy {
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.grain-overlay.grain-light {
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* --- Hero Section --- */
#hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8, #B8B8B8);
    z-index: 100;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#hero.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-title {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 12vw;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #8A8A8A, #E8E8E8, #C0C0C0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 3;
    position: relative;
    line-height: 1;
}

#hero-subtitle {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    z-index: 3;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease 0.5s forwards;
}

.label-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5A5A5A;
}

.chrome-divider {
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, #C0C0C0, #E8E8E8);
}

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

/* --- Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #0A0A0A;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#sidebar.visible {
    transform: translateX(0);
}

#sidebar-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#sidebar-identity {
    position: relative;
    z-index: 3;
    margin-bottom: 32px;
}

.sidebar-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8, #B8B8B8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-tld {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #888888;
    letter-spacing: 0.05em;
}

#sidebar-position {
    position: relative;
    z-index: 3;
    margin-bottom: 40px;
    padding: 16px 0;
    border-top: 1px solid #333333;
    border-bottom: 1px solid #333333;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.position-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666666;
}

#position-indicator {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #E8E8E8;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.position-total {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #555555;
}

#sidebar-nav {
    position: relative;
    z-index: 3;
    list-style: none;
    flex: 1;
}

#sidebar-nav li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    text-decoration: none;
    color: #888888;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: font-weight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #D4D4D4;
}

.nav-link.active {
    color: #E8E8E8;
    font-weight: 900;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, #C0C0C0, #E8E8E8);
}

.nav-shape {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.nav-link.active .nav-shape {
    opacity: 1;
}

.nav-shape svg {
    width: 18px;
    height: 18px;
}

.nav-text {
    position: relative;
}

#sidebar-footer {
    position: relative;
    z-index: 3;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #222222;
}

.bauhaus-shapes svg {
    width: 72px;
    height: 24px;
}

/* --- Main Content --- */
#content {
    margin-left: 0;
    padding: 0;
    opacity: 0;
    transition: margin-left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    position: relative;
    min-height: 100vh;
}

#content.visible {
    margin-left: 280px;
    opacity: 1;
}

#content > .grain-overlay {
    position: fixed;
    top: 0;
    left: 280px;
    width: calc(100vw - 280px);
    height: 100vh;
    z-index: 1;
}

/* --- Content Sections --- */
.content-section {
    padding: 64px 48px;
    position: relative;
    z-index: 2;
}

/* --- Section Divider (border-animate) --- */
.section-divider {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 48px;
    padding: 16px 0;
}

.divider-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #B8B8B8, #E8E8E8, #C0C0C0);
    transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.divider-line.expanded {
    width: 100%;
}

.divider-shapes {
    margin-top: 16px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}

.divider-line.expanded + .divider-shapes,
.section-divider.visible .divider-shapes {
    opacity: 0.4;
    transform: translateY(0);
}

.divider-shapes svg {
    width: 72px;
    height: 24px;
}

/* --- Content Grid (asymmetric two-column) --- */
.content-grid {
    display: grid;
    grid-template-columns: 62% 38%;
    gap: 1px;
    position: relative;
}

.content-grid::before {
    content: '';
    position: absolute;
    left: 62%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, #C0C0C0, #E8E8E8, #C0C0C0);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.primary-column {
    padding-right: 32px;
}

.secondary-column {
    padding-left: 32px;
}

/* --- Content Frames (technical drawing containers) --- */
.content-frame {
    position: relative;
    padding: 32px;
    margin-bottom: 24px;
    /* Borders drawn by animation - initially hidden */
    border: 1px solid transparent;
    transition: border-color 0.1s ease;
}

.content-frame.border-drawn {
    border-color: #B8B8B8;
}

/* Animated border segments */
.content-frame::before,
.content-frame::after {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8, #B8B8B8);
}

/* Top + Right borders */
.content-frame::before {
    top: -1px;
    left: -1px;
    width: 0;
    height: 1px;
    transition: width 0.2s ease;
}

.content-frame.animate-border::before {
    width: calc(100% + 2px);
}

/* Bottom + Left borders */
.content-frame::after {
    bottom: -1px;
    right: -1px;
    width: 0;
    height: 1px;
    transition: width 0.2s ease 0.4s;
}

.content-frame.animate-border::after {
    width: calc(100% + 2px);
}

/* Frame label */
.frame-label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888888;
    z-index: 1;
}

/* --- Typography --- */
.section-headline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1A1A1A;
    margin-bottom: 24px;
    margin-top: 16px;
    line-height: 1.2;
    transition: font-weight 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-headline.weight-animated {
    font-weight: 800;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: #2A2A2A;
    margin-bottom: 16px;
}

.chrome-text {
    background: linear-gradient(135deg, #A0A0A0, #E0E0E0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --- Meta Frames --- */
.meta-frame {
    background: rgba(245, 245, 240, 0.5);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid rgba(192, 192, 192, 0.2);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888888;
}

.meta-value {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1A1A1A;
    letter-spacing: 0.02em;
}

/* --- Annotation Frames --- */
.annotation-frame {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.05), rgba(232, 232, 232, 0.08));
    border-left: 2px solid #B87333;
}

.annotation-text {
    font-family: 'Source Sans 3', sans-serif;
    font-style: italic;
    font-size: 14px;
    line-height: 1.65;
    color: #5A5A5A;
    margin-top: 16px;
}

/* --- Data Grid --- */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.data-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888888;
}

.data-value {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #4A6FA5, #6A8FC5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.data-bar {
    height: 3px;
    background: rgba(192, 192, 192, 0.2);
    position: relative;
    overflow: hidden;
}

.data-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A6FA5, #6A8FC5);
    width: 0;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.data-fill.animated {
    /* width set inline */
}

/* --- Framework Pillars --- */
.framework-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

.pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.pillar-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pillar-icon svg {
    width: 48px;
    height: 48px;
}

.pillar-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1A1A1A;
}

.pillar-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    line-height: 1.65;
    color: #5A5A5A;
}

/* --- Projection Timeline --- */
.projection-timeline {
    margin-top: 40px;
    padding: 24px 0;
}

.timeline-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.timeline-connector {
    position: absolute;
    top: 50%;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, #4A6FA5, #C0C0C0, rgba(192, 192, 192, 0.3));
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-point {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #C0C0C0;
    background: #F5F5F0;
    transition: all 0.3s ease;
}

.timeline-point.active .timeline-dot {
    background: #4A6FA5;
    border-color: #4A6FA5;
    box-shadow: 0 0 12px rgba(74, 111, 165, 0.4);
}

.timeline-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #888888;
}

.timeline-point.active .timeline-label {
    color: #4A6FA5;
    font-weight: 500;
}

/* --- Method Steps --- */
.method-steps {
    margin-top: 32px;
}

.method-step {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid rgba(192, 192, 192, 0.2);
    align-items: flex-start;
}

.method-step:last-child {
    border-bottom: none;
}

.step-number {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 36px;
    color: rgba(192, 192, 192, 0.3);
    line-height: 1;
    flex-shrink: 0;
    width: 56px;
    letter-spacing: 0.02em;
}

.step-content {
    flex: 1;
}

.step-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.step-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #5A5A5A;
}

/* --- Footer --- */
#site-footer {
    padding: 48px 48px 64px;
    position: relative;
    z-index: 2;
}

.footer-rule {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C0C0C0, #E8E8E8, #C0C0C0, transparent);
    margin-bottom: 32px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-domain {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888888;
}

.footer-shapes svg {
    width: 72px;
    height: 24px;
    opacity: 0.4;
}

/* --- Material Textures --- */
/* Brushed metal texture on certain frames */
.content-frame:nth-child(odd)::before {
    /* horizontal micro-lines inherited from border animation */
}

/* Polished chrome on meta frames */
.meta-frame::before {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(232, 232, 232, 0.15), rgba(184, 184, 184, 0.1));
}

/* --- Responsive adjustments --- */
@media (max-width: 1024px) {
    #sidebar {
        width: 240px;
    }

    #content.visible {
        margin-left: 240px;
    }

    #content > .grain-overlay {
        left: 240px;
        width: calc(100vw - 240px);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-grid::before {
        display: none;
    }

    .primary-column,
    .secondary-column {
        padding: 0;
    }

    .framework-pillars {
        grid-template-columns: 1fr;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #sidebar {
        width: 200px;
        padding: 24px 16px;
    }

    #content.visible {
        margin-left: 200px;
    }

    #content > .grain-overlay {
        left: 200px;
        width: calc(100vw - 200px);
    }

    .content-section {
        padding: 32px 24px;
    }

    #hero-title {
        font-size: 16vw;
    }
}
