/* talegrapher.com -- vaporwave lecture hall
   Duotone: lavender (#7B68AE) <-> coral (#E8857A)
   Light-mode pastel gradient mesh, scholarly sidebar, bubble motifs.
*/

:root {
    /* Duotone palette */
    --primary: #7B68AE;
    --primary-light: #C8BFE7;
    --primary-ultralight: #EFECF7;
    --secondary: #E8857A;
    --secondary-light: #F5CFC9;
    --text-dark: #1E1A2B;
    --text-mid: #5A5070;
    --bg: #FAF8FC;
    --bg-alt: #EFECF7;
    --mesh-start: #D4CCF0;
    --mesh-end: #F0D1CD;

    --sidebar-w: clamp(220px, 18vw, 320px);
    --content-pad: clamp(2rem, 4vw, 5rem);
    --gap-section: clamp(3rem, 6vh, 8rem);

    /* Scroll-coupled custom props (set from JS) */
    --scroll-pct: 0;
    --scroll-y: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text-dark);
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    line-height: 1.9;
    overflow-x: hidden;
    min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* ================================================================
   SIDEBAR -- Tale Index
================================================================ */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    padding: clamp(1.4rem, 2vw, 2.2rem) clamp(1.2rem, 1.5vw, 1.8rem);
    background: rgba(250, 248, 252, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(123, 104, 174, 0.12);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
    animation: sidebarFadeIn 0.8s ease-out both;
    /* hue-rotate proportional to scroll position */
    filter: hue-rotate(calc(var(--scroll-pct) * 30deg));
    transition: filter 0.4s ease-out;
}

@keyframes sidebarFadeIn {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* Living gradient-mesh background */
.sidebar-mesh {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.mesh-layer {
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.85;
    will-change: transform;
}

.mesh-layer-1 {
    background: radial-gradient(circle at 30% 30%, var(--mesh-start) 0%, transparent 60%);
    animation: meshDrift1 30s ease-in-out infinite;
}
.mesh-layer-2 {
    background: radial-gradient(circle at 70% 60%, var(--mesh-end) 0%, transparent 60%);
    animation: meshDrift2 36s ease-in-out infinite;
}
.mesh-layer-3 {
    background: radial-gradient(circle at 50% 80%, var(--primary-light) 0%, transparent 60%);
    animation: meshDrift3 42s ease-in-out infinite;
}

@keyframes meshDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20%, -10%) scale(1.1); }
}
@keyframes meshDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-15%, 15%) scale(1.15); }
}
@keyframes meshDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(10%, -20%) scale(1.05); }
}

/* Sidebar header & logo orb */
.sidebar-header {
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(123, 104, 174, 0.18);
}

.logo-orb {
    width: clamp(72px, 7vw, 96px);
    height: clamp(72px, 7vw, 96px);
    border-radius: 50%;
    margin: 0 auto 0.9rem;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 24px rgba(123, 104, 174, 0.25),
        inset 0 0 24px rgba(255, 255, 255, 0.6);
    animation: orbRotate 8s linear infinite;
}

.orb-mesh {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from 0deg,
        var(--primary) 0deg,
        var(--secondary) 90deg,
        var(--primary-light) 180deg,
        var(--secondary-light) 270deg,
        var(--primary) 360deg
    );
    filter: blur(8px);
    animation: orbSpin 8s linear infinite;
}
.orb-mesh-2 {
    background: radial-gradient(circle at 30% 30%, var(--secondary-light) 0%, transparent 60%);
    filter: blur(10px);
    animation: orbSpin 12s linear infinite reverse;
    mix-blend-mode: screen;
}
.orb-mesh-3 {
    background: radial-gradient(circle at 70% 70%, var(--primary-ultralight) 0%, transparent 50%);
    filter: blur(6px);
    animation: orbSpin 10s linear infinite;
    mix-blend-mode: screen;
}

.orb-shine {
    position: absolute;
    top: 12%;
    left: 18%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

@keyframes orbRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes orbSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.sidebar-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 1.4vw, 1.35rem);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--text-dark);
    margin-bottom: 0.15rem;
}

.sidebar-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.78rem, 0.9vw, 0.92rem);
    color: var(--secondary);
}

