/* ============================================================
   storiographer.com — Pastoral Glitch Journal
   Palette:
     Deep Ink         #1A1A2E
     Warm Cream       #FAF3E8
     Dark Walnut      #3D3228
     Pale Parchment   #D4C8B0
     Electric Magenta #FF2D78
     Neon Clover      #00E5A0
     Acid Violet      #B537F2
     Hearthfire Amber #E8A317
     Midnight Bramble #2D1B4E
   Fonts:
     Playfair Display  (display headings)
     Lora              (body text)
     Space Grotesk     (UI / metadata)
   ============================================================ */

:root {
    --c-deep-ink: #1A1A2E;
    --c-warm-cream: #FAF3E8;
    --c-dark-walnut: #3D3228;
    --c-pale-parchment: #D4C8B0;
    --c-magenta: #FF2D78;
    --c-clover: #00E5A0;
    --c-violet: #B537F2;
    --c-amber: #E8A317;
    --c-bramble: #2D1B4E;

    --t-fast: 180ms;
    --t-mid: 420ms;
    --t-slow: 800ms;

    --font-display: "Playfair Display", "Lora", Georgia, serif;
    --font-body: "Lora", Georgia, "Times New Roman", serif;
    --font-ui: "Space Grotesk", "Inter", "Helvetica Neue", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--c-deep-ink);
    color: var(--c-pale-parchment);
    overflow-x: hidden;
    cursor: none;
    line-height: 1.7;
    min-height: 100vh;
}

/* ===========================================================
   Linen / Crosshatch substrate — applied globally over body
   Tiled SVG, very low opacity
   =========================================================== */
.linen-substrate {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><g fill='none' stroke='%233D3228' stroke-width='0.4' stroke-opacity='0.18'><path d='M0 0 L14 14 M14 0 L0 14 M0 7 L14 7 M7 0 L7 14'/></g></svg>");
    background-repeat: repeat;
    opacity: 0.35;
    mix-blend-mode: multiply;
}

/* ===========================================================
   Journal Spine
   =========================================================== */
.journal-spine {
    position: absolute;
    left: 12%;
    top: 0;
    width: 20px;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.journal-spine path {
    fill: none;
    stroke: var(--c-amber);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 6000;
    stroke-dashoffset: 6000;
    filter: drop-shadow(0 0 2px rgba(232, 163, 23, 0.35));
}

.spine-nodes {
    position: absolute;
    left: 12%;
    top: 0;
    height: 100%;
    pointer-events: none;
    z-index: 6;
    width: 20px;
    transform: translateX(-50%);
}

.spine-node {
    position: absolute;
    left: 50%;
    width: 12px;
    height: 12px;
    border: 1.4px solid var(--c-amber);
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    transition: background var(--t-fast) ease, box-shadow var(--t-mid) ease, border-color var(--t-mid) ease;
}

.spine-node[data-node="0"] { top: 14vh; }
.spine-node[data-node="1"] { top: 114vh; }
.spine-node[data-node="2"] { top: 224vh; }
.spine-node[data-node="3"] { top: 334vh; }
.spine-node[data-node="4"] { top: 454vh; }
.spine-node[data-node="5"] { top: 564vh; }

.spine-node.active {
    background: var(--c-clover);
    border-color: var(--c-clover);
    box-shadow: 0 0 12px var(--c-clover), 0 0 22px rgba(0, 229, 160, 0.4);
}

.spine-node.pulse {
    animation: nodePulse 800ms ease-out;
}

@keyframes nodePulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,229,160,0.7); }
    60%  { box-shadow: 0 0 0 14px rgba(0,229,160,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,229,160,0); }
}

/* ===========================================================
   Quill Cursor (custom)
   =========================================================== */
.quill-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-2px, -22px) rotate(0deg);
    transition: transform 100ms ease-out;
    will-change: transform;
}

.quill-cursor.over {
    transform: translate(-2px, -22px) rotate(-12deg);
}

