/* ============================================================
   LUKUL ATELIER: INSTRUMENTS.CSS
   Aesthetic: Surgical Quartz & Antique Bronze (Light Mode)
   Purpose: Standalone Clinical Architecture for Diagnostic Tools
   ============================================================ */

/* --- 1. CORE VARIABLES --- */
:root {
    /* Backgrounds & Surfaces */
    --alabaster-bg: #F8FAFC;
    /* The drafting paper background */
    --quartz-surface: #FFFFFF;
    /* Pure white for cards/consoles */
    --input-recess: #F1F5F9;
    /* Faint gray for recessed inputs */

    /* Typography & Ink */
    --obsidian-ink: #0F172A;
    /* Deepest black/blue for primary text */
    --slate-text: #475569;
    /* Softer gray for descriptions */
    --tech-mono: #64748B;
    /* Muted tech text */

    /* Borders & Accents */
    --platinum-border: #E2E8F0;
    /* Crisp, clean 1px borders */
    --gold-accent: #B89643;
    /* Antique Bronze / Gold */
    --gold-gradient: linear-gradient(135deg, #B89643 0%, #d4b76a 50%, #9e7f32 100%);

    /* Clinical Indicators */
    --status-optimal: #10B981;
    /* Clinical Green */
    --status-warning: #F59E0B;
    /* Alert Yellow */
    --status-critical: #EF4444;
    /* Critical Red */
    --executive-steel: #334155;
    /* Deep steel blue for executive tier */

    /* Grids & Shadows */
    --grid-opacity: 0.05;
    --soft-shadow: 0 15px 35px rgba(15, 23, 42, 0.04);
    --hover-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

/* --- 2. GLOBAL RESETS & THE CANVAS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--alabaster-bg);
    color: var(--obsidian-ink);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;

    /* Faint Architectural Drafting Grid */
    background-image:
        linear-gradient(rgba(15, 23, 42, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridFlow 150s linear infinite;
}

@keyframes gridFlow {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 60px 60px, 60px 60px;
    }
}

.lab-container {
    padding-top: 160px;
    padding-bottom: 100px;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 5%;
    padding-right: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 3. FROSTED QUARTZ HUD (NAVIGATION) --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--platinum-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

nav img {
    height: 35px;
    filter: invert(1);
    opacity: 0.9;
}

/* Darkens the logo */

.nav-center-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Inactive Links (LuKUL, Philosophy, etc.) */
.nav-center-group .app-btn-bespoke:not(#labBtn),
.nav-links a {
    text-decoration: none;
    color: var(--slate-text);
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    transition: 0.3s;
}

.nav-center-group .app-btn-bespoke:not(#labBtn):hover,
.nav-links a:hover {
    color: var(--obsidian-ink);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    margin-left: 10px;
}

/* Active "LAB" / "ATELIER" Button */
#labBtn {
    background: transparent;
    color: var(--obsidian-ink);
    border: 1px solid var(--obsidian-ink);
    padding: 8px 18px;
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-decoration: none;
}

/* Premium "APPLY" CTA */
.cta-btn {
    background: var(--gold-gradient);
    color: #111;
    border: 1px solid rgba(184, 150, 67, 0.8);
    padding: 10px 24px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    box-shadow: 3px 3px 0px rgba(184, 150, 67, 0.2);
    transition: 0.3s;
}

.cta-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px rgba(184, 150, 67, 0.3);
}

/* Language Switcher */
.lang-dropdown {
    position: relative;
    margin-right: 15px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--obsidian-ink);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 700;
    cursor: pointer;
}

.lang-menu {
    position: absolute;
    top: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--platinum-border);
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.1);
    min-width: 60px;
    padding: 5px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.3s;
}

.lang-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.lang-item {
    display: block;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    color: var(--slate-text);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
}

.lang-item:hover {
    color: var(--gold-accent);
    background: rgba(184, 150, 67, 0.05);
}