/* Tale Index Navigation */
.tale-index {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding-right: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.tale-index::-webkit-scrollbar { width: 4px; }
.tale-index::-webkit-scrollbar-track { background: transparent; }
.tale-index::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

.index-list {
    list-style: none;
    position: relative;
    padding: 0.4rem 0;
}

.index-item a {
    display: grid;
    grid-template-columns: 2.4em 1fr;
    gap: 0.4rem;
    align-items: baseline;
    padding: 0.55rem 0.35rem 0.55rem 1.4rem;
    position: relative;
    color: var(--text-mid);
    transition: color 0.4s ease-out, transform 0.4s ease-out;
    border-radius: 6px;
}

.index-item a:hover {
    color: var(--text-dark);
    transform: translateX(2px);
}

.index-num {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--secondary);
    text-align: right;
}

.index-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(0.85rem, 0.95vw, 1rem);
    letter-spacing: 0.01em;
    position: relative;
}

.index-rule {
    position: absolute;
    left: 1.4rem;
    right: 0.35rem;
    bottom: 0.35rem;
    height: 1px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
    opacity: 0.55;
}
.index-item a:hover .index-rule { transform: scaleX(1); }

.index-item.is-active a {
    color: var(--text-dark);
}
.index-item.is-active .index-num { color: var(--primary); font-style: italic; font-weight: 400; }
.index-item.is-active .index-rule { transform: scaleX(1); opacity: 1; }

/* Reading marker (active section indicator) */
.reading-marker {
    position: absolute;
    left: 0.35rem;
    top: 0.55rem;
    width: 14px;
    height: 14px;
    pointer-events: none;
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.marker-bubble {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--secondary) 0%, var(--primary) 80%);
    box-shadow: 0 0 12px rgba(232, 133, 122, 0.5);
    animation: markerPulse 2.4s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.2); opacity: 0.8; }
}

.marker-trail {
    position: absolute;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    transform: translateX(-50%);
}
.marker-trail.trail-1 { top: 18px; opacity: 1; background: var(--secondary); }
.marker-trail.trail-2 { top: 26px; opacity: 0.6; }
.marker-trail.trail-3 { top: 32px; opacity: 0.3; }

/* Hover bubble pop (created by JS) */
.hover-bubble {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(200, 191, 231, 0.45);
    border: 1px solid var(--primary-light);
    pointer-events: none;
    transform: scale(0);
    animation: bubblePop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bubblePop {
    0%   { transform: scale(0) translateY(0); opacity: 1; }
    40%  { transform: scale(1) translateY(-6px); opacity: 1; }
    100% { transform: scale(1.3) translateY(-22px); opacity: 0; }
}

.sidebar-footer {
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(123, 104, 174, 0.18);
    text-align: center;
}
.footer-mark {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 0.78rem;
    color: var(--text-mid);
    letter-spacing: 0.1em;
}

/* Mobile drawer trigger -- stack of book spines */
.drawer-trigger {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    background: rgba(250, 248, 252, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(123, 104, 174, 0.2);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}
.drawer-trigger .spine {
    display: block;
    width: 22px;
    height: 4px;
    border-radius: 2px;
}
.drawer-trigger .spine:nth-child(1) { background: var(--primary); }
.drawer-trigger .spine:nth-child(2) { background: var(--secondary); width: 18px; }
.drawer-trigger .spine:nth-child(3) { background: var(--primary-light); width: 24px; }

/* ================================================================
   MAIN CONTENT
================================================================ */

.content {
    margin-left: var(--sidebar-w);
    padding: var(--content-pad);
    scroll-snap-type: y proximity;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--gap-section);
}

/* ================================================================
   SCHOLAR PANELS -- white-ish blocks with intellectual substance
================================================================ */

.scholar {
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(123, 104, 174, 0.08);
    border-radius: 18px;
    box-shadow:
        0 30px 60px -40px rgba(123, 104, 174, 0.18),
        0 4px 12px rgba(123, 104, 174, 0.04);
    padding: clamp(2rem, 4vw, 4rem) clamp(1.5rem, 3vw, 3.2rem);
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    scroll-snap-align: start;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    overflow: hidden;
}

.scholar.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.scholar > * { position: relative; z-index: 1; }

.scholar p,
.scholar dd,
.scholar .instr-mark + div p {
    max-width: 680px;
    margin: 0 auto 1.4em;
    color: var(--text-dark);
}
.scholar .lede {
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
    font-weight: 300;
    color: var(--text-dark);
    letter-spacing: 0.005em;
}

.scholar-h2 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    letter-spacing: 0.03em;
    color: var(--text-dark);
    margin: 0 auto 1.6rem;
    max-width: 680px;
    line-height: 1.2;
}

