:root {
    --tanned-hide: #3A2518;
    --saddle-brown: #7B4A2E;
    --florist-wire: #C4956A;
    --laid-stock: #F5EBD8;
    --vellum: #FDF8EF;
    --garden-shade: #5E6B4A;
    --pressed-petal: #C17C74;
    --writing-ink: #2C2420;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--laid-stock);
    color: var(--writing-ink);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    filter: url(#grain-filter);
    opacity: 0.06;
    mix-blend-mode: multiply;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-feature-settings: 'ss01';
    text-rendering: optimizeLegibility;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.foyer-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    color: var(--vellum);
    text-shadow:
        0 1px 0 rgba(253,248,239,0.15),
        0 -1px 1px rgba(42,37,20,0.4);
}

.foyer-annotation {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.3rem, 2.8vw, 1.8rem);
    line-height: 1.5;
    color: var(--florist-wire);
    margin-top: 1rem;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    margin-bottom: 2rem;
    color: var(--writing-ink);
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--writing-ink);
    margin-bottom: 1.5rem;
    max-width: 55ch;
}

.body-text strong {
    font-weight: 500;
    color: var(--tanned-hide);
}

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

.epigraph {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.3rem, 2.8vw, 1.8rem);
    line-height: 1.5;
    color: var(--pressed-petal);
    margin-top: 2rem;
    margin-bottom: 1rem;
    max-width: 50ch;
}

/* Underline-Draw System */
[data-draw-underline] {
    background-image: linear-gradient(var(--florist-wire), var(--florist-wire));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline;
    padding-bottom: 2px;
}

[data-draw-underline].drawn {
    background-size: 100% 2px;
}

a {
    color: var(--florist-wire);
    text-decoration: none;
    background-image: linear-gradient(var(--florist-wire), var(--florist-wire));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover {
    background-size: 100% 1px;
}

a:visited {
    color: var(--pressed-petal);
}

/* Drawn Rules */
.drawn-rule {
    border: none;
    height: 1px;
    background-image: linear-gradient(var(--florist-wire), var(--florist-wire));
    background-size: 0% 1px;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-color: transparent;
    opacity: 0.4;
    margin: 2rem 0;
    transition: background-size 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawn-rule.drawn {
    background-size: 100% 1px;
}

/* Zones */
.zone {
    position: relative;
    padding-block: clamp(4rem, 10vh, 8rem);
}

/* Zone 1: Foyer */
.zone-foyer {
    min-height: 100vh;
    background:
        repeating-linear-gradient(7deg, transparent, transparent 39px, rgba(59,37,24,0.03) 39px, rgba(59,37,24,0.03) 40px),
        radial-gradient(ellipse at 30% 40%, var(--saddle-brown) 0%, var(--tanned-hide) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
}

.zone-foyer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.15;
    mix-blend-mode: overlay;
    pointer-events: none;
}

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

/* Peony */
.peony {
    position: absolute;
    bottom: 15%;
    right: 10%;
    width: 180px;
    height: 180px;
    animation: bloom-breathe 12s ease-in-out infinite alternate;
}

.petal {
    position: absolute;
    border-radius: 40% 60% 50% 50%;
    top: 50%;
    left: 50%;
    transform-origin: center;
}

.p1  { width: 80px; height: 60px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(0deg); animation-delay: 0s; }
.p2  { width: 70px; height: 55px; background: rgba(193,124,116,0.7); transform: translate(-50%,-50%) rotate(30deg); animation-delay: 0.4s; }
.p3  { width: 75px; height: 58px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(60deg); animation-delay: 0.8s; }
.p4  { width: 65px; height: 50px; background: rgba(193,124,116,0.6); transform: translate(-50%,-50%) rotate(90deg); animation-delay: 1.2s; }
.p5  { width: 72px; height: 54px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(120deg); animation-delay: 1.6s; }
.p6  { width: 68px; height: 52px; background: rgba(193,124,116,0.5); transform: translate(-50%,-50%) rotate(150deg); animation-delay: 2s; }
.p7  { width: 74px; height: 56px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(180deg); animation-delay: 2.4s; }
.p8  { width: 60px; height: 48px; background: rgba(193,124,116,0.65); transform: translate(-50%,-50%) rotate(210deg); animation-delay: 2.8s; }
.p9  { width: 70px; height: 54px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(240deg); animation-delay: 3.2s; }
.p10 { width: 66px; height: 50px; background: rgba(193,124,116,0.55); transform: translate(-50%,-50%) rotate(270deg); animation-delay: 3.6s; }
.p11 { width: 72px; height: 53px; background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(300deg); animation-delay: 4s; }
.p12 { width: 64px; height: 49px; background: rgba(193,124,116,0.6); transform: translate(-50%,-50%) rotate(330deg); animation-delay: 4.4s; }

.pistil {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--florist-wire);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes bloom-breathe {
    from { transform: rotate(-1deg) scale(1); }
    to { transform: rotate(1deg) scale(1.02); }
}

/* Scroll Cue */
.scroll-cue {
    position: absolute;
    bottom: 6vw;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--florist-wire);
    animation: cue-draw 2s ease-in-out infinite alternate;
}

@keyframes cue-draw {
    from { width: 0; opacity: 0.4; }
    to { width: 60px; opacity: 0.8; }
}

/* Zone 2: Greenhouse */
.zone-greenhouse {
    min-height: 120vh;
    background: var(--laid-stock);
    position: relative;
}

.zone-greenhouse::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: multiply;
}

