/* lrx.sh - Retro Institutional Luxury */
/* Gold-Black-Luxury Palette */

/* ============================================
   ROOT VARIABLES & RESET
   ============================================ */

:root {
    --bg-primary: #0a0a0a;
    --bg-warm: #0f0d08;
    --accent-primary: #c9a84c;
    --accent-secondary: #a8882e;
    --text-primary: #d4c9a8;
    --text-secondary: #8a7d5a;
    --data-highlight: #e8b830;
    --divider: #3d3520;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BARCODE MARGIN (Fixed Decorative Element)
   ============================================ */

.barcode-margin {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 0;
}

.barcode-margin .barcode-line {
    height: 2px;
    background-color: var(--divider);
    display: block;
}

@media (max-width: 768px) {
    .barcode-margin {
        display: none;
    }
}

/* ============================================
   SCROLL CONTAINER
   ============================================ */

.scroll-container {
    position: relative;
    z-index: 2;
}

/* ============================================
   CHAMBERS (General)
   ============================================ */

.chamber {
    position: relative;
    padding: 89px 8%;
}

/* ============================================
   NIXIE TUBE NUMERALS
   ============================================ */

.nixie-numeral {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(5rem, 12vw, 10rem);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent-primary);
    text-shadow: 0 0 40px rgba(232, 184, 48, 0.2);
    position: absolute;
    top: 34px;
    right: 8%;
    line-height: 1;
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

.nixie-numeral-large {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 25vw;
    color: transparent;
    -webkit-text-stroke: 2px var(--accent-primary);
    text-shadow: 0 0 60px rgba(232, 184, 48, 0.2);
    line-height: 0.85;
    user-select: none;
}

/* ============================================
   CORNER FILIGREES
   ============================================ */

.corner-filigree {
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.corner-filigree::before,
.corner-filigree::after {
    content: '';
    position: absolute;
    background-color: var(--divider);
}

.corner-filigree::before {
    width: 24px;
    height: 1.5px;
}

.corner-filigree::after {
    width: 1.5px;
    height: 24px;
}

.corner-filigree.top-left {
    top: 21px;
    left: 21px;
}
.corner-filigree.top-left::before { top: 0; left: 0; }
.corner-filigree.top-left::after { top: 0; left: 0; }

.corner-filigree.top-right {
    top: 21px;
    right: 21px;
}
.corner-filigree.top-right::before { top: 0; right: 0; }
.corner-filigree.top-right::after { top: 0; right: 0; }

.corner-filigree.bottom-left {
    bottom: 21px;
    left: 21px;
}
.corner-filigree.bottom-left::before { bottom: 0; left: 0; }
.corner-filigree.bottom-left::after { bottom: 0; left: 0; }

.corner-filigree.bottom-right {
    bottom: 21px;
    right: 21px;
}
.corner-filigree.bottom-right::before { bottom: 0; right: 0; }
.corner-filigree.bottom-right::after { bottom: 0; right: 0; }

/* ============================================
   CHAMBER 1 - THE LOBBY
   ============================================ */

.chamber-lobby {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1508 0%, var(--bg-primary) 70%);
}

.lobby-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

.lobby-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 7rem);
    color: var(--accent-primary);
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 34px;
}

.lobby-intro {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out 2s, transform 1.2s ease-out 2s;
}

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

/* ============================================
   SPLIT-FLAP TEXT
   ============================================ */

.split-flap-text {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.04em;
    line-height: 1.05;
}

.split-flap-text .flap-char {
    display: inline-block;
    position: relative;
    overflow: hidden;
    perspective: 300px;
}

.split-flap-text .flap-char .flap-top,
.split-flap-text .flap-char .flap-bottom {
    display: block;
    overflow: hidden;
    position: relative;
}

.split-flap-text .flap-char .flap-top {
    height: 0.55em;
}

.split-flap-text .flap-char .flap-bottom {
    height: 0.55em;
}

.split-flap-text .flap-char .flap-inner {
    display: block;
}

.split-flap-text .flap-char .flap-bottom .flap-inner {
    transform: translateY(-0.55em);
}

.flap-animating .flap-top {
    animation: flapDown 0.3s cubic-bezier(0.2, 0, 0.4, 1) forwards;
}

@keyframes flapDown {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(-90deg); }
}

