/* ============================================================
   globaltonecheck.com — a field guide to human communication tone
   hand-drawn · diagonal sections · terracotta-warm · slab-serif
   ============================================================ */

:root {
    --cream: #faf3e8;
    --ochre: #f0dfc4;
    --terracotta: #c4643a;
    --sienna: #7a3b20;
    --charcoal: #3d2e24;
    --gold: #d4a04a;
    --sage: #7a8c5e;
    --clay: #e0a882;

    --font-display: "Zilla Slab", Georgia, serif;
    --font-body: "Roboto Slab", Georgia, serif;
    --font-hand: "Caveat", "Segoe Script", cursive;

    --ease-out: cubic-bezier(0.2, 0.65, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--charcoal);
    background: var(--cream);
    line-height: 1.7;
    overflow-x: hidden;
    font-feature-settings: "liga" 1, "kern" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* SVG defs should be invisible but present */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   SHARED SECTION STRUCTURE
   ============================================================ */

.section {
    position: relative;
    width: 100%;
    padding: 9rem 6vw;
    min-height: 90vh;
    overflow: hidden;
}

.section .paper-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.24  0 0 0 0 0.18  0 0 0 0 0.14  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
    opacity: 0.18;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

.section > *:not(.paper-noise) {
    position: relative;
    z-index: 2;
}

/* ============================================================
   FLOATING MARGIN MOTIFS (decorative, global)
   ============================================================ */

.margin-motifs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.margin-motifs .motif {
    position: absolute;
    opacity: 0.55;
    filter: drop-shadow(2px 2px 0 rgba(61, 46, 36, 0.15));
}

.motif-leaf-1 {
    width: 54px;
    top: 14vh;
    left: 2vw;
    transform: rotate(-18deg);
}

.motif-seed {
    width: 80px;
    top: 62vh;
    right: 2vw;
    transform: rotate(12deg);
    opacity: 0.4;
}

.motif-branch {
    width: 140px;
    top: 120vh;
    left: 3vw;
    transform: rotate(-4deg);
    opacity: 0.35;
}

.motif-arrow-1 {
    width: 120px;
    top: 190vh;
    right: 6vw;
    transform: rotate(18deg);
    opacity: 0.5;
}

@media (max-width: 780px) {
    .margin-motifs .motif {
        display: none;
    }
}

/* ============================================================
   SECTION 1 — OPENING SPREAD
   ============================================================ */

.opening {
    min-height: 100vh;
    background: var(--cream);
    padding: 5rem 6vw 6rem;
    display: flex;
    align-items: center;
}

.opening-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.opening-left {
    padding-right: 2rem;
    position: relative;
}

.eyebrow {
    font-family: var(--font-hand);
    font-size: clamp(1rem, 1.7vw, 1.3rem);
    color: var(--terracotta);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-bottom: 2rem;
    transform: rotate(-1.2deg);
}

.underline-swoosh {
    width: 220px;
    height: 18px;
    display: block;
    order: 2;
    margin-top: 2px;
}

.eyebrow span {
    order: 1;
}

.display-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6.2vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: var(--sienna);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.title-word {
    display: inline-block;
    transform-origin: left center;
}

.title-word.word-1 {
    transform: rotate(-1.8deg);
    color: var(--sienna);
}

.title-word.word-2 {
    transform: rotate(1.4deg) translateX(3vw);
    color: var(--terracotta);
}

.title-word.word-3 {
    transform: rotate(-1deg);
    color: var(--sienna);
    position: relative;
}

.title-word.word-3::after {
    content: "";
    position: absolute;
    left: 0;
    right: -8px;
    bottom: 6px;
    height: 10px;
    background: var(--gold);
    opacity: 0.45;
    z-index: -1;
    transform: rotate(-1deg);
    border-radius: 4px;
}

.opening-lede {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1.05rem, 1.55vw, 1.25rem);
    line-height: 1.75;
    max-width: 38em;
    color: var(--charcoal);
    margin-bottom: 2rem;
}

.annotation {
    font-family: var(--font-hand);
    color: var(--terracotta);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    transform: rotate(-2deg);
    max-width: 300px;
    margin-left: 1rem;
}

.annotation-arrow {
    width: 70px;
    height: 60px;
    flex-shrink: 0;
}

.annotation-hero {
    margin-top: 1rem;
}

