/* ============================================
   gamelicensor.com - Bauhaus + Ludic Delight
   Palette: Ethereal Blue
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #E8F0F8;
    --bg-deep: #0D1B2A;
    --text-primary: #1B2B3A;
    --text-secondary: #4A7BA7;
    --accent-primary: #5B9BD5;
    --accent-secondary: #89B4D4;
    --highlight: #A3D5FF;
    --contrast: #F5F0E8;
    --text-light: #C8DCE8;
    --column-width: 720px;
    --section-gap: 120px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.25rem);
    line-height: 1.9;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    position: relative;
}

/* --- Vertical Structural Rule --- */
.vertical-rule {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(50% + 8% + var(--column-width) / 2 + 20px);
    width: 1px;
    background-color: rgba(137, 180, 212, 0.2);
    z-index: 0;
    pointer-events: none;
}

/* --- Column Container (shared) --- */
.section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.manifesto-column,
.archive-column,
.grid-column {
    max-width: var(--column-width);
    width: 90%;
    margin-left: calc(50% - 8%);
    transform: translateX(-50%);
}

/* --- Bubble Drift (Decorative) --- */
.bubble-drift {
    position: fixed;
    left: var(--bubble-x);
    top: var(--bubble-y);
    width: var(--bubble-size);
    height: var(--bubble-size);
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(163, 213, 255, 0.12) 0%,
        rgba(91, 155, 213, 0.2) 70%,
        rgba(91, 155, 213, 0.08) 100%
    );
    box-shadow:
        0 0 15px rgba(163, 213, 255, 0.15),
        inset 0 -6px 12px rgba(13, 27, 42, 0.06),
        inset 3px 3px 6px rgba(255, 255, 255, 0.25);
    z-index: 1;
    pointer-events: none;
    animation: bubble-float 12s ease-in-out infinite alternate;
}

.bubble-drift::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 22%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(-30deg);
}

.bubble-drift-1 { animation-delay: 0s; animation-duration: 14s; }
.bubble-drift-2 { animation-delay: -3s; animation-duration: 18s; }
.bubble-drift-3 { animation-delay: -6s; animation-duration: 11s; }
.bubble-drift-4 { animation-delay: -2s; animation-duration: 16s; }
.bubble-drift-5 { animation-delay: -8s; animation-duration: 13s; }
.bubble-drift-6 { animation-delay: -5s; animation-duration: 17s; }

@keyframes bubble-float {
    0% { transform: translate(0, 0); }
    25% { transform: translate(6px, -10px); }
    50% { transform: translate(-4px, -18px); }
    75% { transform: translate(8px, -8px); }
    100% { transform: translate(-2px, -14px); }
}

/* ============================================
   Section 1: The Seal
   ============================================ */
.section--seal {
    height: 100vh;
    min-height: 600px;
    background-color: var(--bg-deep);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 15vh;
    overflow: hidden;
}

.seal-circles {
    position: relative;
    width: clamp(200px, 35vw, 400px);
    height: clamp(200px, 35vw, 400px);
}

.seal-svg {
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.8);
    animation: seal-circles-in 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.seal-circle-filled,
.seal-circle-outline {
    transform-origin: center;
}

.seal-circle-outline {
    stroke-dashoffset: 1250;
    animation: stroke-draw 1.6s ease-out 0.4s forwards;
}

@keyframes seal-circles-in {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.0); }
}

@keyframes stroke-draw {
    0% { stroke-dashoffset: 1250; }
    100% { stroke-dashoffset: 0; }
}

.seal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw + 0.5rem, 5rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #E8F0F8;
    margin-top: 2rem;
    opacity: 0;
    animation: fade-in-up 0.8s ease-out 0.6s forwards;
}

.seal-tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw + 0.3rem, 1.1rem);
    color: var(--text-light);
    margin-top: 1rem;
    text-align: center;
    max-width: 420px;
    opacity: 0;
    animation: fade-in-up 0.8s ease-out 0.9s forwards;
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Section 2: The Manifesto
   ============================================ */
.section--manifesto {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
    min-height: 60vh;
}

.manifesto-block {
    margin-bottom: 3rem;
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.manifesto-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.manifesto-block--col1 {
    padding-left: 0;
}

.manifesto-block--col2 {
    padding-left: calc(720px / 4);
}

.manifesto-shape {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 0.5rem;
}

.manifesto-shape circle,
.manifesto-shape polygon,
.manifesto-shape rect {
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.8s ease-out;
}

.manifesto-block.revealed .manifesto-shape circle,
.manifesto-block.revealed .manifesto-shape polygon,
.manifesto-block.revealed .manifesto-shape rect {
    stroke-dashoffset: 0;
}

.manifesto-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.25rem);
    line-height: 1.9;
    color: var(--text-primary);
    max-width: 520px;
}

/* ============================================
   Section 3: The Archive
   ============================================ */
.section--archive {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
    min-height: 80vh;
}

.archive-card {
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.archive-card.revealed {
    opacity: 1;
    transform: scale(1.0);
}

.archive-image-wrapper {
    position: relative;
    width: 100%;
    border: 2px solid var(--accent-secondary);
    padding: 16px;
    background-color: var(--contrast);
    overflow: hidden;
}

.archive-image {
    width: 100%;
    height: 0;
    padding-bottom: 55.5%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: sepia(25%) saturate(50%) hue-rotate(185deg) brightness(0.88) contrast(1.05);
}

.archive-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    pointer-events: none;
}

