/* ============================================================
   LRX Wiki — Chrome-metallic zen design
   Palette: #F0F2F5 #C0C8D0 #8892A0 #2C3E50 #FFFFFF #E8ECF0 #4DB6AC #607080 #F8F9FA
   Fonts: Jost (logotype/headlines), Noto Sans (body), Space Mono (code)
   ============================================================ */

:root {
    --silver-mist: #F0F2F5;
    --chrome-shine: #C0C8D0;
    --polished-steel: #8892A0;
    --dark-slate: #2C3E50;
    --white-chrome: #FFFFFF;
    --bright-chrome: #E8ECF0;
    --accent-teal: #4DB6AC;
    --deep-chrome: #607080;
    --soft-chrome: #F8F9FA;

    --font-display: 'Jost', 'Futura', 'Space Grotesk', sans-serif;
    --font-body: 'Noto Sans', 'Lora', system-ui, sans-serif;
    --font-mono: 'Space Mono', 'Space', ui-monospace, monospace;

    --sidebar-w: 60px;
    --sidebar-w-open: 200px;

    --radius: 4px;
    --gap: 12px;

    --ease-zen: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    background: var(--silver-mist);
    color: var(--dark-slate);
    font-family: var(--font-body);
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-teal);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
    border-bottom-color: var(--accent-teal);
}

::selection {
    background: var(--accent-teal);
    color: var(--white-chrome);
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(to bottom, var(--white-chrome), var(--soft-chrome));
    border-right: 1px solid var(--chrome-shine);
    z-index: 50;
    transition: width 0.3s var(--ease-zen);
    overflow: hidden;
}

.sidebar:hover,
.sidebar.is-open {
    width: var(--sidebar-w-open);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 0 16px 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    margin-bottom: 18px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    color: var(--polished-steel);
    border-bottom: none;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-item:hover {
    background: var(--bright-chrome);
    color: var(--dark-slate);
    border-left-color: var(--accent-teal);
}

.nav-item.is-active {
    background: var(--bright-chrome);
    color: var(--dark-slate);
    border-left-color: var(--accent-teal);
}

.nav-icon {
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
}

.nav-label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.3s var(--ease-zen) 0.05s, transform 0.3s var(--ease-zen) 0.05s;
}

.sidebar:hover .nav-label,
.sidebar.is-open .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-footer {
    padding: 0 16px;
    border-top: 1px solid var(--chrome-shine);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-version {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--deep-chrome);
}

.sidebar-version-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--polished-steel);
    opacity: 0;
    transition: opacity 0.3s var(--ease-zen) 0.05s;
}

.sidebar:hover .sidebar-version-label,
.sidebar.is-open .sidebar-version-label {
    opacity: 1;
}

/* ============================================================
   Main scaffold
   ============================================================ */

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background:
        linear-gradient(to right, var(--bright-chrome) 0.5px, transparent 0.5px) 0 0 / 56px 56px,
        linear-gradient(to bottom, var(--bright-chrome) 0.5px, transparent 0.5px) 0 0 / 56px 56px,
        var(--silver-mist);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 6vw 60px;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--chrome-shine), transparent);
    opacity: 0.6;
}

.hero-inner {
    max-width: 880px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--polished-steel);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--chrome-shine);
    border-radius: 999px;
    background: var(--white-chrome);
    margin-bottom: 28px;
}

.hero-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.18);
}

.hero-wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(48px, 9vw, 128px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--dark-slate);
    display: inline-flex;
    align-items: baseline;
    gap: 0.04em;
    background: linear-gradient(180deg, var(--dark-slate) 0%, var(--deep-chrome) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 14px;
    position: relative;
}

.wm-l, .wm-r, .wm-x {
    display: inline-block;
    transform: translateY(0);
}

.wm-x {
    color: var(--accent-teal);
    -webkit-text-fill-color: var(--accent-teal);
}

