/* --- GLOBAL RESET & LAYOUT --- */
* {
    box-sizing: border-box; /* Ensures padding/borders don't expand widths */
}

body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden; /* Prevents horizontal scrollbar */
}

/* =========================================
   BLOCK 1: HEADER & HOOVES (Strict Frame)
   ========================================= */
.block1-container {
    position: relative;
    width: 100%;
    height: 40vh; 
    min-height: 300px;
    max-height: 500px;
    background-color: #2c2c2c; 
    /* STRICT FRAME: Cuts off anything leaving the box */
    overflow: hidden; 
}
/* --- DRIP CONTAINER --- */
.drip-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;          /* IMPORTANT: must have a unit (%) */
  z-index: 60;          /* above the text */
  pointer-events: none;
}

/* SHARED FRAME STYLES */
.drip-frame {
  position: absolute;
  inset: 0;             /* top:0 left:0 right:0 bottom:0 */
  background-size: 100% 100%;
  background-position: top center;
  background-repeat: no-repeat;

  opacity: 0;
  animation-duration: 1.2s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
  animation-fill-mode: both;
  pointer-events: none;
}

/* Frame images + per-frame animation */
.df1 { background-image: url('Images/frame1.png'); animation-name: dripFrame1; }
.df2 { background-image: url('Images/frame2.png'); animation-name: dripFrame2; }
.df3 { background-image: url('Images/frame3.png'); animation-name: dripFrame3; }

@keyframes dripFrame1 {
  0% {opacity:1;} 33.333% {opacity:1;}
  33.334% {opacity:0;} 100% {opacity:0;}
}
@keyframes dripFrame2 {
  0% {opacity:0;} 33.333% {opacity:0;}
  33.334% {opacity:1;} 66.666% {opacity:1;}
  66.667% {opacity:0;} 100% {opacity:0;}
}
@keyframes dripFrame3 {
  0% {opacity:0;} 66.666% {opacity:0;}
  66.667% {opacity:1;} 100% {opacity:1;}
}

.text-overlay { z-index: 30; }   /* must be lower than drip-container (60) */


/* --- HOOF CONTAINER --- */
.hoof-container {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none; 
}

/* SHARED STYLES */
.hoof {
    position: absolute;
    width: clamp(40px, 6vw, 80px);
    height: auto;
    opacity: 0; /* Start invisible */
    pointer-events: auto; /* Allow hover */
    will-change: transform, opacity;
}

/* PAUSE ON HOVER (Applies to all) */
.hoof:hover {
    animation-play-state: paused !important;
    filter: brightness(1.2);
    cursor: grab;
    z-index: 50;
    opacity: 1 !important; /* Ensure it stays visible if paused mid-fade */
}

/* --- ANIMATION LOGIC --- */

/* Group 1: Left -> Right (Hooves 1-4) */
.move-right {
    animation: walkRight 3s ease-in-out infinite;
}

@keyframes walkRight {
    0%   { opacity: 0; transform: translate(-30px, 10px) rotate(var(--rot)); }
    20%  { opacity: 1; transform: translate(0px, 0px) rotate(var(--rot)); }
    60%  { opacity: 1; transform: translate(10px, -5px) rotate(var(--rot)); }
    100% { opacity: 0; transform: translate(30px, -10px) rotate(var(--rot)); }
}

/* Group 2: Right <- Left (Hooves 5-8) */
.move-left {
    animation: walkLeft 3s ease-in-out infinite;
}

@keyframes walkLeft {
    0%   { opacity: 0; transform: translate(30px, -10px) rotate(var(--rot)); }
    20%  { opacity: 1; transform: translate(0px, 0px) rotate(var(--rot)); }
    60%  { opacity: 1; transform: translate(-10px, -5px) rotate(var(--rot)); }
    100% { opacity: 0; transform: translate(-30px, 10px) rotate(var(--rot)); }
}

/* --- THE WAVE PATTERN POSITIONS --- */
/* Each hoof gets a position on the curve and a specific delay */

/* 1. Bottom Left */
.hoof:nth-of-type(1) {
    --rotation: 20deg;
    left: 5%; top: 80%;
    animation-delay: 0s;
}

/* 2. Moving Up */
.hoof:nth-of-type(2) {
    --rotation: 35deg;
    left: 15%; top: 65%;
    animation-delay: 0.5s;
}

/* 3. First Peak */
.hoof:nth-of-type(3) {
    --rotation: 45deg;
    left: 25%; top: 50%;
    animation-delay: 1.0s;
}

/* 4. The Dip */
.hoof:nth-of-type(4) {
    --rotation: 10deg;
    left: 40%; top: 55%; 
    animation-delay: 1.5s;
}

