/* ===================================
   thesecond.world - Styles
   Bauhaus Ocean World with Cultural Richness
   =================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-offwhite: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --deep-navy: #0d0d1a;
    --ocean-mid: #162447;
    --seafoam: #1f4068;
    --font-handwritten: 'Caveat', cursive;
    --font-body: 'Space Grotesk', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    background: var(--deep-base);
    color: var(--warm-offwhite);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* --- Generative Ocean Canvas --- */
#ocean-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Parallax Layers --- */
#parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.parallax-deep {
    background: radial-gradient(ellipse at 30% 80%, rgba(74, 144, 217, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 20%, rgba(232, 184, 75, 0.05) 0%, transparent 50%);
}

.parallax-mid {
    background: radial-gradient(ellipse at 60% 50%, rgba(74, 144, 217, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 20% 70%, rgba(232, 184, 75, 0.04) 0%, transparent 40%);
}

.parallax-surface {
    background: radial-gradient(ellipse at 50% 10%, rgba(245, 240, 232, 0.03) 0%, transparent 40%);
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 2rem;
    background: linear-gradient(to bottom, rgba(26, 26, 46, 0.95), rgba(26, 26, 46, 0));
    transition: background 0.4s ease;
}

#main-nav.scrolled {
    background: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(10px);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--warm-offwhite);
}

.logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
    position: relative;
}

.logo-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent-gold);
    border-radius: 50%;
}

.logo-text {
    font-family: var(--font-handwritten);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--warm-offwhite);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--muted-gray);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

/* --- Handwritten Typography --- */
.handwritten {
    font-family: var(--font-handwritten);
}

.handwritten-label {
    font-family: var(--font-handwritten);
    color: var(--accent-gold);
    font-size: 1.2rem;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
}

.hero-content {
    text-align: center;
    position: relative;
    max-width: 800px;
}

.bauhaus-shapes {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}

.shape-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid var(--primary-blue);
    top: 20px;
    left: 10%;
    animation-delay: 0s;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid var(--accent-gold);
    top: 50px;
    right: 10%;
    animation-delay: -2s;
    opacity: 0.1;
}

.shape-rect {
    width: 120px;
    height: 120px;
    border: 3px solid var(--accent-gold);
    bottom: 40px;
    left: 20%;
    transform: rotate(15deg);
    animation-delay: -4s;
}

.shape-small-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-blue);
    opacity: 0.08;
    bottom: 80px;
    right: 25%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(1deg); }
}

.hero-title {
    position: relative;
    z-index: 2;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    font-family: var(--font-handwritten);
    line-height: 1.1;
}

.title-line-1 {
    font-size: 2rem;
    color: var(--muted-gray);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.title-line-2 {
    font-size: 4.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--warm-offwhite) 0%, var(--primary-blue) 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--muted-gray);
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.hero-motifs {
    margin: 2rem auto;
    width: 300px;
}

.motif-wave {
    width: 100%;
    height: 60px;
}

.wave-path {
    animation: waveFlow 4s ease-in-out infinite;
}

.wave-2 {
    animation-delay: -1s;
}

@keyframes waveFlow {
    0%, 100% { d: path('M0,30 Q50,10 100,30 T200,30 T300,30 T400,30'); }
    50% { d: path('M0,30 Q50,50 100,30 T200,30 T300,30 T400,30'); }
}

.hero-cta {
    display: inline-block;
    padding: 1rem 3rem;
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--warm-offwhite);
    font-family: var(--font-handwritten);
    font-size: 1.4rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 217, 0.2), transparent);
    transition: left 0.6s ease;
}

.hero-cta:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 217, 0.3);
}

.hero-cta:hover::before {
    left: 100%;
}

/* --- Cultural Border --- */
.cultural-border {
    width: 100%;
    overflow: hidden;
    height: 40px;
}

.cultural-border svg {
    width: 100%;
    height: 100%;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 10;
    padding: 6rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-handwritten);
    font-size: 3rem;
    font-weight: 700;
    color: var(--warm-offwhite);
    margin-bottom: 0.5rem;
}

