:root {
    --rives-bfk: #F5F0E8;
    --stone-dark: #3D2B1F;
    --tusche-medium: #8B7355;
    --press-red: #B5473A;
    --reg-blue: #3A5A7C;
    --crayon-gold: #C4A24E;
    --stone-edge: #C8B89A;
    --tissue-overlay: #EDE8DC;
    --stone-mid: #D4C8B0;
    --grain-opacity: 0.04;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--rives-bfk);
    color: var(--stone-dark);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Grain Overlay */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#grain);
    opacity: var(--grain-opacity);
    pointer-events: none;
    z-index: 1;
}

/* Sections */
.section {
    position: relative;
    min-height: 100vh;
    padding: 80px;
}

.paper-bg {
    background: var(--rives-bfk);
}

.tissue-bg {
    background: radial-gradient(ellipse at 45% 55%, var(--tissue-overlay), #E0D6C4);
}

/* Blank Sheet (Hero) */
#blank-sheet {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rives-bfk);
}

.sheet-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.center-mark {
    margin: 0 auto 40px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.center-mark.visible {
    opacity: 1;
}

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--stone-dark);
    margin-bottom: 16px;
}

.title-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.06s ease, transform 0.15s ease;
}

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

.subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--tusche-medium);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.subtitle.visible {
    opacity: 1;
}

/* Registration Marks */
.reg-mark {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.3s ease 0.3s;
}

.reg-mark.visible {
    opacity: 1;
}

.reg-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.reg-marks .tl { position: absolute; top: 8px; left: 8px; }
.reg-marks .tr { position: absolute; top: 8px; right: 8px; }
.reg-marks .bl { position: absolute; bottom: 8px; left: 8px; }
.reg-marks .br { position: absolute; bottom: 8px; right: 8px; }

/* Roller Line */
.roller-line {
    width: 100%;
    height: 1px;
    position: relative;
    overflow: hidden;
}

.roller-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--stone-dark);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s ease-in-out;
}

.roller-line.swept::after {
    transform: scaleX(1);
}

/* Content Frame */
.content-frame {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

/* Edition Number */
.edition-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--stone-edge);
    display: block;
    margin-bottom: 24px;
}

/* Text */
.body-text {
    color: var(--stone-dark);
    margin-bottom: 16px;
    max-width: 38rem;
}

.center-text {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--stone-dark);
    margin-bottom: 24px;
}

.center-heading {
    text-align: center;
}

/* Drop Cap */
.drop-cap {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 4.5rem;
    float: left;
    color: var(--press-red);
    line-height: 0.8;
    margin-right: 16px;
    margin-top: 6px;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.column .body-text {
    max-width: none;
}

/* Pull Quote */
.pull-quote {
    border: 1px solid var(--stone-dark);
    padding: 32px 40px;
    margin: 40px -40px;
    transform: rotate(-1deg);
    position: relative;
    background: var(--rives-bfk);
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.pull-quote.visible {
    opacity: 1;
}

.pull-quote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--stone-dark);
    line-height: 1.5;
}

/* Stone Divider */
.stone-divider {
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, var(--stone-edge), var(--stone-mid), #E0D6C4);
}

/* Registration Demo */
.registration-demo {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 60px auto;
}

.color-block {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 2px;
    transition: transform 2s ease-out;
}

.blue-block {
    background: rgba(58, 90, 124, 0.4);
    top: 20px;
    left: 20px;
    transform: translate(-8px, -6px);
}

.red-block {
    background: rgba(181, 71, 58, 0.4);
    top: 40px;
    left: 50px;
    transform: translate(6px, 4px);
}

.gold-block {
    background: rgba(196, 162, 78, 0.4);
    top: 30px;
    left: 35px;
    transform: translate(-3px, 5px);
}

.blue-block.registered,
.red-block.registered,
.gold-block.registered {
    transform: translate(0, 0);
}

.reg-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--tusche-medium);
    letter-spacing: 0.04em;
    text-align: center;
    margin-top: 8px;
}

/* Final Impression */
.impression-frame {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 48px;
    box-shadow: 0 0 0 1px var(--stone-dark), 0 0 3px rgba(61, 43, 31, 0.15);
    background: var(--rives-bfk);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.impression-frame.visible {
    transform: scale(1);
    opacity: 1;
}

.impression-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--stone-edge);
}

.edition-label, .date-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--tusche-medium);
}

/* Colophon */
.colophon {
    padding: 48px 80px;
    text-align: center;
    background: var(--rives-bfk);
}

.colophon-rule {
    width: 100%;
    height: 1px;
    background: var(--stone-edge);
    margin-bottom: 24px;
}

.colophon-rule:last-child {
    margin-top: 24px;
    margin-bottom: 0;
}

.colophon-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.2rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: var(--tusche-medium);
    margin-bottom: 8px;
}

.colophon-info {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--tusche-medium);
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 48px 24px;
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .pull-quote {
        margin: 24px 0;
    }

    .colophon {
        padding: 32px 24px;
    }

    .registration-demo {
        width: 240px;
        height: 240px;
    }

    .color-block {
        width: 150px;
        height: 150px;
    }
}
