/* =============================================
   Perrys Lobby – style.css
   Dark terminal-meets-modern aesthetic
   ============================================= */

:root {
    --bg:        #0d0f14;
    --bg2:       #131720;
    --bg3:       #1a1f2e;
    --border:    #252b3b;
    --border2:   #2e3650;
    --text:      #c8d0e7;
    --text-dim:  #5a6480;
    --text-muted:#3d4460;
    --accent:    #4f9cf9;
    --accent2:   #7b61ff;
    --green:     #3ecf8e;
    --yellow:    #f5c842;
    --red:       #f05252;
    --orange:    #f87442;
    --font-body: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius:    8px;
    --radius-lg: 14px;
    --shadow:    0 4px 32px rgba(0,0,0,.5);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
}

/* Subtle scanline overlay */
.scanline {
    pointer-events: none;
    position: fixed; inset: 0; z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,.03) 2px,
        rgba(0,0,0,.03) 4px
    );
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

/* =============================================
   Header
   ============================================= */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(13,15,20,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 60px;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--text);
    flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-icon {
    font-size: 22px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%,100% { filter: drop-shadow(0 0 6px var(--accent)); }
    50%      { filter: drop-shadow(0 0 14px var(--accent)); }
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-title { font-weight: 700; font-size: 15px; letter-spacing: .03em; }
.logo-sub   { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

.header-nav {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: wrap;
    overflow: hidden;
}
.nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dim);
    transition: all .2s;
    white-space: nowrap;
}
.nav-item:hover, .nav-item.active {
    background: var(--bg3);
    color: var(--text);
}
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 14px; }

/* =============================================
   Breadcrumb
   ============================================= */
.breadcrumb {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.breadcrumb-inner {
    max-width: 1100px; margin: 0 auto; padding: 8px 24px;
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-dim);
    font-family: var(--font-mono);
}
.breadcrumb-inner a { color: var(--text-dim); }
.breadcrumb-inner a:hover { color: var(--accent); }
.bc-sep { color: var(--text-muted); }
.bc-current { color: var(--text); }

/* =============================================
   Main
   ============================================= */
.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* =============================================
   Home View
   ============================================= */
.home-hero {
    text-align: center;
    padding: 60px 0 48px;
}
.hero-glyph {
    font-size: 56px;
    color: var(--accent);
    filter: drop-shadow(0 0 20px var(--accent));
    display: block;
    margin-bottom: 16px;
    animation: pulse-glow 3s ease-in-out infinite;
}
.hero-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -.01em;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}
.hero-sub {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: .04em;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.cat-card {
    display: flex; align-items: flex-start; gap: 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    color: var(--text);
    transition: all .25s;
    position: relative;
    overflow: hidden;
}
.cat-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(79,156,249,.04) 0%, transparent 60%);
    opacity: 0; transition: opacity .25s;
}
.cat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79,156,249,.12);
    color: var(--text);
}
.cat-card:hover::before { opacity: 1; }
.cc-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.cc-content { display: flex; flex-direction: column; gap: 4px; }
.cc-title { font-size: 15px; font-weight: 600; }
.cc-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.cc-count { font-size: 12px; font-family: var(--font-mono); color: var(--accent); margin-top: 4px; }

/* =============================================
   Category View
   ============================================= */
.category-header {
    display: flex; align-items: flex-start; gap: 20px;
    padding: 0 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.category-icon-lg { font-size: 40px; flex-shrink: 0; margin-top: 4px; }
.category-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.category-desc { color: var(--text-dim); font-size: 14px; }

.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    color: var(--text);
    transition: all .2s;
}
.topic-card:hover {
    border-color: var(--accent);
    background: var(--bg3);
    color: var(--text);
    transform: translateX(4px);
}
.tc-icon { font-size: 22px; flex-shrink: 0; }
.tc-content { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.tc-title { font-size: 15px; font-weight: 600; }
.tc-preview { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; transition: transform .2s; }
.topic-card:hover .tc-arrow { transform: translateX(4px); color: var(--accent); }

/* =============================================
   Topic View
   ============================================= */
.topic-header {
    display: flex; align-items: center; gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.topic-icon { font-size: 32px; }
.topic-header h1 { font-size: 24px; font-weight: 700; }

.topic-body { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }

/* Intro */
.block-intro {
    font-size: 15px;
    color: var(--text);
    line-height: 1.8;
    padding: 16px 20px;
    background: rgba(79,156,249,.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Text */
.block-text { font-size: 15px; line-height: 1.8; }

/* Step */
.block-step {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    position: relative;
}
.step-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    margin-bottom: 6px;
}
.step-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.step-text { font-size: 14px; color: var(--text-dim); line-height: 1.7; }

/* Code */
.block-code {
    position: relative;
    background: #080b10;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.code-lang {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-dim);
    padding: 8px 16px 0;
}
.block-code pre {
    padding: 12px 16px 14px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    color: #a8d8ff;
}
.block-code code { font-family: inherit; }
.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--text-dim);
    padding: 5px 8px;
    cursor: pointer;
    display: flex; align-items: center;
    transition: all .2s;
    font-size: 11px;
    gap: 4px;
}
.copy-btn:hover { background: var(--border2); color: var(--text); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* Note */
.block-note {
    display: flex; gap: 12px; align-items: flex-start;
    background: rgba(62,207,142,.07);
    border: 1px solid rgba(62,207,142,.2);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
}
.block-warning {
    display: flex; gap: 12px; align-items: flex-start;
    background: rgba(245,200,66,.07);
    border: 1px solid rgba(245,200,66,.2);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
}
.note-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* List */
.block-list {
    list-style: none;
    display: flex; flex-direction: column; gap: 8px;
    padding-left: 4px;
}
.block-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 14px; line-height: 1.6;
}
.block-list li::before {
    content: '▸';
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Image */
.block-image {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.block-image img {
    width: 100%; height: auto;
    display: block;
}
.block-image figcaption {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
}

/* Topic nav */
.topic-nav {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.btn-back {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 18px;
    font-size: 14px;
    color: var(--text-dim);
    transition: all .2s;
}
.btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =============================================
   Footer
   ============================================= */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 700px) {
    .header-nav { display: none; }
    .cat-grid { grid-template-columns: 1fr; }
    .main { padding: 24px 16px 60px; }
    .topic-header h1 { font-size: 20px; }
}