.cursor-spark {
    position: absolute;
    top: 2px;
    left: 22px;
    width: 4px;
    height: 4px;
    background: var(--c-clover);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--c-clover), 0 0 12px var(--c-clover);
    opacity: 0;
    transition: opacity 120ms ease;
}

.quill-cursor.over .cursor-spark {
    opacity: 1;
    animation: sparkFlicker 480ms ease-in-out infinite alternate;
}

@keyframes sparkFlicker {
    from { transform: translate(0, 0) scale(0.8); opacity: 0.8; }
    to   { transform: translate(2px, -1px) scale(1.2); opacity: 1; }
}

/* ===========================================================
   Floating Quill Menu (radial chapter ring)
   =========================================================== */
.quill-menu {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 200;
    width: 56px;
    height: 56px;
}

.quill-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-warm-cream);
    color: var(--c-dark-walnut);
    border: 1.4px solid var(--c-dark-walnut);
    box-shadow: 0 6px 18px rgba(26, 26, 46, 0.4);
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast) ease, box-shadow var(--t-mid) ease;
    position: relative;
    z-index: 2;
}

.quill-button:hover {
    transform: rotate(-10deg);
    box-shadow: 0 6px 22px rgba(232, 163, 23, 0.55);
}

.quill-menu.open .quill-button {
    background: var(--c-amber);
    border-color: var(--c-amber);
    transform: rotate(45deg);
}

.chapter-ring {
    position: absolute;
    top: 28px;
    left: 28px;
    width: 0;
    height: 0;
    list-style: none;
    pointer-events: none;
}

.chapter-ring li {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: transform var(--t-mid) cubic-bezier(0.5, 1.4, 0.6, 1), opacity var(--t-mid) ease;
}

.quill-menu.open .chapter-ring {
    pointer-events: auto;
}

.quill-menu.open .chapter-ring li {
    opacity: 1;
}

/* Position chapter items in a quarter-circle arc to bottom-left of quill */
.chapter-ring li:nth-child(1) { transform: translate(calc(-50% - 110px), calc(-50% + 30px)); }
.chapter-ring li:nth-child(2) { transform: translate(calc(-50% - 96px), calc(-50% + 90px)); }
.chapter-ring li:nth-child(3) { transform: translate(calc(-50% - 64px), calc(-50% + 142px)); }
.chapter-ring li:nth-child(4) { transform: translate(calc(-50% - 14px), calc(-50% + 172px)); }
.chapter-ring li:nth-child(5) { transform: translate(calc(-50% + 38px), calc(-50% + 178px)); }

.chapter-ring a {
    display: inline-block;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-warm-cream);
    text-decoration: none;
    padding: 6px 10px;
    background: rgba(26, 26, 46, 0.85);
    border: 1px solid var(--c-amber);
    white-space: nowrap;
    transition: color var(--t-fast) ease, background var(--t-fast) ease;
    position: relative;
    cursor: none;
}

.chapter-ring a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 1px;
    background: linear-gradient(to right, var(--c-clover) 0 4px, transparent 4px 8px) repeat-x;
    background-size: 8px 1px;
    opacity: 0.7;
}

.chapter-ring a:hover {
    color: var(--c-magenta);
    background: var(--c-warm-cream);
}

/* ===========================================================
   Generic UI label
   =========================================================== */
.meta-label,
.meta-date {
    font-family: var(--font-ui);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-clover);
    display: inline-block;
}

.meta-date {
    color: var(--c-amber);
    opacity: 0.85;
}

/* ===========================================================
   Journal main container
   =========================================================== */
.journal {
    position: relative;
    z-index: 10;
}

/* ===========================================================
   Entries — generic
   =========================================================== */
.entry {
    position: relative;
    min-height: 100vh;
    padding: 8vh 6vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry::after {
    /* "page edge" tear with glitching pixel artifacts */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 8px,
            rgba(255, 45, 120, 0.12) 8px 9px,
            transparent 9px 22px,
            rgba(0, 229, 160, 0.10) 22px 23px
        ),
        linear-gradient(to bottom, transparent 0, rgba(26,26,46,0.7) 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 60%);
}

