/* ===================================================================
   iggi.boo  vol. II  --  haunted moss garden, horizontal panorama
   Palette tokens are exact hex values from DESIGN.md.
   =================================================================== */

:root {
    --ivory:        #F0EDE4;
    --ivory-soft:   #E8E4D8;
    --moss:         #3A6A4A;
    --moss-dark:    #2A3028;
    --redorange:    #C05040;
    --yellow:       #D4A040;
    --text:         #1A2018;
    --spore:        #8A7A60;
    --ghost:        #F8F8F0;
    --moss-tint:    #7A8A70;

    --font-display: "Space Mono", "Courier New", monospace;
    --font-body:    "Work Sans", "Helvetica Neue", Arial, sans-serif;

    --zone-pad-y:   clamp(48px, 8vh, 96px);
    --zone-pad-x:   clamp(48px, 6vw, 120px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ivory);
    color: var(--text);
    font-family: var(--font-body);
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

body {
    overflow: hidden;
    height: 100vh;
}

/* ----- noise overlay ----- */
#noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    mix-blend-mode: multiply;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.13  0 0 0 0 0.09  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
    transition: opacity 1000ms ease;
}
#noise-overlay.is-active { opacity: 0.18; }

/* ----- progress bar ----- */
#progress-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(58, 106, 74, 0.12);
    z-index: 300;
}
#progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0;
    background: var(--moss);
    transition: width 80ms linear;
}
.zone-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px; height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 200ms ease;
}
.zone-marker[data-zone="1"] { left: 10%; }
.zone-marker[data-zone="2"] { left: 32%; }
.zone-marker[data-zone="3"] { left: 56%; }
.zone-marker[data-zone="4"] { left: 76%; }
.zone-marker[data-zone="5"] { left: 92%; }
.zone-marker:hover { transform: translate(-50%, -50%) scale(1.4); }
.zone-marker.is-active .marker { background: var(--redorange); border-color: var(--redorange); }

.marker {
    width: 6px; height: 6px;
    background: var(--moss);
    display: block;
    border: 1px solid var(--moss);
    transition: background 200ms ease, border-color 200ms ease;
}
.marker-circle   { border-radius: 50%; }
.marker-square   { border-radius: 0; }
.marker-triangle {
    width: 0; height: 0;
    background: transparent;
    border: 4px solid transparent;
    border-bottom-color: var(--moss);
    border-top: 0;
    transition: border-bottom-color 200ms ease;
}
.zone-marker.is-active .marker-triangle { border-bottom-color: var(--redorange); }

/* ----- zone counter (top-right) ----- */
#zone-counter {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 250;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--moss);
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-transform: uppercase;
}
.counter-current { font-size: 18px; font-weight: 700; color: var(--text); }
.counter-divider { opacity: 0.4; }
.counter-total   { color: var(--spore); }

/* ----- scroll hint ----- */
#scroll-hint {
    position: fixed;
    bottom: 22px;
    right: 28px;
    z-index: 250;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--moss);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.85;
    transition: opacity 400ms ease;
}
#scroll-hint.is-fading { opacity: 0; }
.hint-arrow {
    display: inline-block;
    transform: translateX(0);
    animation: hint-shift 1800ms ease-in-out infinite;
}
@keyframes hint-shift {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(8px); }
}

/* ----- horizontal scroll container ----- */
#garden {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    width: max-content;
    overflow: visible;
}

.horizontal-scroll {
    will-change: transform;
}

.zone {
    position: relative;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--ivory);
    transition: background-color 600ms ease;
}
#zone-1 { width: 100vw; background: #F0EDE4; }
#zone-2 { width: 120vw; background: #E8E4D8; }
#zone-3 { width: 100vw; background: #2A3028; color: var(--ghost); }
#zone-4 { width: 80vw;  background: #F0EDE4; }
#zone-5 { width: 60vw;  background: #E8E4D8; }

