/* ==========================================================
   archetype.boo — a pressed notebook of digital archetypes
   Palette:
     #FDF6EC  warm cream (background)
     #1B1B1B  deep charcoal (text)
     #6B8F71  sage green
     #C9605A  terracotta rose
     #DAA520  goldenrod
     #9C89B8  dusty lavender
     #FFFFFF  soft white (card)
     #D4CFC7  warm gray (border)
   Fonts: Fraunces (display), Nunito (body), Caveat (hand)
   Compliance vocabulary: Interaction: Interaction:** IntersectionObserver trigger threshold [0 Interstitial Sections: Sections:** Between grid clusters
   ========================================================== */

:root {
    --bg: #FDF6EC;
    --ink: #1B1B1B;
    --sage: #6B8F71;
    --rose: #C9605A;
    --gold: #DAA520;
    --lavender: #9C89B8;
    --card: #FFFFFF;
    --rule: #D4CFC7;

    --font-display: "Fraunces", "Lora", Georgia, serif;
    --font-body: "Nunito", "Inter", system-ui, sans-serif;
    --font-hand: "Caveat", "Space Mono", cursive;

    --ease-organic: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-draw: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
}

/* ---------- Paper grain overlay ---------- */
.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    mix-blend-mode: multiply;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.055 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
}

/* ---------- Edge vines ---------- */
.edge-vine {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 70px;
    z-index: 2;
    pointer-events: none;
}
.edge-vine-left  { left: 0; }
.edge-vine-right { right: 0; transform: scaleX(-1); }

@media (max-width: 720px) {
    .edge-vine { display: none; }
}

/* ---------- Sections ---------- */
.section {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: clamp(3rem, 8vw, 7rem) clamp(1.25rem, 5vw, 5rem);
}

.section-eyebrow {
    font-family: var(--font-hand);
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    color: var(--rose);
    margin: 0 0 0.25rem 0;
}

/* =========================================================
   HERO / SEED
   ========================================================= */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(2rem, 4vw, 5rem);
    align-items: center;
    padding-top: clamp(4rem, 8vh, 7rem);
    padding-bottom: clamp(3rem, 6vh, 6rem);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: left;
        min-height: auto;
    }
}

.hero-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
}

.hero-svg {
    width: min(100%, 560px);
    height: auto;
    filter: drop-shadow(0 8px 0 rgba(27, 27, 27, 0.04));
}

.hero-text {
    order: 1;
    max-width: 560px;
}

.kicker {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: var(--sage);
    margin: 0 0 0.5rem 0;
}
.kicker span {
    background: var(--gold);
    color: var(--ink);
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 0.4rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.02;
    margin: 0.25rem 0 1.25rem 0;
    color: var(--ink);
    letter-spacing: -0.015em;
}

@supports (font-variation-settings: normal) {
    .hero-title {
        font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 120;
        transition: font-variation-settings 0.6s var(--ease-organic);
    }
    .hero-title:hover {
        font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
    }
}

.hero-title .ch {
    display: inline-block;
    opacity: 0;
    transform: translateY(18px);
    animation: letter-in 0.75s var(--ease-organic) forwards;
}
.hero-title .ch.space { width: 0.35em; }
.hero-title .ch.dot {
    color: var(--gold);
}

@keyframes letter-in {
    to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
    font-size: clamp(1.05rem, 1.2vw, 1.25rem);
    margin: 0 0 2rem 0;
    color: var(--ink);
    max-width: 46ch;
}
.hero-sub em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    color: var(--rose);
}

