/* ============================================
   mujun.xyz — Cottagecore Under Siege
   Palette: Complementary (warm earth vs cool digital)
   Fonts: Caveat, Inconsolata, Lora
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --linen-meadow: #f4ede4;
    --bramble-thorn: #4a3728;
    --foxglove-pink: #c4687a;
    --honeycomb-amber: #d4a24e;
    --static-blue: #3a5f8a;
    --corrupted-violet: #7b5ea7;
    --transmission-green: #5a9e6f;
    --root-dark: #2a1f18;
    --specimen-yellow: #f0e8d6;

    --font-display: 'Caveat', cursive;
    --font-data: 'Inconsolata', monospace;
    --font-body: 'Lora', serif;

    --heading-primary: clamp(1.8rem, 4.5vw, 3.6rem);
    --heading-secondary: clamp(1.2rem, 2.5vw, 1.8rem);
    --heading-label: clamp(0.95rem, 1.8vw, 1.3rem);
    --data-readout: clamp(0.75rem, 1.4vw, 1rem);
    --data-micro: 0.7rem;
    --body-text: clamp(1rem, 1.6vw, 1.15rem);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--linen-meadow);
    color: var(--bramble-thorn);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: var(--body-text);
    font-weight: 400;
}

/* --- Scanline Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(58, 95, 138, 0.05) 3px,
        rgba(58, 95, 138, 0.05) 4px
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

#scanline-overlay.active {
    animation: scanline-breathe 6s ease-in-out infinite;
}

@keyframes scanline-breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Click Glitch Overlay --- */
#click-glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: var(--corrupted-violet);
    opacity: 0;
}

#click-glitch-overlay.flash {
    animation: click-flash 40ms linear;
}

@keyframes click-flash {
    0% { opacity: 0.2; transform: translateX(3px); }
    50% { opacity: 0.15; transform: translateX(-1px); }
    100% { opacity: 0; transform: translateX(0); }
}

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--linen-meadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#loading-screen.hidden {
    display: none;
}

#loading-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--bramble-thorn);
    letter-spacing: 0.02em;
    position: relative;
}

#loading-text .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.08s ease;
}

#loading-text .char.visible {
    opacity: 1;
}

#loading-text.glitch-shear {
    animation: text-shear 100ms linear;
}

@keyframes text-shear {
    0% { clip-path: inset(0 0 66% 0); transform: translateX(6px); }
    33% { clip-path: inset(33% 0 33% 0); transform: translateX(-6px); }
    66% { clip-path: inset(66% 0 0 0); transform: translateX(6px); }
    100% { clip-path: none; transform: translateX(0); }
}

/* --- Dashboard --- */
#dashboard {
    display: none;
    width: 100%;
}

#dashboard.visible {
    display: block;
}

/* --- Fold 1: Main Grid --- */
#fold-1 {
    display: grid;
    grid-template-areas:
        "meadow meadow specimen"
        "meadow meadow specimen"
        "signal signal signal"
        "recipe recipe controls"
        "recipe recipe controls";
    grid-template-columns: 3fr 3fr 4fr;
    grid-template-rows: 22.5vh 22.5vh 10vh 22.5vh 22.5vh;
    width: 100%;
    min-height: 100vh;
    gap: 0;
}

/* --- Zone A: Meadow Monitor --- */
#zone-a {
    grid-area: meadow;
    border: 1px solid var(--bramble-thorn);
    border-right: 1px solid var(--bramble-thorn);
    position: relative;
    overflow: hidden;
    background: var(--linen-meadow);
}

.zone-a-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(244, 237, 228, 0.9);
    border-bottom: 1px solid var(--bramble-thorn);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 2;
}

.status-text {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    font-weight: 400;
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
}

.status-text.glitch {
    animation: status-flicker 150ms linear;
}

@keyframes status-flicker {
    0% { opacity: 1; color: var(--bramble-thorn); }
    25% { opacity: 0.3; color: var(--static-blue); }
    50% { opacity: 0.8; color: var(--corrupted-violet); }
    75% { opacity: 0.4; color: var(--bramble-thorn); }
    100% { opacity: 1; color: var(--bramble-thorn); }
}

.corner-acorn {
    flex-shrink: 0;
}