@keyframes flapUp {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

/* ============================================
   SPARK-LINE DIVIDERS
   ============================================ */

.spark-line-divider {
    padding: 13px 8%;
    overflow: hidden;
}

.spark-line-divider svg {
    width: 100%;
    height: 30px;
    display: block;
}

.spark-polyline {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.spark-polyline.animated {
    stroke-dashoffset: 0;
}

/* ============================================
   CHAMBER 2 - THE MEASUREMENT ROOM
   ============================================ */

.chamber-measurement {
    min-height: 150vh;
    position: relative;
    background: var(--bg-primary);
}

.measurement-content {
    width: 55%;
    margin-left: 12%;
    position: relative;
    z-index: 3;
}

.measurement-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin-bottom: 55px;
}

.measurement-text p {
    margin-bottom: 34px;
}

.underline-draw-hr {
    height: 2px;
    background: linear-gradient(to right, var(--accent-primary), transparent);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left center;
    margin: 34px 0;
    transition: background-size 0.8s ease-out;
}

.underline-draw-hr.visible {
    background-size: 100% 2px;
}

.mono-data {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.decorative-bars {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0.5;
    z-index: 1;
}

.decorative-bars .deco-bar {
    height: 2px;
    background-color: var(--accent-primary);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .measurement-content {
        width: 85%;
        margin-left: 8%;
    }
    .decorative-bars {
        display: none;
    }
}

/* ============================================
   CHAMBER 3 - THE TYPING GALLERY
   ============================================ */

.chamber-typing {
    min-height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-warm));
}

.typing-content {
    max-width: 540px;
    text-align: center;
    position: relative;
    z-index: 3;
}

.typing-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin-bottom: 55px;
}

.typing-body p {
    margin-bottom: 34px;
    text-align: left;
}

.typewriter-text {
    overflow: hidden;
}

.typewriter-text .tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--accent-primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s steps(1) infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ============================================
   CHAMBER 4 - THE ARCHIVE
   ============================================ */

.chamber-archive {
    min-height: 180vh;
    background: var(--bg-warm);
    padding-bottom: 120px;
}

.archive-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin-bottom: 89px;
    text-align: center;
}

.archive-cards {
    display: flex;
    flex-direction: column;
    gap: 55px;
}

.index-card {
    width: 380px;
    max-width: 85vw;
    position: relative;
    padding: 2px;
}

.index-card.card-left {
    margin-left: 20%;
}

.index-card.card-right {
    margin-left: 60%;
}

@media (max-width: 768px) {
    .index-card.card-left,
    .index-card.card-right {
        margin-left: auto;
        margin-right: auto;
    }
}

.card-border-animator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.card-border-animator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--accent-primary);
    clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    transition: clip-path 1.5s cubic-bezier(0.2, 0, 0.4, 1);
}

.index-card.card-revealed .card-border-animator::before {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.card-inner {
    padding: 34px;
    opacity: 0;
    transition: opacity 0.4s ease-out 1.5s;
}

.index-card.card-revealed .card-inner {
    opacity: 1;
}

.card-inner h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    margin-bottom: 21px;
}

.card-inner p {
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: var(--text-primary);
    margin-bottom: 21px;
    line-height: 1.6;
}

/* Dot Leaders */
.dot-leader {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
}

.dot-label {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-transform: uppercase;
}

.dot-fill {
    flex: 1;
    border-bottom: 1px dotted var(--divider);
    margin: 0 8px;
    min-width: 20px;
}

.dot-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Micro Charts */
.micro-chart {
    margin-top: 13px;
}

.spark-micro svg {
    width: 100%;
    height: 40px;
    display: block;
}

.bar-micro {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
}

.bar-micro .bar {
    flex: 1;
    background-color: var(--accent-primary);
    opacity: 0.7;
    min-width: 4px;
}

/* ============================================
   CHAMBER 5 - THE DEPARTURE
   ============================================ */

.chamber-departure {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.departure-layout {
    display: flex;
    align-items: center;
    gap: 55px;
    padding: 0 8%;
    width: 100%;
    position: relative;
    z-index: 3;
}

.departure-year {
    flex-shrink: 0;
}

.departure-text {
    max-width: 480px;
}

.departure-text p {
    margin-bottom: 34px;
}

.departure-closing {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--text-secondary);
}

.departure-timestamp {
    margin-top: 21px;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    color: var(--text-secondary);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .departure-layout {
        flex-direction: column;
        text-align: center;
    }
    .nixie-numeral-large {
        font-size: 35vw;
    }
}

/* ============================================
   UNDERLINE-DRAW ACCENTS (links, emphasis)
   ============================================ */

a, .emphasis {
    color: var(--accent-primary);
    text-decoration: none;
    background-image: linear-gradient(var(--accent-primary), var(--accent-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.6s ease-out;
    padding-bottom: 2px;
}

a:hover, .emphasis:hover {
    background-size: 100% 2px;
    color: var(--data-highlight);
}

a.underline-drawn {
    background-size: 100% 2px;
}

a.underline-drawn:hover {
    background-image: linear-gradient(var(--data-highlight), var(--data-highlight));
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

.fade-in-delayed {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in-delayed.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

/* Selection styling */
::selection {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--divider);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}