.entry-frame {
    width: 76%;
    max-width: 1080px;
    background: var(--c-warm-cream);
    color: var(--c-dark-walnut);
    padding: clamp(2rem, 4vw, 4rem);
    position: relative;
    box-shadow:
        0 30px 60px -20px rgba(26, 26, 46, 0.6),
        0 0 0 1px rgba(61, 50, 40, 0.5) inset;
    transform: translateY(40px);
    opacity: 0;
    transition: transform var(--t-slow) ease, opacity var(--t-slow) ease;
}

.entry.in-view .entry-frame {
    transform: translateY(0);
    opacity: 1;
}

.entry-frame.frame-left {
    margin-right: auto;
    margin-left: 18%;
    width: 70%;
}

.entry-frame.frame-right {
    margin-left: auto;
    margin-right: 4%;
    width: 70%;
}

.entry-frame.frame-wide {
    width: 80%;
    max-width: 1240px;
}

.entry-frame.frame-center {
    margin: 0 auto;
    width: 60%;
    max-width: 720px;
    text-align: center;
}

/* Linen substrate over the frame */
.entry-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><g fill='none' stroke='%233D3228' stroke-width='0.4' stroke-opacity='0.12'><path d='M0 0 L10 10 M10 0 L0 10'/></g></svg>");
    background-repeat: repeat;
    opacity: 0.55;
}

/* Hand-drawn glitch border */
.entry-frame::after {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    border: 1px solid var(--c-dark-walnut);
    box-shadow:
        2px 0 0 -1px var(--c-magenta) inset,
        -2px 0 0 -1px var(--c-violet) inset;
    clip-path: polygon(
        0 0, 100% 0, 100% 8%, 99% 8%, 100% 12%, 100% 35%, 98% 35%, 100% 38%,
        100% 100%, 65% 100%, 65% 99%, 60% 100%, 0 100%, 0 70%, 1% 70%, 0 67%, 0 0
    );
    animation: borderGlitch 9s ease-in-out infinite;
}

@keyframes borderGlitch {
    0%, 88%, 100% { transform: translate(0, 0); opacity: 1; }
    89%           { transform: translate(2px, 0); opacity: 1; }
    90%           { transform: translate(-1px, 1px); }
    91%           { transform: translate(0, 0); opacity: 1; }
    94%           { transform: translate(3px, 0); opacity: 1; }
    95%           { transform: translate(0, 0); }
}

/* Entry header */
.entry-header {
    margin-bottom: 1.6rem;
    border-bottom: 1px dashed rgba(61, 50, 40, 0.35);
    padding-bottom: 1.1rem;
    position: relative;
    z-index: 2;
}

.entry-header.centered {
    text-align: center;
    border-bottom: none;
}

.entry-header .meta-date {
    margin-left: 1.4em;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.2rem, 5.5vw, 5rem);
    letter-spacing: -0.01em;
    line-height: 1.05;
    color: var(--c-deep-ink);
    margin: 0.4em 0 0.2em;
    position: relative;
    text-shadow: 0 0 0 transparent;
    animation: headFlicker 6s steps(2, end) infinite;
}

.section-title.centered {
    text-align: center;
}

@keyframes headFlicker {
    0%, 92%, 100% { text-shadow: 0 0 0 transparent; }
    93%           { text-shadow: 2px 0 0 var(--c-magenta), -2px 0 0 var(--c-clover); }
    94%           { text-shadow: 0 0 0 transparent; }
    97%           { text-shadow: -1px 0 0 var(--c-magenta); }
    98%           { text-shadow: 0 0 0 transparent; }
}

/* Body */
.entry-body {
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--c-dark-walnut);
    position: relative;
    z-index: 2;
}

.entry-body p {
    margin-bottom: 1.1em;
    text-indent: 1.5em;
}

