/* ========================================================
   lrx.wiki -- Botanical Specimen Archive
   HUD overlay + watercolor specimens, deep burgundy palette
   ======================================================== */

:root {
    --bg-primary: #1A0A10;
    --bg-secondary: #2D0F1A;
    --hud: #8A3040;
    --hud-soft: rgba(138, 48, 64, 0.55);
    --hud-fade: rgba(138, 48, 64, 0.18);
    --hud-faint: rgba(138, 48, 64, 0.08);
    --rose-faded: #D4A0A0;
    --rose-dusty: #C2727E;
    --cream: #E8D5C4;
    --parchment: #F2E6D9;
    --sand: #E8C8B8;
    --wine-deep: #3A0D1A;
    --cherry: #5E1526;
    --sage: #6B8F71;
    --sage-deep: #5E7A60;
    --lavender: #9E7B9B;

    --ease-bot: cubic-bezier(0.23, 1, 0.32, 1);
    --hud-inset: 24px;
    --bracket-len: 40px;

    --font-display: 'Playfair Display', 'Lora', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'Share Tech Mono', 'Inter', Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---------- Persistent overlays ---------- */

.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background-image:
        radial-gradient(rgba(45, 15, 26, 0.35) 1px, transparent 1px),
        radial-gradient(rgba(232, 213, 196, 0.04) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px;
    background-position: 0 0, 1px 2px;
    opacity: 0.55;
    mix-blend-mode: overlay;
}

.scan-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(138, 48, 64, 0.08) 0px,
        rgba(138, 48, 64, 0.08) 0.5px,
        transparent 0.5px,
        transparent 4px
    );
}

/* ---------- HUD Frame ---------- */

.hud-frame {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
}

.hud-border {
    position: absolute;
    background: var(--hud);
}

.hud-border--top {
    top: var(--hud-inset);
    left: var(--hud-inset);
    right: var(--hud-inset);
    height: 1px;
}

.hud-border--bottom {
    bottom: var(--hud-inset);
    left: var(--hud-inset);
    right: var(--hud-inset);
    height: 1px;
}

.hud-border--left {
    top: var(--hud-inset);
    bottom: var(--hud-inset);
    left: var(--hud-inset);
    width: 1px;
}

.hud-border--right {
    top: var(--hud-inset);
    bottom: var(--hud-inset);
    right: var(--hud-inset);
    width: 1px;
}

.corner {
    position: absolute;
    width: var(--bracket-len);
    height: var(--bracket-len);
}

.corner__h,
.corner__v {
    position: absolute;
    background: var(--hud);
}

.corner__h {
    height: 1px;
    width: var(--bracket-len);
}

.corner__v {
    width: 1px;
    height: var(--bracket-len);
}

.corner--tl {
    top: var(--hud-inset);
    left: var(--hud-inset);
}
.corner--tl .corner__h { top: 0; left: 0; }
.corner--tl .corner__v { top: 0; left: 0; }

.corner--tr {
    top: var(--hud-inset);
    right: var(--hud-inset);
}
.corner--tr .corner__h { top: 0; right: 0; }
.corner--tr .corner__v { top: 0; right: 0; }

.corner--bl {
    bottom: var(--hud-inset);
    left: var(--hud-inset);
}
.corner--bl .corner__h { bottom: 0; left: 0; }
.corner--bl .corner__v { bottom: 0; left: 0; }

.corner--br {
    bottom: var(--hud-inset);
    right: var(--hud-inset);
}
.corner--br .corner__h { bottom: 0; right: 0; }
.corner--br .corner__v { bottom: 0; right: 0; }

/* ---------- Telemetry corners ---------- */

.telemetry {
    position: fixed;
    z-index: 45;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--rose-faded);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.telemetry--tl {
    top: calc(var(--hud-inset) + 16px);
    left: calc(var(--hud-inset) + 16px);
    color: var(--sand);
}

.telemetry--tr {
    top: calc(var(--hud-inset) + 16px);
    right: calc(var(--hud-inset) + 16px);
}

.telemetry--bl {
    bottom: calc(var(--hud-inset) + 16px);
    left: calc(var(--hud-inset) + 16px);
}

.telemetry--br {
    bottom: calc(var(--hud-inset) + 16px);
    right: calc(var(--hud-inset) + 16px);
    color: var(--sand);
}

.scan-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--cherry);
    animation: scan-pulse 2s var(--ease-bot) infinite;
}

@keyframes scan-pulse {
    0%, 100% { background: var(--cherry); box-shadow: 0 0 0 0 rgba(138, 48, 64, 0.0); }
    50% { background: var(--hud); box-shadow: 0 0 8px 2px rgba(138, 48, 64, 0.5); }
}

/* ---------- Cursor reticle ---------- */

