/* Base Styles */
:root {
    /* Colors */
    --primary: #3366FF;
    --secondary: #6941C6;
    --accent: #00BFA5;
    
    /* Brand Accent Colors */
    --brand-red: #FF4D4F;
    --brand-pink: #FF7EB6;
    --brand-azure: #0091FF;
    --brand-yellow: #FFCB45;
    --brand-green: #52C41A;
    --brand-beige-yellow: #F5DEB3;
    
    /* Neutral Colors */
    --background: #FFFFFF;
    --surface: #F9FAFB;
    --border: #E4E7EC;
    
    /* Text Colors */
    --text-primary: #101828;
    --text-secondary: #667085;
    --text-inverse: #FFFFFF;
    
    /* Spacing */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-s: 12px;
    --space-m: 16px;
    --space-l: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    --space-5xl: 128px;
    
    /* Font Sizes */
    --text-2xl: 48px;
    --text-xl: 36px;
    --text-l: 30px;
    --text-m: 24px;
    --text-s: 20px;
    --text-base: 16px;
    --text-xs: 14px;
    --text-2xs: 12px;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito Sans', sans-serif;
    color: var(--text-primary);
    background-color: var(--background);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    min-height: 100vh;
    font-size: var(--text-base);
    line-height: 1.5;
    background-color: var(--background);
}

/* Scroll Snap Container */
.scroll-container {
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
    scroll-snap-type: none; /* disabled for stability */
    position: relative;
    width: 100%;
}

.snap-section {
    position: relative;
    width: 100%;
}

/* Apply scroll snap to all sections */
.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: 96px; /* height of your fixed header */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-m);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bungee', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-s) var(--space-l);
    border-radius: 4px;
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background-color: #2952cc;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background-color: rgba(51, 102, 255, 0.05);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--text-inverse);
}

.btn-accent:hover {
    background-color: #00a890;
}

/* Header Layout */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-l) var(--space-2xl);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    background-color: var(--background);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header.scrolled .sticky-logo {
    opacity: 1;
}


/* Navigation */
.top-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: var(--space-l);
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-link i {
    font-size: 1.5rem;
}

.nav-link:hover {
    color: var(--primary);
}

.sticky-logo {
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.mini-logo {
    height: 40px;
    width: auto;
}

.mini-logo {
    height: 48px;
    width: auto;
}

/* Hero Section */
.hero {
    height: 100vh;
    background-color: var(--brand-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.hero-logo {
    max-width: 900px;
    margin: 0 auto;
    animation: zoomIn 1.2s ease-out;
}

/* Contract Address Section */
.contract-section {
    padding: var(--space-3xl) 0;
}

.contract-box {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-l);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.contract-address {
    font-family: 'Nunito Sans', sans-serif;
    font-size: var(--text-base);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: var(--space-m);
}

/* Mission Statement */
.mission {
    padding: var(--space-3xl) 0;
    background-color: var(--background);
    text-align: center;
}

.mission-text {
    max-width: 640px;
    margin: 0 auto;
    font-size: var(--text-m);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Text Reveal Section - From CodePen Example */
.h100 {
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.first_pin {
    background-color: var(--brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0 20px;
    box-sizing: border-box;
}

.texte_split {
    font-size: 48px;
    font-family: 'Bungee', sans-serif;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.split-char {
    opacity: 0;
    display: inline-block;
    transform: translateY(20px);
}

/* Gallery */
.gallery {
    padding: var(--space-3xl) 0;
    background-color: var(--surface);
}

/* Masonry Gallery */
.masonry-gallery {
    width: 100%;
    padding: 0;
    background-color: var(--background);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 10px;
    gap: 0; /* removes all space between grid items */
    padding: 0;
  }
  

.masonry-item {
    overflow: hidden;
    border-radius: 0;
}

.masonry-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 0;
}

.masonry-item img:hover {
    transform: scale(1.03);
}

/* Media queries for responsive masonry */
@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 0 var(--space-2xl);
    }
}

@media (min-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}



/* Footer */
.footer {
    padding: var(--space-2xl) 0;
    background-color: var(--background);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-l);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

/* Marquee Scroll Section */
.scroll-marquee {
    overflow: hidden;
    background-color: #292C33;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
}

.marquee-row {
    overflow: hidden;
    white-space: nowrap;
    font-size: 2rem;
    font-family: 'Bungee', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    overflow: hidden;
    width: 100%;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: scroll-left var(--marquee-duration, 20s) linear infinite;
}

.marquee-content span {
    display: inline-block;
}

#row1 {
    color: var(--brand-azure);
}

#row2 {
    color: var(--brand-green);
}

#row3 {
    color: var(--brand-pink);
}

#row4 {
    color: var(--brand-yellow);
}



