/*
 * NOIR KIT — v1.0
 * A minimal dark design system extracted from Petzilla docs
 * Usage: <link rel="stylesheet" href="noir.css">
 * Fonts: paste this in your <head>:
 * <link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&display=swap" rel="stylesheet">
 */

/* ── TOKENS ── */
:root {
    --bg:             #050507;
    --bg2:            #0a0a0f;
    --bg3:            #0f0f16;
    --border:         #1a1a24;
    --border-bright:  #2a2a38;
    --text:           #c8c8d8;
    --text-dim:       #5a5a72;
    --text-bright:    #f0f0f8;

    /* Change these to rebrand */
    --accent:         #1db985;
    --accent-dim:     #0f6647;
    --accent-glow:    rgba(29, 185, 133, 0.08);

    --font-display:   'Syne', sans-serif;
    --font-body:      'DM Mono', monospace;

    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      12px;

    --header-h:       72px;
    --header-h-sm:    52px;
    --sidebar-w:      260px;
}

/* ── RESET ── */
*, *::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: 14px;
    line-height: 1.75;
    min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ══════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════ */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-bright);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: 28px; font-weight: 800; margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }

p { margin-bottom: 14px; color: var(--text); }

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; }

.eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    display: block;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */

.nk-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(5, 5, 7, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    z-index: 100;
    transition: height 0.3s cubic-bezier(0.4,0,0.2,1), border-color 0.3s;
}

.nk-header.shrunk {
    height: var(--header-h-sm);
    border-color: var(--border-bright);
}

.nk-header .brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-bright);
    text-decoration: none;
    transition: font-size 0.3s;
}

.nk-header.shrunk .brand { font-size: 15px; }

.nk-header .badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent-dim);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.nk-header nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nk-header nav a {
    font-size: 12px;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    letter-spacing: 0.04em;
    transition: color 0.2s, background 0.2s;
}

.nk-header nav a:hover { color: var(--text-bright); background: var(--bg3); opacity: 1; }

.nk-header nav a.primary {
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    background: var(--accent-glow);
}

.nk-header nav a.primary:hover { background: rgba(29,185,133,0.15); color: #2de9a5; }

/* Logo slot */
.logo-slot {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--bg3);
    border: 1px solid var(--border-bright);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    transition: width 0.3s, height 0.3s, border-radius 0.3s;
    font-family: var(--font-display);
    font-size: 16px; font-weight: 800; color: var(--accent);
}

.nk-header.shrunk .logo-slot { width: 30px; height: 30px; border-radius: 7px; }
.logo-slot img { width: 100%; height: 100%; padding: 0.4rem; object-fit: cover; }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */

/* Full page with sidebar */
.nk-layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
    transition: padding-top 0.3s;
}

/* Centered single column (portfolio, landing) */
.nk-page {
    padding-top: var(--header-h);
    max-width: 760px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 120px;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */

.nk-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed;
    top: var(--header-h);
    bottom: 0; left: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: 28px 0 60px;
    transition: top 0.3s;
}

.nk-sidebar.shrunk { top: var(--header-h-sm); }

.nk-sidebar .group { margin-bottom: 32px; }

.nk-sidebar .group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0 20px;
    margin-bottom: 6px;
}

.nk-sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px;
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nk-sidebar a:hover { color: var(--text); background: var(--bg3); opacity: 1; }
.nk-sidebar a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-glow); }

/* Main content area (used with sidebar) */
.nk-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    max-width: 780px;
    padding: 56px 60px 120px;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */

.nk-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: border-color 0.2s, background 0.2s;
}

.nk-card:hover { border-color: var(--border-bright); background: var(--bg3); }

.nk-card .card-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.nk-card .card-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-bright);
}

/* Card grid */
.nk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0 28px;
}

/* ══════════════════════════════════════
   PROJECT CARD (portfolio use)
══════════════════════════════════════ */

.nk-project {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nk-project:hover { border-color: var(--accent-dim); transform: translateY(-2px); }

.nk-project .proj-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
}

.nk-project .proj-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.nk-project .proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.nk-project .proj-links { display: flex; gap: 10px; margin-top: auto; padding-top: 12px; }