.reticle {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 60;
    transform: translate(-50%, -50%);
    transition: transform 0.2s var(--ease-bot), opacity 0.4s var(--ease-bot);
    opacity: 0;
    will-change: transform;
}

.reticle.is-active {
    opacity: 1;
}

.reticle__circle {
    position: absolute;
    inset: 0;
    border: 1px solid var(--hud);
    border-radius: 50%;
}

.reticle__cross {
    position: absolute;
    background: var(--hud);
}

.reticle__cross--n,
.reticle__cross--s {
    width: 1px;
    height: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.reticle__cross--e,
.reticle__cross--w {
    height: 1px;
    width: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.reticle__cross--n { top: -8px; }
.reticle__cross--s { bottom: -8px; }
.reticle__cross--e { right: -8px; }
.reticle__cross--w { left: -8px; }

/* ---------- Sweep transition line ---------- */

.sweep-line {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: rgba(138, 48, 64, 0.6);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 12px rgba(138, 48, 64, 0.6);
}

.sweep-line.is-sweeping {
    animation: sweep 1.5s var(--ease-bot) forwards;
}

@keyframes sweep {
    0% { opacity: 0; transform: translateY(0); }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { opacity: 0; transform: translateY(100vh); }
}

/* ---------- Reticle navigation ---------- */

.reticle-nav {
    position: fixed;
    right: calc(var(--hud-inset) + 18px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 22px;
    z-index: 48;
}

.reticle-mark {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
    text-decoration: none;
    transition: transform 0.5s var(--ease-bot);
    transform-origin: center;
}

.reticle-mark__ring {
    position: absolute;
    inset: 0;
    border: 1px solid var(--hud);
    border-radius: 50%;
    transition: all 0.5s var(--ease-bot);
}

.reticle-mark.is-active .reticle-mark__ring,
.reticle-mark:hover .reticle-mark__ring {
    background: var(--rose-dusty);
    border-color: var(--rose-dusty);
    border-width: 2px;
    box-shadow: 0 0 14px rgba(194, 114, 126, 0.5);
}

.reticle-mark:hover {
    transform: scale(1.5);
}

.reticle-mark__tooltip {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--sand);
    white-space: nowrap;
    background: rgba(26, 10, 16, 0.85);
    border: 1px solid var(--hud);
    padding: 4px 10px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s var(--ease-bot);
}

.reticle-mark:hover .reticle-mark__tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ---------- Data streams ---------- */

.data-streams {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.data-column {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 16px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 8px;
    color: rgba(138, 48, 64, 0.18);
    text-align: center;
    line-height: 1.4;
    letter-spacing: 0.05em;
}

.data-column[data-column="0"] { left: 8px; }
.data-column[data-column="1"] { left: calc(50% - 320px); }
.data-column[data-column="2"] { right: calc(50% - 320px); }
.data-column[data-column="3"] { right: 8px; }

.data-column__inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    will-change: transform;
}

.data-column__inner span {
    display: block;
}

/* ---------- Archive container ---------- */

.archive {
    position: relative;
    z-index: 10;
    width: 100%;
}

/* ---------- Specimen frames ---------- */

.specimen {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 80px calc(var(--hud-inset) + 80px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.specimen + .specimen {
    border-top: 1px dashed var(--hud-fade);
}

.specimen__illustration {
    position: absolute;
    left: 4%;
    top: 50%;
    width: 60%;
    max-width: 720px;
    transform: translateY(-50%) scale(1);
    transition: transform 0.6s var(--ease-bot), filter 0.6s var(--ease-bot);
    z-index: 2;
    will-change: transform;
}

.specimen__illustration:hover {
    transform: translateY(-50%) scale(1.04);
}

.botanical {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.4));
}

/* ---------- Classification annotation ---------- */

.classification {
    position: absolute;
    right: -4%;
    top: 18%;
    z-index: 4;
    transform-origin: left center;
    transition: transform 0.5s var(--ease-bot);
}

.classification__line {
    position: absolute;
    top: 50%;
    right: 100%;
    width: 80px;
    height: 1px;
    background: var(--hud);
    transform: rotate(-22deg);
    transform-origin: right center;
}

.classification__line--alt {
    transform: rotate(22deg);
}

.classification__tag {
    border: 1px solid var(--hud);
    padding: 10px 14px;
    background: rgba(26, 10, 16, 0.78);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--sand);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    transition: transform 0.5s var(--ease-bot), border-color 0.5s var(--ease-bot), color 0.5s var(--ease-bot);
}

.classification__tag:hover {
    transform: scale(1.15);
    border-color: var(--rose-dusty);
    color: var(--parchment);
}

.classification__tag--alert {
    border-color: var(--rose-dusty);
    color: var(--rose-dusty);
}

.classification__genus {
    color: var(--rose-faded);
    opacity: 0.85;
}

.classification__species {
    color: var(--parchment);
    font-size: 12px;
}

.classification__cat {
    color: var(--rose-faded);
    opacity: 0.7;
    font-size: 10px;
}

/* ---------- Specimen content (right column) ---------- */

.specimen__content {
    position: relative;
    margin-left: 65%;
    max-width: 320px;
    z-index: 3;
    color: var(--cream);
}

.specimen__index {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--rose-faded);
    margin-bottom: 22px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hud-fade);
}