.scholar em { color: var(--secondary); font-style: italic; }
.scholar strong { color: var(--primary); font-weight: 600; }

.section-marker {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0 auto 1.2rem;
    max-width: 680px;
}
.marker-dot {
    border-radius: 50%;
    border: 1px solid var(--primary-light);
    background: rgba(200, 191, 231, 0.18);
}
.dot-sm { width: 8px; height: 8px; }
.dot-md { width: 12px; height: 12px; background: rgba(232, 133, 122, 0.18); border-color: var(--secondary-light); }
.dot-lg { width: 16px; height: 16px; }

/* Decorative orbs behind scholar text */
.orb-decor {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}
.orb-decor-1 {
    top: -60px;
    right: -40px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
}
.orb-decor-2 {
    bottom: -80px;
    left: -60px;
    background: radial-gradient(circle, var(--secondary-light) 0%, transparent 70%);
}
.orb-decor-3 {
    top: 40%;
    right: -100px;
    background: radial-gradient(circle, var(--mesh-start) 0%, transparent 70%);
}

/* Pull quotes */
.pull-quote {
    position: relative;
    max-width: 680px;
    margin: 2.4rem auto;
    padding: 1.6rem 3rem 1.8rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    line-height: 1.55;
    color: var(--text-dark);
    text-align: center;
}
.pull-quote::before,
.pull-quote::after {
    position: absolute;
    font-size: 96px;
    line-height: 1;
    color: var(--primary-light);
    opacity: 0.5;
    font-family: 'Cormorant Garamond', serif;
    transition: transform 0.7s ease-out;
    transform: scale(0.8);
}
.pull-quote::before {
    content: '\201C';
    top: -12px;
    left: 0;
}
.pull-quote::after {
    content: '\201D';
    bottom: -56px;
    right: 0;
}
.pull-quote.is-visible::before,
.pull-quote.is-visible::after { transform: scale(1); }

.pull-quote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-size: 0.85em;
    color: var(--text-mid);
    font-family: 'Cormorant Garamond', serif;
}

.pull-quote-alt::before, .pull-quote-alt::after {
    color: var(--secondary-light);
}

/* Footnote markers */
.footnote-mark {
    color: var(--secondary);
    font-weight: 600;
    cursor: help;
    margin: 0 0.1em;
    font-size: 0.7em;
    vertical-align: super;
    transition: color 0.3s ease;
}
.footnote-mark:hover { color: var(--primary); }

.fn-tooltip {
    position: fixed;
    z-index: 80;
    max-width: 280px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--primary-light);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(123, 104, 174, 0.22);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    pointer-events: none;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-dark);
}
.fn-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.fn-tooltip-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(200, 191, 231, 0.5) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(245, 207, 201, 0.5) 0%, transparent 60%);
    z-index: -1;
    filter: blur(6px);
}
.fn-tooltip-text { position: relative; z-index: 1; }

/* Instrument list */
.instrument-list {
    list-style: none;
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}
.instrument-list li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-ultralight) 0%, transparent 100%);
    border: 1px solid rgba(123, 104, 174, 0.08);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
}
.instrument-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(123, 104, 174, 0.12);
}
.instr-mark {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--secondary);
    font-size: 1.4rem;
    line-height: 1;
}
.instrument-list h3 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}
.instrument-list p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Grammar list */
.grammar-list {
    max-width: 680px;
    margin: 1.4rem auto;
}
.gr-row {
    display: grid;
    grid-template-columns: clamp(120px, 18%, 180px) 1fr;
    gap: 1.2rem;
    padding: 0.9rem 0;
    border-bottom: 1px dashed rgba(123, 104, 174, 0.18);
    align-items: baseline;
}
.gr-row:last-child { border-bottom: none; }
.gr-row dt {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
}
.gr-row dd {
    margin: 0;
    color: var(--text-dark);
}

/* Footnote list */
.scholar-footnotes .fn-list {
    list-style: none;
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
}
.fn-list li {
    padding: 0.7rem 0;
    border-bottom: 1px dashed rgba(123, 104, 174, 0.15);
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: var(--text-mid);
}
.fn-list li:last-child { border-bottom: none; }
.fn-num {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--secondary);
    font-weight: 600;
}