/* Opening globe */
.opening-right {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.globe-wrap {
    position: relative;
    width: min(480px, 90%);
    aspect-ratio: 1 / 1;
    transition: transform 0.4s var(--ease-out);
    will-change: transform;
    transform-style: preserve-3d;
}

.leaf-globe {
    width: 100%;
    height: 100%;
    animation: globe-spin 120s linear infinite;
    transform-origin: center center;
}

@keyframes globe-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.globe-leaves .leaf {
    transform-origin: 200px 200px;
    transition: transform 0.4s var(--ease-out), filter 0.4s var(--ease-out);
}

.leaf-a { animation: leaf-float 4s ease-in-out infinite; animation-delay: 0s; }
.leaf-b { animation: leaf-float 4.5s ease-in-out infinite; animation-delay: 0.4s; }
.leaf-c { animation: leaf-float 3.8s ease-in-out infinite; animation-delay: 0.8s; }
.leaf-d { animation: leaf-float 5s ease-in-out infinite; animation-delay: 1.2s; }
.leaf-e { animation: leaf-float 4.2s ease-in-out infinite; animation-delay: 1.6s; }
.leaf-f { animation: leaf-float 3.6s ease-in-out infinite; animation-delay: 2s; }
.leaf-g { animation: leaf-float 4.8s ease-in-out infinite; animation-delay: 2.4s; }
.leaf-h { animation: leaf-float 4s ease-in-out infinite; animation-delay: 2.8s; }
.leaf-i { animation: leaf-float 3.9s ease-in-out infinite; animation-delay: 3.2s; }
.leaf-j { animation: leaf-float 4.6s ease-in-out infinite; animation-delay: 0.2s; }
.leaf-k { animation: leaf-float 4.1s ease-in-out infinite; animation-delay: 1s; }
.leaf-l { animation: leaf-float 5.1s ease-in-out infinite; animation-delay: 1.8s; }
.leaf-m { animation: leaf-float 3.7s ease-in-out infinite; animation-delay: 2.2s; }
.leaf-n { animation: leaf-float 4.3s ease-in-out infinite; animation-delay: 2.6s; }
.leaf-o { animation: leaf-float 4.9s ease-in-out infinite; animation-delay: 3.4s; }

@keyframes leaf-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.globe-wrap:hover .leaf-globe {
    animation-play-state: paused;
}

.globe-caption {
    position: absolute;
    right: -10px;
    bottom: -40px;
    font-family: var(--font-hand);
    color: var(--sienna);
    font-size: 1.1rem;
    transform: rotate(2deg);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.caption-bracket {
    width: 120px;
    height: 22px;
    display: block;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    font-family: var(--font-hand);
    color: var(--sienna);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.8;
    animation: bob 3s ease-in-out infinite;
}

.arrow-down {
    width: 18px;
    height: 36px;
}

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
    50% { transform: translateX(-50%) translateY(6px) rotate(-1deg); }
}

/* ============================================================
   DIAGONAL BANDS — SHARED
   ============================================================ */

.band {
    padding: 14rem 6vw;
    margin-top: -48px;
}

.band-inner {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.band-chapter {
    font-family: var(--font-hand);
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--charcoal);
    opacity: 0.7;
    display: block;
    transform: rotate(-1.5deg);
    margin-bottom: 0.5rem;
}

.band-chapter-light {
    color: var(--cream);
    opacity: 0.85;
}

.band-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.8vw, 3.8rem);
    line-height: 1;
    letter-spacing: 0.015em;
    color: var(--sienna);
    transform: rotate(-1.3deg);
    margin-bottom: 1.5rem;
    max-width: 15em;
}

.band-title-dark {
    color: var(--charcoal);
}

.band-title-light {
    color: var(--cream);
}

.band-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    line-height: 1.8;
    max-width: 34em;
    color: var(--charcoal);
    margin-bottom: 1.2rem;
}

.band-text-dark {
    color: var(--charcoal);
}

.band-text-light {
    color: var(--cream);
    opacity: 0.92;
}

/* ============================================================
   BAND 1 — HOW TONE TRAVELS (skewed 6deg, terracotta)
   ============================================================ */

.band-1 {
    background: var(--terracotta);
    color: var(--cream);
    clip-path: polygon(0 4%, 100% 0%, 100% 96%, 0 100%);
}

.band-1 .band-inner {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4rem;
    align-items: center;
    transform: rotate(-0.6deg);
}

.band-1 .band-chapter {
    color: var(--cream);
    opacity: 0.85;
}

.band-1 .band-title {
    color: var(--cream);
}

.band-1 .band-text {
    color: var(--cream);
    opacity: 0.92;
}

.band-map {
    position: relative;
}

.world-sketch {
    width: 100%;
    height: auto;
    display: block;
}