.wm-suffix {
    font-weight: 400;
    font-size: 0.35em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-left: 0.6em;
    color: var(--polished-steel);
    -webkit-text-fill-color: var(--polished-steel);
    align-self: center;
    transform: translateY(-0.55em);
}

.hero-tagline {
    max-width: 560px;
    color: var(--polished-steel);
    font-size: clamp(15px, 1.2vw, 18px);
    margin-bottom: 36px;
}

.search-shell {
    width: min(580px, 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--white-chrome);
    border: 1px solid var(--chrome-shine);
    border-radius: var(--radius);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 1px 2px rgba(44, 62, 80, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 36px;
}

.search-shell:focus-within {
    border-color: var(--accent-teal);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 3px rgba(77, 182, 172, 0.15);
}

.search-icon {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--dark-slate);
    letter-spacing: 0.01em;
}

.search-input::placeholder {
    color: var(--polished-steel);
    font-weight: 400;
}

.search-kbd {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--polished-steel);
    background: var(--silver-mist);
    border: 1px solid var(--chrome-shine);
    border-radius: 3px;
    padding: 2px 7px;
    line-height: 1;
}

.hero-meta {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
    padding: 18px 26px;
    border: 1px solid var(--chrome-shine);
    border-radius: var(--radius);
    background: linear-gradient(to bottom, var(--white-chrome), var(--soft-chrome));
    margin-bottom: 56px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
}

.meta-num {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(24px, 2.4vw, 30px);
    color: var(--dark-slate);
    letter-spacing: -0.01em;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--polished-steel);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.meta-divider {
    width: 1px;
    background: var(--chrome-shine);
    align-self: stretch;
    opacity: 0.7;
}

.hero-scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--polished-steel);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-scroll-cue svg {
    animation: drift 2.4s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* ============================================================
   Archive section
   ============================================================ */

.archive {
    padding: 60px 4vw 80px;
    max-width: 1480px;
    margin: 0 auto;
}

.archive-head {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--chrome-shine);
    padding-bottom: 22px;
}

.archive-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(22px, 2.2vw, 32px);
    color: var(--dark-slate);
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.archive-sub {
    color: var(--polished-steel);
    font-size: clamp(13px, 1vw, 15px);
    margin-bottom: 18px;
}

.archive-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--polished-steel);
    background: var(--white-chrome);
    border: 1px solid var(--chrome-shine);
    border-radius: 999px;
    padding: 6px 14px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tool-btn:hover {
    background: var(--bright-chrome);
    color: var(--dark-slate);
}

.tool-btn.is-active {
    background: var(--dark-slate);
    color: var(--white-chrome);
    border-color: var(--dark-slate);
}

/* Modular grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(120px, auto);
    grid-auto-flow: dense;
    gap: var(--gap);
    background-image:
        repeating-linear-gradient(0deg, var(--bright-chrome) 0 0.5px, transparent 0.5px 56px),
        repeating-linear-gradient(90deg, var(--bright-chrome) 0 0.5px, transparent 0.5px 56px);
    padding: 4px;
    border-radius: var(--radius);
}

/* ============================================================
   Modular blocks
   ============================================================ */

.block {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, var(--white-chrome), var(--soft-chrome));
    border: 1px solid var(--chrome-shine);
    border-radius: var(--radius);
    padding: 18px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.5s var(--ease-zen),
        transform 0.5s var(--ease-zen),
        background 0.3s var(--ease-zen),
        border-color 0.3s var(--ease-zen),
        box-shadow 0.3s var(--ease-zen);
}

.block.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.block:hover,
.block.is-expanded {
    background: linear-gradient(to bottom, var(--white-chrome), var(--silver-mist));
    border-color: var(--polished-steel);
    box-shadow: 0 6px 24px -8px rgba(44, 62, 80, 0.12);
}

.block.is-dimmed {
    opacity: 0.25;
    pointer-events: none;
}

.block--medium {
    grid-column: span 2;
}

