:root {
    --primary-red: #B21A27;
    --primary-red-dark: #8a1420;
    --dark-black: #1A1A1A;
    --dark-gray: #2a2a2a;
    --off-white: #F9F9F9;
    --pure-white: #FFFFFF;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
    color: var(--dark-black);
    background-color: var(--pure-white);
    overflow-x: hidden;
}
html { scroll-behavior: smooth; }

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== TOP BAR ===== */
.top-bar {
    background-color: var(--dark-black);
    color: var(--pure-white);
    height: 40px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    transition: transform 0.4s ease;
}

.top-bar-content {
    width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info a, .social-links a {
    color: var(--pure-white);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-weight: 600;
}

.contact-info a:hover, .social-links a:hover {
    color: var(--primary-red);
}

.top-bar svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.social-links {
    display: flex;
    gap: 20px;
}

/* ===== NAVBAR + GLASSMORPHISM (Fase 4) ===== */
nav {
    background-color: var(--pure-white);
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    top: 40px;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease, top 0.4s ease;
}
nav.scrolled {
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.logo-container { display: flex; align-items: center; }
.logo-img { height: 45px; width: auto; display: block; }
footer .logo-img { filter: brightness(0) invert(1); height: 55px; }

nav ul { display: flex; }
nav ul li { margin-left: 30px; }
nav ul li a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: var(--transition);
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}
nav ul li a:hover, nav ul li a.active { color: var(--primary-red); }
nav ul li a:hover::after, nav ul li a.active::after { width: 100%; }

.menu-toggle { display: none; flex-direction: column; cursor: pointer; }
.menu-toggle span {
    width: 25px; height: 3px;
    background-color: var(--dark-black);
    margin: 2px 0;
    transition: var(--transition);
}

/* ===== HERO CAROUSEL (Fase 1) ===== */
#ataria {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 160px 0 60px;
    overflow: hidden;
}
.hero-slides {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(26,26,26,0.85) 0%, rgba(178,26,39,0.6) 100%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 3;
    color: var(--pure-white);
    max-width: 1000px;
    padding: 0 20px;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero logo and dice */
.hero-logo-container {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease 0.2s both;
    transition: transform 0.3s ease;
}
.hero-logo-container:hover {
    transform: scale(1.05);
}
.hero-logo-svg {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    overflow: visible;
}

#dice-container {
    transform-origin: 400px 163px;
    cursor: pointer;
}

/* Rolling state: toss and spin */
.rolling {
    animation: diceThrow 1s ease-in-out forwards;
}

@keyframes diceThrow {
    0%   { transform: translateY(0) rotate(0deg) scale(1); filter: none; }
    20%  { transform: translateY(-30px) rotate(90deg) scale(1.05); filter: blur(0.5px); }
    40%  { transform: translateY(-60px) rotate(180deg) scale(1.1); filter: blur(1.5px); }
    60%  { transform: translateY(-30px) rotate(270deg) scale(1.05); filter: blur(0.5px); }
    80%  { transform: translateY(0) rotate(360deg) scale(1); filter: none; }
    90%  { transform: translateY(-15px) rotate(360deg) scale(1); }
    100% { transform: translateY(0) rotate(360deg) scale(1); }
}

/* Dot pop-in animation */
@keyframes dotPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.35); opacity: 1; }
    80%  { transform: scale(0.85); }
    100% { transform: scale(1); opacity: 1; }
}

/* Glow pulse on the dice face after landing */
@keyframes diceGlow {
    0%   { filter: drop-shadow(0 0 0px rgba(178,26,39,0)); }
    50%  { filter: drop-shadow(0 0 18px rgba(178,26,39,0.8)); }
    100% { filter: drop-shadow(0 0 0px rgba(178,26,39,0)); }
}

.dice-landed {
    animation: diceGlow 0.8s ease-out forwards;
}

/* Hero cards below */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 50px;
}
.hero-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    transition: var(--transition);
    border-bottom: 4px solid transparent;
    border: 1px solid rgba(255,255,255,0.15);
}
.hero-card h3 { color: var(--pure-white); font-size: 1.1rem; margin-bottom: 8px; }
.hero-card p { color: rgba(255,255,255,0.8); font-size: 0.95rem; }
.hero-card:hover {
    transform: translateY(-8px);
    border-bottom: 4px solid var(--primary-red);
    background: rgba(255,255,255,0.18);
}

