/* ============================================================
   RESET & BASE STYLES
   ============================================================ */

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

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: #5A3A20;
    font-family: 'JetBrains Mono', monospace;
    color: #3A2A1A;
    font-weight: 300;
    font-weight: 400;
    font-weight: 700;
}

/* JetBrains Mono Light */
.domain-name {
    font-weight: 300;
}

/* ============================================================
   SCROLL CONTAINER & PANELS
   ============================================================ */

.scroll-container {
    display: flex;
    width: 400vw;
    height: 100vh;
    scroll-behavior: smooth;
}

.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   LEATHER TEXTURE BACKGROUND (CSS-GENERATED)
   ============================================================ */

.panel-1,
.panel-4 {
    background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(255,255,255,0.02) 50%, rgba(0,0,0,0.05) 100%),
                radial-gradient(ellipse at 40% 60%, #7A5A38 0%, transparent 70%),
                radial-gradient(ellipse at 70% 30%, rgba(100,70,40,0.2) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(90,60,30,0.15) 0%, transparent 50%),
                repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,0.02) 40px, rgba(0,0,0,0.02) 41px),
                #5A3A20;
}

.panel-1::before,
.panel-4::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='5' result='noise'/%3E%3C/filter%3E%3Crect width='100' height='100' fill='%235A3A20' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    pointer-events: none;
}

/* ============================================================
   PANEL 1: LOG OPENS
   ============================================================ */

.domain-name-container {
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;
}

