/* eesugi.com - Pixel-Art Cedar Workshop */
/* Fonts: Nunito 800, Varela Round 400, Silkscreen 400 */

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Varela Round', sans-serif;
    font-weight: 400;
    color: #5c4a3a;
    background-color: #f5e6c8;
    overflow-x: hidden;
    line-height: 1.72;
}

/* ========== CEDAR GRAIN TEXTURE ========== */
.light-panel,
.dark-panel,
.merge-panel {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ========== TYPOGRAPHY ========== */
.pixel-font {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1, h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

p {
    font-family: 'Varela Round', sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
}

/* ========== PIXEL NAV ========== */
#pixel-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 1000;
    padding: 8px 16px;
    background: rgba(42, 31, 20, 0.85);
    border-radius: 4px;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    image-rendering: pixelated;
}

.nav-icon svg {
    transform: scale(2.5);
    image-rendering: pixelated;
}

.nav-icon.active {
    opacity: 1;
}

.nav-icon.active svg {
    animation: pixel-pulse 1s step-end infinite;
}

.nav-icon:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

@keyframes pixel-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== SCENE BASE ========== */
.scene {
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* ========== SPLIT SCREEN ========== */
.split-screen {
    display: grid;
    grid-template-columns: 45fr 55fr;
}

.split-screen.flipped .panel-left {
    order: 1;
}

.split-screen.flipped .panel-right {
    order: 2;
}

.panel {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.light-panel {
    background-color: #f5e6c8;
    background-image:
        radial-gradient(ellipse at center, #f5e6c8 0%, #ede0c4 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

.dark-panel {
    background-color: #2a1f14;
    color: #d4c4a8;
}

/* ========== SCENE 1: WORKSHOP DOOR ========== */
#scene-1 {
    height: 100vh;
}

.door-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.pixel-door {
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 24px rgba(26, 18, 9, 0.2));
}

#door-left {
    transform-origin: 14px 80px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#door-right {
    transform-origin: 106px 80px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.door-open #door-left {
    transform: perspective(200px) rotateY(70deg);
    opacity: 0.3;
}

.door-open #door-right {
    transform: perspective(200px) rotateY(-70deg);
    opacity: 0.3;
}

.door-open #workshop-interior {
    opacity: 1 !important;
    transition: opacity 0.4s ease 0.2s;
}

.scroll-hint {
    font-size: 0.65rem;
    color: #b8860b;
    animation: bounce-hint 2s ease-in-out infinite;
}

@keyframes bounce-hint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hero-text-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.domain-name {
    font-size: 0.75rem;
    color: #b8860b;
    display: inline-block;
}

.blink-cursor {
    animation: blink 1s step-end infinite;
    color: #b8860b;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-tagline {
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    color: #f5e6c8;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== SCENE 2: WORKBENCH ========== */
#scene-2 {
    min-height: 120vh;
}

.stagger-content {
    padding: 64px 48px;
    max-width: 480px;
}

