/* Root Variables */
:root {
    --color-dark-green: #1B2E1F;
    --color-accent-tan: #D4A373;
    --color-off-white: #F1FAEE;
    --color-tan-light: #A68A64;
    --color-green-light: #40916C;
    --color-green-medium: #2D6A4F;
    --color-green-soft: #95D5B2;
    --color-green-dark: #264233;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--color-off-white);
    font-family: 'Barlow', sans-serif;
    color: var(--color-dark-green);
}

/* Scroll Container - Horizontal Scroll */
.scroll-container {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    white-space: nowrap;
}

/* Remove scroll bar styling for cleaner look */
.scroll-container::-webkit-scrollbar {
    height: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--color-off-white);
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-green-light);
    border-radius: 4px;
}

/* Panel Base Styles */
.panel {
    width: 100vw;
    height: 100vh;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 3rem;
    white-space: normal;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Hero Panel */
.hero-panel {
    background: linear-gradient(135deg, var(--color-off-white) 0%, var(--color-green-soft) 100%);
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.hero-content {
    text-align: center;
    max-width: 600px;
}

.hero-title {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-bottom: 1rem;
    animation: titleDraw 2.5s ease-out forwards;
}

@keyframes titleDraw {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-title-text {
    fill: url(#titleGradient);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.japanese-subtitle {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-green-medium);
    margin: 1rem 0;
    animation: breathe 4s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.01);
        opacity: 0.95;
    }
}

.hero-description {
    font-family: 'Barlow', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: var(--color-dark-green);
    line-height: 1.6;
    max-width: 500px;
    animation: fadeIn 2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Circuit-Vine SVGs */
.circuit-vine {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 100vh;
    opacity: 0.8;
}

.vine-path {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
}

/* Diagram Panel */
.diagram-panel {
    background: var(--color-off-white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 4rem 3rem;
}

.section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--color-green-medium);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.device-diagram {
    max-width: 500px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 8px 16px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.diagram-caption {
    font-family: 'Architects Daughter', cursive;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-tan-light);
    text-align: center;
    max-width: 400px;
    line-height: 1.6;
    font-style: italic;
}

/* Closing Panel */
.closing-panel {
    background: linear-gradient(135deg, var(--color-green-medium) 0%, var(--color-green-dark) 100%);
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.closing-content {
    text-align: center;
    max-width: 600px;
}

.closing-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-off-white);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.closing-text {
    font-family: 'Barlow', sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    color: var(--color-green-soft);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.vine-ornament {
    display: flex;
    justify-content: center;
}

.vine-ornament svg {
    width: 200px;
    height: 100px;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .panel {
        padding: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .device-diagram {
        max-width: 350px;
    }

    .diagram-caption {
        font-size: 0.9rem;
    }

    .hero-title {
        max-width: 350px;
    }

    .japanese-subtitle {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .panel {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .device-diagram {
        max-width: 250px;
    }

    .diagram-caption {
        font-size: 0.85rem;
    }

    .hero-title {
        max-width: 250px;
    }

    .japanese-subtitle {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .closing-title {
        font-size: 2rem;
    }

    .closing-text {
        font-size: 1rem;
    }
}

/* Clock hands animation */
.hour-hand {
    animation: rotateHourHand 43200s linear infinite;
    transform-origin: 150px 140px;
    transform-box: fill-box;
}

.minute-hand {
    animation: rotateMinuteHand 3600s linear infinite;
    transform-origin: 150px 140px;
    transform-box: fill-box;
}

@keyframes rotateHourHand {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateMinuteHand {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Print styles */
@media print {
    .scroll-container {
        overflow-x: visible;
    }

    .panel {
        page-break-after: always;
        break-after: page;
    }
}