.zone-a-content {
    position: absolute;
    top: 28px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meadow-vignette {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-hero {
    width: 70%;
    max-width: 360px;
    height: auto;
}

.meadow-annotations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.annotation {
    position: absolute;
    font-family: var(--font-display);
    font-size: var(--heading-label);
    color: var(--bramble-thorn);
    opacity: 0.7;
}

.annotation-1 {
    top: 15%;
    right: 8%;
}

.annotation-2 {
    bottom: 30%;
    left: 6%;
    font-family: var(--font-data);
    font-size: var(--data-readout);
    letter-spacing: 0.05em;
}

.annotation-3 {
    bottom: 12%;
    right: 10%;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
}

/* Botanical path animation base */
.botanical-path {
    transition: all 0.3s ease;
}

/* Slow wind rotation for one botanical per viewport */
.botanical-hero {
    animation: gentle-wind 20s ease-in-out infinite;
}

@keyframes gentle-wind {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(0.3deg); }
}

/* --- Zone B: Specimen Drawer --- */
#zone-b {
    grid-area: specimen;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bramble-thorn);
    border-left: none;
    overflow: hidden;
}

.specimen-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--specimen-yellow);
    border-bottom: 1px solid var(--bramble-thorn);
    padding: 8px;
    position: relative;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    box-shadow: 2px 3px 8px rgba(42, 31, 24, 0.12);
    cursor: default;
}

.specimen-card:last-child {
    border-bottom: none;
}

.specimen-card:hover {
    transform: translateY(-3px);
}

.specimen-card:hover .specimen-svg {
    stroke-width: 2.5px;
}

.specimen-card:hover .specimen-name {
    color: var(--foxglove-pink);
}

.specimen-svg {
    width: 80%;
    max-width: 120px;
    height: auto;
    flex-shrink: 0;
    transition: stroke-width 0.2s ease-out;
}

.specimen-label {
    width: 100%;
    background: rgba(244, 237, 228, 0.8);
    padding: 4px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.specimen-name {
    font-family: var(--font-display);
    font-size: var(--heading-label);
    color: var(--bramble-thorn);
    font-weight: 600;
    transition: color 0.2s ease-out;
}

.specimen-latin {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
    font-style: italic;
    opacity: 0.7;
}

.specimen-date {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
    opacity: 0.5;
}

/* Specimen hover scanline flash */
.specimen-card.scan-flash::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(58, 95, 138, 0.15) 2px,
        rgba(58, 95, 138, 0.15) 3px
    );
    pointer-events: none;
    animation: scan-flash 80ms linear forwards;
}

@keyframes scan-flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Zone C: Signal Bar --- */
#zone-c {
    grid-area: signal;
    border: 1px solid var(--bramble-thorn);
    border-top: none;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: var(--linen-meadow);
}

.signal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bramble-thorn);
    z-index: 2;
}

.signal-line.animate {
    animation: draw-line 400ms ease-out forwards;
}

@keyframes draw-line {
    from { width: 0; }
    to { width: 100%; }
}

.ticker-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 40px;
    white-space: nowrap;
    will-change: transform;
}

.ticker-item {
    font-family: var(--font-data);
    font-size: var(--data-readout);
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.15s ease;
    cursor: default;
    padding: 0 4px;
}

.ticker-item:hover {
    color: var(--honeycomb-amber);
    transform: scale(1.05);
}

.ticker-leaf {
    flex-shrink: 0;
}

/* Zone C glitch displacement */
#zone-c.glitch-shift {
    animation: ticker-shift 200ms ease-out;
}

@keyframes ticker-shift {
    0% { transform: translateX(0); }
    30% { transform: translateX(6px); }
    70% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* --- Zone D: Recipe Panel --- */
#zone-d {
    grid-area: recipe;
    border: 1px solid var(--bramble-thorn);
    border-right: none;
    position: relative;
    overflow: hidden;
    background: var(--linen-meadow);
}

.recipe-card {
    width: 100%;
    height: 100%;
    padding: 24px 28px;
    transform: rotate(-0.7deg);
    position: relative;
    clip-path: polygon(
        0% 0%,
        97% 0%,
        98% 3%,
        96% 6%,
        99% 10%,
        97% 14%,
        98% 18%,
        96% 22%,
        99% 26%,
        97% 30%,
        98% 35%,
        96% 40%,
        99% 45%,
        97% 50%,
        98% 55%,
        96% 60%,
        99% 65%,
        97% 70%,
        98% 75%,
        96% 80%,
        99% 85%,
        97% 90%,
        98% 95%,
        100% 100%,
        0% 100%
    );
}

