
:root {
    /* Surfaces */
    --bg:            #0d1117;
    --bg-elev-1:     #11161d;
    --bg-elev-2:     #161b22;
    --bg-elev-3:     #1c2128;
    --border:        #30363d;
    --border-soft:   #21262d;

    /* Text */
    --text:          #e6edf3;
    --text-soft:     #adbac7;
    --text-muted:    #7d8590;

    /* Accents - Minecraft-inspired */
    --diamond:       #4dd0e1;   /* cyan diamond */
    --emerald:       #56d364;   /* emerald/grass */
    --gold:          #f0c24b;   /* gold ingot */
    --redstone:      #e5534b;   /* redstone */
    --lapis:         #58a6ff;   /* lapis blue */
    --amethyst:      #a78bfa;

    /* Semantic */
    --primary:       var(--emerald);
    --secondary:     var(--diamond);
    --accent:        var(--gold);

    /* Typography */
    --font-code:     "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --font-pixel:    "Press Start 2P", var(--font-code);
    --font-sans:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Layout */
    --container:     1180px;
    --radius:        10px;
    --radius-sm:     6px;
    --transition:    200ms ease;
}

/* =========================================================
   Base
   ========================================================= */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

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

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary); }

.accent { color: var(--primary); }

/* =========================================================
   Background layers
   ========================================================= */

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(86, 211, 100, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(86, 211, 100, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -2;
    mask-image: radial-gradient(ellipse at top, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at top, #000 0%, transparent 75%);
}

.bg-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(circle, rgba(77, 208, 225, 0.12), transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: -1;
}

/* =========================================================
   Nav
   ========================================================= */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--text);
    letter-spacing: 0.5px;
}
.nav-logo:hover { color: var(--primary); }