.section-annotation {
    font-family: var(--font-handwritten);
    color: var(--accent-gold);
    font-size: 1.2rem;
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.world-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.world-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.world-card:hover {
    transform: translateY(-8px);
    border-color: rgba(74, 144, 217, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(74, 144, 217, 0.1);
}

.world-card:hover::before {
    transform: scaleX(1);
}

.card-decoration {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: rgba(13, 13, 26, 0.5);
}

.card-decoration svg {
    width: 80px;
    height: 80px;
    transition: transform 0.6s ease;
}

.world-card:hover .card-decoration svg {
    transform: rotate(15deg) scale(1.1);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-family: var(--font-handwritten);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--warm-offwhite);
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--muted-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 500;
}

/* --- Cultures Section --- */
.section-cultures {
    background: linear-gradient(to bottom, rgba(13, 13, 26, 0.3), transparent, rgba(13, 13, 26, 0.3));
}

.cultures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.culture-item {
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(26, 26, 46, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(232, 184, 75, 0.1);
    transition: all 0.4s ease;
}

.culture-item:hover {
    border-color: rgba(232, 184, 75, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.culture-icon {
    margin-bottom: 1.5rem;
}

.culture-icon svg {
    width: 80px;
    height: 80px;
    transition: transform 0.5s ease;
}

.culture-item:hover .culture-icon svg {
    transform: scale(1.15) rotate(5deg);
}

.culture-name {
    font-family: var(--font-handwritten);
    font-size: 1.6rem;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

.culture-desc {
    color: var(--muted-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Create Section --- */
.section-create {
    background: linear-gradient(to bottom, transparent, rgba(22, 36, 71, 0.2), transparent);
}

.create-container {
    max-width: 1100px;
    margin: 0 auto;
}

.create-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.create-visual {
    position: relative;
    aspect-ratio: 1;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(74, 144, 217, 0.2);
}

#create-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: var(--deep-navy);
}

.create-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bauhaus-compose {
    position: relative;
    width: 200px;
    height: 200px;
}

.compose-circle {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid rgba(74, 144, 217, 0.4);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: composeFloat 6s ease-in-out infinite;
}

.compose-square {
    position: absolute;
    width: 70px;
    height: 70px;
    border: 2px solid rgba(232, 184, 75, 0.4);
    bottom: 20px;
    left: 10px;
    animation: composeFloat 6s ease-in-out infinite -2s;
}

.compose-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid rgba(74, 144, 217, 0.15);
    bottom: 20px;
    right: 10px;
    animation: composeFloat 6s ease-in-out infinite -4s;
}

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

.compose-circle {
    animation-name: composeFloat;
}

.create-info h3 {
    font-family: var(--font-handwritten);
    font-size: 2.2rem;
    color: var(--warm-offwhite);
    margin-bottom: 1rem;
}

.create-info p {
    color: var(--muted-gray);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.create-features {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.feature-text {
    font-size: 0.85rem;
    color: var(--warm-offwhite);
    font-weight: 500;
}

.btn-create {
    padding: 0.9rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-blue), #3a7bc8);
    color: var(--warm-offwhite);
    border: none;
    border-radius: 6px;
    font-family: var(--font-handwritten);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-create::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(232, 184, 75, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 144, 217, 0.4);
}

.btn-create:hover::after {
    width: 300px;
    height: 300px;
}

/* --- Explore Section --- */
.section-explore {
    padding-bottom: 8rem;
}

.depth-meter {
    max-width: 800px;
    margin: 0 auto 4rem;
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.depth-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 400px;
}

.depth-marker {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    opacity: 0.5;
    transition: all 0.4s ease;
}

.depth-marker.active {
    opacity: 1;
}

.depth-label {
    font-family: var(--font-handwritten);
    font-size: 1.3rem;
    color: var(--warm-offwhite);
    min-width: 140px;
}

.depth-value {
    font-size: 0.85rem;
    color: var(--primary-blue);
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 4px;
}

.depth-progress {
    width: 4px;
    background: rgba(74, 144, 217, 0.15);
    border-radius: 2px;
    position: relative;
    min-height: 400px;
}

.depth-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--primary-blue), var(--accent-gold), var(--primary-blue));
    border-radius: 2px;
    transition: height 0.8s ease;
}

/* --- Explore Stats --- */
.explore-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-handwritten);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 10;
    padding: 4rem 2rem 2rem;
    background: rgba(13, 13, 26, 0.8);
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

.footer-logo {
    font-family: var(--font-handwritten);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--warm-offwhite);
}

.footer-tagline {
    color: var(--muted-gray);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--muted-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.footer-decoration svg {
    width: 200px;
    height: 50px;
    opacity: 0.5;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    color: var(--muted-gray);
    font-size: 0.8rem;
}

/* --- Scroll Reveal Animations --- */
.section-header,
.world-card,
.culture-item,
.create-panel,
.depth-meter,
.explore-stats {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-header.revealed,
.world-card.revealed,
.culture-item.revealed,
.create-panel.revealed,
.depth-meter.revealed,
.explore-stats.revealed {
    opacity: 1;
    transform: translateY(0);
}

.world-card:nth-child(2) { transition-delay: 0.1s; }
.world-card:nth-child(3) { transition-delay: 0.2s; }
.world-card:nth-child(4) { transition-delay: 0.3s; }
.world-card:nth-child(5) { transition-delay: 0.4s; }
.world-card:nth-child(6) { transition-delay: 0.5s; }

.culture-item:nth-child(2) { transition-delay: 0.15s; }
.culture-item:nth-child(3) { transition-delay: 0.3s; }
.culture-item:nth-child(4) { transition-delay: 0.45s; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .title-line-2 {
        font-size: 2.8rem;
    }

    .nav-links {
        display: none;
    }

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

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

    .create-panel {
        grid-template-columns: 1fr;
    }

    .create-visual {
        max-width: 100%;
    }

    .explore-stats {
        flex-direction: column;
        gap: 2rem;
    }

    .depth-meter {
        flex-direction: column;
    }

    .depth-progress {
        width: 100%;
        height: 4px;
        min-height: auto;
    }

    .depth-fill {
        width: 0%;
        height: 100%;
        background: linear-gradient(to right, var(--primary-blue), var(--accent-gold));
    }

    .footer-inner {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .create-features {
        flex-direction: column;
        gap: 0.75rem;
    }

    .bauhaus-shapes {
        width: 300px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .cultures-grid {
        grid-template-columns: 1fr;
    }

    .title-line-2 {
        font-size: 2.2rem;
    }

    .section {
        padding: 4rem 1rem;
    }
}
