/* ===========================================
   bada.news - Scandinavian Functionalist Newsroom
   =========================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #F7F5F0;
    color: #3A3A3A;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* --- Floating Elements Layer --- */
#floating-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1200ms ease-in-out;
}

#floating-layer.visible {
    opacity: 1;
}

.floating-shape {
    position: absolute;
    will-change: transform;
    border-radius: 50%;
}

.floating-shape--circle {
    background-color: #2D5F3A;
    opacity: 0.04;
    border-radius: 50%;
}

.floating-shape--oval {
    background-color: #B8D4C4;
    opacity: 0.06;
    border-radius: 50%;
}

.floating-shape--rect {
    background-color: #7BA88E;
    opacity: 0.03;
    border-radius: 12px;
}

/* --- Header / Wordmark --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 32px;
    transition: transform 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#header.scrolled {
    transform: scale(0.8);
    transform-origin: top left;
}

.wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #1A3C2A;
    letter-spacing: -0.01em;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
}

.wordmark.visible {
    opacity: 1;
}

#header-rule {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #2D5F3A;
    opacity: 0.08;
    z-index: 99;
}

/* --- Sections Toggle --- */
#sections-toggle {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 100;
    background: none;
    border: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7BA88E;
    cursor: pointer;
    padding: 8px 0;
}

/* --- Sections Panel --- */
.sections-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 200;
    overflow: hidden;
    transition: height 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sections-panel.open {
    height: 60vh;
}

.sections-panel-bloom {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 226, 165, 0.08) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.sections-panel.open .sections-panel-bloom {
    opacity: 1;
}

.sections-panel-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(247, 245, 240, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 48px 32px;
}

.sections-panel-content nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.section-link {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: #2D5F3A;
    text-decoration: none;
    transition: color 300ms ease;
    line-height: 1.3;
}

.section-link:hover {
    color: #7BA88E;
}

#sections-close {
    background: none;
    border: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7BA88E;
    cursor: pointer;
    padding: 8px 0;
    position: absolute;
    top: 32px;
    right: 32px;
}

/* --- Main Content --- */
#main-content {
    position: relative;
    z-index: 10;
    max-width: 680px;
    margin: 0 auto;
    padding: 160px 24px 80px;
}

/* --- Story Sections --- */
.story-section {
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(16px);
}

.story-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.category-label {
    display: block;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7BA88E;
    margin-bottom: 16px;
}

.headline {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #1A3C2A;
    margin-bottom: 16px;
    position: relative;
}

.headline-primary {
    font-size: 42px;
}

/* Headline lens-flare bloom */
.headline .lens-bloom {
    position: absolute;
    top: 50%;
    left: -20px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 226, 165, 0.15) 0%, transparent 70%);
    transform: translate(0, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: transform 800ms ease-out, opacity 800ms ease-out;
}

.headline .lens-bloom.active {
    transform: translate(0, -50%) scale(1);
    opacity: 1;
}

.headline .lens-bloom.settled {
    opacity: 0.33;
}

/* Headline hover ripple */
.headline .hover-ripple {
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 1px solid rgba(123, 168, 142, 0.08);
    transform: translateX(-50%);
    pointer-events: none;
}

.dateline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}

.dateline .date,
.dateline .byline {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7BA88E;
}

.dateline .separator {
    color: #B8D4C4;
    font-size: 14px;
}

.body-text p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #3A3A3A;
    margin-bottom: 24px;
}

.body-text p:last-child {
    margin-bottom: 0;
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-style: italic;
    font-size: 32px;
    line-height: 1.35;
    color: #2D5F3A;
    border-left: 3px solid #B8D4C4;
    padding-left: 24px;
    margin: 40px 0;
    quotes: none;
}

/* --- Breathing Moments --- */
.breathing-moment {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 200px;
    background-color: #EDE9E0;
    margin-bottom: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.breathing-element {
    position: absolute;
    pointer-events: none;
}

.breathing-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: #2D5F3A;
    opacity: 0.05;
    left: 35%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.breathing-oval {
    width: 180px;
    height: 90px;
    border-radius: 50%;
    background-color: #B8D4C4;
    opacity: 0.08;
    left: 60%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.breathing-hexagon {
    position: absolute;
    width: 40px;
    height: 40px;
    right: 30%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.2;
    transition: opacity 400ms ease-out, transform 400ms ease-out;
    pointer-events: none;
}

.breathing-hexagon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #B8D4C4;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.breathing-hexagon.bright {
    opacity: 0.4;
    transform: translateY(-50%) translateX(10px);
}

/* Breathing moment ripple */
.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(45, 95, 58, 0.10);
    pointer-events: none;
    animation: ripple-expand 1200ms ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
    }
}

/* --- Lens Bloom Accent Color: #D4E2A5 --- */
.lens-bloom-accent {
    color: #D4E2A5;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 80px 24px 120px;
}

.footer-wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #1A3C2A;
    margin-bottom: 12px;
}

.footer-tagline {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #7BA88E;
    letter-spacing: 0.01em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #main-content {
        padding: 140px 20px 60px;
    }

    .story-section {
        margin-bottom: 80px;
    }

    .headline {
        font-size: 28px;
    }

    .headline-primary {
        font-size: 28px;
    }

    .body-text p {
        font-size: 16px;
    }

    .pull-quote {
        font-size: 24px;
        padding-left: 20px;
    }

    .breathing-moment {
        height: 120px;
        margin-bottom: 80px;
    }

    .breathing-circle {
        width: 100px;
        height: 100px;
    }

    .breathing-oval {
        width: 120px;
        height: 60px;
    }

    .section-link {
        font-size: 20px;
    }

    #header {
        padding: 20px;
    }

    #header-rule {
        top: 60px;
    }

    #sections-toggle {
        bottom: 20px;
        right: 20px;
    }

    .dateline {
        margin-bottom: 32px;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    #floating-layer {
        display: none;
    }

    .story-section {
        opacity: 1;
        transform: none;
    }

    .wordmark {
        opacity: 1;
    }

    .breathing-hexagon {
        transition: none;
    }

    .ripple-ring {
        animation: none;
        display: none;
    }

    .headline .lens-bloom {
        transition: none;
    }

    .sections-panel {
        transition: none;
    }
}