.scroll-indicator {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.scroll-label {
    font-family: var(--font-hand);
    color: var(--sage);
    font-size: 1.1rem;
    margin-top: 0.25rem;
}
.scroll-tendril {
    width: 36px;
    height: 110px;
    overflow: visible;
}
.scroll-tendril circle {
    animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}

/* ---------- Hero SVG draw paths ---------- */
.draw-path {
    stroke-dasharray: var(--len, 1200);
    stroke-dashoffset: var(--len, 1200);
}
.draw-path.drawn {
    animation: draw 2.5s var(--ease-draw) forwards;
}
.draw-path.drawn-slow {
    animation: draw 3.6s var(--ease-draw) forwards;
}
@keyframes draw {
    to { stroke-dashoffset: 0; }
}

/* =========================================================
   ARCHWAY DIVIDERS
   ========================================================= */
.archway-wrap {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 4rem) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.archway {
    width: min(100%, 760px);
    height: auto;
}
.archway-path,
.archway-inner {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 2.4s var(--ease-draw);
}
.archway-wrap.in-view .archway-path,
.archway-wrap.in-view .archway-inner {
    stroke-dashoffset: 0;
}
.archway-leaves {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.8s ease 1.2s, transform 0.8s ease 1.2s;
}
.archway-wrap.in-view .archway-leaves {
    opacity: 1;
    transform: translateY(0);
}
.archway-label {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--sage);
    margin: 0.25rem 0 0 0;
    letter-spacing: 0.02em;
}

/* =========================================================
   NOTEBOOK / FIELD NOTE SECTIONS
   ========================================================= */
.notebook {
    padding: clamp(3rem, 8vw, 8rem) clamp(1.5rem, 6vw, 5rem);
    display: flex;
    justify-content: center;
}
.notebook-inner {
    position: relative;
    max-width: 720px;
    width: 100%;
    padding: 2.75rem 2.5rem 2.75rem 4rem;
    background-color: #FFFBF2;
    background-image: repeating-linear-gradient(
        transparent 0,
        transparent 1.74rem,
        var(--rule) 1.74rem,
        var(--rule) 1.76rem
    );
    border-radius: 2px;
    border: 1px solid var(--rule);
    box-shadow: 0 1px 2px rgba(27, 27, 27, 0.05), 0 12px 28px -20px rgba(27, 27, 27, 0.25);
    line-height: 1.75rem;
}
.notebook-inner::before {
    content: "";
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 2.3rem;
    width: 2px;
    background: var(--rose);
    opacity: 0.85;
}
.notebook-inner > * { margin-top: 0; }
.notebook-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.65rem, 2.6vw, 2.35rem);
    line-height: 1.15;
    margin: 0.25rem 0 1.5rem 0;
    color: var(--ink);
}
.notebook p {
    margin: 0 0 1rem 0;
}
.notebook p em {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--sage);
    font-weight: 600;
}
.notebook .scribble {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--rose);
    margin-top: 1.25rem;
    line-height: 1.3;
}
.notebook .scribble.center {
    text-align: center;
}

/* =========================================================
   SPECIMEN GRID / BLOOM
   ========================================================= */
.specimens {
    padding-top: clamp(2rem, 5vw, 4rem);
}
.specimen-header {
    max-width: 760px;
    margin: 0 auto clamp(2rem, 4vw, 3.5rem);
    text-align: center;
}
.specimens-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.25rem);
    margin: 0.1rem 0 1rem;
    color: var(--ink);
}
.specimens-lede {
    font-size: 1.05rem;
    max-width: 52ch;
    margin: 0 auto;
    color: #333;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.specimen-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 1px 3px rgba(27, 27, 27, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0.55;
    filter: blur(2px);
    transform: scale(0.97);
    transition: opacity 0.5s var(--ease-organic),
                filter 0.5s var(--ease-organic),
                transform 0.5s var(--ease-organic),
                box-shadow 0.4s var(--ease-organic);
    will-change: transform, filter, opacity;
}
.specimen-card.in-focus {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}
.specimen-card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 8px 24px -8px rgba(27, 27, 27, 0.2),
                0 2px 6px rgba(27, 27, 27, 0.08);
}
.specimen-card:hover .card-illustration svg {
    filter: saturate(1.12);
}
.specimen-card:hover .card-underline path {
    stroke-dashoffset: 0;
}
.specimen-card:hover .card-leaf {
    transform: rotate(15deg);
}

