/* koomimi.com — Mid-Century Field Journal */

:root {
    --terracotta: #C2612C;
    --umber: #2B1F16;
    --parchment: #F2E6D8;
    --clay: #D4956A;
    --tobacco: #8B5E3C;
    --patina: #4A7C6A;
    --dark-plate: #1A120D;
    --grain-base: #E8DCC8;
    --grain-opacity: 0.35;
    --zoom-duration: 800ms;
    --scroll-progress: 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    color: var(--umber);
    background: var(--parchment);
    line-height: 1.72;
    overflow-x: hidden;
}

/* ---- Progress bar ---- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--terracotta);
    width: calc(var(--scroll-progress) * 100%);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ---- Grain overlay (global) ---- */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

/* ---- Plate grain layers ---- */
.plate-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.plate-grain-dark {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    mix-blend-mode: screen;
    opacity: 0.25;
}

.plate-grain-light {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    mix-blend-mode: multiply;
    opacity: 0.35;
}

/* ---- Plates ---- */
.plate {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 6vh 8.333%;
}

/* ---- Zoom-focus targets ---- */
.zoom-target {
    opacity: 0.7;
    filter: blur(2px);
    transition: opacity var(--zoom-duration) ease-out, transform var(--zoom-duration) ease-out, filter var(--zoom-duration) ease-out;
}

.zoom-target[data-zoom="in"] {
    transform: scale(1.15);
}

.zoom-target[data-zoom="out"] {
    transform: scale(0.92);
}

.zoom-target.in-view {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* ---- Data reveal ---- */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- PLATE I: COVER ---- */
.plate-cover {
    background: var(--dark-plate);
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.cover-content {
    position: relative;
    z-index: 2;
    margin-left: -2%;
}

.cover-title {
    font-family: 'Rokkitt', serif;
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--terracotta);
    letter-spacing: 0.04em;
    line-height: 1.08;
    text-transform: uppercase;
}

.cover-subtitle {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--clay);
    margin-top: 1.5rem;
}

.fox-silhouette {
    position: absolute;
    z-index: 1;
}

.fox-cover {
    bottom: 5%;
    right: 5%;
    width: 200px;
    height: 200px;
    opacity: 0.4;
    transform: scale(1.4);
}

.fig-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--clay);
    position: absolute;
}

.fig-cover {
    bottom: 8%;
    right: 6%;
    z-index: 2;
}

/* ---- PLATE II: TAXONOMY ---- */
.plate-taxonomy {
    background: var(--parchment);
    padding-top: 12vh;
    padding-bottom: 12vh;
}

.taxonomy-grid {
    display: flex;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.taxonomy-headline {
    flex: 6;
}

.taxonomy-data {
    flex: 3;
    transform: rotate(-1.5deg);
}

.plate-heading {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--umber);
    letter-spacing: 0.04em;
    line-height: 1.08;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.body-text {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.72;
    max-width: 38em;
    margin-bottom: 1.5rem;
    color: var(--umber);
}

.body-text-light {
    color: var(--parchment);
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(43, 31, 22, 0.15);
}

.data-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--patina);
}

.data-value {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--umber);
    text-align: right;
    max-width: 60%;
}

.fox-taxonomy {
    right: 15%;
    top: 20%;
    width: 250px;
    height: 250px;
    z-index: 1;
}

.fig-taxonomy {
    right: 18%;
    top: 22%;
    z-index: 2;
}

/* ---- PLATE III: HABITAT ---- */
.plate-habitat {
    background: var(--parchment);
    padding-top: 12vh;
    padding-bottom: 12vh;
}

.habitat-content {
    display: flex;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.habitat-field {
    flex: 0 0 55%;
    min-height: 50vh;
    background: linear-gradient(135deg, var(--terracotta), var(--clay));
    border-radius: 2px;
    position: relative;
}

.habitat-field::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--umber) 0.5px, transparent 0.5px);
    background-size: 3px 3px;
    mix-blend-mode: multiply;
    opacity: 0.15;
}

.habitat-text {
    flex: 1;
    padding-top: 2rem;
}

.annotation {
    position: absolute;
    z-index: 3;
    transform: rotate(-2deg);
}

.ann-1 {
    top: 8%;
    right: 3%;
}

.ann-2 {
    bottom: 12%;
    left: 2%;
    transform: rotate(1.5deg);
}

.ann-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tobacco);
    display: block;
}

.ann-sub {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--clay);
    display: block;
}

/* ---- Redaction bars ---- */
.redacted {
    background: var(--dark-plate);
    color: var(--dark-plate);
    padding: 0 0.2em;
    box-shadow: 0 0 0 3px var(--dark-plate);
}