.recipe-title {
    font-family: var(--font-display);
    font-size: var(--heading-primary);
    font-weight: 700;
    color: var(--foxglove-pink);
    margin-bottom: 16px;
    line-height: 1.2;
}

.recipe-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recipe-ingredients h3,
.recipe-method h3 {
    font-family: var(--font-display);
    font-size: var(--heading-secondary);
    font-weight: 600;
    color: var(--bramble-thorn);
    margin-bottom: 8px;
}

.recipe-ingredients ul {
    list-style: none;
    padding-left: 0;
}

.recipe-ingredients li {
    font-family: var(--font-body);
    font-size: var(--body-text);
    color: var(--bramble-thorn);
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.recipe-ingredients li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--foxglove-pink);
    opacity: 0.6;
}

.recipe-method p {
    font-family: var(--font-body);
    font-size: var(--body-text);
    color: var(--bramble-thorn);
    line-height: 1.7;
    margin-bottom: 10px;
}

.glitch-word {
    display: inline-block;
    position: relative;
    transition: color 0.15s ease, transform 0.15s ease;
}

.glitch-word.active {
    color: var(--static-blue);
    transform: translateY(-2px);
}

.recipe-sketch {
    position: absolute;
    opacity: 0.4;
}

.recipe-sketch-1 {
    top: 12px;
    right: 30px;
}

.recipe-sketch-2 {
    bottom: 20px;
    right: 40px;
}

/* --- Zone E: Control Cluster --- */
#zone-e {
    grid-area: controls;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    border: 1px solid var(--bramble-thorn);
    border-left: none;
    overflow: hidden;
}

.indicator-panel {
    background: var(--root-dark);
    border: 1px solid var(--bramble-thorn);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    transition: border-color 0.15s ease;
    cursor: default;
    overflow: hidden;
}

.indicator-panel:hover {
    border-color: var(--transmission-green);
}

.indicator-panel.green-flash {
    animation: green-border-flash 60ms linear;
}

@keyframes green-border-flash {
    0% { border-color: var(--transmission-green); box-shadow: inset 0 0 8px rgba(90, 158, 111, 0.4); }
    100% { border-color: var(--bramble-thorn); box-shadow: none; }
}

.indicator-label {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    color: var(--linen-meadow);
    letter-spacing: 0.05em;
    opacity: 0.7;
    text-align: center;
}

.indicator-value,
.gauge-value,
.data-value {
    font-family: var(--font-data);
    font-size: var(--data-readout);
    color: var(--linen-meadow);
    letter-spacing: 0.05em;
}

/* Rainfall graph */
.mini-graph {
    width: 90%;
    height: 40px;
}

.mini-graph svg {
    width: 100%;
    height: 100%;
}

/* Bloom gauge */
.circular-gauge {
    position: relative;
    width: 50px;
    height: 50px;
}

.circular-gauge svg {
    width: 100%;
    height: 100%;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    color: var(--foxglove-pink);
}

/* Bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    width: 80%;
}

.bar {
    flex: 1;
    height: var(--bar-height);
    background: var(--static-blue);
    border-radius: 2px 2px 0 0;
    position: relative;
    min-height: 4px;
    transition: background 0.2s ease;
}

.bar-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-data);
    font-size: 0.55rem;
    color: var(--linen-meadow);
    opacity: 0.6;
}

/* Binary grid */
.binary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    width: 70%;
}

.bit {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(244, 237, 228, 0.2);
    border-radius: 1px;
    background: transparent;
    transition: background 0.15s ease;
}

.bit.active {
    background: var(--transmission-green);
    opacity: 0.7;
}

/* Compass */
.compass-rose {
    width: 50px;
    height: 50px;
}

.compass-rose svg {
    width: 100%;
    height: 100%;
}

