/* ===================================================================
 * explore_v8.css — FIELD GUIDE variant
 * ===================================================================
 * Naturalist's notebook. Cream paper with horizontal rule lines, cursive
 * marginalia, hand-drawn SVG illustrations, coffee rings, specimen tags.
 * The cosmology as a Peterson Field Guide / Audubon plate / Beagle journal.
 *
 * All paper effects are pure CSS. Illustrations are server-rendered inline
 * SVG so the page weighs little and prints clean.
 * =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&family=Patrick+Hand&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');
/* Caveat = informal cursive marginalia. Patrick Hand = neater notebook hand.
 * EB Garamond = the typeset specimen Latinate-classifier line. */

.v8 *, .v8 *::before, .v8 *::after { box-sizing: border-box; }

.v8 {
    --paper: #f5edd6;
    --paper-2: #ece2c2;
    --rule: rgba(60, 80, 130, 0.18);   /* the notebook rule line */
    --ink: #1c2233;                     /* iron-gall ink, dark navy */
    --ink-2: #3a4054;
    --pencil: #5a4630;                  /* graphite annotations */
    --green: #3d5a3a;                   /* botanical green */
    --rust: #8a4a2a;                    /* iron oxide / dried blood */
    --stain: rgba(122, 76, 30, 0.18);   /* coffee */

    background: var(--paper);
    color: var(--ink);
    font-family: "EB Garamond", "Iowan Old Style", Georgia, serif;
    font-size: 16.5px;
    line-height: 1.5;

    /* Cream paper texture: subtle horizontal rule lines + foxing + grain. */
    background-image:
        /* coffee ring stain top-right */
        radial-gradient(circle at 88% 12%,
            transparent 38px,
            rgba(122, 76, 30, 0.10) 39px,
            rgba(122, 76, 30, 0.18) 41px,
            transparent 44px),
        /* pencil smudge mid-left */
        radial-gradient(ellipse at 5% 50%,
            rgba(50, 40, 30, 0.10) 0,
            transparent 80px),
        /* foxing spots */
        radial-gradient(circle at 25% 30%, rgba(140, 90, 40, 0.06) 0px, transparent 14px),
        radial-gradient(circle at 70% 65%, rgba(140, 90, 40, 0.05) 0px, transparent 18px),
        radial-gradient(circle at 50% 92%, rgba(140, 90, 40, 0.06) 0px, transparent 20px),
        /* the notebook horizontal rule */
        repeating-linear-gradient(0deg,
            transparent 0 31px,
            var(--rule) 31px 32px),
        /* paper grain */
        repeating-linear-gradient(45deg,
            rgba(80, 60, 30, 0.025) 0 1px,
            transparent 1px 3px),
        linear-gradient(180deg, #f6efd7 0%, #efe5c4 100%);
}

/* Page edge: a soft inner shadow so the surface reads as a single sheet. */
body:has(.v8) main { max-width: 920px; }
body:has(.v8) { background: #ddd1a8; } /* table underneath the book */

.v8-page {
    position: relative;
    padding: 28px 30px 80px;
    box-shadow:
        inset 0 0 30px rgba(110, 80, 30, 0.18),
        2px 4px 14px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(120, 90, 40, 0.3);
}

/* The red margin rule down the left side — every steno notebook has one. */
.v8-page::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: 56px;
    width: 1px;
    background: rgba(150, 50, 50, 0.4);
    pointer-events: none;
}

/* ============================================================
 * 1 — Heading: cursive title + Latinate sub
 * ============================================================ */
.v8-mast {
    margin: 0 0 18px 68px;
    padding-bottom: 14px;
    border-bottom: 1.5px solid var(--ink);
    position: relative;
}
.v8-h1 {
    font-family: "Caveat", "Snell Roundhand", cursive;
    font-size: 56px;
    font-weight: 700;
    line-height: 0.95;
    color: var(--ink);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    transform: rotate(-1.5deg);
    transform-origin: left top;
}
.v8-h1-sub {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 17px;
    color: var(--ink-2);
    margin-top: 12px;
}
.v8-h1-cl {
    font-family: "EB Garamond", Georgia, serif;
    font-size: 13px;
    font-style: italic;
    color: var(--pencil);
    letter-spacing: 0.4px;
    margin-top: 2px;
}

/* date tag in upper-left (a pasted slip) */
.v8-date-tag {
    position: absolute;
    top: 10px;
    left: -4px;
    transform: rotate(-3deg);
    background: #f9f1cf;
    border: 1px solid var(--pencil);
    padding: 4px 10px 4px 12px;
    font-family: "Patrick Hand", "Caveat", cursive;
    font-size: 13px;
    color: var(--ink);
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.12);
    z-index: 5;
}
.v8-date-tag::before {
    /* tape strip across the top */
    content: "";
    position: absolute;
    top: -4px; left: 12px;
    width: 32px; height: 8px;
    background: rgba(255, 240, 180, 0.5);
    border-left: 1px dashed rgba(0,0,0,0.12);
    border-right: 1px dashed rgba(0,0,0,0.12);
}