/* ===== PARTICLES (Fase 6) ===== */
.particles-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    opacity: 0.12;
    border-radius: 4px;
    background: var(--pure-white);
}
@keyframes floatUp {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.12; }
    90%  { opacity: 0.12; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ===== WAVE SEPARATORS (Fase 3) ===== */
.wave-separator {
    width: 100%;
    line-height: 0;
    overflow: hidden;
}
.wave-separator svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ===== SECTIONS - general ===== */
section {
    padding: 100px 10%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.section-title {
    font-size: 2.8rem;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 5px;
    background-color: var(--primary-red);
    border-radius: 3px;
}

/* ===== HELBURUAK (improved - Fase 3) ===== */
#helburuak {
    background: linear-gradient(160deg, var(--dark-black) 0%, var(--dark-gray) 100%);
    color: var(--pure-white);
}
.goals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.goal-item {
    padding: 25px;
    border-left: 4px solid var(--primary-red);
    background: rgba(255,255,255,0.04);
    border-radius: 0 12px 12px 0;
    transition: var(--transition);
}
.goal-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(6px);
}
.goal-item h3 { margin-bottom: 10px; color: var(--primary-red); }


/* ===== ZER EGITEN DUGU (improved) ===== */
#zer-egiten-dugu {
    background-color: var(--off-white);
}
.activity-container {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: center;
}
.activity-text { flex: 1; min-width: 300px; }
.activity-text p { margin-bottom: 20px; font-size: 1.1rem; }
.activity-cards {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-width: 300px;
}
.activity-mini-card {
    background: var(--pure-white);
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    transition: var(--transition);
}
.activity-mini-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.activity-mini-card svg {
    width: 44px; height: 44px;
    margin-bottom: 15px;
    fill: var(--primary-red);
}
.activity-mini-card h4 { font-family: 'Montserrat', sans-serif; }

/* ===== NOR GARA (improved - Fase 3) ===== */
#nor-gara { background-color: var(--pure-white); }
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.member-card {
    padding: 30px 20px;
    border: 2px solid var(--off-white);
    border-radius: 20px;
    transition: var(--transition);
    text-align: center;
}
.member-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(178,26,39,0.12);
}
.member-card .icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--pure-white);
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
}
.member-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; }
.member-role {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== HASTAPENA (improved) ===== */
#hastapena {
    background: linear-gradient(160deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--pure-white);
}
#hastapena .section-title::after { background-color: var(--pure-white); }
.crowdfunding-box {
    max-width: 800px;
    margin: 40px auto;
    background: var(--pure-white);
    color: var(--dark-black);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transition: var(--transition);
}
.crowdfunding-box:hover { transform: translateY(-4px); box-shadow: 0 25px 70px rgba(0,0,0,0.3); }
.crowdfunding-box h3 { font-size: 1.5rem; }

.btn-cta {
    display: inline-block;
    background-color: var(--primary-red);
    color: var(--pure-white);
    padding: 16px 44px;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 30px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(178,26,39,0.3);
}
.btn-cta:hover {
    background-color: var(--dark-black);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.btn-cta-light {
    background-color: var(--pure-white);
    color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.btn-cta-light:hover {
    background-color: var(--dark-black);
    color: var(--pure-white);
}

/* ===== FOOTER (improved) ===== */
footer {
    padding: 50px 10%;
    background-color: var(--dark-black);
    color: var(--pure-white);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== SCROLL REVEAL (Fase 2) ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.reveal-left {
    transform: translateX(-40px);
}
.reveal.revealed {
    opacity: 1;
    transform: translate(0, 0);
}
/* staggered delays */
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }
.reveal-d5 { transition-delay: 0.5s; }
.reveal-d6 { transition-delay: 0.6s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .goals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px; left: 0;
        width: 100%;
        background: var(--pure-white);
        padding: 20px;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }
    nav ul.active { display: flex; }
    nav ul li { margin: 10px 0; }
    .menu-toggle { display: flex; }

    #ataria {
        padding-top: 150px;
        padding-bottom: 50px;
        align-items: flex-start;
    }
    .hero-content .slogan { font-size: 1.4rem; margin-top: 15px; }
    .hero-logo-svg { height: 70px; }
    .hero-desc { font-size: 0.95rem; }
    .section-title { font-size: 1.8rem; }
    .crowdfunding-box { padding: 30px 20px; }
    .hero-grid { grid-template-columns: 1fr; gap: 15px; }
    .top-bar { font-size: 0.75rem; }
    .contact-info span { display: none; }
    .contact-info a::after { content: 'Email'; }
    .goals-grid { grid-template-columns: 1fr; }
}
