/* ==========================================================================
   Dev.Code Portfolio — terminal/IDE inspired dark theme
   Type: JetBrains Mono (display/code) + Inter (body)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-primary: #0d0f12;
    --bg-surface: #14171c;
    --bg-surface-raised: #1a1e24;
    --border-color: #262b33;
    --text-main: #d8dee4;
    --text-muted: #7d8590;
    --success: #3fb950;
    --danger: #f85149;

    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Default accent theme */
    --accent: #00adb5;
    --accent-dim: #00adb524;
}

body.theme-teal   { --accent: #00adb5; --accent-dim: #00adb524; }
body.theme-green  { --accent: #00ff66; --accent-dim: #00ff6620; }
body.theme-pink   { --accent: #ff2e63; --accent-dim: #ff2e6320; }
body.theme-purple { --accent: #9b5de5; --accent-dim: #9b5de524; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 48px 48px;
    background-attachment: fixed;
    background-position: center top;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }

::selection { background: var(--accent); color: var(--bg-primary); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------------- */
/* Header / Nav                                                           */
/* ---------------------------------------------------------------------- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 40px;
    background: rgba(20, 23, 28, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 200;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-nav > a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
}
.site-nav > a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}
.site-nav > a:hover::after { width: 100%; }
.site-nav > a:hover { color: var(--accent); }

.nav-toggle { display: none; }

/* Theme filter dropdown */
.theme-selector-container { position: relative; }

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); transform: rotate(15deg); }
.filter-icon-wheel { display: block; }

.theme-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 300;
    min-width: 180px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.theme-dropdown.show { display: block; }

.theme-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-main);
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.theme-dropdown button:hover { background: var(--bg-surface); color: var(--accent); }

.swatch {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.swatch-teal   { background: #00adb5; }
.swatch-green  { background: #00ff66; }
.swatch-pink   { background: #ff2e63; }
.swatch-purple { background: #9b5de5; }

/* ---------------------------------------------------------------------- */
/* Layout                                                                  */
/* ---------------------------------------------------------------------- */
.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px 80px;
    flex: 1;
}

.site-footer {
    background: #000000;
    border-top: 1px solid var(--border-color);
    padding: 48px 24px 32px;
    margin-top: 64px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.footer-nav a:hover { color: var(--accent); }

.footer-divider {
    width: 100%;
    max-width: 1100px;
    height: 1px;
    background: var(--border-color);
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Terminal-style eyebrows / section labels — the signature motif         */
/* ---------------------------------------------------------------------- */
.prompt {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.prompt::before { content: "$"; color: var(--text-muted); }

.section-title {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.section-sub {
    color: var(--text-muted);
    margin: 0 0 36px;
    max-width: 60ch;
    line-height: 1.6;
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 48px;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}
.hero-title .accent { color: var(--accent); }

.cursor {
    display: inline-block;
    width: 0.55ch;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 62ch;
    line-height: 1.65;
    margin: 0 0 32px;
}

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

/* Call To Action section (homepage) */
.cta-section {
    text-align: center;
    padding: 56px 24px;
    margin-top: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-surface);
}

.cta-heading {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.cta-subtext {
    color: var(--text-muted);
    max-width: 50ch;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.terminal-window {
    margin-top: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-surface-raised);
    border-bottom: 1px solid var(--border-color);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }
.terminal-titlebar-label {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.terminal-body {
    padding: 20px 22px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--text-main);
}
.terminal-body .tm { color: var(--text-muted); }
.terminal-body .ta { color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
    font-family: var(--font-sans);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--text-main); border-color: var(--border-color); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 26px;
    min-width: 0;
}

.grid {
    display: grid;
    gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.project-card .cat-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.project-card h3 { margin: 0; font-size: 1.15rem; }
.project-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; flex: 1; }

.tech-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 20px;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* Category filter chips                                                  */
/* ---------------------------------------------------------------------- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}
.chip {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-surface);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); font-weight: 600; }

/* Profile photo (About page) */
.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    display: block;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------------------- */
/* Timeline (About page)                                                   */
/* ---------------------------------------------------------------------- */
.timeline { border-left: 2px solid var(--border-color); padding-left: 28px; display: flex; flex-direction: column; gap: 32px; margin: 32px 0; }
.timeline-entry { position: relative; }
.timeline-entry::before {
    content: "";
    position: absolute;
    left: -34px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline-period { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); margin-bottom: 4px; }
.timeline-role { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; }
.timeline-org { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 8px; }
.timeline-desc { color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Skill categories */
.skill-category-list { display: flex; flex-direction: column; gap: 20px; }
.skill-category-row { display: flex; flex-direction: column; gap: 8px; }
.skill-category-name {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------------- */
/* Project detail / sandbox                                                */
/* ---------------------------------------------------------------------- */
.detail-header { margin-bottom: 8px; }
.detail-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.detail-desc { line-height: 1.75; color: var(--text-main); margin-bottom: 32px; max-width: 75ch; }

.sandbox-frame {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-surface);
    margin-bottom: 32px;
}
.sandbox-frame iframe {
    width: 100%;
    height: 520px;
    border: 0;
    display: block;
}
.sandbox-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.link-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.form-field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-field label { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }
.form-field input, .form-field textarea {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: vertical;
}
.form-field input:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-errors { color: var(--danger); font-size: 0.82rem; margin: 4px 0 0; }

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.92rem;
    border: 1px solid var(--border-color);
}
.alert-success { border-color: var(--success); color: var(--success); }
.alert-error { border-color: var(--danger); color: var(--danger); }

.contact-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.contact-links a {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 6px;
}
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Empty state                                                             */
/* ---------------------------------------------------------------------- */
.empty-state { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.9rem; padding: 40px 0; }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 860px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .site-header { padding: 16px 20px; }
    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px;
    }
    .nav-toggle span { width: 22px; height: 2px; background: var(--text-main); display: block; }
    .site-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 8px 0;
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav > a { width: 100%; padding: 14px 24px; }
    .theme-selector-container { padding: 10px 24px; width: 100%; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .container { padding: 32px 18px 60px; }
}
