/* ==========================================================
   telomere.digital -- Inflated-3D Scholarly Bubble
   Palette: Soft Lilac #F0E8F8, Deep Purple #2A1A3A,
            Pastel Violet #C0A8D8, Soft Pink #F0C8D0,
            Mint #C0E0D0, Plum Gray #5A4A60
   Fonts: Josefin Sans (display), Inter (body)
   ========================================================== */

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: #5A4A60;
    background-color: #F0E8F8;
    overflow-x: hidden;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    color: #2A1A3A;
}

h2.section-heading {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.15;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1rem;
}

em {
    font-style: italic;
}

sup.footnote-ref {
    font-size: 0.65em;
    color: #C0A8D8;
    cursor: default;
    font-weight: 600;
    vertical-align: super;
    line-height: 0;
}

/* --- INDEX TABS (Book-scholarly) --- */
.index-tab {
    position: absolute;
    left: 0;
    top: 2.5rem;
    width: 2.2rem;
    height: 3rem;
    background-color: #C0A8D8;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.index-tab::after {
    content: attr(data-label);
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #F0E8F8;
    letter-spacing: 0.05em;
}

/* Alternate tab colors */
#section-research .index-tab {
    background-color: #F0C8D0;
}

#section-methods .index-tab {
    background-color: #C0E0D0;
}

#section-closing .index-tab {
    background-color: #C0A8D8;
}

/* --- HERO SECTION --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background-color: #F0E8F8;
    overflow: hidden;
    padding: 4rem;
}

.hero-content {
    position: relative;
    z-index: 5;
    max-width: 720px;
}

.hero-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: #2A1A3A;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 300;
    color: #5A4A60;
    margin-bottom: 0.8rem;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #5A4A60;
    opacity: 0.75;
    max-width: 480px;
}

/* --- HERO BUBBLES (Inflated 3D) --- */
.hero-bubbles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #C0A8D8 70%);
    box-shadow:
        inset -10px -10px 30px rgba(255,255,255,0.5),
        inset 10px 10px 30px rgba(0,0,0,0.1),
        0 8px 32px rgba(192,168,216,0.3);
}

.bubble-1 {
    width: 320px;
    height: 320px;
    top: 8%;
    right: 10%;
    opacity: 0.7;
}

.bubble-2 {
    width: 180px;
    height: 180px;
    top: 55%;
    right: 30%;
    opacity: 0.5;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #F0C8D0 70%);
    box-shadow:
        inset -10px -10px 30px rgba(255,255,255,0.5),
        inset 10px 10px 30px rgba(0,0,0,0.1),
        0 8px 32px rgba(240,200,208,0.3);
}

.bubble-3 {
    width: 120px;
    height: 120px;
    top: 20%;
    right: 40%;
    opacity: 0.4;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #C0E0D0 70%);
    box-shadow:
        inset -10px -10px 30px rgba(255,255,255,0.5),
        inset 10px 10px 30px rgba(0,0,0,0.1),
        0 8px 32px rgba(192,224,208,0.3);
}

.bubble-4 {
    width: 220px;
    height: 220px;
    bottom: 10%;
    right: 5%;
    opacity: 0.55;
}

.bubble-5 {
    width: 90px;
    height: 90px;
    top: 40%;
    right: 55%;
    opacity: 0.35;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #F0C8D0 70%);
}

.bubble-6 {
    width: 160px;
    height: 160px;
    bottom: 25%;
    left: 60%;
    opacity: 0.3;
}

.bubble-7 {
    width: 60px;
    height: 60px;
    top: 15%;
    left: 55%;
    opacity: 0.5;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #C0E0D0 70%);
}

/* --- SCROLL INDICATOR --- */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, transparent, #C0A8D8);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- CONTENT SECTIONS --- */
.content-section {
    position: relative;
    padding: 6rem 4rem;
    background-color: #F0E8F8;
}

.section-inner {
    max-width: 720px;
    margin: 0;
}

.section-intro {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #5A4A60;
    margin-bottom: 2.5rem;
}

/* --- F-PATTERN ROW (Section 2) --- */
.f-pattern-row {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.f-pattern-text {
    flex: 1;
    min-width: 0;
}

.f-pattern-visual {
    flex: 0 0 300px;
}

/* --- DUOTONE FRAMES --- */
.duotone-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #E8D8F0;
}

.duotone-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #C0A8D8;
    mix-blend-mode: multiply;
    opacity: 0.35;
    pointer-events: none;
}

.duotone-image {
    filter: grayscale(1);
}

.duotone-image svg {
    display: block;
    width: 100%;
    height: auto;
}

.duotone-frame--small {
    margin-top: 2.5rem;
}

.duotone-frame--small svg {
    display: block;
    width: 100%;
    height: auto;
}

/* --- ACCORDION --- */
.accordion-group {
    margin-top: 1rem;
}

.accordion-item {
    border-top: 1px solid rgba(192,168,216,0.3);
}

.accordion-item:last-child {
    border-bottom: 1px solid rgba(192,168,216,0.3);
}

.accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1.2rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #2A1A3A;
    text-align: left;
    gap: 1rem;
    transition: color 0.2s ease;
}

.accordion-header:hover {
    color: #C0A8D8;
}

.accordion-ref {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #C0A8D8;
    min-width: 2rem;
    letter-spacing: 0.05em;
}

.accordion-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
}

.accordion-icon {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    background-color: #C0A8D8;
    transition: transform 0.3s ease;
}

.accordion-icon::before {
    width: 20px;
    height: 2px;
    top: 9px;
    left: 0;
}

.accordion-icon::after {
    width: 2px;
    height: 20px;
    top: 0;
    left: 9px;
}

.accordion-item.is-open .accordion-icon::after {
    transform: rotate(90deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.is-open .accordion-body {
    max-height: 600px;
}

.accordion-content {
    padding: 0 0 1.8rem 3rem;
    position: relative;
}

.accordion-content p {
    font-size: 0.95rem;
    line-height: 1.85;
    color: #5A4A60;
}

/* --- BUBBLE ACCENTS (inside accordions) --- */
.bubble-accent {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #C0A8D8 70%);
    box-shadow:
        inset -6px -6px 18px rgba(255,255,255,0.5),
        inset 6px 6px 18px rgba(0,0,0,0.08);
    position: absolute;
    pointer-events: none;
}

.bubble-accent-sm {
    width: 40px;
    height: 40px;
    top: 0;
    right: -20px;
    opacity: 0.5;
}

.bubble-accent-md {
    width: 60px;
    height: 60px;
    bottom: 10px;
    right: -30px;
    opacity: 0.4;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #F0C8D0 70%);
}

/* --- SECTION 3: NARROW / VERTICAL F-PATTERN --- */
.content-section--narrow {
    padding-left: 6rem;
}

.content-section--narrow .section-inner {
    display: flex;
    gap: 2rem;
    max-width: 780px;
}

.marginal-numbers {
    display: flex;
    flex-direction: column;
    gap: 10rem;
    padding-top: 4.5rem;
    min-width: 2.5rem;
}

.marginal-num {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #C0A8D8;
    opacity: 0.6;
    letter-spacing: 0.05em;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

.section-body {
    flex: 1;
    min-width: 0;
}

.methods-visual {
    margin-top: 2rem;
}

/* --- SECTION 4: CLOSING --- */
.content-section--closing {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.closing-bubbles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.bubble-close-1 {
    width: 260px;
    height: 260px;
    top: 10%;
    right: 8%;
    opacity: 0.5;
}

.bubble-close-2 {
    width: 140px;
    height: 140px;
    bottom: 15%;
    right: 25%;
    opacity: 0.4;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #F0C8D0 70%);
    box-shadow:
        inset -10px -10px 30px rgba(255,255,255,0.5),
        inset 10px 10px 30px rgba(0,0,0,0.1),
        0 8px 32px rgba(240,200,208,0.3);
}

.bubble-close-3 {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 70%;
    opacity: 0.3;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #C0E0D0 70%);
}

.bubble-close-4 {
    width: 200px;
    height: 200px;
    bottom: 5%;
    left: 50%;
    opacity: 0.35;
}

.bubble-close-5 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 45%;
    opacity: 0.45;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45), #F0C8D0 70%);
}

.closing-inner {
    position: relative;
    z-index: 5;
}

.closing-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2A1A3A;
    margin-bottom: 1rem;
}

.closing-text {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #5A4A60;
    max-width: 560px;
    margin-bottom: 3rem;
}

/* --- FOOTNOTE SUMMARY --- */
.footnote-summary {
    border-top: 1px solid rgba(192,168,216,0.3);
    padding-top: 2rem;
    max-width: 600px;
}

.footnote-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #C0A8D8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.footnote-list {
    list-style: none;
    counter-reset: footnotes;
    padding: 0;
}

.footnote-list li {
    counter-increment: footnotes;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #5A4A60;
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footnote-list li::before {
    content: "[" counter(footnotes) "]";
    position: absolute;
    left: 0;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: #C0A8D8;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    #hero {
        padding: 2.5rem;
    }

    .content-section {
        padding: 4rem 2.5rem;
    }

    .content-section--narrow {
        padding-left: 2.5rem;
    }

    .content-section--narrow .section-inner {
        flex-direction: column;
    }

    .marginal-numbers {
        flex-direction: row;
        gap: 2rem;
        padding-top: 0;
        margin-bottom: 1rem;
    }

    .marginal-num {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .f-pattern-row {
        flex-direction: column;
    }

    .f-pattern-visual {
        flex: none;
        width: 100%;
    }

    .bubble-1 {
        width: 200px;
        height: 200px;
    }

    .bubble-4 {
        width: 140px;
        height: 140px;
    }

    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .index-tab {
        width: 1.6rem;
        height: 2.2rem;
    }

    .accordion-content {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    #hero {
        padding: 2rem 1.5rem;
    }

    .content-section {
        padding: 3rem 1.5rem;
    }

    .content-section--narrow {
        padding-left: 1.5rem;
    }

    .f-pattern-visual {
        display: none;
    }
}