.zone-inner {
    position: relative;
    height: 100%;
    width: 100%;
    padding: var(--zone-pad-y) var(--zone-pad-x);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.zone-inner-tight {
    flex-direction: row;
    align-items: center;
    gap: clamp(40px, 5vw, 80px);
}

/* paper grain on every zone surface */
.zone::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='300' height='300'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.74' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.13  0 0 0 0 0.09  0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23p)'/></svg>");
    background-size: 300px 300px;
    opacity: 0.5;
    mix-blend-mode: multiply;
    z-index: 1;
}
.zone-dark::before { mix-blend-mode: screen; opacity: 0.18; }
.zone-inner > * { position: relative; z-index: 2; }

/* ===================================================================
   ZONE 1 : entry
   =================================================================== */

.composition {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.bauhaus-shape {
    position: absolute;
    opacity: 0;
    transform: translate(0,0) rotate(0deg);
    transition:
        transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity   700ms ease-out;
}
#intro-circle {
    width: clamp(180px, 22vw, 280px);
    height: clamp(180px, 22vw, 280px);
    top: 14%;
    left: 6%;
    transform: translateX(-160%) rotate(-30deg);
}
#intro-triangle {
    width: clamp(160px, 20vw, 240px);
    height: clamp(160px, 20vw, 240px);
    top: 8%;
    right: 18%;
    transform: translateY(-160%) rotate(20deg);
}
#intro-square {
    width: clamp(140px, 18vw, 220px);
    height: clamp(140px, 18vw, 220px);
    bottom: 22%;
    right: 6%;
    transform: translateX(160%) rotate(15deg);
}
.bauhaus-shape.is-in {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
}
#intro-circle.is-in   { transform: translate(0, 0) rotate(0deg); }
#intro-triangle.is-in { transform: translate(0, 0) rotate(0deg); }
#intro-square.is-in   { transform: translate(0, 0) rotate(0deg); }

.ideogram {
    position: absolute;
    bottom: 10%;
    left: 4%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(220px, 32vw, 480px);
    color: var(--moss);
    opacity: 0.05;
    line-height: 0.85;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    letter-spacing: -0.04em;
}

.zone-header-entry {
    max-width: 64ch;
    position: relative;
    z-index: 3;
}
.domain-mark {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--spore);
    margin: 0 0 24px 0;
}
.logotype {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(40px, 6vw, 88px);
    letter-spacing: 0.06em;
    color: var(--text);
    line-height: 1;
}
.logo-char {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05em;
    height: 1.2em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.logo-char.is-in { opacity: 1; transform: translateY(0); }
.char-bg {
    position: absolute;
    inset: 0.1em 0;
    z-index: 1;
}
.logo-char[data-shape="circle"]   .char-bg { background: var(--moss);      border-radius: 50%; }
.logo-char[data-shape="square"]   .char-bg { background: var(--yellow);    border-radius: 0; }
.logo-char[data-shape="triangle"] .char-bg {
    background: var(--redorange);
    clip-path: polygon(50% 6%, 96% 96%, 4% 96%);
}
.char-glyph {
    position: relative;
    z-index: 2;
    color: var(--ghost);
    font-weight: 700;
    line-height: 1;
}
.logo-char[data-shape="square"] .char-glyph { color: var(--text); }
.logo-dot { width: 0.6em; }
.logo-dot .char-glyph { color: var(--text); }

.lede {
    margin: 28px 0 28px 0;
    max-width: 52ch;
    font-size: clamp(15px, 1.15vw, 18px);
    color: var(--text);
}

.zone-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 32px;
}
.zone-meta li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text);
}
.meta-key {
    color: var(--spore);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.meta-val {
    color: var(--moss);
    font-style: italic;
}

/* ----- wave container ----- */
.wave-container {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}
.wave-container-bottom {
    bottom: 0;
    height: 140px;
}
#wave-zone3 { height: 180px; }
.wave-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===================================================================
   ZONE 2 : botanical dossier
   =================================================================== */

.zone-header {
    max-width: 78ch;
    margin-bottom: 36px;
}
.zone-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--moss);
    border-bottom: 1px solid var(--moss);
    padding-bottom: 4px;
    margin-bottom: 20px;
}
.zone-tag-dark {
    color: var(--redorange);
    border-bottom-color: var(--redorange);
}
.zone-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(28px, 3.4vw, 48px);
    line-height: 1.2;
    margin: 0 0 18px 0;
    letter-spacing: 0.02em;
    color: var(--text);
}
.zone-title-dark { color: var(--ghost); }
.zone-prose {
    font-size: clamp(14px, 1vw, 16px);
    color: var(--text);
    margin: 0;
    max-width: 64ch;
}

