/* ============================================
   gabs.news - Styles
   Hand-drawn journalist's notebook aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --aurora-pink: #E88B9C;
    --aurora-gold: #F0C86A;
    --aurora-violet: #7B68AE;
    --newsprint-cream: #F5EEE0;
    --reporters-ink: #1E1E28;
    --margin-blue: #3A6EA5;
    --sketch-gray: #6B6B78;
    --font-headline: 'Archivo Black', sans-serif;
    --font-body: 'Literata', Georgia, serif;
    --font-meta: 'Space Grotesk', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.8;
    color: var(--reporters-ink);
    background-color: var(--newsprint-cream);
    overflow-x: hidden;
    /* Layered paper texture gradients */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(240, 200, 106, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(232, 139, 156, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(123, 104, 174, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #F5EEE0 0%, #F0E8D8 50%, #EDE4D4 100%);
}

/* --- Aurora Bokeh Spots --- */
.bokeh-spots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bokeh-spot {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bokeh-spot.visible {
    opacity: 1;
}

#bokeh1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(232, 139, 156, 0.08) 0%, transparent 70%);
    top: 5%;
    right: 10%;
}

#bokeh2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(240, 200, 106, 0.07) 0%, transparent 70%);
    top: 30%;
    left: 5%;
}

#bokeh3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(123, 104, 174, 0.06) 0%, transparent 70%);
    top: 60%;
    right: 15%;
}

#bokeh4 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(232, 139, 156, 0.07) 0%, transparent 70%);
    top: 85%;
    left: 20%;
}

/* --- Flowing Curves Spine --- */
.spine-svg {
    position: fixed;
    left: 30px;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#spinePath {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 0.05s linear;
}