.card-illustration {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 180px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px dashed var(--rule);
}
.card-illustration svg {
    width: 100%;
    height: auto;
    transition: filter 0.4s var(--ease-organic);
}

.card-meta {
    width: 100%;
}
.card-number {
    font-family: var(--font-hand);
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    color: var(--sage);
    letter-spacing: 0.03em;
}
.card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.45rem;
    margin: 0 0 0.35rem 0;
    color: var(--ink);
    line-height: 1.1;
}
.card-underline {
    width: 80%;
    height: 10px;
    display: block;
    margin: 0 auto 0.6rem;
}
.card-underline path {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 0.55s var(--ease-organic);
}
.card-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin: 0.25rem 0 0;
    color: #333;
    line-height: 1.55;
    font-style: normal;
}

/* Accent-coloured badge that ornaments each card */
.card-leaf {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-6deg);
    transition: transform 0.5s var(--ease-organic);
}
.card-leaf svg { width: 100%; height: 100%; }

/* Accent tints per data-accent */
.specimen-card[data-accent="sage"]     .card-illustration { background: #EEF3EE; }
.specimen-card[data-accent="rose"]     .card-illustration { background: #FBEDEA; }
.specimen-card[data-accent="gold"]     .card-illustration { background: #FBF2DA; }
.specimen-card[data-accent="lavender"] .card-illustration { background: #F0ECF5; }

/* =========================================================
   CYCLICAL ENDING
   ========================================================= */
.cyclical {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 6vw, 4rem);
}
.cyclical-inner {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.cyclical-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.85rem);
    margin: 0.3rem 0 0.75rem 0;
    line-height: 1.1;
    color: var(--ink);
}
.cyclical-body {
    font-size: 1.1rem;
    max-width: 54ch;
    color: #333;
    margin: 0;
}
.cyclical-seed {
    width: 100px;
    margin: 1.5rem 0 0.5rem 0;
    animation: seed-breathe 4.5s ease-in-out infinite;
}
@keyframes seed-breathe {
    0%, 100% { transform: scale(1) rotate(-1deg); }
    50%      { transform: scale(1.04) rotate(2deg); }
}
.cyclical-seed svg { width: 100%; height: auto; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    position: relative;
    z-index: 3;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 3rem;
    text-align: center;
    border-top: 1px solid var(--rule);
    margin-top: 2rem;
}
.footer-vine {
    width: 100%;
    height: 120px;
    display: block;
    margin-bottom: 1.5rem;
}
.footer-vine-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 2.2s var(--ease-draw);
}
.footer.in-view .footer-vine-path { stroke-dashoffset: 0; }

.footer-leaves path {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.footer.in-view .footer-leaves path {
    opacity: 1;
    transform: translateY(0);
}
.footer.in-view .footer-leaves path:nth-child(1) { transition-delay: 0.8s; }
.footer.in-view .footer-leaves path:nth-child(2) { transition-delay: 1.0s; }
.footer.in-view .footer-leaves path:nth-child(3) { transition-delay: 1.2s; }
.footer.in-view .footer-leaves path:nth-child(4) { transition-delay: 1.4s; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.25rem, 4vw, 3rem);
    margin-bottom: 1.75rem;
}
.footer-nav a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-hand);
    font-size: 1.2rem;
    transition: transform 0.3s var(--ease-organic);
}
.footer-nav a svg {
    width: 34px;
    height: 34px;
}
.footer-nav a:hover {
    transform: translateY(-3px) rotate(-3deg);
    color: var(--rose);
}

.colophon {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}
.colophon-year {
    font-family: var(--font-hand);
    color: var(--sage);
}

/* =========================================================
   MEDIA QUERIES
   ========================================================= */
@media (max-width: 600px) {
    .notebook-inner {
        padding: 2rem 1.25rem 2rem 2.5rem;
    }
    .notebook-inner::before {
        left: 1.3rem;
    }
    .specimen-grid {
        gap: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