@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

#row1 { --marquee-duration: 20s; }
#row2 { --marquee-duration: 25s; }
#row3 { --marquee-duration: 30s; }
#row4 { --marquee-duration: 22s; }
#row5 {
    color: var(--brand-red);
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Styles */

/* Mobile & Tablet (<= 1023px) overrides */
@media screen and (max-width: 1023px) {
    /* Ensure no horizontal scrolling */
    html, body {
        overflow-x: hidden;
    }

    /* Allow the BODY to handle scrolling instead of nested container */
    .scroll-container {
        height: auto;
        overflow-y: visible;
        scroll-snap-type: none; /* disable snap */
    }

    .snap-section {
        scroll-snap-align: none;
        scroll-snap-stop: normal;
        min-height: 100dvh;
        height: auto;
        scroll-margin-top: 96px; /* space for fixed header */
    }

    .hero,
    .scroll-marquee {
        min-height: 100dvh;
        height: auto;
        scroll-margin-top: 96px;
    }
}

/* Re-enable scroll snap for screens wider than small phones */
@media screen and (min-width: 481px) {
    .scroll-container {
        height: 100dvh;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }
    .snap-section {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* Tablet (640px - 1023px) */
@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px - 1279px) */
@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .container {
        padding: 0 var(--space-2xl);
    }
}

.pt-2xl { padding-top: var(--space-2xl); }  /* 48px */
.pt-3xl { padding-top: var(--space-3xl); }  /* 64px */


.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
  
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    padding: 0;
  
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    color: var(--text-primary);
    font-size: 1.5rem;
  
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  .back-to-top-btn:hover {
    transform: translateX(-50%) scale(1.1);
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
  }
  
  
  #section-whats-better {
    background-color: var(--brand-azure);
  }
  
  #section-friends {
    background-color: var(--brand-pink);
  }
  
  #section-token {
    background-color: var(--brand-red);
  }

  #section-nothing-beats {
    background-color: var(--brand-green);
  }
  
  #contract {
    background-color: var(--brand-yellow);
  }

/* Image overlay */
#img-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

#img-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#img-overlay img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
}

/* Close button */
#img-overlay .close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

#img-overlay .close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Download button */
#download-btn {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 32px;
  border-radius: 24px;
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 600;
  text-decoration: none;
}

#download-btn:hover {
  background: #2952cc;
}

#img-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}

/* Mobile and Tablet Optimizations */
@media screen and (max-width: 768px) {
    html, body, .scroll-container, .snap-section, .first_pin, .scroll-marquee {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .texte_split {
        font-size: 32px;
        padding: 0 15px;
        text-align: center;
        width: 100%;
    }
    
    .marquee-row {
        font-size: 1.5rem;
    }
    
    .site-header {
        padding: var(--space-m) var(--space-l);
    }
    
    .scroll-marquee {
        padding: 1vh 0;
    }
}

/* Small Mobile Optimizations */
@media screen and (max-width: 480px) {
    /* Re-enable marquee animation with slower speed and enforce overflow hidden */
    .marquee-content {
        animation: scroll-left 30s linear infinite;
        white-space: nowrap;
        display: inline-block;
    }
    .marquee-row {
        overflow: hidden;
        white-space: nowrap;
    }
    .texte_split {
        font-size: 24px;
        padding: 0 10px;
    }
    
    .marquee-row {
        font-size: 1.2rem;
    }
}