/* 5. Lowest Point of Dip */
.hoof:nth-of-type(5) {
    --rotation: -10deg;
    left: 55%; top: 60%;
    animation-delay: 2.0s;
}

/* 6. Climbing Back Up */
.hoof:nth-of-type(6) {
    --rotation: -40deg;
    left: 70%; top: 40%;
    animation-delay: 2.5s;
}

/* 7. High Right */
.hoof:nth-of-type(7) {
    --rotation: -50deg;
    left: 85%; top: 25%;
    animation-delay: 3.0s;
}

/* 8. Top Right Exit */
.hoof:nth-of-type(8) {
    --rotation: -60deg;
    left: 95%; top: 10%;
    animation-delay: 3.5s;
}
@keyframes fadeIn { to { opacity: 1; } }



/* Interaction */
.hoof:hover {
    cursor: grab;
    filter: brightness(1.2);
    z-index: 20; 
    transform: scale(1.1) rotate(var(--rotation)); /* Mild pop effect */
}

/* --- POSITIONS (The Wave Path) --- */
/* We set the fixed X/Y coordinates here. The animation moves them slightly *around* these points. */

/* 1. Bottom Left */
.h1 { --rot: 10deg;  left: 5%;  top: 80%; animation-delay: 0s; }

/* 2. Moving Up */
.h2 { --rot: 25deg;  left: 15%; top: 65%; animation-delay: 1.5s; }

/* 3. First Peak */
.h3 { --rot: 35deg;  left: 25%; top: 50%; animation-delay: 0.5s; }

/* 4. The Dip (End of Left-to-Right group) */
.h4 { --rot: 10deg;  left: 40%; top: 55%; animation-delay: 2.0s; }

/* 5. Lowest Point (Start of Right-to-Left group) */
.h5 { --rot: -10deg; left: 55%; top: 60%; animation-delay: 0s; }

/* 6. Climbing Back Up */
.h6 { --rot: -30deg; left: 70%; top: 40%; animation-delay: 1.5s; }

/* 7. High Right */
.h7 { --rot: -45deg; left: 85%; top: 25%; animation-delay: 0.5s; }

/* 8. Top Right Exit */
.h8 { --rot: -60deg; left: 95%; top: 10%; animation-delay: 2.0s; }
/* Text Overlay */
.text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -30%);
    z-index: 30;
    font-size: clamp(40px, 10vw, 100px);
    font-weight: bold;
    letter-spacing: 5px;
    color: white;
    user-select: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap; 
}

.letter-target { transition: color 0.3s ease; display: inline-block; }
.letter-target:hover { color: rgba(148, 191, 167, 1); cursor: pointer; }


/* =========================================
   BLOCK 2: RIBBON (Strict Frame)
   ========================================= */