/* Marginalia note up at the top right. */
.v8-marg-top {
    position: absolute;
    top: 24px;
    right: 28px;
    max-width: 220px;
    transform: rotate(2deg);
    font-family: "Caveat", cursive;
    font-size: 19px;
    line-height: 1.15;
    color: var(--pencil);
    z-index: 4;
}
.v8-marg-top::before {
    content: "↘";
    display: block;
    font-size: 22px;
    margin-bottom: 2px;
}

/* ============================================================
 * 2 — Section headers (handwritten cursive)
 * ============================================================ */
.v8-section { margin: 36px 0 0 68px; }
.v8-section-head {
    font-family: "Caveat", cursive;
    font-size: 34px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.05;
    margin-bottom: 4px;
    transform: rotate(-0.8deg);
}
.v8-section-sub {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 14.5px;
    color: var(--ink-2);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--pencil);
}

/* ============================================================
 * 3 — Specimen entries
 * ============================================================ */
.v8-specimens {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}
@media (min-width: 720px) {
    .v8-specimens { grid-template-columns: 1fr 1fr; gap: 26px 32px; }
}

.v8-spec {
    display: grid;
    grid-template-columns: 88px 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 14px;
    row-gap: 6px;
    padding: 14px 14px 16px;
    background: rgba(255, 250, 220, 0.42);
    border: 1px solid rgba(120, 90, 40, 0.28);
    border-radius: 2px;
    text-decoration: none;
    color: var(--ink);
    position: relative;
    transition: transform 0.1s;
}
.v8-spec:hover { background: rgba(255, 245, 200, 0.55); transform: rotate(-0.3deg); }
.v8-spec:focus { outline: 2px solid var(--rust); outline-offset: 3px; }

/* Pasted specimen tag in upper-left of each entry. */
.v8-spec-tag {
    position: absolute;
    top: -8px;
    left: -6px;
    transform: rotate(-4deg);
    background: #ede0b8;
    border: 1px solid var(--pencil);
    padding: 2px 8px;
    font-family: "Patrick Hand", cursive;
    font-size: 11px;
    color: var(--pencil);
    letter-spacing: 0.5px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    z-index: 3;
}
.v8-spec-tag::after {
    /* a piece of tape */
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 20px; height: 6px;
    background: rgba(255,240,180,0.6);
    transform: translateX(-50%);
}

/* SVG illustration column */
.v8-spec-fig {
    grid-row: span 2;
    width: 88px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px dashed var(--pencil);
    padding-right: 8px;
}
.v8-spec-fig svg {
    width: 100%; height: auto; max-height: 110px;
    color: var(--ink);
}

/* Header line: common name + Latinate classification. */
.v8-spec-head { display: flex; flex-direction: column; gap: 1px; }
.v8-spec-name {
    font-family: "Caveat", cursive;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    transform: rotate(-0.6deg);
}
.v8-spec-latin {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: var(--ink-2);
    margin-top: 2px;
}
.v8-spec-class {
    font-family: "Patrick Hand", cursive;
    font-size: 11.5px;
    color: var(--pencil);
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Observation notes */
.v8-spec-notes {
    grid-column: 2;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-2);
    margin-top: 4px;
}
.v8-spec-notes b { color: var(--ink); font-weight: 500; }

/* "see also" cross-reference line */
.v8-xref {
    grid-column: 2;
    font-family: "Caveat", cursive;
    font-size: 16px;
    color: var(--pencil);
    margin-top: 6px;
    line-height: 1.2;
}
.v8-xref::before {
    content: "→ see also: ";
    font-style: italic;
}

/* ============================================================
 * 4 — Hand-drawn arrow + leader lines (atmospheric)
 * ============================================================ */
.v8-leader {
    position: absolute;
    pointer-events: none;
    font-family: "Caveat", cursive;
    color: var(--pencil);
    font-size: 17px;
    line-height: 1.1;
    z-index: 4;
}

/* ============================================================
 * 5 — Site entries (plate style)
 * ============================================================ */
.v8-plates {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
@media (min-width: 720px) {
    .v8-plates { grid-template-columns: 1fr 1fr; gap: 22px 28px; }
}
.v8-plate {
    border: 1px solid rgba(120, 90, 40, 0.4);
    padding: 10px 10px 14px;
    background: rgba(255, 250, 220, 0.42);
    text-decoration: none;
    color: var(--ink);
    position: relative;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.10);
}
.v8-plate:hover { background: rgba(255, 245, 200, 0.55); }
.v8-plate-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    filter: sepia(0.28) saturate(0.85) contrast(0.95);
    border: 1px solid rgba(80, 60, 30, 0.45);
    display: block;
}
.v8-plate-img--blank {
    background:
        repeating-linear-gradient(45deg,
            #c5b88a 0 8px,
            #b3a577 8px 16px);
}
.v8-plate-cap {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--pencil);
    font-family: "Caveat", cursive;
    font-size: 21px;
    line-height: 1.05;
    color: var(--ink);
    transform: rotate(-0.5deg);
}
.v8-plate-latin {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 2px;
}
.v8-plate-coord {
    font-family: "Patrick Hand", cursive;
    font-size: 11.5px;
    color: var(--pencil);
    margin-top: 2px;
    letter-spacing: 0.4px;
}
.v8-plate-num {
    position: absolute;
    top: -10px;
    right: 8px;
    background: var(--paper);
    border: 1px solid var(--pencil);
    padding: 1px 7px;
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 12px;
    color: var(--pencil);
    transform: rotate(2deg);
}