/* Colophon */
.scholar-colophon {
    text-align: center;
}
.scholar-colophon p { margin-left: auto; margin-right: auto; }
.colophon-mark {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--text-mid);
    letter-spacing: 0.06em;
    margin-top: 1.4rem;
}

/* ================================================================
   VAPOR INTERLUDES -- gradient mesh chambers
================================================================ */

.vapor {
    position: relative;
    width: 100%;
    min-height: 40vh;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 3vw, 3rem);
    scroll-snap-align: start;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.vapor.is-visible { opacity: 1; transform: scale(1); }

.vapor-mesh {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 18% 28%, var(--primary-light) 0%, transparent 55%),
        radial-gradient(circle at 80% 22%, var(--secondary-light) 0%, transparent 55%),
        radial-gradient(circle at 60% 78%, var(--mesh-start) 0%, transparent 60%),
        radial-gradient(circle at 30% 80%, var(--mesh-end) 0%, transparent 55%),
        linear-gradient(135deg, var(--primary-ultralight) 0%, var(--bg) 100%);
    filter: blur(40px);
    animation: vaporMeshShift 22s ease-in-out infinite;
    z-index: 0;
}

@keyframes vaporMeshShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.08) rotate(2deg); }
}

.vapor-mesh-alt {
    background:
        radial-gradient(circle at 70% 30%, var(--secondary) 0%, transparent 50%),
        radial-gradient(circle at 30% 70%, var(--primary) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, var(--primary-light) 0%, transparent 60%),
        linear-gradient(135deg, var(--secondary-light) 0%, var(--primary-ultralight) 100%);
    opacity: 0.85;
}

.vapor-mesh-warm {
    background:
        radial-gradient(circle at 25% 25%, var(--secondary) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--primary) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--secondary-light) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, var(--primary-light) 0%, transparent 60%),
        linear-gradient(160deg, var(--secondary-light) 0%, var(--mesh-start) 100%);
    opacity: 0.95;
}

.vapor-stage {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 760px;
    color: var(--text-dark);
}

.vapor-eyebrow {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--primary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

.vapor-h2 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.03em;
    color: var(--text-dark);
    line-height: 1.05;
    margin-bottom: 1rem;
    text-shadow: 0 2px 14px rgba(255, 255, 255, 0.5);
}
.vapor-h2-large {
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    line-height: 1;
}

.vapor-line {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: var(--text-mid);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.55;
}

/* Vapor: Overture (full height) */
.vapor-overture {
    min-height: calc(100vh - 2 * var(--content-pad));
}

.overture-stage {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 920px;
}

.overture-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.05em;
    color: var(--text-dark);
    line-height: 1;
    text-shadow: 0 4px 22px rgba(255,255,255,0.45);
    margin-bottom: 1rem;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
}

.ot-letter {
    display: inline-block;
    transform: translateY(80px);
    opacity: 0;
}
.ot-letter.is-in {
    animation: letterIn 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes letterIn {
    0%   { transform: translateY(80px); opacity: 0; }
    60%  { transform: translateY(-6px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.overture-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.6rem);
    color: var(--secondary);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out 1.6s, transform 0.8s ease-out 1.6s;
}
.overture-subtitle.is-in { opacity: 1; transform: translateY(0); }

.overture-hint {
    margin-top: 3.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.8s ease-out 2.4s;
}
.overture-hint.is-in { opacity: 0.7; }
.hint-bubble {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: hintFloat 2.8s ease-in-out infinite;
}
.hint-bubble:nth-child(2) { animation-delay: -0.9s; background: var(--secondary); }
.hint-bubble:nth-child(3) { animation-delay: -1.8s; }
.hint-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--text-mid);
    margin-left: 0.4rem;
    letter-spacing: 0.16em;
    text-transform: lowercase;
    font-size: 0.82rem;
}

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

/* Immersive vapor (full height) */
.vapor-immersive {
    min-height: 96vh;
}
.vapor-vignette {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 120px rgba(30, 26, 43, 0.15);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* ================================================================
   BUBBLES -- rising thought motifs
================================================================ */

.bubble-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(calc(var(--scroll-y) * -0.05px));
    transition: transform 0.1s linear;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(200, 191, 231, 0.08);
    border: 1px solid rgba(200, 191, 231, 0.6);
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.4);
    transform: translateY(120%);
    opacity: 0;
    will-change: transform, opacity;
}