.spine-dot {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.spine-dot.visible {
    opacity: 0.3;
}

/* --- Masthead / Hero --- */
.masthead {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 40px;
}

.masthead-inner {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.masthead-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.masthead-title {
    font-family: var(--font-headline);
    font-size: clamp(60px, 15vw, 180px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    color: var(--reporters-ink);
    margin-bottom: 0;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.letter[data-index="0"].visible { transform: translateY(0) rotate(-0.8deg); }
.letter[data-index="1"].visible { transform: translateY(0) rotate(0.5deg); }
.letter[data-index="2"].visible { transform: translateY(0) rotate(-0.3deg); }
.letter[data-index="3"].visible { transform: translateY(0) rotate(0.7deg); }

.masthead-subtitle {
    display: inline-block;
    position: relative;
    margin-top: -5px;
}

.dot-news {
    font-family: var(--font-headline);
    font-size: clamp(20px, 4vw, 48px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--reporters-ink);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.dot-news.visible {
    opacity: 1;
}

.underline-svg {
    display: block;
    width: 100%;
    height: 8px;
    margin-top: 2px;
}

.underline-svg path {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    transition: stroke-dashoffset 0.5s ease;
}

.underline-svg.drawn path {
    stroke-dashoffset: 0;
}

.masthead-tagline {
    font-family: var(--font-meta);
    font-size: clamp(14px, 2vw, 22px);
    font-weight: 400;
    color: var(--sketch-gray);
    margin-top: 30px;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

.masthead-tagline.visible {
    opacity: 1;
}

.masthead-description {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.4vw, 18px);
    font-weight: 400;
    color: var(--sketch-gray);
    margin-top: 12px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transition: opacity 0.6s ease 0.5s;
}

.masthead-description.visible {
    opacity: 1;
}

/* --- Stories Sections --- */
.stories-section {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 60px 60px 80px;
}

/* Asymmetric layout: large left, stack right */
.stories-layout.asymmetric {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.stories-layout.asymmetric .story-featured {
    flex: 0 0 62%;
}

.stories-layout.asymmetric .stories-stack {
    flex: 0 0 34%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Reversed asymmetry */
.stories-layout.asymmetric-reverse {
    display: flex;
    flex-direction: row-reverse;
    gap: 40px;
    align-items: flex-start;
}

.stories-layout.asymmetric-reverse .story-featured {
    flex: 0 0 62%;
}

.stories-layout.asymmetric-reverse .stories-stack {
    flex: 0 0 34%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Three column layout */
.stories-layout.three-col {
    display: flex;
    gap: 30px;
}

.story-col {
    flex: 1;
}

/* --- Story Cards --- */
.story {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.story.from-right {
    transform: translateX(30px);
}

.story.visible {
    opacity: 1;
    transform: translateX(0);
}

.story-inner {
    padding: 28px 30px;
    position: relative;
}

/* Torn edge effect for notebook pages */
.torn-edge {
    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 2%,
        99% 5%,
        100% 8%,
        99.5% 12%,
        100% 15%,
        99% 20%,
        100% 25%,
        99.5% 30%,
        100% 35%,
        99% 40%,
        100% 45%,
        99.5% 50%,
        100% 55%,
        99% 60%,
        100% 65%,
        99.5% 70%,
        100% 75%,
        99% 80%,
        100% 85%,
        99.5% 90%,
        100% 95%,
        100% 100%,
        0% 100%
    );
    background: rgba(245, 238, 224, 0.5);
    border-left: 3px solid rgba(58, 110, 165, 0.15);
}

.torn-edge-left {
    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 100%,
        0% 100%,
        0% 95%,
        1% 90%,
        0.5% 85%,
        0% 80%,
        1% 75%,
        0.5% 70%,
        0% 65%,
        1% 60%,
        0.5% 55%,
        0% 50%,
        1% 45%,
        0.5% 40%,
        0% 35%,
        1% 30%,
        0.5% 25%,
        0% 20%,
        1% 15%,
        0.5% 10%,
        0% 5%,
        0.5% 2%,
        0% 0%
    );
    background: rgba(245, 238, 224, 0.5);
    border-right: 3px solid rgba(58, 110, 165, 0.15);
}

.story-dateline {
    font-family: var(--font-meta);
    font-size: 12px;
    font-weight: 500;
    color: var(--margin-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 12px;
}

.story-headline {
    font-family: var(--font-headline);
    font-size: clamp(28px, 5.5vw, 68px);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--reporters-ink);
    margin-bottom: 20px;
    position: relative;
}

.story-headline-sm {
    font-family: var(--font-headline);
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.15;
    color: var(--reporters-ink);
    margin-bottom: 14px;
    position: relative;
}

.headline-text {
    display: block;
}

.headline-underline {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 6px;
}

.headline-underline path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.6s ease;
}

.story.visible .headline-underline path {
    stroke-dashoffset: 0;
}

.story-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.8;
    color: var(--reporters-ink);
    margin-bottom: 16px;
}

.story-excerpt {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.7;
    color: var(--reporters-ink);
    margin-bottom: 12px;
}

.story-byline {
    font-family: var(--font-meta);
    font-size: 13px;
    font-weight: 400;
    color: var(--sketch-gray);
    letter-spacing: 0.04em;
    display: block;
    margin-top: 8px;
}

/* Story wide layout with columns */
.story-wide {
    max-width: 1000px;
}

.story-wide .story-headline {
    font-size: clamp(24px, 4vw, 52px);
}

.story-columns {
    columns: 2;
    column-gap: 40px;
}

/* --- Ink Illustration Dividers --- */
.ink-divider {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px 40px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.ink-divider.visible {
    opacity: 1;
}

.ink-illustration {
    width: 100%;
    height: auto;
}

.ink-stroke {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1s ease;
}

.ink-divider.visible .ink-stroke {
    stroke-dashoffset: 0;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    margin-top: 80px;
    padding: 60px 40px 40px;
    border-top: 1px solid rgba(107, 107, 120, 0.15);
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 12px;
}

.footer-logo {
    font-family: var(--font-headline);
    font-size: 32px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--reporters-ink);
    letter-spacing: 0.05em;
}

.footer-logo-dot {
    font-family: var(--font-headline);
    font-size: 18px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--aurora-pink);
    letter-spacing: 0.1em;
}

.footer-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 15px;
    color: var(--sketch-gray);
    margin-bottom: 24px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 24px;
}

.footer-link {
    font-family: var(--font-meta);
    font-size: 13px;
    font-weight: 500;
    color: var(--margin-blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--aurora-pink);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--reporters-ink);
}

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

.footer-copy {
    font-family: var(--font-meta);
    font-size: 12px;
    color: var(--sketch-gray);
    opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .stories-section {
        padding: 40px 30px 40px 50px;
    }

    .stories-layout.asymmetric,
    .stories-layout.asymmetric-reverse {
        flex-direction: column;
    }

    .stories-layout.asymmetric .story-featured,
    .stories-layout.asymmetric .stories-stack,
    .stories-layout.asymmetric-reverse .story-featured,
    .stories-layout.asymmetric-reverse .stories-stack {
        flex: 1 1 100%;
    }

    .stories-layout.three-col {
        flex-direction: column;
    }

    .story-columns {
        columns: 1;
    }

    .spine-svg {
        left: 10px;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .stories-section {
        padding: 30px 20px 30px 40px;
    }

    .masthead {
        padding: 30px 20px;
    }

    .masthead-title {
        font-size: clamp(50px, 18vw, 100px);
    }

    .spine-svg {
        display: none;
    }

    .story-inner {
        padding: 20px 16px;
    }

    .torn-edge,
    .torn-edge-left {
        clip-path: none;
    }
}