.block--large {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 720px) {
    .block--medium,
    .block--large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.summary {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 0 0 auto;
}

.summary-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.summary-text {
    flex: 1;
    min-width: 0;
}

.block-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--polished-steel);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.block-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(15px, 1.2vw, 19px);
    color: var(--dark-slate);
    letter-spacing: -0.005em;
    line-height: 1.3;
    margin-bottom: 4px;
}

.block-summary-line {
    font-size: 13.5px;
    color: var(--polished-steel);
    line-height: 1.55;
    margin-top: 4px;
}

.details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 0.3s var(--ease-zen),
        opacity 0.3s var(--ease-zen),
        margin-top 0.3s var(--ease-zen);
    margin-top: 0;
    color: var(--dark-slate);
}

.block:hover .details,
.block.is-expanded .details {
    opacity: 1;
    margin-top: 14px;
}

.details > p,
.details > ul,
.details > code,
.details > .block-note {
    margin-bottom: 10px;
    font-size: 13.5px;
    line-height: 1.65;
}

.details > *:last-child {
    margin-bottom: 0;
}

.block-list {
    list-style: none;
    padding-left: 0;
    border-top: 1px dashed var(--bright-chrome);
    border-bottom: 1px dashed var(--bright-chrome);
    padding: 8px 0;
}

.block-list li {
    padding: 4px 0;
    border-bottom: 1px dashed var(--bright-chrome);
    font-size: 13px;
    color: var(--dark-slate);
}

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

.block-list strong {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--deep-chrome);
}

.block-code {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--deep-chrome);
    background: var(--silver-mist);
    border: 1px solid var(--bright-chrome);
    border-radius: 3px;
    padding: 4px 9px;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.block-note {
    color: var(--polished-steel);
    font-size: 12.5px;
    border-left: 2px solid var(--accent-teal);
    padding-left: 10px;
}

/* Tropical fish easter egg */
.fish {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 22px;
    height: 11px;
    opacity: 0;
    transition: opacity 0.4s var(--ease-zen);
    pointer-events: none;
}

.block:hover .fish,
.block.is-expanded .fish {
    opacity: 1;
    animation: swim 3s ease-in-out infinite;
}

@keyframes swim {
    0%   { transform: translateX(0)    rotate(0deg); }
    25%  { transform: translateX(-6px) rotate(-3deg); }
    50%  { transform: translateX(0)    rotate(0deg); }
    75%  { transform: translateX(6px)  rotate(3deg); }
    100% { transform: translateX(0)    rotate(0deg); }
}

/* ============================================================
   Footer
   ============================================================ */

.foot {
    border-top: 1px solid var(--chrome-shine);
    background: linear-gradient(to bottom, var(--white-chrome), var(--soft-chrome));
    padding: 50px 4vw 30px;
    margin-top: 40px;
}

.foot-grid {
    max-width: 1400px;
    margin: 0 auto 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 28px 24px;
}

.foot-h {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 13px;
    color: var(--dark-slate);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--chrome-shine);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.foot-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.foot-col a {
    font-family: var(--font-display);
    font-size: 12.5px;
    color: var(--polished-steel);
    letter-spacing: 0.02em;
    border-bottom: none;
    transition: color 0.2s ease;
}

.foot-col a:hover {
    color: var(--accent-teal);
}

.foot-bar {
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid var(--bright-chrome);
    padding-top: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--polished-steel);
    letter-spacing: 0.06em;
}

.foot-mark {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--dark-slate);
    letter-spacing: 0.04em;
}

.foot-sep {
    color: var(--chrome-shine);
}

.foot-fish {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    animation: swim 4s ease-in-out infinite;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    :root {
        --sidebar-w: 52px;
        --sidebar-w-open: 180px;
    }

    .archive {
        padding: 40px 4vw 60px;
    }

    .meta-divider {
        display: none;
    }

    .hero-meta {
        gap: 6px 14px;
        padding: 14px 18px;
    }

    .meta-item {
        padding: 0 8px;
    }
}