.bubble.is-rising {
    animation:
        bubbleRise var(--rise-duration, 10s) ease-in-out forwards,
        bubbleDrift var(--drift-duration, 4.5s) ease-in-out infinite alternate;
}

@keyframes bubbleRise {
    0%   { transform: translateY(120%); opacity: 0; }
    10%  { opacity: var(--bubble-op, 0.7); }
    90%  { opacity: var(--bubble-op, 0.7); }
    100% { transform: translateY(-180%); opacity: 0; }
}

@keyframes bubbleDrift {
    from { margin-left: 0; }
    to   { margin-left: var(--drift-x, 24px); }
}

.bubble.size-sm { width: 14px; height: 14px; background: rgba(245, 207, 201, 0.1); border-color: var(--secondary-light); }
.bubble.size-md { width: 24px; height: 24px; }
.bubble.size-lg { width: 38px; height: 38px; }
.bubble.size-xl { width: 56px; height: 56px; background: rgba(232, 133, 122, 0.06); border-color: rgba(232, 133, 122, 0.5); }

/* ================================================================
   DIVIDERS
================================================================ */

.divider { width: 100%; max-width: 880px; margin: 0 auto; }

.divider-mesh {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-light) 18%,
        var(--secondary-light) 50%,
        var(--mesh-start) 82%,
        transparent 100%);
    filter: blur(0.5px);
    box-shadow: 0 0 18px rgba(200, 191, 231, 0.5);
}

.divider-bubbles {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 1rem 0;
}
.dv-bubble {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 1px solid var(--primary-light);
    background: rgba(200, 191, 231, 0.18);
    animation: dvFloat 3.4s ease-in-out infinite;
}
.dv-bubble:nth-child(1) { background: rgba(245, 207, 201, 0.25); border-color: var(--secondary-light); animation-delay: -0.3s; }
.dv-bubble:nth-child(2) { width: 14px; height: 14px; animation-delay: -1.2s; }
.dv-bubble:nth-child(3) { animation-delay: -2s; }

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

/* ================================================================
   INK DISPERSE OVERLAY (page-transition Lottie substitute)
================================================================ */

.ink-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}
.ink-overlay.is-active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease-out;
}
.ink-drop {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    transform: scale(0);
}
.ink-overlay.is-active .ink-drop {
    animation: inkDisperse 1.2s ease-out forwards;
}
.ink-drop-1 {
    top: 30%; left: 45%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    animation-delay: 0s !important;
}
.ink-drop-2 {
    top: 50%; left: 55%;
    width: 240px; height: 240px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation-delay: 0.1s !important;
}
.ink-drop-3 {
    top: 40%; left: 35%;
    width: 180px; height: 180px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    animation-delay: 0.2s !important;
}
.ink-drop-4 {
    top: 55%; left: 50%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, var(--secondary-light) 0%, transparent 70%);
    animation-delay: 0.05s !important;
}

@keyframes inkDisperse {
    0%   { transform: scale(0) translate(0, 0); opacity: 0.7; }
    50%  { transform: scale(1.4) translate(0, 20px); opacity: 0.5; }
    100% { transform: scale(2.4) translate(40px, 60px); opacity: 0; }
}

/* ================================================================
   RESPONSIVE -- mobile drawer
================================================================ */

@media (max-width: 768px) {
    .drawer-trigger { display: flex; }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 70vh;
        inset: 0 0 auto 0;
        border-right: none;
        border-bottom: 1px solid rgba(123, 104, 174, 0.12);
        transform: translateY(-100%);
        transition: transform 0.5s ease-out;
        animation: none;
    }
    .sidebar.is-open {
        transform: translateY(0);
    }

    .content {
        margin-left: 0;
        padding: clamp(4rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem) 4rem;
    }

    .vapor-overture {
        min-height: calc(100vh - 5rem);
    }

    .gr-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media (max-width: 480px) {
    .scholar { padding: 1.6rem 1.1rem; border-radius: 14px; }
    .pull-quote { padding: 1.2rem 1.4rem 2rem; }
    .pull-quote::before { font-size: 64px; top: -4px; }
    .pull-quote::after { font-size: 64px; bottom: -36px; }
    .instrument-list li { grid-template-columns: 2rem 1fr; }
}
