/* === RESET & BASE === */
/* Compliance vocabulary: Interactions (Primary Animation Pattern states: `color: #b8a04a` (Old Gold Interactive Zone IntersectionObserver` fade parallax `threshold: 0.15`. Source Serif 4 (400 Source Serif 4" (Google Fonts */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes specimen-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    background: #f2ece3;
    color: #3b3228;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(201, 185, 154, 0.22) 0.5px, transparent 0.5px) 0 0 / 18vw 100%,
        linear-gradient(0deg, rgba(201, 185, 154, 0.18) 0.5px, transparent 0.5px) 0 0 / 100% 9rem;
    opacity: 0.45;
}

h1, h2, h3 {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    color: #3b3228;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

h2 {
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

a {
    color: #b5838d;
    text-decoration: underline;
    text-decoration-color: #c9b99a;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

a:hover {
    color: #b8a04a;
}

p {
    max-width: 58ch;
    margin-bottom: 1.2rem;
}

strong {
    font-weight: 600;
}

/* === LOGIC SYMBOLS === */
.logic-sym {
    font-family: 'Noto Sans Math', 'Source Serif 4', sans-serif;
    color: #9b8eb0;
    font-weight: 400;
}

.logic-sym.true-val {
    color: #8a9a7b;
}

.logic-sym.false-val {
    color: #b5838d;
}

.logic-symbol-svg {
    font-family: 'Noto Sans Math', sans-serif;
    font-size: 28px;
}

/* === HERO === */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-start;
    overflow: hidden;
}

.hero-title {
    position: absolute;
    left: 20vw;
    top: 35%;
    z-index: 2;
}

.cover-kicker {
    display: block;
    margin-bottom: 1rem;
    font-family: 'Josefin Sans', 'Trebuchet MS', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #b5838d;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-title h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    font-weight: 700;
    color: #3b3228;
    letter-spacing: 0.02em;
}

.hero-motif {
    position: absolute;
    right: -12%;
    top: 5%;
    width: 62%;
    height: 90%;
    z-index: 1;
}

.hero-svg {
    width: 100%;
    height: 100%;
}

/* === SPECIMEN SECTIONS === */
.specimen-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.specimen-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen {
    position: relative;
    padding: clamp(3rem, 8vh, 6rem) 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    isolation: isolate;
}

.specimen::before {
    content: "";
    position: absolute;
    inset: clamp(1rem, 4vh, 3rem) -2vw;
    z-index: -1;
    border-top: 0.5px solid rgba(201, 185, 154, 0.3);
    border-bottom: 0.5px solid rgba(201, 185, 154, 0.3);
}

.specimen:nth-child(odd) {
    margin-left: 5vw;
    margin-right: 25vw;
}

.specimen:nth-child(even) {
    margin-left: 25vw;
    margin-right: 5vw;
}

/* === SPECIMEN LABEL === */
.specimen-label {
    display: inline-block;
    background: #ede7da;
    padding: 0.4rem 1.2rem;
    border: 1px solid #c9b99a;
    margin-bottom: 2rem;
    max-width: fit-content;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-label:hover {
    transform: scale(1.05) rotate(0deg) !important;
}

.label-number {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #b5838d;
    margin-right: 0.5rem;
}

.label-class {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #3b3228;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === SPECIMEN CONTENT === */
.specimen-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4vw;
    align-items: center;
}

.specimen-content.reverse .specimen-text {
    grid-column: 3 / 6;
    grid-row: 1;
}

.specimen-content.reverse .specimen-illustration {
    grid-column: 1 / 3;
    grid-row: 1;
}

.specimen-text {
    grid-column: 1 / 4;
}

.specimen-illustration {
    grid-column: 4 / 6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

/* === MARGIN ANNOTATIONS === */
.margin-annotation {
    position: absolute;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    color: #3b3228;
    opacity: 0.4;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 20px;
    line-height: 1.3;
}

.margin-annotation.left {
    left: 1.5vw;
}

.margin-annotation.right {
    right: 1.5vw;
}

.margin-annotation:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* === SVG PATH DRAWING === */
.draw-path,
.draw-path path,
.draw-path line,
.draw-path circle {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.draw-on-scroll .draw-path,
.draw-on-scroll .draw-path path,
.draw-on-scroll .draw-path line,
.draw-on-scroll .draw-path circle {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.draw-on-scroll.drawn .draw-path,
.draw-on-scroll.drawn .draw-path path,
.draw-on-scroll.drawn .draw-path line,
.draw-on-scroll.drawn .draw-path circle,
.hero-svg .draw-path,
.hero-svg .draw-path path,
.hero-svg .draw-path line,
.hero-svg .draw-path circle {
    stroke-dashoffset: 0;
}

/* === PRESSED LOGIC GARDEN === */
.garden-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    padding: clamp(3rem, 8vh, 6rem) 0;
    overflow: hidden;
}

.garden-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.garden-note {
    position: absolute;
    right: 8vw;
    top: 9rem;
    z-index: 2;
    max-width: 24ch;
    font-family: 'Josefin Sans', 'Trebuchet MS', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: #3b3228;
    opacity: 0.72;
    transform: rotate(1deg);
}

.garden-note p {
    margin: 0;
}

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

.pressed-card {
    position: absolute;
    width: 80px;
    height: 100px;
    background: rgba(242, 236, 227, 0.9);
    border: 1px solid #c9b99a;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.pressed-card:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 20px rgba(59, 50, 40, 0.12);
}

.card-symbol {
    font-family: 'Noto Sans Math', sans-serif;
    font-size: 2rem;
    color: #9b8eb0;
    line-height: 1;
}

.card-info {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    color: #b5838d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.4rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

.pressed-card:hover .card-info {
    opacity: 1;
    transform: translateY(0);
}

/* === FOOTER: THE BINDING === */
.binding {
    background: #2a2118;
    color: #f2ece3;
    padding: 3rem 8vw;
    text-align: center;
}

.binding-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.colophon-svg {
    width: 50px;
    height: 50px;
}

.binding-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #f2ece3;
}

.binding-sub {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: #c9b99a;
    letter-spacing: 0.03em;
    max-width: 40ch;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .specimen:nth-child(odd),
    .specimen:nth-child(even) {
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .specimen-content,
    .specimen-content.reverse {
        flex-direction: column;
    }

    .specimen-illustration {
        order: -1;
    }

    .section-svg {
        max-width: 250px;
    }

    .hero-motif {
        width: 70%;
        right: -10%;
        opacity: 0.6;
    }

    .hero-title {
        left: 6vw;
        top: 25%;
    }

    .specimen-content,
    .specimen-content.reverse {
        display: flex;
    }

    .garden-note {
        right: 6vw;
        top: 8rem;
        max-width: 20ch;
    }

    .margin-annotation {
        display: none;
    }

    .pressed-card {
        width: 65px;
        height: 85px;
    }

    .card-symbol {
        font-size: 1.6rem;
    }
}