.domain-name {
    font-size: clamp(3rem, 10vw, 9rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 0.95;
    color: #E8D8C0;
    margin: 0;
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out 0.8s forwards;
}

.domain-label {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #6A5A4A;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out 1.1s forwards;
}

/* Border-animate frame for Panel 1 */
.domain-name-container::before,
.domain-name-container::after {
    content: '';
    position: absolute;
    border: 2px solid #8A6A4A;
    inset: 0;
    transform-origin: left;
    animation: borderDrawTop 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s forwards;
}

.domain-name-container::after {
    animation: borderDrawRight 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

.domain-name-container {
    position: relative;
}

.domain-name-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #8A6A4A;
    transform: scaleX(0);
    transform-origin: left;
    animation: scaleXAnimation 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s forwards;
}

@keyframes scaleXAnimation {
    to { transform: scaleX(1); }
}

/* Right side of frame */
.domain-name-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: #8A6A4A;
    transform: scaleY(0);
    transform-origin: top;
    animation: scaleYAnimation 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

@keyframes scaleYAnimation {
    to { transform: scaleY(1); }
}

/* Bottom border */
.domain-name-container > * {
    position: relative;
}

.domain-name::before {
    content: '';
    position: absolute;
    bottom: -3rem;
    left: 0;
    right: 0;
    height: 2px;
    background: #8A6A4A;
    transform: scaleX(0);
    transform-origin: right;
    animation: scaleXReverseAnimation 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

@keyframes scaleXReverseAnimation {
    to { transform: scaleX(1); }
}

.domain-name::after {
    content: '';
    position: absolute;
    top: -3rem;
    left: -3rem;
    bottom: -3rem;
    width: 2px;
    background: #8A6A4A;
    transform: scaleY(0);
    transform-origin: bottom;
    animation: scaleYReverseAnimation 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

@keyframes scaleYReverseAnimation {
    to { transform: scaleY(1); }
}

/* ============================================================
   PANEL 2: THE PLATES
   ============================================================ */

.panel-2 {
    background: #5A3A20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 5vw;
}

.plates-wrapper {
    display: flex;
    gap: 3vw;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.plate {
    width: 26vw;
    height: 80vh;
    background: #F0E8D8;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.plate-1 {
    background: linear-gradient(135deg, #F0E8D8 0%, #F0E8D8 50%),
                radial-gradient(ellipse at 50% 40%, rgba(100,140,90,0.15) 0%, transparent 60%);
}

.plate-2 {
    background: linear-gradient(135deg, #F0E8D8 0%, #F0E8D8 50%),
                radial-gradient(ellipse at 50% 40%, rgba(180,150,70,0.12) 0%, transparent 60%);
}

.plate-3 {
    background: linear-gradient(135deg, #F0E8D8 0%, #F0E8D8 50%),
                radial-gradient(ellipse at 50% 40%, rgba(60,80,120,0.13) 0%, transparent 60%);
}

.fish-svg {
    width: 180px;
    height: 120px;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInScale 0.5s ease-out 0.4s forwards;
}

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

.plate-label {
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #3A2A1A;
    text-align: center;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.6s forwards;
}

.plate::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    border: 2px solid #8A6A4A;
    transform: scaleX(0);
    transform-origin: left;
    animation: plateBorderAnimation 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.plate-1::before {
    animation-delay: 0s;
}

.plate-2::before {
    animation-delay: 0.4s;
}

.plate-3::before {
    animation-delay: 0.8s;
}

@keyframes plateBorderAnimation {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    25% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleY(1);
        transform-origin: top right;
    }
    75% {
        transform: scaleX(0);
        transform-origin: right;
    }
    100% {
        transform: scaleX(1) scaleY(0);
        transform-origin: bottom;
    }
}

/* ============================================================
   PANEL 3: THE OBSERVATION
   ============================================================ */

.panel-3 {
    background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(255,255,255,0.02) 50%, rgba(0,0,0,0.05) 100%),
                radial-gradient(ellipse at 40% 60%, rgba(122,90,56,0.3) 0%, transparent 70%),
                radial-gradient(ellipse at 70% 30%, rgba(100,70,40,0.2) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(90,60,30,0.15) 0%, transparent 50%),
                repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,0.02) 40px, rgba(0,0,0,0.02) 41px),
                #5A3A20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-3::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='5' result='noise'/%3E%3C/filter%3E%3Crect width='100' height='100' fill='%235A3A20' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    pointer-events: none;
}

.watercolor-wash {
    width: 80vw;
    height: 70vh;
    background: #F0E8D8;
    position: absolute;
    top: 15vh;
    left: 10vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watercolor-wash::before,
.watercolor-wash::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.watercolor-wash::before {
    background: radial-gradient(ellipse at 30% 40%, rgba(100,140,90,0.2) 0%, transparent 60%);
}

.watercolor-wash::after {
    background: radial-gradient(ellipse at 70% 60%, rgba(180,150,70,0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 20%, rgba(60,80,120,0.18) 0%, transparent 55%);
}

.fish-school {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 5;
}

.fish-group {
    animation: fishFloat 6s ease-in-out infinite;
    transform-origin: center;
}

.fish-group:nth-child(2) {
    animation-delay: 0s;
}

.fish-group:nth-child(3) {
    animation-delay: 1s;
}

.fish-group:nth-child(4) {
    animation-delay: 2s;
}

.fish-group:nth-child(5) {
    animation-delay: 3s;
}

.fish-group:nth-child(6) {
    animation-delay: 4s;
}

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

.observation-text {
    position: absolute;
    top: 5vh;
    left: 10vw;
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.4;
    color: #3A2A1A;
    max-width: 60vw;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.3s forwards;
}

/* ============================================================
   PANEL 4: THE LOG CLOSES
   ============================================================ */

.closing-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.closing-frame {
    position: relative;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #8A6A4A;
    animation: closingFrameAnimation 2.5s ease-in-out 0.5s forwards;
}

@keyframes closingFrameAnimation {
    0% {
        border: 2px solid #8A6A4A;
        opacity: 1;
    }
    100% {
        border: 2px solid #8A6A4A;
        opacity: 0;
    }
}

.closing-title {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #8A6A4A;
    margin: 0;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.3s forwards;
}

.closing-fish {
    width: 80px;
    height: 50px;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.5s forwards;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes borderDrawTop {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes borderDrawRight {
    from {
        transform: scaleY(0);
        transform-origin: top;
    }
    to {
        transform: scaleY(1);
    }
}

@keyframes borderDrawBottom {
    from {
        transform: scaleX(0);
        transform-origin: right;
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes borderDrawLeft {
    from {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    to {
        transform: scaleY(1);
    }
}

/* ============================================================
   RESPONSIVE & UTILITY
   ============================================================ */

/* Color palette reference for design compliance */
:root {
    --leather-base: #5A3A20;
    --leather-highlight: #7A5A38;
    --leather-dark: #3A2218;
    --watercolor-paper: #F0E8D8;
    --text-on-leather: #E8D8C0;
    --text-on-paper: #3A2A1A;
    --border-frame: #8A6A4A;
    --fish-accent: #B87A4A;
    --label-text: #6A5A4A;
}

::-webkit-scrollbar {
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #3A2218;
}

::-webkit-scrollbar-thumb {
    background: #8A6A4A;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B87A4A;
}