.entry-body p.lead,
.entry-body p:first-of-type {
    text-indent: 0;
}

/* Drop cap */
.dropcap-wrap {
    position: relative;
    overflow: visible;
}

.dropcap {
    float: left;
    width: 5.4em;
    height: 5.4em;
    margin: 0.1em 0.6em -0.2em -0.2em;
    shape-outside: square;
}

.dc-glitch {
    transform: translate(2px, 0);
    mix-blend-mode: multiply;
    opacity: 0.55;
    animation: dcGlitch 7s ease-in-out infinite;
}

@keyframes dcGlitch {
    0%, 90%, 100% { transform: translate(2px, 0); opacity: 0.4; }
    91%           { transform: translate(5px, -1px); opacity: 0.7; }
    92%           { transform: translate(2px, 0); opacity: 0.4; }
    96%           { transform: translate(-2px, 1px); opacity: 0.6; }
    97%           { transform: translate(2px, 0); opacity: 0.4; }
}

.lead {
    font-size: 1.08em;
    line-height: 1.7;
}

/* ===========================================================
   Opening sequence
   =========================================================== */
.entry-opening {
    background: var(--c-deep-ink);
    flex-direction: column;
    text-align: center;
    padding-top: 0;
}

.entry-opening::after {
    background: none;
}

.opening-stage {
    position: relative;
    width: min(90vw, 1100px);
    margin: 0 auto;
}

.opening-line {
    width: 0;
    max-width: 60vw;
    height: 1.6px;
    margin: 0 auto 2.2rem;
    background: var(--c-amber);
    box-shadow: 0 0 8px var(--c-amber);
    position: relative;
    transition: width 1.2s cubic-bezier(0.45, 0.05, 0.2, 1);
}

.opening-line.draw { width: 60vw; }
.opening-line.fracture::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -2px;
    width: 6px;
    height: 5px;
    background: var(--c-magenta);
    box-shadow: 0 0 10px var(--c-magenta);
    transform: translateX(-50%);
    animation: fractureFlash 200ms ease-out forwards;
}
@keyframes fractureFlash {
    0%   { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) scaleX(20) scaleY(0.4); }
}

.masthead {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.4rem, 9vw, 7rem);
    letter-spacing: 0.04em;
    color: var(--c-warm-cream);
    line-height: 1;
    margin: 0;
}

.masthead .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 380ms ease, transform 380ms ease, color 200ms ease;
}

.masthead.reveal .letter {
    opacity: 1;
    transform: translateY(0);
}

.masthead .letter.glitching {
    color: var(--c-magenta);
    text-shadow: 2px 0 0 var(--c-clover);
}

.tagline {
    font-family: var(--font-ui);
    font-size: clamp(0.8rem, 1vw, 1rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-clover);
    margin-top: 1.6rem;
    opacity: 0;
    transition: opacity 600ms ease 1.2s;
}

.tagline.show { opacity: 1; }

.scroll-chevron {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    opacity: 0;
    transition: opacity 600ms ease 2s;
    animation: chevPulse 2.4s ease-in-out infinite;
}

.scroll-chevron.show { opacity: 1; }

.chevron-label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--c-amber);
}

@keyframes chevPulse {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}

/* ===========================================================
   Chronicle
   =========================================================== */
.entry-chronicle {
    background: linear-gradient(to bottom, var(--c-deep-ink) 0%, var(--c-deep-ink) 8vh, transparent 8vh);
}

.wildflower-band {
    margin-top: 2.5rem;
    border-top: 1px dashed rgba(61, 50, 40, 0.4);
    padding-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.wildflower-band svg {
    width: 100%;
    height: auto;
    max-height: 140px;
}

.wildflower-band circle[fill="#00E5A0"],
.wildflower-band circle[fill="#FF2D78"],
.wildflower-band circle[fill="#B537F2"],
.wildflower-band circle[fill="#E8A317"] {
    animation: ledPulse 2s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 1px currentColor); }
    50%      { opacity: 0.55; filter: drop-shadow(0 0 4px currentColor); }
}