/* --- 4. TYPOGRAPHY & HEADERS --- */
.lab-header {
    text-align: center;
    margin-bottom: 60px;
    width: 100%;
}

.lab-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--obsidian-ink);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.lab-subtitle {
    color: var(--slate-text);
    font-family: 'Manrope', sans-serif;
    letter-spacing: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

.tech-mono {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--tech-mono);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
}

.executive-divider {
    margin: 60px 0 30px;
    border-bottom: 1px solid var(--platinum-border);
    padding-bottom: 15px;
    width: 100%;
    text-align: left;
}

.executive-divider h2 {
    font-family: 'Cinzel', serif;
    color: var(--obsidian-ink);
    font-size: 1.8rem;
    letter-spacing: 2px;
}

/* --- 5. THE CLINICAL CONSOLES (CARDS & CALCULATORS) --- */
.protocol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
    margin-bottom: 80px;
}

.protocol-card,
.calculator-box {
    background: var(--quartz-surface);
    border: 1px solid var(--platinum-border);
    border-radius: 6px;
    padding: 30px;
    box-shadow: var(--soft-shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.calculator-box {
    width: 100%;
    max-width: 600px;
    padding: 50px;
    margin: 0 auto;
}

.protocol-card {
    cursor: pointer;
}

.protocol-card:hover {
    border-color: var(--gold-accent);
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
}

.card-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--platinum-border);
    padding-bottom: 15px;
}

.modal-header {
    flex-direction: column;
    align-items: flex-start;
}

.card-title,
.modal-title {
    font-family: 'Marcellus', serif;
    font-size: 1.6rem;
    color: var(--obsidian-ink);
    margin: 5px 0 10px;
    font-weight: 600;
}

.card-desc {
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem;
    color: var(--slate-text);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Scan Lines */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    padding-top: 15px;
}

.scan-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
    transform: translateX(-100%);
    opacity: 0.5;
}

.protocol-card:hover .scan-line {
    transform: translateX(100%);
    transition: transform 0.6s ease-in-out;
}

.executive-scan {
    background: linear-gradient(90deg, transparent, var(--executive-steel), transparent);
}

/* Locked (Redacted) State */
.protocol-card.locked {
    background: repeating-linear-gradient(45deg, #FFFFFF, #FFFFFF 10px, #F8FAFC 10px, #F8FAFC 20px);
    border-color: var(--platinum-border);
    box-shadow: none;
}

.protocol-card.locked .card-title,
.protocol-card.locked .card-desc {
    color: #94A3B8;
}

.lock-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.5;
    font-size: 1.2rem;
    filter: grayscale(1);
}

/* --- 6. TACTILE INPUTS & FORMS --- */
.lab-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.full-width {
    grid-column: span 2;
}

.tech-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--tech-mono);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.lab-input,
.lab-select {
    width: 100%;
    background: var(--input-recess);
    border: 1px solid var(--platinum-border);
    color: var(--obsidian-ink);
    padding: 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    border-radius: 4px;
    transition: 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.lab-input:focus,
.lab-select:focus {
    background: var(--quartz-surface);
    border-color: var(--gold-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 150, 67, 0.1);
}

/* Tool Buttons */
.lab-btn-executive {
    width: 100%;
    background: var(--obsidian-ink);
    color: #fff;
    border: none;
    padding: 16px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: 0.3s;
}

.lab-btn-executive:hover {
    background: var(--executive-steel);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.lab-btn-secondary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--platinum-border);
    color: var(--slate-text);
    padding: 15px;
    margin-top: 20px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 2px;
    font-weight: 600;
    border-radius: 3px;
    transition: 0.3s;
}

.lab-btn-secondary:hover {
    border-color: var(--obsidian-ink);
    color: var(--obsidian-ink);
}