/* Observation log */
.observation-log {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.log-entry {
    font-family: var(--font-data);
    font-size: 0.6rem;
    color: var(--linen-meadow);
    opacity: 0.6;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Value scramble effect */
.indicator-value.scramble,
.gauge-value.scramble,
.counter-num.scramble {
    animation: value-scramble 100ms linear;
}

@keyframes value-scramble {
    0% { opacity: 1; }
    25% { opacity: 0.6; color: var(--transmission-green); }
    50% { opacity: 0.8; color: var(--static-blue); }
    75% { opacity: 0.5; color: var(--honeycomb-amber); }
    100% { opacity: 1; }
}

/* --- Zone visibility animations --- */
.zone-hidden {
    opacity: 0;
}

.zone-enter-shear {
    animation: zone-shear 120ms linear forwards;
}

@keyframes zone-shear {
    0% { opacity: 0; clip-path: inset(0 0 66% 0); transform: translateX(4px); }
    33% { opacity: 0.5; clip-path: inset(33% 0 33% 0); transform: translateX(-4px); }
    66% { opacity: 0.8; clip-path: inset(66% 0 0 0); transform: translateX(4px); }
    100% { opacity: 1; clip-path: none; transform: translateX(0); }
}

.zone-enter-drop {
    animation: zone-drop 300ms ease-out forwards;
}

@keyframes zone-drop {
    0% { opacity: 0; transform: translateY(-30px); }
    60% { opacity: 0.7; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.zone-enter-slide {
    animation: zone-slide 400ms ease-out forwards;
}

@keyframes zone-slide {
    0% { opacity: 0; transform: translateX(-40px) rotate(-2deg); }
    100% { opacity: 1; transform: translateX(0) rotate(-0.7deg); }
}

.zone-enter-pop {
    animation: zone-pop 150ms ease-out forwards;
}

@keyframes zone-pop {
    0% { opacity: 0; transform: scale(0.9); }
    50% { opacity: 0.7; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- Fold 2: Foxglove Study --- */
#fold-2 {
    min-height: 100vh;
    position: relative;
    padding: 40px 20px;
}

.fold-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fold-visible {
    opacity: 1;
    transform: translateY(0);
}

.fold-glitch-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--corrupted-violet);
    opacity: 0;
    pointer-events: none;
}

.fold-glitch-bar.flash {
    animation: glitch-bar-flash 80ms linear;
}

@keyframes glitch-bar-flash {
    0% { opacity: 0.6; }
    50% { opacity: 0.4; }
    100% { opacity: 0; }
}

.fold2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    align-items: start;
}

.fold2-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.fold2-title {
    font-family: var(--font-display);
    font-size: var(--heading-primary);
    font-weight: 700;
    color: var(--bramble-thorn);
    text-align: center;
}

.foxglove-detailed {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* Foxglove draw animation */
.foxglove-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.foxglove-draw.animate {
    stroke-dashoffset: 0;
}

.fold2-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.data-panel {
    background: var(--specimen-yellow);
    border: 1px solid var(--bramble-thorn);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 2px 3px 8px rgba(42, 31, 24, 0.1);
}

.data-panel h3 {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}

.data-graph {
    width: 100%;
    height: 50px;
}

.data-panel .data-value {
    color: var(--bramble-thorn);
    font-weight: 500;
}

/* Horizontal bars */
.horizontal-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.h-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.h-bar-label {
    font-family: var(--font-data);
    font-size: 0.6rem;
    color: var(--bramble-thorn);
    letter-spacing: 0.05em;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.h-bar-fill {
    height: 8px;
    width: var(--fill-width);
    background: var(--static-blue);
    border-radius: 2px;
    opacity: 0.7;
}

/* Sun gauge */
.sun-gauge {
    position: relative;
    width: 80px;
    height: 50px;
}

.sun-gauge svg {
    width: 100%;
    height: 100%;
}

.sun-gauge .data-value {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--honeycomb-amber);
}

/* Pollinator counter */
.counter-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.counter-num {
    font-family: var(--font-data);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--bramble-thorn);
    letter-spacing: 0.03em;
}

.counter-unit {
    font-family: var(--font-data);
    font-size: var(--data-micro);
    color: var(--bramble-thorn);
    opacity: 0.5;
}

.counter-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.counter-breakdown span {
    font-family: var(--font-data);
    font-size: 0.6rem;
    color: var(--bramble-thorn);
    opacity: 0.6;
    letter-spacing: 0.03em;
}

/* --- Fold 3: Recipe Spread --- */
#fold-3 {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-spread {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 80vh;
    margin: 40px auto;
    padding: 0 20px;
}

.recipe-spread-margin {
    flex-shrink: 0;
    width: 50px;
    display: flex;
    align-items: center;
}

.recipe-spread-content {
    flex: 1;
    padding: 40px 30px;
    background: var(--specimen-yellow);
    border: 1px solid var(--bramble-thorn);
    box-shadow: 2px 3px 12px rgba(42, 31, 24, 0.1);
}

.recipe-spread-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--foxglove-pink);
    margin-bottom: 32px;
    line-height: 1.1;
    text-align: center;
}