.nav-logo-block {
    width: 22px; height: 22px;
    background:
        linear-gradient(135deg, #7cb342 0%, #7cb342 50%, #5b8f2e 50%, #5b8f2e 100%),
        #7cb342;
    background-size: 100% 100%;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.35),
        inset 2px 2px 0 0 rgba(255, 255, 255, 0.2),
        inset -2px -2px 0 0 rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    position: relative;
}
.nav-logo-block::after {
    content: "";
    position: absolute;
    inset: 4px;
    background:
        radial-gradient(circle at 30% 30%, #8bc34a 2px, transparent 2.5px),
        radial-gradient(circle at 70% 60%, #689f38 2px, transparent 2.5px),
        radial-gradient(circle at 40% 75%, #7cb342 2px, transparent 2.5px);
}

.nav-logo-cursor {
    color: var(--primary);
    animation: blink 1s steps(1) infinite;
}

.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    display: inline-block;
    padding: 8px 14px;
    font-family: var(--font-code);
    font-size: 14px;
    color: var(--text-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-links a:hover {
    color: var(--primary);
    background: var(--bg-elev-2);
    border-color: var(--border);
}
.nav-symbol {
    color: var(--text-muted);
    margin-right: 2px;
}
.nav-links a:hover .nav-symbol { color: var(--primary); }

.nav-links a.is-active {
    color: var(--primary);
    background: var(--bg-elev-2);
    border-color: var(--border);
}
.nav-links a.is-active .nav-symbol { color: var(--primary); }

/* Konami creative mode easter egg */
body.creative-mode .nav-logo-block,
body.creative-mode .footer-block,
body.creative-mode .tl-dot {
    animation: rainbow 2s linear infinite;
}
@keyframes rainbow {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: transform var(--transition);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: var(--font-code);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(86, 211, 100, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3ea34b);
    border-color: #3ea34b;
    color: #0d1117;
}
.btn-primary:hover {
    color: #0d1117;
    background: linear-gradient(135deg, #6be078, #46b456);
    border-color: #6be078;
    box-shadow: 0 6px 18px rgba(86, 211, 100, 0.3);
}

.btn-ghost {
    background: transparent;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
    position: relative;
    padding: 80px 32px 60px;
    max-width: var(--container);
    margin: 0 auto;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-hello {
    font-family: var(--font-code);
    color: var(--primary);
    font-size: 14px;
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}

.hero-name {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 1;
}
.hero-name-small {
    font-family: var(--font-code);
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}
.hero-name-big {
    font-family: var(--font-pixel);
    font-size: clamp(36px, 6vw, 64px);
    color: var(--text);
    text-shadow:
        3px 3px 0 rgba(86, 211, 100, 0.25),
        6px 6px 0 rgba(77, 208, 225, 0.12);
    letter-spacing: 1px;
}
.hero-name-alias {
    font-family: var(--font-code);
    font-size: 14px;
    color: var(--secondary);
    margin-top: 6px;
}

.hero-role {
    font-family: var(--font-code);
    font-size: clamp(18px, 2.5vw, 22px);
    color: var(--text);
    margin: 20px 0 8px;
    min-height: 1.4em;
}
.blink {
    display: inline-block;
    color: var(--primary);
    animation: blink 1s steps(1) infinite;
}

.hero-sub {
    color: var(--text-soft);
    font-size: 16px;
    max-width: 520px;
    margin: 8px 0 28px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    padding-top: 24px;
    border-top: 1px dashed var(--border);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
    font-family: var(--font-pixel);
    font-size: 20px;
    color: var(--primary);
}
.stat-lbl {
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-muted);
}

.hero-scroll {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    animation: float 2.5s ease-in-out infinite;
}
.hero-scroll:hover { color: var(--primary); border-color: var(--primary); }

/* =========================================================
   Terminal
   ========================================================= */

.terminal {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(77, 208, 225, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-elev-3);
    border-bottom: 1px solid var(--border);
}
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-muted);
}

.terminal-body {
    padding: 18px 20px;
    font-family: var(--font-code);
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-soft);
}

.tline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tline.tout { color: var(--text); padding-left: 4px; }
.tprompt { color: var(--primary); }
.tcolon  { color: var(--text-muted); }
.tpath   { color: var(--secondary); }
.tdollar { color: var(--text-muted); margin: 0 6px 0 2px; }

.yml-key { color: var(--amethyst); }
.yml-str { color: var(--gold); }

/* =========================================================
   Sections
   ========================================================= */

.section {
    max-width: var(--container);
    margin: 0 auto;
    padding: 80px 32px;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}
.section-num {
    font-family: var(--font-code);
    font-size: 14px;
    color: var(--primary);
    letter-spacing: 1px;
}
.section-title {
    font-family: var(--font-pixel);
    font-size: clamp(22px, 3.5vw, 32px);
    margin: 0;
    color: var(--text);
    letter-spacing: 1px;
}
.bracket { color: var(--primary); }
.section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.section-lead {
    color: var(--text-soft);
    max-width: 680px;
    margin: -20px 0 36px;
}

/* =========================================================
   About
   ========================================================= */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-code .terminal { margin: 0; }

pre.code {
    margin: 0;
    padding: 20px 22px;
    font-family: var(--font-code);
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-soft);
    white-space: pre;
    overflow-x: auto;
}

.c-cmt { color: var(--text-muted); font-style: italic; }
.c-kw  { color: var(--redstone); }
.c-cls { color: var(--diamond); }
.c-var { color: var(--amethyst); }
.c-str { color: var(--emerald); }
.c-fn  { color: var(--lapis); }

.about-text p {
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 16px;
}
.about-text strong { color: var(--text); font-weight: 600; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-soft);
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all var(--transition);
}
.chip:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.chip i { color: var(--secondary); }
.chip:hover i { color: var(--primary); }

/* =========================================================
   Projects
   ========================================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}

.project {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(86, 211, 100, 0.2);
}

.project.featured {
    grid-column: span 2;
    border-color: rgba(77, 208, 225, 0.4);
}
.project.featured::before {
    content: "★ featured";
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    font-family: var(--font-code);
    font-size: 11px;
    color: var(--gold);
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--gold);
    border-radius: 4px;
    backdrop-filter: blur(6px);
}

.project-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-elev-3);
    cursor: zoom-in;
}
.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    transition: transform 500ms ease, filter var(--transition);
}
.project:hover .project-media img {
    transform: scale(1.04);
    filter: brightness(1.08);
}

.project-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-family: var(--font-code);
    font-size: 11px;
    color: var(--primary);
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(86, 211, 100, 0.4);
    border-radius: 4px;
    backdrop-filter: blur(6px);
    text-transform: lowercase;
}

.project-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.project-title {
    margin: 0;
    font-family: var(--font-pixel);
    font-size: 15px;
    color: var(--text);
    letter-spacing: 0.5px;
}
.project-desc {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.55;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    font-family: var(--font-code);
    font-size: 11px;
    padding: 3px 8px;
    color: var(--secondary);
    background: rgba(77, 208, 225, 0.08);
    border: 1px solid rgba(77, 208, 225, 0.2);
    border-radius: 3px;
}

.project-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* =========================================================
   Timeline
   ========================================================= */

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 70px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
    opacity: 0.5;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    padding: 12px 0 28px;
    align-items: start;
}