/* Zone 3: Refutation Garden */
.zone-refutation {
    min-height: 130vh;
    background: var(--laid-stock);
    position: relative;
}

.zone-refutation::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    mix-blend-mode: multiply;
}

/* Zone 4: Resolution */
.zone-resolution {
    min-height: 100vh;
    background: var(--laid-stock);
    position: relative;
}

/* Zone 5: Colophon */
.zone-colophon {
    min-height: 60vh;
    background:
        repeating-linear-gradient(7deg, transparent, transparent 39px, rgba(59,37,24,0.03) 39px, rgba(59,37,24,0.03) 40px),
        radial-gradient(ellipse at 60% 50%, var(--saddle-brown) 0%, var(--tanned-hide) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-colophon::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    mix-blend-mode: multiply;
}

/* Reading Column */
.reading-column {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    position: relative;
}

/* Two-Column Refutation */
.two-columns {
    columns: 2;
    column-gap: 2.4rem;
    position: relative;
}

.column-divider {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background:
        repeating-linear-gradient(
            180deg,
            var(--saddle-brown) 0px,
            var(--saddle-brown) 6px,
            transparent 6px,
            transparent 12px
        );
    opacity: 0.4;
}

/* Botanical Elements */
.botanical-vine {
    position: absolute;
    left: -40px;
    top: 10%;
    bottom: 10%;
    width: 30px;
}

.stem {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--garden-shade);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.stem.growing {
    transform: scaleY(1);
}

.leaf {
    position: absolute;
    width: 16px;
    height: 10px;
    background: var(--garden-shade);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--grow-delay, 0s);
}

.leaf-r {
    left: 14px;
    border-radius: 0 80% 0 80%;
    transform: rotate(0deg);
}

.leaf-l {
    right: 14px;
    left: auto;
    border-radius: 80% 0 80% 0;
    transform: rotate(0deg);
}

.leaf.growing {
    opacity: 0.8;
    transform: rotate(var(--leaf-angle, 40deg));
}

.thorn {
    position: absolute;
    left: 12px;
    width: 6px;
    height: 10px;
    background: var(--saddle-brown);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: var(--grow-delay, 0s);
}

.thorn.growing {
    opacity: 0.7;
}

/* Bower Arch */
.bower-arch {
    position: absolute;
    top: 0;
    left: -60px;
    right: -60px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.arch-left, .arch-right {
    position: relative;
    width: 40px;
    height: 100%;
}

.arch-left .leaf {
    opacity: 0.6;
    left: auto;
    right: 0;
}

.arch-right .leaf {
    opacity: 0.6;
    left: 0;
}

/* Colophon Content */
.colophon-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.colophon-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--vellum);
    max-width: 45ch;
    margin: 0 auto 2rem;
}

.colophon-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--florist-wire);
    display: inline;
}

/* Pressed Flower */
.pressed-flower {
    width: 80px;
    height: 80px;
    margin: 0 auto 3rem;
    position: relative;
    animation: pressed-sway 8s ease-in-out infinite alternate;
    filter: sepia(15%) brightness(0.95);
}

.pf-petal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 18px;
    border-radius: 50%;
    opacity: 0.6;
}

.pf1 { background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(0deg) translateY(-14px); }
.pf2 { background: rgba(193,124,116,0.5); transform: translate(-50%,-50%) rotate(72deg) translateY(-14px); }
.pf3 { background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(144deg) translateY(-14px); }
.pf4 { background: rgba(193,124,116,0.5); transform: translate(-50%,-50%) rotate(216deg) translateY(-14px); }
.pf5 { background: var(--pressed-petal); transform: translate(-50%,-50%) rotate(288deg) translateY(-14px); }

.pf-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--florist-wire);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes pressed-sway {
    from { transform: rotate(-2deg); }
    to { transform: rotate(2deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .two-columns {
        columns: 1;
    }
    .column-divider {
        display: none;
    }
    .botanical-vine {
        display: none;
    }
    .peony {
        right: 5%;
        bottom: 10%;
        width: 120px;
        height: 120px;
    }
    .bower-arch {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .peony, .pressed-flower { animation: none; }
    .scroll-cue { animation: none; width: 60px; opacity: 0.6; }
    [data-draw-underline] { transition: none; }
    .drawn-rule { transition: none; }
    .stem { transition: none; }
    .leaf { transition: none; }
    .thorn { transition: none; }
}