.specimen__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 56px;
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--parchment);
    margin-bottom: 18px;
}

.specimen__quote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.35;
    color: var(--rose-dusty);
    margin-bottom: 22px;
    text-shadow: 0 0 20px rgba(138, 48, 64, 0.3);
}

.specimen__notes {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--cream);
    margin-bottom: 26px;
    opacity: 0.94;
}

.specimen__field {
    list-style: none;
    border-top: 1px solid var(--hud-fade);
    padding-top: 12px;
    margin-bottom: 26px;
}

.specimen__field li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--hud-fade);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.specimen__field li:last-child {
    border-bottom: none;
}

.field__key {
    color: var(--rose-faded);
    flex-shrink: 0;
}

.field__val {
    color: var(--cream);
    text-align: right;
    text-transform: none;
    letter-spacing: 0.03em;
    font-size: 12px;
    font-family: var(--font-body);
    opacity: 0.92;
}

.specimen__cta {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--rose-dusty);
    text-decoration: none;
    padding: 10px 14px;
    border: 1px solid var(--hud);
    transition: transform 0.5s var(--ease-bot), color 0.5s var(--ease-bot), border-color 0.5s var(--ease-bot), text-shadow 0.5s var(--ease-bot);
}

.specimen__cta:hover {
    transform: scale(1.02);
    color: var(--parchment);
    border-color: var(--rose-dusty);
    text-shadow: 0 0 14px rgba(194, 114, 126, 0.55);
}

.specimen--close {
    background: linear-gradient(180deg, transparent 0%, rgba(45, 15, 26, 0.55) 100%);
}

/* ---------- Specimen-specific tweaks ---------- */

.specimen[data-index="002"] .classification {
    top: 24%;
    right: 0%;
}

.specimen[data-index="003"] .classification {
    top: 14%;
    right: -2%;
}

.specimen[data-index="004"] .classification {
    top: 12%;
    right: -2%;
}

.specimen[data-index="005"] .classification {
    top: 22%;
    right: -2%;
}

.specimen[data-index="006"] .classification {
    top: 16%;
    right: 0%;
}

.specimen[data-index="007"] .classification {
    top: 28%;
    right: -2%;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .specimen {
        padding: 80px calc(var(--hud-inset) + 36px);
    }
    .specimen__illustration {
        width: 56%;
        left: 2%;
    }
    .specimen__content {
        margin-left: 60%;
        max-width: 300px;
    }
    .specimen__title {
        font-size: 46px;
    }
}

@media (max-width: 820px) {
    .specimen {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 100px 36px 60px;
        min-height: auto;
    }
    .specimen__illustration {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        width: 100%;
        max-width: 480px;
        margin: 0 auto 28px;
    }
    .specimen__illustration:hover {
        transform: scale(1.04);
    }
    .specimen__content {
        margin-left: 0;
        max-width: 100%;
    }
    .specimen__title {
        font-size: 42px;
    }
    .classification {
        position: static;
        margin: 12px auto 0;
        display: inline-flex;
        right: auto;
        top: auto;
    }
    .classification__line {
        display: none;
    }
    .reticle-nav {
        right: calc(var(--hud-inset) + 6px);
        gap: 16px;
    }
    .reticle-mark__tooltip {
        display: none;
    }
    .telemetry {
        font-size: 9px;
        letter-spacing: 0.18em;
    }
    .data-column[data-column="1"],
    .data-column[data-column="2"] {
        display: none;
    }
}

@media (max-width: 480px) {
    .telemetry--tl span,
    .telemetry--bl span,
    .telemetry--tr span,
    .telemetry--br span {
        font-size: 8px;
    }
    .specimen__title {
        font-size: 36px;
    }
    .specimen__quote {
        font-size: 19px;
    }
}

/* ---------- Hover state on specimen container ---------- */

.specimen:hover .classification__line {
    background: var(--rose-faded);
}

/* ---------- Active reticle pulse ---------- */

.reticle-mark.is-active .reticle-mark__ring {
    animation: ring-pulse 2.4s var(--ease-bot) infinite;
}

@keyframes ring-pulse {
    0%, 100% { box-shadow: 0 0 14px rgba(194, 114, 126, 0.4); }
    50% { box-shadow: 0 0 22px rgba(194, 114, 126, 0.75); }
}