.map-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-label {
    position: absolute;
    font-family: var(--font-hand);
    color: var(--cream);
    background: rgba(122, 59, 32, 0.5);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.map-label-1 {
    top: 8%;
    left: 30%;
    transform: rotate(-2deg);
}

.map-label-2 {
    top: 18%;
    left: 62%;
    transform: rotate(1.5deg);
}

.map-label-3 {
    top: 62%;
    left: 38%;
    transform: rotate(-1.5deg);
}

.map-label-4 {
    top: 68%;
    left: 68%;
    transform: rotate(2deg);
}

/* ============================================================
   BAND 2 — READING BETWEEN THE LINES (skewed -5deg, ochre)
   ============================================================ */

.band-2 {
    background: var(--ochre);
    clip-path: polygon(0 0%, 100% 5%, 100% 100%, 0 95%);
    padding-top: 16rem;
    padding-bottom: 16rem;
}

.band-2 .band-inner {
    transform: rotate(0.8deg);
}

.panels-heading {
    max-width: 700px;
    margin: 3rem 0 0;
}

.panels-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.2rem;
    margin-bottom: 3rem;
}

.panel {
    position: relative;
    background: var(--cream);
    padding: 2.5rem 1.6rem 2rem;
    border: 1.5px solid rgba(61, 46, 36, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    will-change: transform;
    box-shadow: 4px 5px 0 rgba(61, 46, 36, 0.12);
}

.panel:nth-child(1) {
    transform: rotate(-1.5deg);
}

.panel:nth-child(2) {
    transform: rotate(0.8deg) translateY(18px);
}

.panel:nth-child(3) {
    transform: rotate(-0.6deg);
}

.panel-edge {
    position: absolute;
    left: 0;
    right: 0;
    height: 16px;
    background:
        radial-gradient(circle at 10% 100%, var(--ochre) 0 6px, transparent 7px),
        radial-gradient(circle at 28% 100%, var(--ochre) 0 4px, transparent 5px),
        radial-gradient(circle at 48% 100%, var(--ochre) 0 7px, transparent 8px),
        radial-gradient(circle at 66% 100%, var(--ochre) 0 5px, transparent 6px),
        radial-gradient(circle at 82% 100%, var(--ochre) 0 6px, transparent 7px),
        var(--cream);
}

.panel-edge-top {
    top: 0;
    transform: scaleY(-1);
}

.panel-edge-bottom {
    bottom: 0;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    color: var(--sienna);
    transform: rotate(-1.3deg);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.panel-illo {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
}

.panel-caption {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--charcoal);
}

.panel-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-hand);
    font-size: 0.95rem;
    color: var(--terracotta);
    transform: rotate(4deg);
}

/* ============================================================
   BAND 3 — THE SPECTRUM (skewed 4deg, sienna)
   ============================================================ */

.band-3 {
    background: var(--sienna);
    color: var(--cream);
    clip-path: polygon(0 5%, 100% 0%, 100% 95%, 0 100%);
    padding-top: 15rem;
    padding-bottom: 16rem;
}

.band-3 .band-inner {
    transform: rotate(-0.5deg);
}

.spectrum-copy {
    max-width: 640px;
    margin-bottom: 3.5rem;
}

.spectrum-wrap {
    position: relative;
    padding: 2rem 0 4rem;
}

.spectrum-bar {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 2rem;
}

.specimen-row {
    position: relative;
    height: 280px;
    max-width: 900px;
    margin: 0 auto;
}

.specimen {
    position: absolute;
    top: 0;
    left: var(--stem-left);
    transform: translateX(-50%);
    width: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.3s var(--ease-out);
}

.specimen-stem {
    width: 1.2px;
    height: 36px;
    background: var(--cream);
    opacity: 0.6;
}

.specimen-card {
    background: rgba(250, 243, 232, 0.08);
    border: 1px dashed rgba(250, 243, 232, 0.45);
    padding: 0.9rem 0.9rem 1rem;
    width: 100%;
    text-align: center;
    transform: rotate(-1.5deg);
}

.specimen:nth-child(even) .specimen-card {
    transform: rotate(1.8deg);
}

.specimen-illo {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 0.5rem;
}

.specimen-label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--cream);
    line-height: 1.3;
    margin-bottom: 0.35rem;
}

.specimen-hint {
    font-family: var(--font-hand);
    font-size: 0.85rem;
    color: var(--gold);
    opacity: 0.9;
}

/* ============================================================
   SECTION 5 — CLOSING SPREAD
   ============================================================ */