.taxa-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 14px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--moss);
}
.taxa-mark {
    width: 10px; height: 10px;
    display: inline-block;
}
.taxa-circle   { background: var(--moss); border-radius: 50%; }
.taxa-square   { background: var(--yellow); }
.taxa-triangle {
    width: 0; height: 0;
    background: transparent;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--redorange);
}

.species-shelf {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(6, minmax(220px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.species-card {
    position: relative;
    background: var(--ghost);
    padding: 22px 22px 24px;
    transition: transform 300ms ease, box-shadow 300ms ease;
}
.species-card[data-shape="circle"]   { border-radius: 18px; }
.species-card[data-shape="square"]   { border-radius: 0; }
.species-card[data-shape="triangle"] {
    border-radius: 0;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    padding-top: 60px;
}
.species-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -16px rgba(26, 32, 24, 0.4);
}

.card-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: transparent;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--spore);
}
.species-card[data-shape="circle"]   .card-frame { border-radius: 50%; }
.species-card[data-shape="triangle"] .card-frame {
    border: 0;
    aspect-ratio: 1 / 1;
    clip-path: polygon(50% 6%, 96% 96%, 4% 96%);
    background: rgba(58, 106, 74, 0.05);
}
.moss-illustration {
    width: 70%;
    height: 70%;
    overflow: visible;
}

/* path-draw animation */
.draw-path {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 1500ms ease-out, stroke-width 200ms ease;
}
.species-card.is-drawn .draw-path { stroke-dashoffset: 0; }
.species-card:hover .draw-path { stroke-width: 1.8; }

.card-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}
.species-card[data-shape="triangle"] .card-mark { right: 50%; transform: translateX(50%); top: 18px; }

.card-body { position: relative; }
.card-name {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    color: var(--moss);
    margin: 0 0 4px 0;
    line-height: 1.3;
}
.card-vernacular {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text);
    margin: 0 0 12px 0;
    font-weight: 500;
}
.card-meta {
    margin: 0 0 12px 0;
    padding: 10px 0 0 0;
    border-top: 1px solid rgba(138, 122, 96, 0.4);
    display: grid;
    gap: 4px;
}
.card-meta div {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
}
.card-meta dt {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--spore);
    margin: 0;
}
.card-meta dd {
    margin: 0;
    color: var(--text);
}
.card-prose {
    font-size: 12.5px;
    color: var(--text);
    margin: 0;
    line-height: 1.55;
    opacity: 0.85;
}

/* tooltip */
.card-tooltip {
    position: fixed;
    z-index: 400;
    background: var(--text);
    color: var(--ghost);
    padding: 8px 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 12px;
    border: 2px solid var(--moss);
    pointer-events: none;
    transition: opacity 180ms ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-tooltip[hidden] { display: none; }
.tooltip-mark {
    width: 8px; height: 8px;
    background: var(--yellow);
    display: inline-block;
}

/* ===================================================================
   ZONE 3 : dark side
   =================================================================== */

.zone-dark {
    color: var(--ghost);
}
.zone-header-dark { max-width: 80ch; margin-bottom: 40px; }

.dark-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.dark-card {
    position: relative;
    padding: 26px 22px;
    background: rgba(248, 248, 240, 0.04);
    border: 1px solid rgba(192, 80, 64, 0.4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dark-card-shape {
    display: block;
    margin-bottom: 8px;
}
.dark-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ghost);
    margin: 0;
    letter-spacing: 0.02em;
}
.dark-card-prose {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(248, 248, 240, 0.78);
    margin: 0;
}
.dark-card-prose em {
    font-style: italic;
    color: var(--yellow);
    font-family: var(--font-display);
}
.dark-card-figure {
    margin-top: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 3vw, 44px);
    color: var(--redorange);
    letter-spacing: 0.04em;
    line-height: 1;
}
.dark-card-caption {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--moss-tint);
}