.archive-overlay circle,
.archive-overlay rect,
.archive-overlay polygon {
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s ease-out;
}

.archive-card.revealed .archive-overlay circle,
.archive-card.revealed .archive-overlay rect,
.archive-card.revealed .archive-overlay polygon {
    stroke-dashoffset: 0;
}

.archive-caption {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw + 0.2rem, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ============================================
   Section 4: The Grid of Principles
   ============================================ */
.section--grid {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.principles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    position: relative;
}

/* Mondrian-style grid lines with overshoot */
.principles-grid::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    left: 50%;
    width: 1px;
    background-color: var(--accent-secondary);
    transform: translateX(-0.5px);
}

.principles-grid::after {
    content: '';
    position: absolute;
    left: -20px;
    right: -20px;
    top: 50%;
    height: 1px;
    background-color: var(--accent-secondary);
    transform: translateY(-0.5px);
}

.principle-cell {
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.principle-cell.revealed {
    opacity: 1;
    transform: translateY(0);
}

.principle-cell--filled {
    background-color: rgba(163, 213, 255, 0.12);
}

.principle-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw + 0.3rem, 1.8rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.principle-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw + 0.3rem, 1.05rem);
    line-height: 1.7;
    color: var(--text-primary);
}

/* ============================================
   Section 5: The Departure
   ============================================ */
.section--departure {
    height: 60vh;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-primary);
}

.departure-bubble {
    width: clamp(200px, 30vw, 300px);
    height: clamp(200px, 30vw, 300px);
    border-radius: 50%;
    background: radial-gradient(
        circle at 40% 35%,
        rgba(163, 213, 255, 0.1) 0%,
        rgba(91, 155, 213, 0.25) 80%,
        rgba(91, 155, 213, 0.15) 100%
    );
    box-shadow:
        0 0 15px rgba(163, 213, 255, 0.3),
        inset 0 -10px 20px rgba(13, 27, 42, 0.1),
        inset 5px 5px 10px rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    cursor: default;
}

.departure-bubble.revealed {
    opacity: 1;
    transform: scale(1);
}

.departure-bubble::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 22%;
    width: 30%;
    height: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(-30deg);
    pointer-events: none;
}

.departure-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw + 0.5rem, 4.5rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    user-select: none;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 2rem;
}

.footer-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.footer-rule {
    width: 120px;
    border: none;
    border-top: 1px solid var(--text-secondary);
}

.footer-copyright {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw + 0.2rem, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

/* ============================================
   Shake-Error Animation
   ============================================ */
@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
    40%, 60% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(2px); }
}

.shake {
    animation: shake-error 500ms ease-in-out;
}

/* Shake bubble pop effect */
.shake-bubble {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(163, 213, 255, 0.2),
        rgba(91, 155, 213, 0.35)
    );
    box-shadow: 0 0 8px rgba(163, 213, 255, 0.3);
    pointer-events: none;
    z-index: 10;
}

.shake-bubble.inflate {
    animation: bubble-inflate 300ms ease-out forwards;
}

.shake-bubble.pop {
    animation: bubble-pop 150ms ease-in forwards;
}

@keyframes bubble-inflate {
    0% { transform: translateY(-50%) scale(0); }
    100% { transform: translateY(-50%) scale(1); }
}

@keyframes bubble-pop {
    0% { transform: translateY(-50%) scale(1); opacity: 1; }
    100% { transform: translateY(-50%) scale(1.3); opacity: 0; }
}

/* ============================================
   Prefers Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .seal-svg {
        opacity: 1;
        transform: scale(1);
        animation: none;
    }

    .seal-circle-outline {
        stroke-dashoffset: 0;
        animation: none;
    }

    .seal-title,
    .seal-tagline {
        opacity: 1;
        animation: none;
    }

    .manifesto-block,
    .archive-card,
    .principle-cell,
    .departure-bubble {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bubble-drift {
        animation: none;
    }

    .shake {
        animation: none;
    }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1024px) {
    .manifesto-column,
    .archive-column,
    .grid-column {
        margin-left: auto;
        margin-right: auto;
        transform: none;
    }

    .vertical-rule {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 80px;
    }

    .manifesto-block--col2 {
        padding-left: 0;
    }

    .principles-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .principles-grid::before {
        display: none;
    }

    .principles-grid::after {
        display: none;
    }

    .principle-cell {
        padding: 1.5rem;
        border-bottom: 1px solid var(--accent-secondary);
    }

    .principle-cell:last-child {
        border-bottom: none;
    }

    .seal-circles {
        width: clamp(160px, 50vw, 280px);
        height: clamp(160px, 50vw, 280px);
    }

    .departure-bubble {
        width: clamp(160px, 50vw, 240px);
        height: clamp(160px, 50vw, 240px);
    }
}

@media (max-width: 480px) {
    :root {
        --section-gap: 60px;
    }

    .manifesto-column,
    .archive-column,
    .grid-column {
        width: 92%;
    }

    .principle-cell {
        padding: 1.2rem;
    }
}