/* ===========================================================
   Method — two-column layout
   =========================================================== */
.method-grid {
    display: grid;
    grid-template-columns: 38% 1fr;
    gap: 2.4rem;
    position: relative;
    z-index: 2;
}

.method-margin {
    border-right: 1px dashed rgba(61, 50, 40, 0.45);
    padding-right: 1.2rem;
}

.margin-embroidery {
    width: 100%;
    height: auto;
    max-height: 600px;
}

.margin-embroidery .node {
    transform-origin: center;
    transform-box: fill-box;
    opacity: 0.45;
    transition: opacity 280ms ease, filter 280ms ease;
}

.entry-method.in-view .margin-embroidery .node {
    animation: nodeSequence 5s ease-in-out forwards;
}

.margin-embroidery .node.n1 { animation-delay: 0.1s; }
.margin-embroidery .node.n2 { animation-delay: 0.5s; }
.margin-embroidery .node.n3 { animation-delay: 0.9s; }
.margin-embroidery .node.n4 { animation-delay: 1.3s; }
.margin-embroidery .node.n5 { animation-delay: 1.7s; }
.margin-embroidery .node.n6 { animation-delay: 2.1s; }
.margin-embroidery .node.n7 { animation-delay: 2.5s; }
.margin-embroidery .node.n8 { animation-delay: 2.9s; }
.margin-embroidery .node.n9 { animation-delay: 3.3s; }

@keyframes nodeSequence {
    0%   { opacity: 0.45; filter: drop-shadow(0 0 0 transparent); }
    20%  { opacity: 1;    filter: drop-shadow(0 0 6px var(--c-clover)); }
    60%  { opacity: 1;    filter: drop-shadow(0 0 4px var(--c-clover)); }
    100% { opacity: 0.85; filter: drop-shadow(0 0 2px var(--c-clover)); }
}

.method-text .lead-paragraph {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 1.6vw, 1.5rem);
    line-height: 1.45;
    color: var(--c-dark-walnut);
    margin-bottom: 1.4rem;
    text-indent: 0;
}

.subhead {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-violet);
    margin-top: 1.6rem;
    margin-bottom: 0.4rem;
    border-left: 2px solid var(--c-amber);
    padding-left: 0.8rem;
}

.method-text p {
    font-size: clamp(1rem, 1.05vw, 1.15rem);
    line-height: 1.75;
    margin-bottom: 0.9em;
    text-indent: 1.5em;
}

.method-text p.lead-paragraph,
.method-text p:first-of-type,
.method-text .pull-quote {
    text-indent: 0;
}

.pull-quote {
    margin: 1.8rem 0 0;
    padding: 1.2rem 1.4rem;
    border-left: 3px solid var(--c-amber);
    background: rgba(232, 163, 23, 0.08);
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.18rem;
    line-height: 1.5;
    color: var(--c-bramble);
}

/* ===========================================================
   Archive — index-card scatter
   =========================================================== */
.archive-intro {
    font-size: 1.05rem;
    color: var(--c-dark-walnut);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    max-width: 70ch;
}

.card-scatter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.6rem 1.2rem;
    padding: 1rem 0;
    position: relative;
    z-index: 2;
}

.archive-card {
    width: 280px;
    height: 180px;
    background: var(--c-warm-cream);
    border: 1px solid var(--c-dark-walnut);
    box-shadow:
        0 6px 14px -4px rgba(26, 26, 46, 0.4),
        0 0 0 4px rgba(212, 200, 176, 0.3);
    padding: 0.9rem 1rem;
    position: relative;
    transform: rotate(var(--rot, 0deg));
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
    cursor: none;
    overflow: hidden;
}

.archive-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><g fill='none' stroke='%233D3228' stroke-width='0.3' stroke-opacity='0.12'><path d='M0 0 L8 8 M8 0 L0 8'/></g></svg>");
    pointer-events: none;
}

