/* ============================================
   whitepapers.xyz - Y2K Neoclassical Data Terminal
   HUD-Overlay | Garamond | Pastel Palette
   ============================================ */

/* --- CSS Custom Properties (Palette) --- */
:root {
    --parchment-bone: #f4f0e8;
    --marble-fog: #eae4da;
    --iron-manuscript: #2a2420;
    --sepia-annotation: #6b5e52;
    --pearl-lavender: #c8b8e8;
    --iridescent-mint: #a8e8d0;
    --blush-quartz: #e8c0c0;
    --frosted-chrome: #d8d0e8;
    --aged-violet: #8878a8;
    
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'EB Garamond', serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    background: var(--parchment-bone);
    color: var(--iron-manuscript);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- HUD Frame (Fixed Outer Border) --- */
.hud-frame {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 1px solid;
    border-color: var(--pearl-lavender);
    opacity: 0.4;
    animation: hue-rotate-anim 12s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes hue-rotate-anim {
    0%, 100% { filter: hue-rotate(0deg); opacity: 0.4; }
    50% { filter: hue-rotate(15deg); opacity: 0.35; }
}

/* --- HUD Corner Brackets --- */
.hud-bracket {
    position: fixed;
    width: 20px;
    height: 20px;
    z-index: 11;
    pointer-events: none;
}

.bracket-top-left {
    top: 16px;
    left: 16px;
    border-top: 1px solid var(--pearl-lavender);
    border-left: 1px solid var(--pearl-lavender);
}

.bracket-top-right {
    top: 16px;
    right: 16px;
    border-top: 1px solid var(--pearl-lavender);
    border-right: 1px solid var(--pearl-lavender);
}

.bracket-bottom-left {
    bottom: 16px;
    left: 16px;
    border-bottom: 1px solid var(--pearl-lavender);
    border-left: 1px solid var(--pearl-lavender);
}

.bracket-bottom-right {
    bottom: 16px;
    right: 16px;
    border-bottom: 1px solid var(--pearl-lavender);
    border-right: 1px solid var(--pearl-lavender);
}

.bracket-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--iridescent-mint);
    border-radius: 50%;
    top: -2px;
    left: -2px;
    opacity: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- Top HUD Strip (Navigation) --- */
.hud-strip-top {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 48px;
    border-bottom: 1px dashed var(--pearl-lavender);
    border-bottom-color: rgba(200, 184, 232, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 12;
    pointer-events: auto;
}

.hud-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--iron-manuscript);
}

.hud-nav {
    display: flex;
    gap: 40px;
}

.hud-nav-item {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--iron-manuscript);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease-out;
}

.hud-nav-item::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--pearl-lavender);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hud-nav-item:hover::after {
    transform: scaleX(1);
}

.hud-nav-item:hover {
    color: var(--pearl-lavender);
}

/* --- Content Viewport --- */
.content-viewport {
    position: fixed;
    top: 80px;
    left: 40px;
    right: 40px;
    bottom: 60px;
    overflow-y: scroll;
    overflow-x: hidden;
    box-shadow: inset 0 0 80px rgba(200, 184, 232, 0.06);
    scrollbar-width: thin;
    scrollbar-color: var(--pearl-lavender) transparent;
}

.content-viewport::-webkit-scrollbar {
    width: 8px;
}

.content-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.content-viewport::-webkit-scrollbar-thumb {
    background: var(--pearl-lavender);
    opacity: 0.2;
    border-radius: 4px;
}

.content-viewport::-webkit-scrollbar-thumb:hover {
    opacity: 0.4;
}

/* --- Pediment (Top Marble Divider) --- */
.pediment {
    height: 200px;
    margin-bottom: 120px;
    background: linear-gradient(
        180deg,
        rgba(234, 228, 218, 1) 0%,
        rgba(234, 228, 218, 0.5) 50%,
        rgba(200, 184, 232, 0.08) 100%
    );
    position: relative;
}

.pediment::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--pearl-lavender) 50%,
        transparent 100%
    );
    opacity: 0.15;
}

/* --- Document Panels --- */
.document-panel {
    position: relative;
    margin-bottom: 120px;
    padding-top: 80px;
    opacity: 0;
    transform: translateY(24px);
    animation: panel-enter 0.6s ease-out forwards;
}

@keyframes panel-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-watermark {
    position: absolute;
    top: 0;
    left: -60px;
    font-family: var(--font-display);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 300;
    color: var(--pearl-lavender);
    opacity: 0.08;
    line-height: 1;
    opacity: 0;
    animation: watermark-enter 0.6s ease-out 0.2s forwards;
}

