/* =========================================================
   CSS custom properties
   ========================================================= */
:root {
    --bg:           #18191a;
    --bg-2:         #212529;
    --bg-3:         #2a2d31;
    --text:         #e4e6eb;
    --text-muted:   #b0b3b8;
    --accent:       #dc143c;
    --accent-dim:   rgba(220, 20, 60, 0.15);
    --accent-glow:  rgba(220, 20, 60, 0.35);
    --border:       rgba(255, 255, 255, 0.1);
    --radius:       12px;
    --radius-sm:    8px;
    --nav-height:   60px;
    --content-width: 1400px;
    --font-sans:    'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:hover {
    opacity: 0.75;
}

img, video {
    max-width: 100%;
    display: block;
}

/* =========================================================
   Navbar
   ========================================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: transparent;
    padding: 0 3rem;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: 0.04em;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 1.1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.15s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.1rem;
    right: 1.1rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    opacity: 1;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* =========================================================
   Page layout
   ========================================================= */
.page-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 3rem) 2rem 6rem;
    box-sizing: border-box;
    width: 100%;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.2rem;  margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem;  margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-top: 2rem;   margin-bottom: 0.5rem; }
h4 { font-size: 1rem;    margin-top: 1.5rem; margin-bottom: 0.4rem; }

p {
    margin-bottom: 1rem;
    color: var(--text);
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.3rem;
}

strong {
    color: inherit;
    font-weight: 600;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-3);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
}

iframe {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

/* =========================================================
   Badges
   ========================================================= */
.badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    background: var(--bg-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

/* Fluid iframes (YouTube embeds etc.) */
.iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
}

/* Tablet */
@media (max-width: 900px) {
    .page-content {
        padding: calc(var(--nav-height) + 2.5rem) 1.5rem 5rem;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .nav {
        padding: 0 1rem;
    }

    .nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.82rem;
    }

    .page-content {
        padding: 2rem 1rem 4rem;
    }

    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.25rem; }

    iframe {
        width: 100%;
    }
}