.archive-card:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow:
        0 12px 24px -6px rgba(26, 26, 46, 0.6),
        0 0 0 4px rgba(255, 45, 120, 0.3);
    filter: hue-rotate(0deg);
    animation: cardGlitch 220ms steps(3, end);
}

@keyframes cardGlitch {
    0%   { transform: rotate(0deg) translateY(-4px); }
    33%  { transform: rotate(0deg) translateY(-4px) translateX(3px); filter: drop-shadow(2px 0 0 var(--c-magenta)); }
    66%  { transform: rotate(0deg) translateY(-4px) translateX(-2px); filter: drop-shadow(-2px 0 0 var(--c-clover)); }
    100% { transform: rotate(0deg) translateY(-4px); filter: none; }
}

.card-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 56px;
    background:
        radial-gradient(circle at 30% 70%, var(--c-magenta) 0 4px, transparent 4px 8px),
        radial-gradient(circle at 50% 50%, var(--c-amber) 0 3px, transparent 3px),
        radial-gradient(circle at 70% 30%, var(--c-violet) 0 3px, transparent 3px),
        linear-gradient(135deg, transparent 50%, rgba(232,163,23,0.18) 50%);
}

.card-corner::after {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(61, 50, 40, 0.4);
    border-radius: 50%;
}

.card-date {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--c-violet);
    text-transform: uppercase;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.25;
    color: var(--c-deep-ink);
    margin: 0.4em 0 0.6em;
    max-width: 18ch;
}

.card-excerpt {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--c-dark-walnut);
    opacity: 0;
    max-height: 0;
    transition: opacity 280ms ease 100ms, max-height 280ms ease;
}

.archive-card:hover .card-excerpt {
    opacity: 1;
    max-height: 80px;
}

/* ===========================================================
   Tools workbench
   =========================================================== */
.tools-intro {
    font-size: 1.05rem;
    color: var(--c-dark-walnut);
    margin-bottom: 1.4rem;
    position: relative;
    z-index: 2;
    max-width: 70ch;
}

.workbench-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 800 / 360;
    z-index: 2;
}

.workbench-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tool {
    position: absolute;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: none;
    transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 260ms ease;
    padding: 0;
}

.tool:hover {
    transform: translateY(-12px) rotate(-3deg);
    filter: drop-shadow(0 8px 12px rgba(26, 26, 46, 0.45));
    z-index: 3;
}

.tool:hover .tool-tip {
    opacity: 1;
    transform: translate(-50%, -8px);
}

.tool-tip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--c-deep-ink);
    color: var(--c-clover);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 6px 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
    border: 1px solid var(--c-amber);
}

.tool-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--c-amber);
}

/* Position tools along the bench (viewBox 800x360 -> percentages) */
.tool-1 { left: 10%;  bottom: 20%; }
.tool-2 { left: 24%;  bottom: 20%; }
.tool-3 { left: 38%;  bottom: 20%; }
.tool-4 { left: 52%;  bottom: 20%; }
.tool-5 { left: 66%;  bottom: 20%; }
.tool-6 { left: 80%;  bottom: 20%; }

/* ===========================================================
   Contact
   =========================================================== */
.entry-contact {
    flex-direction: column;
    padding-bottom: 0;
}

.contact-line {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.4vw, 2.2rem);
    text-align: center;
    color: var(--c-dark-walnut);
    margin: 1.2rem 0 2rem;
    text-indent: 0;
    line-height: 1.4;
}

.parchment {
    position: relative;
    width: min(480px, 90%);
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.parchment-svg {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 18px rgba(26,26,46,0.35));
    transition: transform 280ms ease;
}

.parchment-svg .parchment-shape {
    transition: stroke 280ms ease;
}

.parchment:hover .parchment-shape {
    stroke: var(--c-magenta);
    animation: parchTear 380ms steps(2);
}

@keyframes parchTear {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

.parchment-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem;
    text-align: center;
}

