/* ========================================================
   LARF — Leipzig Advanced Research Facility
   ======================================================== */

:root {
    --bg-primary: #06080d;
    --bg-secondary: #0b0e16;
    --bg-tertiary: #10141e;
    --bg-surface: #0d1119;
    --border: #1a2030;
    --border-light: #242d3d;
    --text-primary: #c9d1d9;
    --text-secondary: #6e7681;
    --text-heading: #e6edf3;
    --accent: #00b4d8;
    --accent-dim: rgba(0, 180, 216, 0.10);
    --accent-border: rgba(0, 180, 216, 0.25);
    --status-green: #00d68f;
    --status-amber: #d4a017;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    --max-w: 1140px;
    --nav-h: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #33cfef; }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; border: none; outline: none; }
h1, h2, h3, h4 { color: var(--text-heading); font-weight: 600; line-height: 1.2; }

/* ========================================================
   GATE — Password Screen
   ======================================================== */
.gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.5s, visibility 0.5s;
}
.gate.gate--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.gate-container {
    width: 100%;
    max-width: 420px;
    padding: 0 24px;
    text-align: center;
}

.gate-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}
.gate-atom {
    width: 36px;
    height: 36px;
    color: var(--accent);
}
.gate-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-heading);
}

.gate-terminal {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    overflow: hidden;
}
.gate-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}
.gate-header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}
.gate-header-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.gate-body {
    padding: 32px 24px 28px;
}
.gate-prompt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}
.gate-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gate-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0 14px;
    transition: border-color 0.2s;
}
.gate-input-row:focus-within {
    border-color: var(--accent);
}
.gate-input-prefix {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    user-select: none;
}
#gate-input {
    width: 100%;
    padding: 12px 0;
    background: transparent;
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}
#gate-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}
.gate-form button {
    padding: 11px 0;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}
.gate-form button:hover {
    background: #0096c7;
}
.gate-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.gate-error {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #e55050;
    margin-top: 12px;
    min-height: 1.2em;
}
.gate-footer-text {
    margin-top: 32px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ========================================================
   NAV
   ======================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-h);
    transition: background 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}
.nav.nav--scrolled {
    background: rgba(6, 8, 13, 0.92);
    border-bottom-color: var(--border);
    backdrop-filter: saturate(1.2);
}
.nav-inner {
    max-width: var(--max-w);
    height: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
}
.nav-logo:hover { color: var(--text-heading); }
.nav-atom {
    width: 28px;
    height: 28px;
    color: var(--accent);
}
.nav-links {
    display: flex;
    gap: 32px;
}
.nav-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-heading); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    transition: transform 0.3s, opacity 0.3s;
}

/* ========================================================
   HERO
   ======================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 40px) 0 80px;
    overflow: hidden;
    background-image: radial-gradient(circle, rgba(26, 32, 48, 0.4) 1px, transparent 1px);
    background-size: 32px 32px;
}
.hero-inner {
    position: relative;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.hero-content {
    max-width: 640px;
    position: relative;
    z-index: 2;
}
.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}
.hero-heading {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--text-heading);
    margin-bottom: 24px;
}
.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.65;
}
.hero-rule {
    width: 48px;
    height: 1px;
    background: var(--border-light);
    margin: 32px 0;
}
.hero-stats {
    display: flex;
    gap: 36px;
}
.hero-stat {
    display: flex;
    flex-direction: column;
}
.hero-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}
.hero-stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.hero-decor {
    position: relative;
    flex-shrink: 0;
    width: 380px;
    height: 380px;
    color: var(--accent);
    opacity: 0.06;
    animation: hero-spin 180s linear infinite;
}
.hero-decor svg {
    width: 100%;
    height: 100%;
}
@keyframes hero-spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   SECTIONS — shared
   ======================================================== */