/* ---- PLATE IV: MORPHOLOGY ---- */
.plate-morphology {
    background: var(--dark-plate);
    padding-top: 10vh;
    padding-bottom: 8vh;
    min-height: 120vh;
}

.morph-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto 4rem;
    position: relative;
    z-index: 2;
}

.morph-fox {
    text-align: center;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.morph-fox.in-view {
    opacity: 1;
}

.morph-fox svg {
    width: 100px;
    height: 100px;
    margin-bottom: 0.5rem;
}

.morph-fox .fig-label {
    position: static;
    display: block;
}

/* Stagger offsets for broken grid */
.mf-1 { transform: translate(-5%, 0) rotate(-2deg); }
.mf-2 { transform: translate(3%, 15%) rotate(1deg); }
.mf-3 { transform: translate(-2%, -8%) rotate(-1.5deg); }
.mf-4 { transform: translate(4%, 10%) rotate(2deg); }
.mf-5 { transform: translate(-6%, -5%) rotate(-1deg); }
.mf-6 { transform: translate(2%, 12%) rotate(1.5deg); }
.mf-7 { transform: translate(-3%, -10%) rotate(-2.5deg); }
.mf-8 { transform: translate(5%, 5%) rotate(0.5deg); }
.mf-9 { transform: translate(0, -3%) rotate(-0.5deg); }

.morph-text {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

/* ---- PLATE V: FIELD NOTES ---- */
.plate-notes {
    background: var(--parchment);
    padding-top: 15vh;
    padding-bottom: 12vh;
}

.pull-quote-block {
    margin-bottom: 6vh;
    position: relative;
    z-index: 2;
}

.pull-quote {
    font-family: 'Rokkitt', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 7vw, 6rem);
    color: var(--umber);
    line-height: 1.08;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: rotate(-1deg);
    padding: 2rem 0;
}

.pq-rule {
    width: 100%;
    height: 4px;
    background: var(--terracotta);
}

.field-entries {
    max-width: 38em;
    position: relative;
    z-index: 2;
}

.field-entry {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.72;
    color: var(--umber);
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 1px solid var(--clay);
}

.entry-date {
    font-style: normal;
    font-weight: 600;
    color: var(--terracotta);
}

/* ---- PLATE VI: EVIDENCE ---- */
.plate-evidence {
    padding: 0;
    min-height: auto;
}

.evidence-band {
    padding: 6vh 8.333%;
    position: relative;
}

.band-dark {
    background: var(--dark-plate);
    clip-path: polygon(0 0, 100% 2%, 100% 98%, 0 100%);
}

.band-light {
    background: var(--parchment);
    clip-path: polygon(0 2%, 100% 0, 100% 100%, 0 98%);
}

.evidence-item {
    max-width: 600px;
}

.specimen-num {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--patina);
    display: block;
    margin-bottom: 0.5rem;
}

.band-dark .specimen-num {
    color: var(--patina);
}

.evidence-caption {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
}

.band-dark .evidence-caption {
    color: var(--parchment);
}

.band-light .evidence-caption {
    color: var(--umber);
}

/* ---- PLATE VII: CONCLUSION ---- */
.plate-conclusion {
    background: var(--dark-plate);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

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

.conclusion-title {
    font-family: 'Rokkitt', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--terracotta);
    letter-spacing: 0.04em;
    line-height: 1.08;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.conclusion-wordmark {
    font-family: 'Zilla Slab', serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--clay);
}

.fox-conclusion {
    left: 20%;
    top: 50%;
    transform: translateY(-50%) scale(2);
    width: 200px;
    height: 200px;
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
    .plate {
        padding: 4vh 5%;
    }

    .taxonomy-grid,
    .habitat-content {
        flex-direction: column;
        gap: 2rem;
    }

    .taxonomy-data {
        transform: none;
    }

    .habitat-field {
        flex: none;
        min-height: 30vh;
    }

    .morph-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .morph-fox svg {
        width: 60px;
        height: 60px;
    }

    .mf-1, .mf-2, .mf-3, .mf-4, .mf-5, .mf-6, .mf-7, .mf-8, .mf-9 {
        transform: none;
    }

    .pull-quote {
        font-size: clamp(2rem, 8vw, 3.5rem);
        transform: none;
    }

    .annotation {
        display: none;
    }

    .fox-silhouette {
        display: none;
    }

    .evidence-band {
        clip-path: none;
    }
}

/* ---- Tablet ---- */
@media (min-width: 768px) and (max-width: 1023px) {
    .taxonomy-grid {
        gap: 2rem;
    }

    .habitat-field {
        flex: 0 0 45%;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .zoom-target {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    [data-reveal] {
        opacity: 1;
        transform: translateY(0);
    }

    .morph-fox {
        opacity: 1;
    }
}
