/* ============================================================
   murasaki.day — Styles
   CSS custom properties + full editorial layout
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
    --color-bg:          #F5EDE8;
    --color-text:        #3D1F5B;
    --color-accent:      #7B5EA7;
    --color-wisteria:    #C4A8D9;
    --color-sage:        #A8BFA4;
    --color-herb:        #8A9B72;
    --color-cream-glass: rgba(245, 238, 232, 0.70);
    --color-lavender-glass: rgba(196, 168, 217, 0.35);
    --color-plum-mid:    rgba(61, 31, 91, 0.08);

    --font-display:  'Playfair Display', Georgia, serif;
    --font-body:     'Crimson Pro', Georgia, serif;
    --font-ui:       'Inter', system-ui, sans-serif;
    --font-mono:     'Space Mono', monospace;

    --max-reading:   68ch;
    --margin-width:  220px;
    --gap-margin:    2rem;

    --transition-slow: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --transition-med:  0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* --- Bokeh Background Layer ------------------------------- */
.bokeh-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: var(--color-bg);
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

/* Each circle: unique size, color, position, blur, animation */
.bc-1  { width: 320px; height: 320px; left: -5%;  top: 10%;  background: var(--color-wisteria); opacity: 0.28; filter: blur(42px); animation: drift1 45s infinite alternate; }
.bc-2  { width: 180px; height: 180px; left: 20%;  top: 5%;   background: var(--color-accent);   opacity: 0.18; filter: blur(28px); animation: drift2 38s infinite alternate; }
.bc-3  { width: 250px; height: 250px; left: 55%;  top: -8%;  background: var(--color-wisteria); opacity: 0.24; filter: blur(36px); animation: drift3 52s infinite alternate; }
.bc-4  { width: 140px; height: 140px; left: 80%;  top: 15%;  background: var(--color-sage);     opacity: 0.22; filter: blur(22px); animation: drift4 33s infinite alternate; }
.bc-5  { width: 400px; height: 400px; left: 70%;  top: 30%;  background: var(--color-wisteria); opacity: 0.16; filter: blur(48px); animation: drift5 60s infinite alternate; }
.bc-6  { width: 200px; height: 200px; left: 10%;  top: 40%;  background: var(--color-sage);     opacity: 0.20; filter: blur(30px); animation: drift6 41s infinite alternate; }
.bc-7  { width: 280px; height: 280px; left: 40%;  top: 55%;  background: var(--color-wisteria); opacity: 0.22; filter: blur(38px); animation: drift7 55s infinite alternate; }
.bc-8  { width: 160px; height: 160px; left: -2%;  top: 70%;  background: var(--color-accent);   opacity: 0.14; filter: blur(24px); animation: drift8 37s infinite alternate; }
.bc-9  { width: 340px; height: 340px; left: 60%;  top: 65%;  background: var(--color-sage);     opacity: 0.18; filter: blur(44px); animation: drift9 49s infinite alternate; }
.bc-10 { width: 120px; height: 120px; left: 30%;  top: 80%;  background: var(--color-wisteria); opacity: 0.30; filter: blur(18px); animation: drift10 30s infinite alternate; }
.bc-11 { width: 220px; height: 220px; left: 85%;  top: 75%;  background: var(--color-accent);   opacity: 0.16; filter: blur(32px); animation: drift11 43s infinite alternate; }
.bc-12 { width: 180px; height: 180px; left: 48%;  top: 25%;  background: var(--color-herb);     opacity: 0.14; filter: blur(26px); animation: drift12 58s infinite alternate; }
.bc-13 { width: 260px; height: 260px; left: 15%;  top: 60%;  background: var(--color-wisteria); opacity: 0.20; filter: blur(40px); animation: drift13 46s infinite alternate; }
.bc-14 { width: 100px; height: 100px; left: 72%;  top: 5%;   background: var(--color-sage);     opacity: 0.26; filter: blur(16px); animation: drift14 35s infinite alternate; }
.bc-15 { width: 300px; height: 300px; left: 25%;  top: 90%;  background: var(--color-wisteria); opacity: 0.15; filter: blur(46px); animation: drift15 62s infinite alternate; }
.bc-16 { width: 150px; height: 150px; left: 90%;  top: 50%;  background: var(--color-accent);   opacity: 0.18; filter: blur(22px); animation: drift16 40s infinite alternate; }

@keyframes drift1  { to { transform: translate(12px, -8px);  } }
@keyframes drift2  { to { transform: translate(-9px, 13px);  } }
@keyframes drift3  { to { transform: translate(7px, 10px);   } }
@keyframes drift4  { to { transform: translate(-14px, -6px); } }
@keyframes drift5  { to { transform: translate(10px, -12px); } }
@keyframes drift6  { to { transform: translate(15px, 7px);   } }
@keyframes drift7  { to { transform: translate(-8px, -15px); } }
@keyframes drift8  { to { transform: translate(11px, 9px);   } }
@keyframes drift9  { to { transform: translate(-13px, 6px);  } }
@keyframes drift10 { to { transform: translate(6px, -11px);  } }
@keyframes drift11 { to { transform: translate(-10px, 14px); } }
@keyframes drift12 { to { transform: translate(13px, -7px);  } }
@keyframes drift13 { to { transform: translate(-7px, 12px);  } }
@keyframes drift14 { to { transform: translate(9px, 8px);    } }
@keyframes drift15 { to { transform: translate(-11px, -9px); } }
@keyframes drift16 { to { transform: translate(8px, -13px);  } }

/* --- ACT Structure ---------------------------------------- */
.act {
    position: relative;
    z-index: 1;
}

/* --- ACT I: Hero ------------------------------------------ */
.act-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 760px;
}