.tl-dot {
    position: absolute;
    left: 62px;
    top: 20px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: 3px solid var(--bg);
    box-shadow:
        0 0 0 2px var(--primary),
        0 0 20px rgba(86, 211, 100, 0.5);
    image-rendering: pixelated;
    z-index: 1;
}

.tl-year {
    font-family: var(--font-pixel);
    font-size: 13px;
    color: var(--secondary);
    padding-top: 16px;
    text-align: left;
}

.tl-card {
    padding: 18px 22px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.tl-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}
.tl-card h3 {
    margin: 0 0 6px;
    font-family: var(--font-code);
    font-size: 16px;
    color: var(--text);
}
.tl-card p {
    margin: 0 0 10px;
    color: var(--text-soft);
    font-size: 14px;
}
.tl-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tl-links a {
    font-family: var(--font-code);
    font-size: 12px;
    padding: 3px 8px;
    color: var(--secondary);
    background: rgba(77, 208, 225, 0.06);
    border: 1px solid rgba(77, 208, 225, 0.2);
    border-radius: 4px;
}
.tl-links a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(86, 211, 100, 0.08);
}

/* =========================================================
   Contact
   ========================================================= */

.contact-wrap { max-width: 900px; margin: 0 auto; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.contact-link i {
    font-size: 22px;
    color: var(--secondary);
    width: 24px;
    text-align: center;
}
.contact-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--bg-elev-3);
}
.contact-link:hover i { color: var(--primary); }

.contact-link > div { display: flex; flex-direction: column; line-height: 1.3; }
.contact-cmd {
    font-family: var(--font-code);
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}
.contact-desc {
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================================================
   Popup
   ========================================================= */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    backdrop-filter: blur(8px);
}
.popup-overlay.is-open { display: flex; }

.popup-content {
    position: relative;
    padding: 12px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 90vw;
    max-height: 90vh;
}
.popup-content img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: var(--radius-sm);
    image-rendering: pixelated;
}
.close-btn {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: var(--text);
    background: var(--bg-elev-3);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
}
.close-btn:hover {
    background: var(--redstone);
    border-color: var(--redstone);
    color: #fff;
    transform: rotate(90deg);
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
    margin-top: 40px;
    padding: 28px 32px;
    background: var(--bg-elev-1);
    border-top: 1px solid var(--border-soft);
}
.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--text);
    letter-spacing: 1px;
}
.footer-block {
    width: 16px; height: 16px;
    background: #7cb342;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.3),
        inset 2px 2px 0 rgba(255, 255, 255, 0.18);
}
.footer-meta {
    font-family: var(--font-code);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.footer-meta a { color: var(--text-soft); }
.footer-meta a:hover { color: var(--primary); }

/* =========================================================
   Animations
   ========================================================= */

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-6px); }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 30px; }
    .about-grid { grid-template-columns: 1fr; gap: 28px; }
    .project.featured { grid-column: span 1; }
}

@media (max-width: 720px) {
    .nav { padding: 14px 18px; }
    .nav-links {
        position: absolute;
        top: 100%;
        right: 18px;
        flex-direction: column;
        gap: 4px;
        padding: 10px;
        background: var(--bg-elev-2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        display: none;
        min-width: 180px;
    }
    .nav-links.is-open { display: flex; }
    .nav-toggle { display: flex; }

    .hero { padding: 48px 20px 40px; }
    .section { padding: 56px 20px; }

    .hero-stats { flex-wrap: wrap; gap: 18px; }

    .timeline::before { left: 8px; }
    .tl-item { grid-template-columns: 1fr; gap: 8px; padding-left: 30px; }
    .tl-dot { left: 0; top: 12px; }
    .tl-year { padding-top: 0; }

    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 460px) {
    .hero-name-big { font-size: 42px; }
    .btn { font-size: 13px; padding: 10px 14px; }
    .project-title { font-size: 13px; }
    pre.code { font-size: 12px; padding: 14px; }
}
