/* =========================================
   blockchain.day - Glassmorphism Frosted SaaS
   ========================================= */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: #1a1a2e;
    background: #f8f9ff;
    overflow-x: hidden;
}

/* --- Gradient Mesh Background --- */
#gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(129, 140, 248, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 70%, rgba(52, 211, 153, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 70%, rgba(251, 191, 36, 0.1) 0%, transparent 40%);
    transition: opacity 0.3s ease;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.code-text {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    font-weight: 400;
}

/* --- Glassmorphic Cards --- */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* =========================================
   HERO SECTION
   ========================================= */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    padding: 40px 20px;
}

.hero-card {
    max-width: 600px;
    width: 100%;
    padding: 48px 40px;
    text-align: center;
    animation: heroFadeIn 1s ease-out;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-date {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.hero-dot {
    color: #fbbf24;
}

.hero-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #34d399, #fbbf24);
    border-radius: 2px;
    margin: 20px auto;
}

.hero-concept-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.hero-concept {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #fbbf24;
    margin-bottom: 12px;
}

.hero-concept-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    animation: bounceDown 2s ease-in-out infinite;
    opacity: 0.6;
}

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

/* =========================================
   CONCEPT GALLERY
   ========================================= */
#concepts {
    background: #f8f9ff;
    padding: 80px 20px;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #1a1a2e;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1rem;
    color: #667eea;
    font-weight: 400;
}

.section-title-light {
    color: #ffffff;
}

.section-subtitle-light {
    color: rgba(255, 255, 255, 0.7);
}

.concept-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.concept-gallery::-webkit-scrollbar {
    display: none;
}

.concept-card {
    scroll-snap-align: center;
    flex: 0 0 300px;
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.15);
}

.concept-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 16px;
    margin-bottom: 20px;
}

.concept-title {
    font-size: 1.25rem;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.concept-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

/* =========================================
   CHAIN VISUALIZATION
   ========================================= */
#chain-viz {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.chain-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    padding: 20px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chain-container::-webkit-scrollbar {
    display: none;
}

.chain-scroll {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px;
    min-width: min-content;
}

/* Block Card */
.block-card {
    flex: 0 0 200px;
    min-width: 200px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #ffffff;
    position: relative;
}

.block-card.genesis {
    border-color: #34d399;
    box-shadow: 0 8px 32px rgba(52, 211, 153, 0.2);
}

.block-card.confirmed {
    border-color: #818cf8;
    box-shadow: 0 8px 32px rgba(129, 140, 248, 0.2);
}

.block-card.pending {
    border-color: #fbbf24;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.2);
    animation: blockEnter 0.5s ease-out;
}

@keyframes blockEnter {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.block-number {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.block-field {
    margin-bottom: 6px;
}

.block-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.block-value {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-all;
    line-height: 1.3;
}

.block-value.hash-value {
    color: #34d399;
}

.block-value.prev-hash-value {
    color: #818cf8;
}

.block-status {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 8px;
}

.block-status.status-genesis {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.block-status.status-confirmed {
    background: rgba(129, 140, 248, 0.2);
    color: #818cf8;
}

.block-status.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Chain Connector Arrow */
.chain-arrow {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chain-arrow svg {
    overflow: visible;
}

.chain-arrow-line {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 0.6s ease;
}

.chain-arrow-line.animated {
    stroke-dashoffset: 0;
}

.chain-arrow-head {
    fill: rgba(255, 255, 255, 0.4);
}

/* Controls */
.chain-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.add-block-btn,
.reset-chain-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-block-btn:hover,
.reset-chain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.add-block-btn:active,
.reset-chain-btn:active {
    transform: translateY(0);
}

/* =========================================
   HOW IT WORKS
   ========================================= */
#how-it-works {
    background: #f8f9ff;
    padding: 80px 20px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.step-card {
    padding: 32px 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-4px);
}

.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50%;
}

.step-title {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.step-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

/* =========================================
   DAILY CHALLENGE
   ========================================= */
#daily-challenge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 20px;
}

.challenge-card {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 40px;
    text-align: center;
}

.challenge-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.challenge-question {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #ffffff;
    margin-bottom: 32px;
}

.challenge-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.challenge-option {
    padding: 16px 24px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.95rem;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.challenge-option:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.25);
}

.challenge-option.selected-correct {
    background: rgba(52, 211, 153, 0.3);
    border-color: #34d399;
}

.challenge-option.selected-wrong {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.5);
}

.challenge-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.challenge-option.disabled.highlight-correct {
    opacity: 1;
    background: rgba(52, 211, 153, 0.3);
    border-color: #34d399;
}

.challenge-feedback {
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    min-height: 24px;
}

/* =========================================
   FOOTER
   ========================================= */
#footer {
    background: #1a1a2e;
    padding: 48px 20px;
    text-align: center;
}

.footer-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.footer-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* =========================================
   SCROLL ANIMATIONS
   ========================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 600px) {
    .hero-card {
        padding: 36px 24px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .concept-card {
        flex: 0 0 260px;
    }

    .challenge-card {
        padding: 32px 20px;
    }

    .block-card {
        flex: 0 0 170px;
        min-width: 170px;
        padding: 16px 12px;
    }
}