.nk-project .proj-links a {
    font-size: 12px;
    color: var(--text-dim);
    border: 1px solid var(--border-bright);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, border-color 0.15s;
}

.nk-project .proj-links a:hover { color: var(--accent); border-color: var(--accent-dim); opacity: 1; }

/* ══════════════════════════════════════
   BADGES & TAGS
══════════════════════════════════════ */

.nk-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg3);
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
}

.nk-tag.accent { background: var(--accent-glow); border-color: var(--accent-dim); color: var(--accent); }
.nk-tag.warn   { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); color: #f59e0b; }
.nk-tag.danger { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.3);  color: #ef4444; }

/* ══════════════════════════════════════
   CALLOUTS
══════════════════════════════════════ */

.nk-callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-glow);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 13px;
    color: var(--text);
}

.nk-callout strong { color: var(--text-bright); }
.nk-callout.warn   { border-left-color: #f59e0b; background: rgba(245,158,11,0.06); }
.nk-callout.danger { border-left-color: #ef4444; background: rgba(239,68,68,0.06); }

/* ══════════════════════════════════════
   CODE
══════════════════════════════════════ */

code {
    font-family: var(--font-body);
    font-size: 12px;
    background: var(--bg3);
    border: 1px solid var(--border-bright);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    overflow-x: auto;
    margin: 16px 0 24px;
    position: relative;
}

pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13px; line-height: 1.7; }

.code-lang {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ══════════════════════════════════════
   TABLE
══════════════════════════════════════ */

.nk-table-wrap { overflow-x: auto; margin: 16px 0 28px; }

.nk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.nk-table thead tr { border-bottom: 1px solid var(--border-bright); }

.nk-table th {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 10px 14px;
    text-align: left;
}

.nk-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.nk-table tr:last-child td { border-bottom: none; }
.nk-table tr:hover td { background: var(--bg3); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */

.nk-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-bright);
    background: var(--bg3);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.nk-btn:hover { border-color: var(--border-bright); color: var(--text-bright); background: var(--bg2); opacity: 1; }

.nk-btn.primary {
    background: var(--accent-glow);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.nk-btn.primary:hover { background: rgba(29,185,133,0.15); color: #2de9a5; }

/* ══════════════════════════════════════
   DIVIDER
══════════════════════════════════════ */

.nk-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--border-bright), transparent);
    margin: 48px 0;
    border: none;
}

/* ══════════════════════════════════════
   SECTION
══════════════════════════════════════ */

.nk-section {
    margin-bottom: 72px;
    animation: nk-fadeup 0.4s ease both;
}

@keyframes nk-fadeup {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   ON THIS PAGE (right rail)
══════════════════════════════════════ */

.nk-toc {
    position: fixed;
    right: 32px;
    top: calc(var(--header-h) + 40px);
    width: 160px;
    font-size: 12px;
    transition: top 0.3s;
}

.nk-toc.shrunk { top: calc(var(--header-h-sm) + 40px); }

.nk-toc .toc-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.nk-toc a {
    display: block;
    padding: 4px 0 4px 12px;
    border-left: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.nk-toc a:hover, .nk-toc a.active { color: var(--accent); border-left-color: var(--accent); opacity: 1; }

/* ══════════════════════════════════════
   HERO (portfolio use)
══════════════════════════════════════ */

.nk-hero {
    padding: 80px 0 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
}

.nk-hero .title {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.nk-hero .title span { color: var(--accent); }

.nk-hero .subtitle {
    font-size: 15px;
    color: var(--text-dim);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.nk-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ══════════════════════════════════════
   STAT ROW (portfolio / about)
══════════════════════════════════════ */

.nk-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 28px 0;
}

.nk-stat .stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-bright);
}

.nk-stat .stat-label { font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

@media (max-width: 1100px) { .nk-toc { display: none; } }

@media (max-width: 768px) {
    .nk-sidebar { display: none; }
    .nk-content { margin-left: 0; padding: 32px 24px 80px; }
    .nk-hero .title { font-size: 32px; }
    .nk-header { padding: 0 16px; }
}
