/* DevFolio – Default Theme CSS
   Dark-first, typography-led, minimal. No framework dependencies. */

/* ── Custom properties ────────────────────────────────────────────────────── */
:root {
    --bg:          #0c0e14;
    --bg2:         #12151e;
    --bg3:         #1a1f2e;
    --border:      #252d3d;
    --text:        #e2e8f0;
    --text-muted:  #7a8499;
    --text-faint:  #4a5568;
    --accent:      #6366f1;
    --accent-h:    #818cf8;
    --accent-glow: rgba(99,102,241,0.15);
    --success:     #22c55e;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --radius:      8px;
    --radius-lg:   14px;
    --font-sans:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono:   'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    --max-w:       1100px;
    --transition:  0.2s ease;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-h); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem);  font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg3);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent-h);
}
pre { background: var(--bg3); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem; }
pre code { background: none; padding: 0; }
blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text-muted); margin: 1.25rem 0; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.site-main { flex: 1; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: -0.03em;
    text-decoration: none;
}
.nav-brand:hover { color: var(--accent-h); }
.nav-logo { height: 36px; width: auto; }
.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
}
.nav-links a {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--bg3);
}
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.1s;
    text-decoration: none;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--accent-h);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-h); }
.btn-ghost {
    background: var(--bg3);
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-accent { background: var(--accent-glow); color: var(--accent-h); border: 1px solid rgba(99,102,241,0.3); }
.badge-gray   { background: var(--bg3);          color: var(--text-muted); border: 1px solid var(--border); }

/* ── Section wrapper ──────────────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-h);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.section-heading { margin-bottom: 0.75rem; }
.section-lead { color: var(--text-muted); font-size: 1.05rem; max-width: 520px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    padding: 5rem 0 4rem;
    position: relative;
}
.hero-inner { max-width: 680px; }
.hero-eyebrow {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-h);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.hero-eyebrow::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
}
.hero h1 { margin-bottom: 1.25rem; }
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── Featured projects grid ───────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.project-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99,102,241,0.12);
}
.project-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg3);
}
.project-card-img-placeholder {
    width: 100%;
    height: 180px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 2rem;
}
.project-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.project-card-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-h);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.project-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.project-card-desc { font-size: 0.875rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; line-height: 1.55; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.project-card-link { font-size: 0.82rem; font-weight: 600; color: var(--accent-h); }
.project-card-link:hover { color: #fff; }

/* ── Category filter bar ──────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.filter-btn {
    padding: 0.35rem 0.9rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg2);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-h);
}

/* ── Single project page ──────────────────────────────────────────────────── */
.project-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.project-header h1 { margin-bottom: 0.75rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--text-muted); font-size: 0.875rem; }
.project-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2.5rem; align-items: start; }
.project-body { font-size: 0.95rem; line-height: 1.75; }
.project-body h2, .project-body h3 { margin-top: 1.75rem; margin-bottom: 0.75rem; }
.project-sidebar > * + * { margin-top: 1.25rem; }
.sidebar-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.sidebar-card-header {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.sidebar-card-body { padding: 0.9rem 1rem; }
.detail-table { width: 100%; font-size: 0.85rem; }
.detail-table tr + tr td { border-top: 1px solid var(--border); }
.detail-table td { padding: 0.4rem 0; vertical-align: top; }
.detail-table td:first-child { color: var(--text-muted); padding-right: 0.75rem; width: 45%; white-space: nowrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Gallery lightbox ─────────────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.gallery-thumb {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}
.gallery-thumb:hover { border-color: var(--accent); transform: scale(1.02); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.4rem;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.16); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-counter {
    position: absolute;
    bottom: 1.25rem;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* ── Downloads ────────────────────────────────────────────────────────────── */
.download-list { list-style: none; padding: 0; }
.download-list li { padding: 0; }
.download-list li + li { border-top: 1px solid var(--border); }
.download-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--transition);
}
.download-link:hover { color: var(--accent-h); }
.download-icon { font-size: 1rem; }

/* ── Changelog ────────────────────────────────────────────────────────────── */
.changelog-list { list-style: none; padding: 0; }
.changelog-entry { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-version {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: var(--accent-h);
    margin-right: 0.5rem;
}
.changelog-date { font-size: 0.78rem; color: var(--text-muted); }
.changelog-note { margin-top: 0.35rem; font-size: 0.875rem; color: var(--text-muted); }

/* ── CV / Timeline ────────────────────────────────────────────────────────── */
.cv-timeline { position: relative; padding-left: 2rem; }
.cv-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.cv-entry { position: relative; padding-bottom: 2.5rem; }
.cv-entry:last-child { padding-bottom: 0; }
.cv-dot {
    position: absolute;
    left: -2.4rem;
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.cv-period {
    font-size: 0.78rem;
    color: var(--accent-h);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.cv-role { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.15rem; }
.cv-org  { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.cv-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ── About page ───────────────────────────────────────────────────────────── */
.about-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 680px;
    margin-bottom: 3rem;
}
.about-intro p + p { margin-top: 1rem; }

/* ── Contact form ─────────────────────────────────────────────────────────── */
.contact-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; align-items: start; }
.contact-form { max-width: 560px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.form-control {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.form-control { resize: vertical; min-height: 130px; }

/* Flash messages */
.flash { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.875rem; }
.flash-success { background: rgba(34,197,94,0.1);   border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.flash-error   { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }

/* Contact info aside */
.contact-info h3 { margin-bottom: 0.75rem; }
.contact-info p  { color: var(--text-muted); font-size: 0.9rem; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.not-found { text-align: center; padding: 6rem 1rem; }
.not-found h1 { font-size: 5rem; color: var(--accent); margin-bottom: 0.5rem; }
.not-found p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .project-layout { grid-template-columns: 1fr; }
    .project-sidebar { order: -1; }
    .contact-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg2);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem 0;
        gap: 0;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.7rem 1.5rem; border-radius: 0; }
    .hero { padding: 3rem 0 2.5rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