.recipe-spread-text {
    max-width: 600px;
    margin: 0 auto;
}

.recipe-para {
    font-family: var(--font-body);
    font-size: var(--body-text);
    font-weight: 400;
    color: var(--bramble-thorn);
    line-height: 1.7;
    margin-bottom: 20px;
}

.recipe-para em {
    font-weight: 500;
}

/* --- Glitch Effects --- */

/* Horizontal shear effect */
.glitch-shear {
    animation: element-shear 150ms linear;
}

@keyframes element-shear {
    0% {
        clip-path: inset(0 0 70% 0);
        transform: translateX(4px);
        filter: drop-shadow(3px 0 0 var(--corrupted-violet));
    }
    33% {
        clip-path: inset(30% 0 40% 0);
        transform: translateX(-6px);
    }
    66% {
        clip-path: inset(60% 0 0 0);
        transform: translateX(8px);
    }
    100% {
        clip-path: none;
        transform: translateX(0);
        filter: none;
    }
}

/* Color channel separation */
.glitch-rgb {
    animation: rgb-split 200ms linear;
}

@keyframes rgb-split {
    0% {
        text-shadow:
            2px 0 rgba(0, 255, 255, 0.5),
            -2px 0 rgba(255, 0, 255, 0.5),
            0 2px rgba(255, 255, 0, 0.5);
    }
    50% {
        text-shadow:
            -1px -1px rgba(0, 255, 255, 0.5),
            1px 1px rgba(255, 0, 255, 0.5),
            1px -1px rgba(255, 255, 0, 0.5);
    }
    100% {
        text-shadow: none;
    }
}

/* Scanline interference */
.glitch-scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(58, 95, 138, 0.3) 1px,
        rgba(58, 95, 138, 0.3) 2px
    );
    pointer-events: none;
    animation: scanline-fade 300ms ease-out forwards;
}

@keyframes scanline-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Micro-glitch for ambient panels */
.micro-glitch {
    animation: micro-shift 100ms linear;
}

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

/* --- Glitch render stutter (3-phase entrance) --- */
.glitch-stutter-enter {
    animation: stutter-render 400ms ease-out forwards;
}

@keyframes stutter-render {
    0% { opacity: 0; }
    15% { opacity: 0.2; }
    20% { opacity: 0; }
    45% { opacity: 0.5; }
    50% { opacity: 0; }
    70% { opacity: 1; }
    100% { opacity: 1; }
}

/* --- Responsive: Below 768px --- */
@media (max-width: 768px) {
    #fold-1 {
        display: flex;
        flex-direction: column;
        grid-template-areas: none;
        grid-template-columns: none;
        grid-template-rows: none;
    }

    #zone-a {
        width: 100%;
        min-height: 50vh;
        border-right: 1px solid var(--bramble-thorn);
    }

    #zone-c {
        width: 100%;
        min-height: 10vh;
        position: sticky;
        top: 0;
        z-index: 100;
        border-top: 1px solid var(--bramble-thorn);
        border-bottom: 1px solid var(--bramble-thorn);
    }

    #zone-b {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        min-height: auto;
        border-left: 1px solid var(--bramble-thorn);
    }

    .specimen-card {
        min-width: 200px;
        flex: 0 0 auto;
    }

    #zone-d {
        width: 100%;
        min-height: 50vh;
        border-right: 1px solid var(--bramble-thorn);
    }

    #zone-e {
        width: 100%;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        min-height: 60vh;
        border-left: 1px solid var(--bramble-thorn);
    }

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

    .fold2-data {
        grid-template-columns: 1fr 1fr;
    }

    .recipe-spread {
        flex-direction: column;
    }

    .recipe-spread-margin {
        width: 100%;
        height: 40px;
        justify-content: center;
    }

    .recipe-spread-margin svg {
        width: auto;
        height: 40px;
    }
}

/* --- Order for mobile flex layout --- */
@media (max-width: 768px) {
    #zone-a { order: 1; }
    #zone-c { order: 2; }
    #zone-b { order: 3; }
    #zone-d { order: 4; }
    #zone-e { order: 5; }
}

/* --- Utility --- */
.no-scroll {
    overflow: hidden;
}