.hand-note {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    color: var(--c-dark-walnut);
    font-size: 1.05rem;
    margin-bottom: 0.6em;
    text-indent: 0;
}

.hand-note.small {
    font-size: 0.85rem;
    color: rgba(61, 50, 40, 0.7);
    margin-top: 0.6em;
}

.contact-mail {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1rem, 1.6vw, 1.4rem);
    color: var(--c-deep-ink);
    text-decoration: none;
    border-bottom: 1.4px dashed var(--c-amber);
    padding-bottom: 2px;
    transition: color 200ms ease, border-color 200ms ease;
    cursor: none;
}

.contact-mail:hover {
    color: var(--c-magenta);
    border-color: var(--c-magenta);
}

/* ===========================================================
   Meadow Footer
   =========================================================== */
.meadow-footer {
    width: 100%;
    margin-top: 6vh;
    background: linear-gradient(to bottom, transparent 0%, var(--c-deep-ink) 60%);
    padding: 2vh 0 2vh;
    position: relative;
}

.meadow-svg {
    width: 100%;
    height: 200px;
    display: block;
}

.meadow-svg.glitch-sweep {
    animation: meadowSweep 200ms ease-out;
}

@keyframes meadowSweep {
    0%, 100% { filter: none; transform: translateX(0); }
    40%      { filter: drop-shadow(6px 0 0 var(--c-magenta)); transform: translateX(2px); }
    80%      { filter: drop-shadow(-4px 0 0 var(--c-clover)); transform: translateX(-2px); }
}

.footer-mark {
    text-align: center;
    padding: 1.4rem 0 2rem;
    color: var(--c-pale-parchment);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
}

.footer-glyph {
    color: var(--c-amber);
    font-size: 1.4rem;
}

/* ===========================================================
   Glitch utility — applied by JS to random elements
   =========================================================== */
.glitch-pulse {
    animation: glitchPulse 200ms steps(2, end);
}

@keyframes glitchPulse {
    0%   { transform: translateX(0); text-shadow: 0 0 0 transparent; }
    33%  { transform: translateX(3px); text-shadow: -2px 0 0 var(--c-magenta), 2px 0 0 var(--c-clover); }
    66%  { transform: translateX(-2px); text-shadow: 2px 0 0 var(--c-violet); }
    100% { transform: translateX(0); text-shadow: 0 0 0 transparent; }
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 900px) {
    .journal-spine { left: 6%; }
    .spine-nodes   { left: 6%; }

    .entry-frame.frame-left,
    .entry-frame.frame-right,
    .entry-frame.frame-wide {
        margin-left: 8%;
        margin-right: 4%;
        width: 88%;
    }

    .entry-frame.frame-center {
        width: 88%;
    }

    .method-grid {
        grid-template-columns: 1fr;
    }

    .method-margin {
        border-right: none;
        border-bottom: 1px dashed rgba(61,50,40,0.4);
        padding-right: 0;
        padding-bottom: 1rem;
        max-height: 200px;
        overflow: hidden;
    }

    .quill-cursor { display: none; }
    body { cursor: auto; }

    .archive-card { width: 100%; }
}

@media (max-width: 560px) {
    .entry { padding: 6vh 4vw; }
    .entry-frame { padding: 1.4rem; }
    .masthead { letter-spacing: 0.02em; }
    .chapter-ring li:nth-child(1) { transform: translate(calc(-50% - 80px), calc(-50% + 30px)); }
    .chapter-ring li:nth-child(2) { transform: translate(calc(-50% - 70px), calc(-50% + 80px)); }
    .chapter-ring li:nth-child(3) { transform: translate(calc(-50% - 40px), calc(-50% + 122px)); }
    .chapter-ring li:nth-child(4) { transform: translate(calc(-50% + 0px), calc(-50% + 142px)); }
    .chapter-ring li:nth-child(5) { transform: translate(calc(-50% + 40px), calc(-50% + 142px)); }
}