.mode-toggle {
    display: flex;
    background: var(--input-recess);
    border: 1px solid var(--platinum-border);
    border-radius: 4px;
    margin-bottom: 25px;
    overflow: hidden;
}

.mode-btn {
    flex: 1;
    padding: 14px;
    background: transparent;
    color: var(--slate-text);
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.mode-btn.active {
    background: var(--quartz-surface);
    color: var(--obsidian-ink);
    font-weight: 700;
    border-bottom: 2px solid var(--gold-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* --- 7. BIOMETRIC READOUTS (THE REVEAL) --- */
.modal-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.modal-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-readout {
    text-align: center;
    margin-bottom: 20px;
}

.big-data {
    display: block;
    font-size: 4rem;
    color: var(--obsidian-ink);
    font-family: 'Marcellus', serif;
    line-height: 1;
    margin: 15px 0;
}

.data-status {
    color: var(--slate-text);
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
}

.readout-list {
    text-align: left;
    margin-top: 30px;
    background: var(--alabaster-bg);
    border: 1px solid var(--platinum-border);
    border-radius: 4px;
    padding: 20px;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--platinum-border);
    color: var(--slate-text);
    font-size: 0.9rem;
}

.readout-row:last-child {
    border-bottom: none;
}

.status-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
    animation: pulseLight 3s infinite;
}

.status-light.operational {
    background-color: var(--status-optimal);
    color: var(--status-optimal);
}

.status-light.warning {
    background-color: var(--status-warning);
    color: var(--status-warning);
}

.status-light.locked-light {
    background-color: var(--status-critical);
    color: var(--status-critical);
    animation: none;
}

.status-light.executive-light {
    background-color: var(--executive-steel);
    color: var(--executive-steel);
}

@keyframes pulseLight {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 0px currentColor;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 8px currentColor;
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 0px currentColor;
    }
}

/* --- 8. ALERTS & COMING SOON --- */
.coming-soon-box {
    border: 1px dashed var(--platinum-border);
    background: var(--alabaster-bg);
    padding: 50px 20px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 20px;
}

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: var(--quartz-surface);
    border: 1px solid var(--status-critical);
    border-radius: 4px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.15);
    transform: translateY(20px);
    transition: 0.4s;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: translateY(0);
}

.custom-alert-title {
    font-family: 'Cinzel', serif;
    color: var(--status-critical);
    font-size: 1.2rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.custom-alert-text {
    font-family: 'Manrope', sans-serif;
    color: var(--slate-text);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.custom-alert-btn {
    background: transparent;
    border: 1px solid var(--status-critical);
    color: var(--status-critical);
    padding: 12px 30px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: 0.3s;
}

.custom-alert-btn:hover {
    background: var(--status-critical);
    color: #fff;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--alabaster-bg);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.breathing-seal {
    height: 60px;
    filter: invert(1);
    animation: somatic-pulse 2s infinite ease-in-out;
    opacity: 0.5;
}

/* --- 9. MOBILE RESPONSIVENESS (PERFECT SYMMETRY) --- */
@media (max-width: 900px) {
    .protocol-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav {
        justify-content: center !important;
        gap: 12px !important;
        padding-left: 2% !important;
        padding-right: 2% !important;
    }

    nav .lang-dropdown,
    nav .nav-center-group,
    nav .cta-btn {
        margin: 0 !important;
        position: static !important;
        transform: none !important;
    }

    nav .nav-center-group {
        gap: 8px !important;
    }

    nav .app-btn-bespoke,
    nav .cta-btn,
    nav #labBtn {
        white-space: nowrap !important;
        font-size: 9px !important;
        letter-spacing: 0.5px !important;
        padding: 8px 10px !important;
        line-height: 1 !important;
        height: auto !important;
    }

    .nav-links {
        display: none;
    }

    /* Hide text links on mobile to save space */
    .lab-title {
        font-size: 2.2rem;
    }

    .calculator-box {
        padding: 30px 20px;
    }

    .lab-form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }
}