/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --parchment: #f4ece1;
    --charcoal: #1a1a1a;
    --burnt-sienna: #c1440e;
    --red-ink: #e63b2e;
    --deep-brown: #2c1810;
    --warm-brown: #6b4226;
    --tan: #b8956a;
    --sand: #d4c5b0;
}

html {
    scroll-behavior: smooth;
}

body {
    display: grid;
    grid-template-columns: 38fr 62fr;
    min-height: 100vh;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--parchment);
    background: var(--charcoal);
    overflow-x: hidden;
}

/* === CHAPTER STRUCTURE === */
.chapter {
    display: contents;
}

.margin-zone {
    background: var(--parchment);
    min-height: 100vh;
    padding: 4rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
    border-right: 2px solid var(--tan);
}

.text-zone {
    background: var(--charcoal);
    min-height: 100vh;
    padding: 4rem 4rem 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

/* === TYPOGRAPHY === */
.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: var(--parchment);
}

.headline .red-dot {
    color: var(--red-ink);
}

.headline .red-ink {
    color: var(--red-ink);
}

.rotated {
    transform: rotate(-2.5deg);
    transform-origin: left bottom;
}

.rotated-neg {
    transform: rotate(1.5deg);
    transform-origin: left bottom;
}

.tilted {
    transform: rotate(-1deg);
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--sand);
    max-width: 540px;
}

.body-text.faded {
    opacity: 0.5;
    font-size: 0.95rem;
}

.strikethrough {
    text-decoration: line-through;
    text-decoration-color: var(--red-ink);
    text-decoration-thickness: 2px;
    opacity: 0.6;
}

.red-ink {
    color: var(--red-ink);
}

/* === MARGIN NOTES (Caveat handwriting) === */
.margin-note {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: var(--deep-brown);
    transform: rotate(-3deg);
    text-align: center;
    max-width: 200px;
}

.caveat {
    font-family: 'Caveat', cursive;
}

/* === 3D OBJECTS (CSS pseudo-3D) === */
.object-3d {
    width: 80px;
    height: 80px;
    position: relative;
    transform: perspective(800px) rotateX(-15deg) rotateY(25deg);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.book-object {
    width: 100px;
    height: 130px;
    background: var(--burnt-sienna);
    border-radius: 2px 6px 6px 2px;
    box-shadow:
        -5px 5px 0 var(--deep-brown),
        -10px 10px 0 var(--warm-brown),
        inset 3px 0 0 rgba(255,255,255,0.1);
    transform: perspective(800px) rotateX(-10deg) rotateY(20deg) rotateZ(-5deg);
}

.cube-object {
    width: 70px;
    height: 70px;
    background: var(--warm-brown);
    box-shadow:
        -8px 8px 0 var(--deep-brown),
        -4px 4px 0 var(--burnt-sienna);
    transform: perspective(800px) rotateX(-15deg) rotateY(35deg);
}

.sphere-object {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--tan), var(--burnt-sienna), var(--deep-brown));
    box-shadow: 8px 8px 20px rgba(0,0,0,0.3);
}

.pyramid-object {
    width: 0;
    height: 0;
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 80px solid var(--burnt-sienna);
    box-shadow: none;
    transform: perspective(800px) rotateX(-5deg) rotateY(15deg);
}

.pyramid-object::after {
    content: '';
    position: absolute;
    top: 0;
    left: -45px;
    width: 0;
    height: 0;
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 80px solid var(--deep-brown);
    opacity: 0.4;
    transform: skewX(-10deg);
}

.torus-object {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 16px solid var(--burnt-sienna);
    box-shadow:
        inset 0 0 10px var(--deep-brown),
        4px 4px 10px rgba(0,0,0,0.3);
    transform: perspective(800px) rotateX(65deg) rotateY(10deg);
}

/* === REDACTION BLOCKS === */
.redaction-block {
    width: 120px;
    height: 18px;
    background: var(--charcoal);
    opacity: 0.85;
}

.redaction-block.wide {
    width: 160px;
    height: 14px;
}

/* === WORK ITEMS === */
.work-item {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(212, 197, 176, 0.15);
    transition: transform 0.3s ease, padding-left 0.3s ease;
    cursor: pointer;
}

.work-item:hover {
    transform: translateX(10px) rotate(-0.5deg);
    padding-left: 0.5rem;
}

.work-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--burnt-sienna);
    letter-spacing: 0.05em;
}

.work-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--parchment);
    transition: color 0.3s ease;
}

.work-item:hover .work-title {
    color: var(--red-ink);
}

/* === PROCESS LIST === */
.process-list {
    list-style: none;
    counter-reset: process;
}

.process-list li {
    counter-increment: process;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--parchment);
    padding: 0.8rem 0;
    border-bottom: 1px dashed rgba(212, 197, 176, 0.2);
}

.process-list li::before {
    content: counter(process) ". ";
    color: var(--burnt-sienna);
    font-family: 'Space Grotesk', sans-serif;
}

/* === FOOTNOTE === */
.footnote-marker {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--tan);
    opacity: 0.6;
    margin-top: 2rem;
}

/* === SCROLL TRIGGERED ANIMATIONS === */
.margin-zone,
.text-zone {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.margin-zone.visible,
.text-zone.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-zone.visible .rotated {
    transform: rotate(-2.5deg);
}

.text-zone.visible .rotated-neg {
    transform: rotate(1.5deg);
}

.text-zone.visible .tilted {
    transform: rotate(-1deg);
}

/* === HOVER on 3D objects === */
.object-3d:hover {
    transform: perspective(800px) rotateX(-5deg) rotateY(10deg) scale(1.1);
}

.sphere-object:hover {
    transform: perspective(800px) rotateX(-5deg) rotateY(10deg) scale(1.1);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .margin-zone {
        min-height: 40vh;
        border-right: none;
        border-bottom: 2px solid var(--tan);
    }

    .text-zone {
        min-height: 60vh;
        padding: 3rem 2rem;
    }

    .headline {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}