.text-block {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.text-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-block:nth-child(2) {
    margin-left: 40px;
}

.text-block:nth-child(4) {
    margin-left: 60px;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #b8860b;
    margin-bottom: 16px;
    padding: 4px 8px;
    border: 1px dashed #b8860b;
}

.highlight {
    color: #b8860b;
    font-size: 0.7rem;
    vertical-align: baseline;
}

/* Workbench Diorama */
.workbench-diorama {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pixel-workbench {
    position: relative;
    width: 320px;
    height: 400px;
}

.wb-surface {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    height: 16px;
    background-color: #b8860b;
    box-shadow: 0 4px 0 #5c4a3a;
}

.pixel-tool {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    image-rendering: pixelated;
}

.pixel-tool:hover {
    transform: translateY(-8px) scale(1.15);
}

.pixel-tool svg {
    image-rendering: pixelated;
}

.tool-hammer {
    top: 40px;
    left: 40px;
}

.tool-saw {
    top: 80px;
    right: 40px;
}

.tool-chisel {
    top: 160px;
    left: 80px;
}

.tool-plane {
    top: 200px;
    right: 60px;
}

.wood-blocks {
    position: absolute;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.wood-block {
    image-rendering: pixelated;
}

.block-1 {
    width: 48px;
    height: 32px;
    background-color: #c46b3a;
}

.block-2 {
    width: 32px;
    height: 48px;
    background-color: #b8860b;
    margin-top: -16px;
}

.block-3 {
    width: 40px;
    height: 24px;
    background-color: #7a9e7e;
    margin-top: 8px;
}

.pixel-shavings {
    position: absolute;
    bottom: 48px;
    left: 0;
    width: 100%;
}

.shaving {
    position: absolute;
    width: 8px;
    height: 4px;
    background-color: #d4c4a8;
    opacity: 0.5;
}

.s1 { left: 20%; bottom: 0; transform: rotate(15deg); }
.s2 { left: 35%; bottom: 8px; transform: rotate(-25deg); }
.s3 { left: 50%; bottom: 4px; transform: rotate(45deg); }
.s4 { left: 65%; bottom: 12px; transform: rotate(-10deg); }
.s5 { left: 80%; bottom: 2px; transform: rotate(30deg); }

.tool-tooltip {
    position: absolute;
    background-color: #1a1209;
    color: #f5e6c8;
    padding: 4px 8px;
    font-size: 0.65rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    z-index: 10;
}

.tool-tooltip.visible {
    opacity: 1;
}

/* ========== SCENE 3: GALLERY (MERGE) ========== */
.merge-scene {
    display: flex;
    align-items: center;
    justify-content: center;
}

.merge-panel {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 48px;
    background: linear-gradient(135deg, #f5e6c8 0%, #e8d4a8 30%, #d4b896 60%, #ede0c4 100%);
}

.center-label {
    margin-bottom: 48px;
}

.gallery-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

.gallery-frame {
    position: relative;
    padding: 16px;
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.gallery-frame.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 18, 9, 0.15);
}

.gallery-frame:hover .pixel-artwork {
    image-rendering: auto;
    filter: none;
}

.frame-content {
    overflow: hidden;
    image-rendering: pixelated;
}

.pixel-artwork {
    display: block;
    image-rendering: pixelated;
    width: 200px;
    height: 150px;
    transition: filter 0.3s ease;
}

.corner-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
}

.corner-bracket.top-left {
    top: 0;
    left: 0;
    border-top: 3px solid #c46b3a;
    border-left: 3px solid #c46b3a;
}

.corner-bracket.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 3px solid #c46b3a;
    border-right: 3px solid #c46b3a;
}

.frame-label {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 0.65rem;
    color: #5c4a3a;
}

/* ========== DIAMOND DIVIDER ========== */
.diamond-divider {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 48px;
}

.diamond {
    color: #b8860b;
    font-size: 8px;
    line-height: 1;
}

/* ========== SCENE 4: TIMBER YARD (FLIPPED) ========== */
#scene-4 {
    min-height: 100vh;
}

.geometric-shapes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 64px 32px;
}

.geo-shape {
    transition: transform 0.5s ease;
    image-rendering: pixelated;
}

.geo-shape svg {
    image-rendering: pixelated;
}

.project-cards {
    padding: 64px 48px;
    max-width: 480px;
}

.project-cards .section-label {
    margin-bottom: 32px;
}

.project-card {
    padding: 24px;
    margin-bottom: 32px;
    border: 1px dashed #b8860b;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:nth-child(odd) {
    margin-left: 24px;
}

.project-card:nth-child(even) {
    margin-right: 24px;
}

.card-label {
    display: block;
    font-size: 0.7rem;
    color: #b8860b;
    margin-bottom: 12px;
}

.project-card p {
    color: #5c4a3a;
    font-size: 0.95rem;
}

/* ========== SCENE 5: FOREST PATH (FINAL MERGE) ========== */
.final-scene {
    min-height: 100vh;
}

.forest-panel {
    position: relative;
    background: #f5e6c8;
    overflow: hidden;
}

.pixel-forest {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.forest-svg {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    opacity: 0.4;
}

.final-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.final-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #2a1f14;
    opacity: 0;
}

.final-title.visible {
    opacity: 1;
}

.final-title .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.final-title .letter.visible {
    opacity: 1;
    transform: scale(1);
}

.final-tagline {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #5c4a3a;
    opacity: 0;
    transition: opacity 0.6s ease 1.5s;
}

.final-tagline.visible {
    opacity: 1;
}

.final-diamonds {
    opacity: 0;
    transition: opacity 0.6s ease 2s;
}

.final-diamonds.visible {
    opacity: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .split-screen {
        grid-template-columns: 1fr;
    }

    .panel {
        min-height: 80vh;
    }

    #pixel-nav {
        gap: 8px;
        padding: 6px 12px;
    }

    .nav-icon svg {
        transform: scale(2);
    }

    .stagger-content {
        padding: 48px 24px;
    }

    .gallery-row {
        flex-direction: column;
        align-items: center;
    }

    .pixel-artwork {
        width: 160px;
        height: 120px;
    }

    .project-cards {
        padding: 48px 24px;
    }

    .pixel-workbench {
        width: 240px;
        height: 320px;
        transform: scale(0.85);
    }

    .geometric-shapes {
        padding: 48px 24px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delay utility classes (applied via JS) */
.stagger-delay-1 { transition-delay: 80ms; }
.stagger-delay-2 { transition-delay: 160ms; }
.stagger-delay-3 { transition-delay: 240ms; }
.stagger-delay-4 { transition-delay: 320ms; }
.stagger-delay-5 { transition-delay: 400ms; }
.stagger-delay-6 { transition-delay: 480ms; }