/* ============================================================
 * 6 — Periods (rendered as chronology of observations)
 * ============================================================ */
.v8-chron {
    margin: 0;
    padding-left: 18px;
    list-style: none;
}
.v8-chron-row {
    padding: 10px 0 12px;
    border-bottom: 1px dashed var(--pencil);
    position: relative;
}
.v8-chron-row::before {
    content: "❦";
    position: absolute;
    left: -22px;
    top: 12px;
    color: var(--rust);
    font-size: 14px;
}
.v8-chron-label {
    font-family: "Caveat", cursive;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.1;
}
.v8-chron-blurb {
    font-family: "EB Garamond", Georgia, serif;
    font-size: 14.5px;
    font-style: italic;
    color: var(--ink-2);
    margin-top: 2px;
}

/* ============================================================
 * 7 — Themes (procedural diagrams)
 * ============================================================ */
.v8-procs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 720px) {
    .v8-procs { grid-template-columns: 1fr 1fr; }
}
.v8-proc {
    border: 1px solid rgba(120, 90, 40, 0.35);
    padding: 12px 12px 14px;
    background: rgba(255, 250, 220, 0.42);
    position: relative;
}
.v8-proc-head {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 10px;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--pencil);
    margin-bottom: 8px;
}
.v8-proc-fig {
    width: 70px;
    height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.v8-proc-fig svg { width: 100%; height: 100%; color: var(--ink); }
.v8-proc-title {
    font-family: "Caveat", cursive;
    font-size: 24px;
    line-height: 1;
    color: var(--ink);
    transform: rotate(-0.6deg);
}
.v8-proc-list { list-style: none; padding: 0; margin: 0; }
.v8-proc-list li {
    padding: 4px 0 4px 18px;
    border-bottom: 1px dotted var(--pencil);
    font-size: 14px;
    position: relative;
}
.v8-proc-list li:last-child { border-bottom: 0; }
.v8-proc-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: var(--green);
}
.v8-proc-list a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--pencil); }
.v8-proc-list a:hover { background: #fff7d4; }
.v8-proc-kind {
    font-family: "Patrick Hand", cursive;
    font-size: 11px;
    color: var(--pencil);
    letter-spacing: 0.4px;
    margin-right: 6px;
}

/* ============================================================
 * 8 — Begin-here card row at top
 * ============================================================ */
.v8-begin {
    margin: 0 0 0 68px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 720px) {
    .v8-begin { grid-template-columns: 1fr 1fr 1fr; }
}
.v8-begin-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(120, 90, 40, 0.35);
    background: rgba(255, 250, 220, 0.5);
    text-decoration: none;
    color: var(--ink);
    position: relative;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.08);
}
.v8-begin-card:hover { background: rgba(255, 245, 200, 0.6); }
.v8-begin-kicker {
    font-family: "Patrick Hand", cursive;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    color: var(--pencil);
    text-transform: uppercase;
}
.v8-begin-title {
    font-family: "Caveat", cursive;
    font-size: 27px;
    line-height: 1;
    transform: rotate(-0.5deg);
}
.v8-begin-blurb { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.v8-begin-fig { height: 70px; display: flex; align-items: center; justify-content: center; }
.v8-begin-fig svg { width: 90px; height: 70px; color: var(--ink); }

/* ============================================================
 * 9 — Bottom marginalia + signature
 * ============================================================ */
.v8-foot {
    margin: 40px 0 0 68px;
    padding-top: 20px;
    border-top: 1.5px solid var(--ink);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: var(--ink-2);
}
.v8-foot-sig {
    font-family: "Caveat", cursive;
    font-size: 22px;
    color: var(--ink);
    transform: rotate(-2deg);
}

.v8-foot-folio {
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    font-size: 14px;
}

/* ============================================================
 * 10 — Mobile
 * ============================================================ */
@media (max-width: 599px) {
    .v8 { font-size: 15px; }
    .v8-page { padding: 18px 16px 60px; }
    .v8-page::before { left: 36px; }
    .v8-mast, .v8-section, .v8-begin, .v8-foot { margin-left: 46px; }
    .v8-h1 { font-size: 40px; }
    .v8-section-head { font-size: 26px; }
    .v8-marg-top { display: none; }
    .v8-spec { grid-template-columns: 64px 1fr; padding: 12px 10px 14px; }
    .v8-spec-fig { width: 64px; height: 84px; }
    .v8-spec-name { font-size: 21px; }
    .v8-specimens { grid-template-columns: 1fr; }
    .v8-plates { grid-template-columns: 1fr; }
    .v8-procs { grid-template-columns: 1fr; }
    .v8-begin { grid-template-columns: 1fr; }
}