/* ===================================================================
   ZONE 4 : key panel
   =================================================================== */

.key-panel {
    margin-top: 28px;
    background: var(--ghost);
    padding: 32px 36px 36px;
    max-width: 720px;
    border: 1px solid var(--spore);
    position: relative;
}
.key-prompt {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 24px;
}
.prompt-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    color: var(--redorange);
    letter-spacing: 0.04em;
}
.prompt-text {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--text);
    line-height: 1.45;
    transition: opacity 220ms ease;
}
.prompt-text.is-fading { opacity: 0.2; }

.key-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.key-option {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    border: 1px solid var(--spore);
    padding: 14px 18px;
    cursor: pointer;
    text-align: left;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.key-option:hover {
    background: rgba(58, 106, 74, 0.06);
    border-color: var(--moss);
    transform: translateX(4px);
}
.key-option .taxa-mark { flex-shrink: 0; }
.key-label {
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

.key-result {
    border-top: 1px solid var(--spore);
    padding-top: 22px;
    margin-top: 6px;
}
.result-tag {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--spore);
    display: block;
    margin-bottom: 8px;
}
.result-name {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    color: var(--moss);
    margin: 0 0 8px 0;
}
.result-note {
    font-size: 13.5px;
    color: var(--text);
    margin: 0 0 18px 0;
}
.key-restart {
    background: var(--moss);
    color: var(--ghost);
    border: 0;
    padding: 10px 16px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 200ms ease;
}
.key-restart:hover { background: var(--moss-dark); }

.key-trail {
    margin: 22px 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.key-trail li {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--spore);
    padding: 3px 8px;
    border: 1px solid rgba(138, 122, 96, 0.5);
    text-transform: lowercase;
}

/* ===================================================================
   ZONE 5 : colophon
   =================================================================== */

.colophon-composition {
    flex: 0 0 38%;
    max-width: 38%;
    aspect-ratio: 3 / 2;
}
.colophon-text { flex: 1; max-width: 56ch; }
.colophon-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(22px, 2.4vw, 34px);
    margin: 0 0 18px 0;
    color: var(--text);
}
.colophon-title em {
    font-style: italic;
    font-weight: 700;
    color: var(--moss);
}
.colophon-prose {
    font-size: 14px;
    color: var(--text);
    margin: 0 0 24px 0;
}
.colophon-credits {
    list-style: none;
    margin: 0 0 22px 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.colophon-credits li {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 12px;
}
.credit-key {
    color: var(--spore);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.credit-val {
    color: var(--text);
}
.credit-val em { font-style: italic; color: var(--moss); }
.colophon-finish {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 12px;
    color: var(--spore);
    margin: 0;
    letter-spacing: 0.04em;
}

/* ===================================================================
   responsive note: horizontal scroll only on desktop
   =================================================================== */

@media (max-width: 880px) {
    body { overflow-y: auto; height: auto; }
    #garden {
        flex-direction: column;
        height: auto;
        width: 100%;
    }
    .zone, #zone-1, #zone-2, #zone-3, #zone-4, #zone-5 {
        width: 100% !important;
        height: auto;
        min-height: 100vh;
    }
    .species-shelf {
        grid-template-columns: repeat(2, 1fr);
    }
    .dark-grid {
        grid-template-columns: 1fr 1fr;
    }
    .zone-inner-tight { flex-direction: column; }
    .colophon-composition { max-width: 100%; flex: 0 0 auto; width: 100%; }
    #scroll-hint { display: none; }
}