@keyframes watermark-enter {
    to { opacity: 0.08; }
}

.panel-content {
    max-width: 38em;
}

.document-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: var(--iron-manuscript);
    margin-bottom: 20px;
    position: relative;
    padding-left: 30px;
}

.document-title::before {
    content: '§';
    position: absolute;
    left: 0;
    font-size: 1.2em;
    color: var(--aged-violet);
    opacity: 0.3;
}

.document-meta {
    display: flex;
    gap: 30px;
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: var(--sepia-annotation);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(200, 184, 232, 0.15);
}

.meta-author::before {
    content: '✎ ';
    opacity: 0.5;
}

.meta-date::before {
    content: '📅 ';
    opacity: 0.5;
}

.document-summary {
    background: rgba(216, 208, 232, 0.12);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid var(--pearl-lavender);
    border-color: rgba(200, 184, 232, 0.15);
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(42, 36, 32, 0.04);
}

.document-summary p {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.72;
    color: var(--iron-manuscript);
}

.document-excerpt {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-style: italic;
    line-height: 1.8;
    color: var(--sepia-annotation);
    padding-left: 30px;
    border-left: 2px solid var(--blush-quartz);
    opacity: 0.9;
}

.panel-divider {
    height: 2px;
    width: 60%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--pearl-lavender) 50%,
        transparent 100%
    );
    opacity: 0.15;
    margin-top: 50px;
}

/* --- Closing Section --- */
#panel-closing {
    padding-top: 100px;
    text-align: center;
}

.closing-text {
    font-family: var(--font-body);
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.8;
    color: var(--sepia-annotation);
    font-style: italic;
    max-width: 45em;
    margin: 0 auto;
    padding-bottom: 120px;
}

/* --- Bottom HUD Strip (Status Bar) --- */
.hud-strip-bottom {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 32px;
    border-top: 1px dashed var(--pearl-lavender);
    border-top-color: rgba(200, 184, 232, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 12;
    pointer-events: none;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sepia-annotation);
    opacity: 0.6;
}

.status-value {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--iron-manuscript);
    font-weight: 600;
}

.status-right {
    flex: 1;
    justify-content: flex-end;
    position: relative;
}

.progress-line {
    height: 1px;
    width: 0%;
    background: var(--iridescent-mint);
    transition: width 0.2s ease-out;
}

/* --- Marginalia Symbols (Pseudo-elements) --- */
.document-title::after {
    content: '†';
    position: absolute;
    right: -30px;
    font-size: 1em;
    color: var(--aged-violet);
    opacity: 0.2;
}

/* --- Typography Improvements --- */
p {
    margin-bottom: 1.5em;
}

/* --- Animations for Entry Sequence --- */
@keyframes frame-draw-top {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes frame-draw-bottom {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes frame-draw-left {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes frame-draw-right {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes title-type {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .hud-nav {
        gap: 20px;
    }

    .hud-nav-item {
        font-size: 10px;
    }

    .document-title {
        padding-left: 20px;
    }

    .document-excerpt {
        padding-left: 20px;
    }

    .content-viewport {
        top: 80px;
        left: 20px;
        right: 20px;
        bottom: 60px;
    }

    .pediment {
        margin-bottom: 80px;
    }

    .document-panel {
        margin-bottom: 80px;
    }

    .panel-watermark {
        display: none;
    }

    .hud-bracket {
        width: 15px;
        height: 15px;
    }

    .hud-frame {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .bracket-top-left,
    .bracket-top-right {
        top: 12px;
    }

    .bracket-bottom-left,
    .bracket-bottom-right {
        bottom: 12px;
    }

    .bracket-top-left,
    .bracket-bottom-left {
        left: 12px;
    }

    .bracket-top-right,
    .bracket-bottom-right {
        right: 12px;
    }
}

@media (max-width: 480px) {
    .hud-nav {
        display: none;
    }

    .hud-title {
        font-size: 12px;
    }

    .document-title {
        font-size: 1.3rem;
    }

    .content-viewport {
        left: 12px;
        right: 12px;
    }

    .document-meta {
        flex-direction: column;
        gap: 8px;
    }

    .status-label,
    .status-value {
        font-size: 9px;
    }
}

/* --- Print Styles --- */
@media print {
    .hud-frame,
    .hud-strip-top,
    .hud-strip-bottom,
    .hud-bracket {
        display: none;
    }

    .content-viewport {
        position: static;
        overflow: visible;
        box-shadow: none;
    }

    body {
        background: white;
    }
}