.closing {
    background: var(--cream);
    min-height: 100vh;
    padding: 10rem 6vw 6rem;
    margin-top: -48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.notebook {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f5ead4;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-width: 1100px;
    margin: 0 auto 4rem;
    box-shadow:
        0 20px 40px rgba(61, 46, 36, 0.2),
        0 4px 10px rgba(61, 46, 36, 0.15),
        inset 0 0 80px rgba(122, 59, 32, 0.06);
    transform: rotate(-0.8deg) perspective(1600px) rotateX(3deg);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.4s var(--ease-out);
    border: 1px solid rgba(61, 46, 36, 0.35);
}

.notebook-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to right,
        rgba(61, 46, 36, 0.25),
        rgba(61, 46, 36, 0.35),
        rgba(61, 46, 36, 0.25));
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 3;
}

.notebook-spine::before,
.notebook-spine::after {
    content: "";
    position: absolute;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sienna);
    opacity: 0.6;
}

.notebook-spine::before {
    top: 15%;
}

.notebook-spine::after {
    bottom: 15%;
}

.notebook-page {
    position: relative;
    padding: 3rem 2.8rem;
    overflow: hidden;
}

.page-rule {
    position: absolute;
    inset: 2.5rem 1.8rem;
    width: calc(100% - 3.6rem);
    height: calc(100% - 5rem);
    pointer-events: none;
    opacity: 0.7;
}

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

.manifesto-title {
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    color: var(--sienna);
    transform: rotate(-2deg);
    margin-bottom: 1.5rem;
}

.manifesto-line {
    font-family: var(--font-hand);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.9;
    color: var(--charcoal);
    margin-bottom: 0.3rem;
}

.manifesto-line:nth-child(2) { transform: rotate(-0.5deg) translateX(4px); }
.manifesto-line:nth-child(3) { transform: rotate(0.8deg); }
.manifesto-line:nth-child(4) { transform: rotate(-0.3deg) translateX(-2px); }
.manifesto-line:nth-child(5) { transform: rotate(0.6deg); }
.manifesto-line:nth-child(6) { transform: rotate(-0.4deg) translateX(6px); }

.manifesto-signature {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: var(--font-hand);
    color: var(--sienna);
    transform: rotate(-1.5deg);
}

.signature-scribble {
    width: 160px;
    height: 40px;
    margin-bottom: 0.2rem;
}

.page-content-right {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    text-align: center;
}

.sketch-block {
    width: 58%;
    max-width: 220px;
    transform: rotate(2deg);
}

.closing-sketch {
    width: 100%;
    height: auto;
    display: block;
}

.closing-note {
    font-family: var(--font-hand);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--charcoal);
    max-width: 22em;
    line-height: 1.55;
    transform: rotate(-1deg);
}

.closing-stamp {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    transform: rotate(-3deg);
}

.stamp-circle {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.stamp-circle svg {
    width: 100%;
    height: 100%;
    opacity: 0.85;
}

.stamp-note {
    font-family: var(--font-hand);
    color: var(--sienna);
    text-align: left;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.stamp-small {
    font-size: 0.85rem;
    opacity: 0.75;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-hand);
    color: var(--sienna);
    font-size: 1.05rem;
    opacity: 0.8;
    padding: 0 1rem;
}

.footer-leaves svg {
    width: 80px;
    height: 20px;
}

/* ============================================================
   SCROLL REVEAL STATES
   ============================================================ */

.reveal {
    opacity: 0;
    transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.reveal-right {
    transform: translateX(80px);
}

.reveal-left {
    transform: translateX(-80px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
    .opening-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .opening-right {
        order: -1;
    }

    .globe-wrap {
        width: min(380px, 80%);
    }

    .band-1 .band-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .panels-wrap {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .panel:nth-child(2) {
        transform: rotate(0.8deg);
    }

    .band {
        padding: 10rem 6vw;
    }

    .notebook {
        grid-template-columns: 1fr;
        aspect-ratio: auto;
    }

    .notebook-spine {
        display: none;
    }

    .specimen-row {
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        margin-top: 2rem;
    }

    .specimen {
        position: relative;
        left: auto;
        transform: none;
        width: 100%;
    }

    .specimen-stem {
        display: none;
    }

    .spectrum-bar {
        display: none;
    }
}

@media (max-width: 580px) {
    .section {
        padding: 6rem 5vw;
    }

    .band {
        padding: 9rem 5vw;
    }

    .specimen-row {
        grid-template-columns: 1fr;
    }

    .footer-row {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
    }
}