.block2-container {
    width: 100%;
    height: 120px; 
    background-color: white; 
    /* STRICT FRAME: Removed Border, Added Overflow Hidden */
    overflow: hidden; 
    position: relative;
    border: none; /* No border as requested */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.marquee-row {
    width: 100%;
    overflow: hidden;
    height: 50%; 
    display: flex;
    align-items: center;
}

.marquee-track-right {
    display: flex;
    width: max-content; 
    animation: scrollRight 20s linear infinite; 
}
.marquee-track-left {
    display: flex;
    width: max-content; 
    /* Uses the new scrollLeft animation */
    animation: scrollLeft 20s linear infinite; 
}
.marquee-text {
    font-size: 30px; 
    font-weight: bold;
    text-transform: uppercase;
    color: #333;
    white-space: nowrap;
    padding-right: 40px; 
}

@keyframes scrollRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}
@keyframes scrollLeft {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   MIDDLE ROW (BLOCKS 3 & 4) (Strict Frames)
   ========================================= */
.middle-row-container {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 3 | 4 */
  width: 100%;
  gap: 0;
}

/* BLOCK 3 */
.block3-container {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background-image: url("Images/block3.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;  
}

.falling-coin{
  position: absolute;
  top: -60px;
  width: clamp(30px, 5vw, 50px);
  height: auto;

  pointer-events: auto; /* was none */
  cursor: pointer;

  /* CSS vars controlled by JS */
  --fall-distance: 500px;
  --coin-scale: 1;

  animation-name: coinFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/* Option A: freeze coin under cursor */
.falling-coin:hover{
  animation-play-state: paused;
  z-index: 10;
}

@keyframes coinFall{
  0%   { transform: translateY(0) rotate(0deg) scale(var(--coin-scale)); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(var(--fall-distance)) rotate(720deg) scale(var(--coin-scale)); opacity: 1; }
}


/* =========================================
   BLOCK 4 (Fixed)
   ========================================= */
.block4-container {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  /* Removed padding to let content hit the edges */
  background-image: url("Images/block4.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover; /* Ensures background fills the space */
}

.disappearing-elements-wrapper {
  width: 100%;
  height: 100%;

  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 equal columns */
  gap: 0; /* Removed gap so elements touch/fill the area evenly */

  align-items: stretch;   
  justify-items: stretch;
  
  /* Removed padding so grid goes edge-to-edge */
  opacity: 0;
  animation: fadeIn 1s ease-out 0.5s forwards;
}

.vanish-item {
  width: 100%;
  height: 100%;          
  display: block; 

  /* CHANGED from 'contain' to 'fill' */
  /* 'fill' forces the image to stretch to the exact size of the grid cell */
  object-fit: fill;   
  
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
}

.vanish-item:hover { 
    opacity: 0; 
}



/* =========================================
   BLOCK 5: PARALLAX LETTERS (Strict Frame)
   ========================================= */
.block5-container {
    position: relative;
    width: 100%;
    height: 300px; 
    background-color: white;
    /* STRICT FRAME: Removed Border */
    overflow: hidden; 
    border: none;
}

.parallax-letter {
    position: absolute;
    width: auto;
    height: clamp(25px, 5vw, 50px); 
    transition: transform 0.1s ease-out;
    pointer-events: none; 
}

/* Scattered Positions */
.pos-f { top: 10%; left: 5%; } .pos-f1 { top: 25%; left: 15%; } .pos-f2 { top: 45%; left: 8%; }
.pos-f3 { top: 60%; left: 20%; } .pos-f4 { top: 80%; left: 10%; } .pos-f5 { top: 15%; left: 30%; }
.pos-n { top: 5%; left: 45%; } .pos-n1 { top: 35%; left: 40%; } .pos-n2 { top: 70%; left: 50%; }
.pos-r { top: 10%; left: 65%; } .pos-r1 { top: 40%; left: 60%; } .pos-r2 { top: 65%; left: 70%; }
.pos-u { top: 20%; left: 80%; } .pos-u1 { top: 50%; left: 85%; } .pos-u2 { top: 85%; left: 75%; }
.pos-t { top: 5%; left: 90%; } .pos-t1 { top: 30%; left: 95%; } .pos-t2 { top: 75%; left: 92%; }


/* =========================================
   BOTTOM ROW (BLOCKS 6, 7, 8) (Strict Frames)
   ========================================= */
.bottom-row-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* 6 | 7 | 8 */

  width: 100%;
  gap: 0;
}  
.block6-container{
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background-image: url("Images/block6.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.block7-container, .block8-container {
  min-width: 0;
  height: clamp(240px, 36vh, 350px);
  overflow: hidden;
  position: relative;
}

/* Block 6 */
.block6-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Block 7 */
.block7-container {height: 100%; cursor: pointer; background-color: #000; }
.block7-img { 
    width: 100%; height: 100%; object-fit: cover; position: absolute; top:0; left:0; 
    transition: opacity 0.5s ease-in-out; opacity: 0;
    animation: fadeIn 1.5s ease-out 1s forwards;
}
.img-base-state { z-index: 1; }
.img-hover-state { z-index: 2; opacity: 0; animation: none; }
.block7-container:hover .img-hover-state { opacity: 1; }

/* --- BLOCK 8 (waves) --- */
.block8-container{
  background:#dcb3b3;
  height: 100%;      /* or your needed height */
  overflow:hidden;
  position: relative;
}

.waves-svg{
  width:100%;
  height:100%;
  display:block;
}



/* Responsive */
@media (max-width: 768px) {
    .block1-container { height: 300px; }
    .hoof { width: 40px; }
    .text-overlay { font-size: 50px; }
}

:root{
  --layout-font: "Unbounded", sans-serif;
}

/* Block 1 title */
.text-overlay,
.text-overlay span{
  font-family: var(--layout-font);
  font-weight: 400; /* Regular */
}
.marquee-text{
  font-family: var(--layout-font);
  font-weight: 400;
}
/* Add to the bottom of style.css */
@media (max-width: 768px) {
    /* Stack the Middle Row (Block 3 and 4) */
    .middle-row-container {
        grid-template-columns: 1fr; /* Change from 2 columns to 1 */
        height: auto; /* Allow height to grow */
    }

    /* Give blocks height so they don't collapse */
    .block3-container, .block4-container {
        height: 300px; /* Adjust height as needed */
    }

    /* Stack the Bottom Row (Block 6, 7, 8) */
    .bottom-row-container {
        grid-template-columns: 1fr; /* Change from 3 columns to 1 */
        height: auto;
    }

    /* Ensure bottom blocks have distinct height on mobile */
    .block6-container, .block7-container, .block8-container {
        height: 250px; 
    }
}