.section {
    padding: 100px 0;
}
.section--alt {
    background: var(--bg-secondary);
}
.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
}
.section-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.section-heading {
    font-size: 1.8rem;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

/* ========================================================
   IMAGES & VISUAL BREAKS
   ======================================================== */
.about-img {
    margin-bottom: 48px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.about-img img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
    filter: brightness(0.8) saturate(0.9);
}
.visual-break {
    position: relative;
    height: 340px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.visual-break::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 13, 0.72);
}
.visual-break-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
}
.visual-break blockquote {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-heading);
    text-align: center;
    font-style: italic;
    letter-spacing: -0.01em;
    max-width: 600px;
}

/* ========================================================
   ABOUT
   ======================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 64px;
    align-items: start;
}
.about-text h2 {
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}
.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}
.about-text p:last-child { margin-bottom: 0; }

.about-aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
}
.about-fact {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.about-fact-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 6px;
}
.about-fact-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================================
   RESEARCH
   ======================================================== */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}
.research-card {
    padding: 36px 32px;
    background: var(--bg-secondary);
    transition: background 0.3s;
}
.research-card:hover {
    background: var(--bg-tertiary);
}
.research-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}
.research-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
.research-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================================
   OBSIDIAN
   ======================================================== */
.obsidian-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 56px;
    align-items: start;
}
.obsidian-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.obsidian-img {
    overflow: hidden;
    border: 1px solid var(--border);
}
.obsidian-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    filter: brightness(0.85) saturate(0.9);
}
.obsidian-text h2 {
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}
.obsidian-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}
.obsidian-text strong {
    color: var(--text-heading);
    font-weight: 600;
}

.obsidian-panel {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    overflow: hidden;
}
.obsidian-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
.obsidian-panel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--status-green);
    box-shadow: 0 0 6px var(--status-green);
    animation: pulse-dot 3s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.obsidian-panel-body {
    padding: 20px 16px;
}
.obsidian-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 32, 48, 0.6);
}
.obsidian-row:last-of-type {
    border-bottom: none;
}
.obsidian-key {
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.obsidian-val {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.75rem;
}
.obsidian-val--restricted {
    color: var(--status-amber);
}
.obsidian-val--active {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--status-green);
}
.obsidian-dot-active {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-green);
}

.obsidian-bar-group {
    margin-top: 16px;
}
.obsidian-bar-group + .obsidian-bar-group {
    margin-top: 12px;
}
.obsidian-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.obsidian-bar {
    height: 4px;
    background: var(--bg-primary);
    overflow: hidden;
}
.obsidian-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 1.5s ease-out;
}
.obsidian-bar--warn .obsidian-bar-fill--warn {
    background: var(--status-amber);
}

/* ========================================================
   FOOTER
   ======================================================== */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 64px 0 0;
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px 48px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-heading);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.footer-atom {
    width: 24px;
    height: 24px;
    color: var(--accent);
}
.footer-brand p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.footer-col h4 {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-heading); }
.footer-col p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 32px;
    text-align: center;
}
.footer-bottom p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ========================================================
   SCROLL REVEAL
   ======================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .obsidian-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-decor { display: none; }
    .visual-break { background-attachment: scroll; }
}

@media (max-width: 768px) {
    :root { --nav-h: 56px; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(6, 8, 13, 0.97);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
    }
    .nav-links.nav-links--open { display: flex; }
    .nav-links a {
        padding: 12px 32px;
        font-size: 0.9rem;
    }

    .hero { min-height: auto; padding: 120px 0 64px; }
    .hero-heading { font-size: 2rem; }
    .hero-stats { flex-wrap: wrap; gap: 24px; }

    .section { padding: 64px 0; }
    .section-heading { font-size: 1.4rem; }

    .about-img img { height: 220px; }
    .visual-break { height: 240px; }
    .visual-break blockquote { font-size: 1.1rem; }
    .obsidian-img img { height: 160px; }

    .research-grid { grid-template-columns: 1fr; }
    .research-card { padding: 28px 24px; }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .hero-stats { gap: 16px 28px; }
    .gate-body { padding: 24px 16px 20px; }
    .obsidian-panel { font-size: 0.72rem; }
}
