:root {
    --color-parchment: #f5ede0;
    --color-ink: #3d2e1f;
    --color-terracotta: #c27856;
    --color-sage: #8fa883;
    --color-slate: #6b7f9e;
    --color-ochre: #d4a574;
    --color-wash: #e8c5b0;
    --color-umber: #2a1f14;
    --color-spine: #b8a088;
}

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--color-parchment);
    color: var(--color-ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.008em;
    overflow-x: hidden;
}

/* Journal Spine */
.journal-spine {
    position: fixed;
    top: 0;
    left: clamp(24px, 4vw, 48px);
    width: 2px;
    height: 100vh;
    background: var(--color-spine);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

.spine-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-parchment);
    border: 1.5px solid var(--color-spine);
    transition: background 0.4s ease, transform 0.4s ease;
    position: relative;
    left: 0;
}

.spine-dot.active {
    background: var(--color-ochre);
    border-color: var(--color-ochre);
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Pages */
.page {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Cover Page */
.cover-page {
    flex-direction: column;
    text-align: center;
}

.cover-content {
    position: relative;
    z-index: 2;
}

.cover-title {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw + 0.8rem, 4.8rem);
    letter-spacing: 0.01em;
    line-height: 1.12;
    color: var(--color-ink);
    margin-bottom: 1rem;
}

.cover-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--color-slate);
    font-style: italic;
}

/* Watercolor wash */
.watercolor-wash {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.wash-blob {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    mix-blend-mode: multiply;
    filter: blur(20px);
}

.wash-blob-1 {
    width: 50vw;
    height: 50vh;
    top: 20%;
    left: 25%;
    background: radial-gradient(ellipse, rgba(194,120,86,0.2) 0%, transparent 65%);
}

.wash-blob-2 {
    width: 40vw;
    height: 40vh;
    top: 30%;
    left: 35%;
    background: radial-gradient(ellipse, rgba(143,168,131,0.2) 0%, transparent 65%);
    border-radius: 55% 45% 40% 60% / 45% 55% 50% 50%;
}

.wash-blob-3 {
    width: 35vw;
    height: 35vh;
    top: 40%;
    left: 20%;
    background: radial-gradient(ellipse, rgba(232,197,176,0.25) 0%, transparent 60%);
    border-radius: 45% 55% 60% 40% / 55% 45% 40% 60%;
}

/* Scroll Arrow */
.scroll-arrow {
    position: absolute;
    bottom: 3rem;
    z-index: 2;
    animation: arrow-bob 2s ease-in-out infinite;
}

@keyframes arrow-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Interstitials */
.interstitial {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(232,197,176,0.3) 0%, transparent 70%);
    mix-blend-mode: multiply;
}

.divider-line {
    width: clamp(200px, 50vw, 500px);
    height: 4px;
}

.divider-line path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.6s ease;
}

.interstitial.visible .divider-line path {
    stroke-dashoffset: 0;
}

/* Content Pages */
.content-page {
    flex-direction: column;
}

.page-number {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-variant: small-caps;
    font-size: 0.75rem;
    color: var(--color-slate);
    letter-spacing: 0.1em;
}

.page-container {
    display: grid;
    grid-template-columns: 55% 40%;
    gap: 5%;
    max-width: clamp(680px, 75vw, 1080px);
    width: 100%;
    align-items: start;
}

.section-heading {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw + 0.5rem, 3rem);
    letter-spacing: 0.01em;
    line-height: 1.12;
    color: var(--color-ink);
    margin-bottom: 1.5rem;
}

.page-left p {
    margin-bottom: 1.2rem;
}

/* Drop Cap */
.drop-cap {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: 4em;
    float: left;
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.05em;
    color: var(--color-ink);
    position: relative;
}

.drop-cap::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5em;
    height: 1.5em;
    background: radial-gradient(circle, rgba(143,168,131,0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* Right Column */
.page-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sketch-container {
    text-align: center;
}

.prototype-sketch {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.sketch-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease;
}

.page.visible .sketch-path {
    stroke-dashoffset: 0;
}

.sketch-label {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--color-slate);
    transform: rotate(-2deg);
    margin-top: 0.5rem;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--color-slate);
    line-height: 1.5;
    padding: 0.5rem;
    border-left: 2px solid var(--color-wash);
    margin-top: 0.5rem;
}

/* Footnotes */
.footnote-marker {
    color: var(--color-terracotta);
    cursor: pointer;
    font-size: 0.75em;
    position: relative;
}

.footnote-tooltip {
    display: none;
    position: fixed;
    background: var(--color-wash);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    max-width: 280px;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--color-umber);
    z-index: 200;
    box-shadow: 0 4px 20px rgba(42,31,20,0.1);
}

.footnote-tooltip.show {
    display: block;
}

/* Colophon */
.colophon-page {
    min-height: 60svh;
}

.colophon-content {
    text-align: center;
    max-width: 560px;
}

.colophon-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-variant: small-caps;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    line-height: 2.0;
    color: var(--color-umber);
    margin-bottom: 2rem;
}

.colophon-signature {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--color-slate);
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .journal-spine {
        left: 12px;
    }

    .page {
        padding: 3rem 1.5rem 3rem 2.5rem;
    }

    .page-right {
        order: -1;
    }
}