.hero-glass {
    background: var(--color-cream-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(196, 168, 217, 0.40);
    border-radius: 2px;
    padding: 4rem 4rem 3.5rem;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 48px rgba(61, 31, 91, 0.10);
}

.wisteria-sprig {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.wisteria-sprig.wisteria-small svg {
    width: 80px;
    height: auto;
    opacity: 0.7;
}

.hero-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(2.4rem, 6vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: 0.6rem;
    cursor: default;
}

.hero-subtitle-bar {
    width: 60px;
    height: 2px;
    background: var(--color-wisteria);
    margin: 0.8rem auto 1.2rem;
}

.hero-tagline {
    font-family: var(--font-ui);
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.hero-epigraph {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.05rem;
    color: rgba(61, 31, 91, 0.72);
    max-width: 38ch;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
}

.nav-link {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-med), color var(--transition-med);
    padding-bottom: 1px;
}

.nav-link:hover {
    color: var(--color-text);
    border-bottom-color: var(--color-wisteria);
}

.nav-sep {
    color: var(--color-wisteria);
    opacity: 0.6;
}

/* --- Book Divider ----------------------------------------- */
.book-divider {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 2rem 0 0;
    min-height: 80px;
}

/* --- ACT II: Reading Room --------------------------------- */
.act-reading {
    position: relative;
    padding: 5rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Manuscript — main reading lane */
.reading-manuscript {
    width: 100%;
    max-width: var(--max-reading);
    position: relative;
}

/* Chapter headers */
.chapter-header {
    text-align: center;
    margin: 3.5rem 0 2rem;
}

.chapter-ornament {
    font-size: 0.75rem;
    color: var(--color-wisteria);
    letter-spacing: 0.3em;
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.8;
}

.chapter-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--color-text);
    letter-spacing: -0.01em;
    line-height: 1.2;
    cursor: default;
    display: inline-block;
}

.chapter-rule {
    width: 40px;
    height: 1px;
    background: var(--color-herb);
    margin: 1rem auto 0;
    opacity: 0.6;
}

/* Body text */
.body-text {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1.6rem;
    max-width: var(--max-reading);
}

/* Drop cap */
.drop-cap::first-letter {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 4.2em;
    float: left;
    line-height: 0.78;
    margin: 0.06em 0.12em 0 0;
    color: var(--color-accent);
}

/* Pull-quote */
.pull-quote {
    border-left: 3px solid var(--color-wisteria);
    padding: 1.2rem 1.6rem;
    margin: 2.5rem 0;
    background: var(--color-lavender-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0 2px 2px 0;
}

.pull-quote p {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-text);
    line-height: 1.55;
    margin-bottom: 0.6rem;
}

.pull-quote cite {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(61, 31, 91, 0.6);
    letter-spacing: 0.04em;
}

/* Margin annotations */
.margin-note {
    position: absolute;
    right: 0;
    width: var(--margin-width);
    background: var(--color-lavender-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 168, 217, 0.35);
    border-radius: 2px;
    padding: 0.9rem 1rem;
    transform: translateX(calc(100% + var(--gap-margin)));
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.margin-note.visible {
    opacity: 1;
}

.mn-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: rgba(61, 31, 91, 0.75);
}

.mn-text em {
    font-style: italic;
}

/* Reading card (floating) */
.reading-card {
    background: var(--color-cream-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(196, 168, 217, 0.45);
    border-radius: 2px;
    padding: 1.8rem 2rem;
    margin: 2.5rem 0;
    box-shadow: 0 4px 28px rgba(61, 31, 91, 0.08);
    cursor: default;
    transition: box-shadow var(--transition-med), transform var(--transition-med);
}

.reading-card:hover {
    box-shadow: 0 8px 40px rgba(61, 31, 91, 0.14);
}

.reading-card-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-sage);
    margin-bottom: 0.6rem;
}

.reading-card-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.reading-card-author {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-accent);
    margin-bottom: 0.9rem;
    letter-spacing: 0.02em;
}

.reading-card-note {
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(61, 31, 91, 0.8);
}

/* --- ACT III: Colophon ------------------------------------ */
.act-colophon {
    padding: 5rem 2rem 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.colophon-glass {
    background: var(--color-cream-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(196, 168, 217, 0.38);
    border-radius: 2px;
    padding: 3.5rem 4rem;
    text-align: center;
    max-width: 620px;
    box-shadow: 0 8px 48px rgba(61, 31, 91, 0.09);
}

.colophon-heading {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 1.8rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.colophon-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(61, 31, 91, 0.75);
    margin-bottom: 1rem;
}

.colophon-ornament {
    margin: 1.8rem 0 0.8rem;
    color: var(--color-wisteria);
    letter-spacing: 0.5em;
    font-size: 0.8rem;
    opacity: 0.7;
}

.colophon-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: rgba(61, 31, 91, 0.45);
}

/* --- Magnetic text effect --------------------------------- */
.magnetic-text {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

/* --- Page-entry fade-in ----------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.act-hero .hero-glass {
    animation: fadeInUp 1.2s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 1100px) {
    .margin-note {
        position: static;
        transform: none;
        width: 100%;
        max-width: var(--max-reading);
        margin: 1rem auto;
        opacity: 1;
    }

    .act-reading {
        padding: 4rem 1.5rem 3rem;
    }
}

@media (max-width: 720px) {
    html {
        font-size: 16px;
    }

    .hero-glass {
        padding: 2.5rem 2rem 2rem;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .colophon-glass {
        padding: 2.5rem 1.8rem;
    }

    .reading-manuscript {
        padding: 0;
    }

    .drop-cap::first-letter {
        font-size: 3.6em;
    }
}
