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

/* ── Design tokens ───────────────────────────────────── */
:root {
    --bg:         #1a1b26;
    --bg-2:       #16161e;
    --bg-3:       #1f2335;
    --win-bar:    #15161e;
    --border:     #292e42;
    --border-2:   #3b4261;
    --text:       #c0caf5;
    --text-2:     #787c99;
    --text-3:     #565f89;
    --green:      #9ece6a;
    --blue:       #7aa2f7;
    --cyan:       #7dcfff;
    --purple:     #bb9af7;
    --red:        #f7768e;
    --yellow:     #e0af68;
    --orange:     #ff9e64;
    --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body, html {
    margin: 0; padding: 0; width: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Terminal Nav ────────────────────────────────────── */
.apple-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21,22,30,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.apple-nav-inner {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 44px;
}
.nav-logo {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--green);
    text-decoration: none;
    letter-spacing: 0;
}
.nav-logo::before { content: '~/'; color: var(--text-2); }

.nav-links-top {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links-top a {
    font-family: var(--font);
    font-size: 0.78rem;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links-top a::before { content: './'; color: var(--text-3); }
.nav-links-top a:hover { color: var(--cyan); }

/* ── Hero / Terminal Window ──────────────────────────── */
.content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 100px 44px 80px;
    background: var(--bg);
    max-width: 100%;
    margin: 0;
    text-align: left;
}

.term-window {
    width: 100%;
    max-width: 860px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
}

.term-titlebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--win-bar);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.term-dots { display: flex; gap: 7px; }
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.term-title {
    font-size: 0.75rem;
    color: var(--text-3);
    margin: 0 auto;
    letter-spacing: 0.02em;
}

.term-body {
    padding: 24px 28px 28px;
    line-height: 1.7;
}

/* Prompt line */
.term-line {
    font-size: 0.88rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}
.t-user   { color: var(--green); font-weight: 600; }
.t-at     { color: var(--text-3); }
.t-host   { color: var(--green); font-weight: 600; }
.t-sep    { color: var(--text-3); }
.t-path   { color: var(--blue); }
.t-dollar { color: var(--purple); font-weight: 600; }
.t-cmd    { color: var(--text); }

/* Output block inside terminal */
.term-output {
    padding: 12px 0 6px 0;
    margin-bottom: 16px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 0;
    margin-bottom: 16px;
}

h1 {
    color: var(--cyan);
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 8px 0 4px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 0 40px rgba(125,207,255,0.25);
}

h2 {
    color: var(--text-2);
    font-size: 1rem;
    margin: 0 0 20px;
    font-weight: 400;
    letter-spacing: 0;
}
h2::before { content: '// '; color: var(--text-3); }

/* Blinking cursor */
.term-cursor-line { margin-top: 8px; }
.cursor {
    display: inline-block;
    width: 9px;
    height: 1.1em;
    background: var(--green);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1.2s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Social links */
.social-links {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
    text-decoration: none;
    padding: 6px 14px;
    background: var(--bg-2);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    font-size: 0.8rem;
    font-family: var(--font);
}
.social-link::before { content: '['; color: var(--text-3); }
.social-link::after  { content: ']'; color: var(--text-3); }
.social-link:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(125,207,255,0.07); transform: none; box-shadow: none; }
.social-link svg { width: 14px; height: 14px; }

/* Terminal resume output block */
.term-resume-output {
    padding: 6px 0 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.term-resume-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font);
    font-size: 0.84rem;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    width: fit-content;
}
.term-resume-link:hover { background: rgba(125,207,255,0.08); }
.t-arrow   { color: var(--green); font-weight: 700; }
.t-res-cmd { color: var(--cyan); font-weight: 600; min-width: 36px; }
.t-res-desc { color: var(--text-3); }
.term-resume-link:hover .t-res-desc { color: var(--text-2); }

/* Resume button / card (legacy — kept for JS compat, hidden) */
.resume-btn-container { display: none; }
.resume-card          { display: none; }

/* ── Explore Section ─────────────────────────────────── */
/* ── Section command headers ─────────────────────────── */
.section-cmd {
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text-2);
    margin-bottom: 32px;
    padding: 10px 16px;
    background: var(--bg-3);
    border-left: 3px solid var(--green);
    border-radius: 0 6px 6px 0;
    display: inline-block;
}
.section-cmd .t-dollar { color: var(--green); font-weight: 700; margin-right: 6px; }
.section-cmd .t-cmd-text { color: var(--text); }

/* ── About ───────────────────────────────────────────── */
.about-section {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 90px 44px;
    margin-top: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: none;
}
.about-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 48px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
}
.about-top-row { display: flex; align-items: flex-start; gap: 52px; }
.about-photo { flex-shrink: 0; }
.about-photo-left { order: 1; }
.about-bio { flex: 1; order: 2; }
.about-photo-right { order: 3; }
.about-img {
    width: 180px; height: 240px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transition: transform 0.3s, border-color 0.3s;
    filter: grayscale(15%);
}
.about-img:hover { transform: scale(1.02); border-color: var(--cyan); filter: grayscale(0%); }
.about-bio h3 {
    color: var(--cyan);
    font-size: 1.4rem;
    margin: 0 0 20px;
    font-weight: 600;
    letter-spacing: 0;
}
.about-bio h3::before { content: '## '; color: var(--text-3); font-weight: 400; }
.about-bio p, .bio-text {
    color: var(--text-2);
    font-size: 0.88rem;
    line-height: 1.85;
    text-align: left;
    font-weight: 400;
}
.bio-text strong { color: var(--cyan); font-weight: 600; }

/* Quote */
.quote-container {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-left: 3px solid var(--purple);
    border-radius: 0 8px 8px 0;
    padding: 24px 28px;
    max-width: 700px;
    margin: 0;
    box-shadow: none;
    backdrop-filter: none;
    animation: none;
    transition: none;
}
.quote-container:hover { transform: none; box-shadow: none; border-color: var(--border); border-left-color: var(--purple); }
.quote-text { position: relative; }
.quote-content {
    display: block;
    color: var(--text-2);
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 10px;
    animation: none;
    font-weight: 400;
}
.quote-content::before { content: '"'; color: var(--purple); font-size: 1.2rem; line-height: 0; vertical-align: -0.2em; margin-right: 4px; }
.quote-author {
    text-align: right;
    color: var(--text-3);
    font-weight: 400;
    font-size: 0.8rem;
    animation: none;
    opacity: 0;
}

/* Education / Work */
.about-bottom-row { display: flex; gap: 20px; }
.info-section {
    flex: 1;
    padding: 28px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.info-section:hover { border-color: var(--border-2); box-shadow: 0 4px 24px rgba(0,0,0,0.3); transform: none; }
.info-section h4 {
    color: var(--yellow);
    font-size: 0.72rem;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: left;
    font-weight: 600;
}
.info-section h4::before { content: '// '; color: var(--text-3); text-transform: none; letter-spacing: 0; }
.info-item { margin-bottom: 14px; }
.info-item:last-child { margin-bottom: 0; }
.education-section .info-item { display: flex; align-items: center; gap: 16px; }
.education-section .info-logo { width: 48px; height: 48px; object-fit: contain; background: rgba(255,255,255,0.05); padding: 6px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; box-shadow: none; }
.education-section .info-content { display: flex; flex-direction: column; text-align: left; }
.info-logo { width: 48px; height: 48px; object-fit: contain; background: rgba(255,255,255,0.05); padding: 6px; border-radius: 6px; border: 1px solid var(--border); box-shadow: none; }
.info-title { color: var(--text); font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; text-align: left; }
.info-subtitle { color: var(--text-2); font-size: 0.82rem; margin-bottom: 2px; text-align: left; font-weight: 400; }
.education-section .info-subtitle, .education-section .info-date { text-align: left; }
.info-date { color: var(--text-3); font-size: 0.78rem; font-style: normal; text-align: left; }

/* ── Skills Showcase ─────────────────────────────────── */
.skills-showcase {
    margin: 60px auto 0;
    padding: 0;
    text-align: left;
    max-width: 1200px;
    width: 100%;
}
.skills-showcase h3 {
    color: var(--cyan);
    font-size: 1.4rem;
    margin-bottom: 36px;
    font-weight: 600;
    letter-spacing: 0;
}
.skills-showcase h3::before { content: '## '; color: var(--text-3); font-weight: 400; }
.skills-category { margin-top: 40px; }
.skills-category:first-child { margin-top: 0; }
.skills-category h4 {
    color: var(--yellow);
    font-size: 0.72rem;
    margin-bottom: 18px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.skills-category h4::before { content: '# '; color: var(--text-3); text-transform: none; letter-spacing: 0; }
.category-icons { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-2);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.skill-icon:hover { background: rgba(125,207,255,0.08); border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(125,207,255,0.15); }
.skill-icon svg { width: 26px; height: 26px; transition: none; }
.skill-icon:hover svg { transform: none; filter: none; }
.skill-icon::after {
    content: attr(title);
    position: absolute;
    bottom: -32px; left: 50%;
    transform: translateX(-50%);
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100; pointer-events: none;
}
.skill-icon:hover::after { opacity: 1; visibility: visible; }

/* ── Projects ────────────────────────────────────────── */
.projects-section {
    background: var(--bg-2);
    padding: 90px 44px;
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-top: 1px solid var(--border);
    border-bottom: none;
}
.projects-content { max-width: 1200px; width: 100%; text-align: left; }
.projects-content h3 {
    color: var(--cyan);
    font-size: 1.5rem;
    margin: 0 0 8px;
    font-weight: 600;
}
.projects-content h3::before { content: '## '; color: var(--text-3); font-weight: 400; }
.projects-subtitle { color: var(--text-2); font-size: 0.85rem; font-weight: 400; margin-bottom: 36px; font-style: normal; }
.projects-subtitle::before { content: '// '; color: var(--text-3); }

/* Filter buttons */
.filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.filter-btn {
    padding: 6px 16px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
    transition: all 0.2s;
    font-family: var(--font);
    white-space: nowrap;
}
.filter-btn::before { content: '['; color: var(--text-3); }
.filter-btn::after  { content: ']'; color: var(--text-3); }
.filter-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(125,207,255,0.07); transform: none; }
.filter-btn.active { background: rgba(125,207,255,0.1); color: var(--cyan); border-color: var(--cyan); box-shadow: none; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 0; }

.project-card {
    background: var(--bg-3);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    animation: none;
}
.project-card::before {
    content: '';
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    opacity: 0;
    transition: opacity 0.2s;
}
.project-card.hidden { display: none; }
.project-card:hover { border-color: var(--border-2); box-shadow: 0 8px 32px rgba(0,0,0,0.3); transform: translateY(-2px); background: var(--bg-3); }
.project-card:hover::before { opacity: 1; }

.project-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.project-header > div { text-align: left; flex: 1; }
.project-github-icon { color: var(--text-3); transition: color 0.2s; flex-shrink: 0; padding: 4px; border-radius: 4px; background: transparent; }
.project-github-icon:hover { color: var(--cyan); background: transparent; transform: none; }
.project-title { color: var(--blue); font-size: 1rem; margin: 0; font-weight: 600; line-height: 1.3; }
.project-title::before { content: '> '; color: var(--text-3); font-weight: 400; }
.project-subtitle-small { color: var(--text-3); font-size: 0.78rem; margin: 4px 0 0; font-style: normal; }
.project-subtitle-small::before { content: '// '; }
.project-description { color: var(--text-2); line-height: 1.7; margin: 0; font-size: 0.82rem; text-align: left; font-weight: 400; }
.project-tech { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tag { background: rgba(122,162,247,0.1); color: var(--blue); padding: 3px 10px; border-radius: 4px; font-size: 0.72rem; font-weight: 500; border: 1px solid rgba(122,162,247,0.25); transition: all 0.15s; }
.tech-tag:hover { background: rgba(122,162,247,0.2); border-color: var(--blue); transform: none; }

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .about-top-row { flex-direction: column; align-items: flex-start; gap: 28px; }
    .about-photo-right { display: none; }
    .about-bottom-row { flex-direction: column; gap: 16px; }
    .category-icons { justify-content: flex-start; }
    .projects-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* Mobile landscape / large phones */
@media (max-width: 768px) {
    /* Nav */
    .apple-nav-inner { padding: 0 20px; }
    .nav-links-top { display: none; }

    /* Hero */
    .content { padding: 72px 16px 48px; align-items: flex-start; }
    .term-window { border-radius: 8px; }
    .term-titlebar { padding: 10px 12px; }
    .term-title { font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
    .term-body { padding: 14px 14px 18px; }
    .term-line { font-size: 0.72rem; }

    /* Hide @macbook on small screens to keep prompt short */
    .t-at, .t-host { display: none; }

    h1 { font-size: clamp(1.6rem, 8vw, 2.4rem); }
    h2 { font-size: 0.85rem; }

    .social-links { gap: 8px; }
    .social-link { font-size: 0.72rem; padding: 5px 10px; }
    .resume-btn { font-size: 0.75rem; padding: 7px 14px; }

    /* Sections */
    .about-section { padding: 60px 20px; }
    .projects-section { padding: 60px 20px; }

    /* Section cmd */
    .section-cmd { display: block; width: 100%; font-size: 0.78rem; padding: 8px 12px; margin-bottom: 24px; }

    /* About */
    .about-top-row { flex-direction: column; gap: 20px; }
    .about-img { width: 140px; height: 185px; }
    .about-bio h3 { font-size: 1.1rem; }
    .about-bio p, .bio-text { font-size: 0.82rem; }
    .about-content { gap: 32px; }
    .info-section { padding: 20px; }
    .info-section h4 { font-size: 0.65rem; }
    .info-title { font-size: 0.82rem; }
    .info-subtitle { font-size: 0.78rem; }

    /* Skills */
    .skills-showcase { margin-top: 40px; }
    .skills-showcase h3 { font-size: 1.1rem; margin-bottom: 24px; }
    .skills-category { margin-top: 28px; }
    .skill-icon { width: 48px; height: 48px; }
    .skill-icon svg { width: 22px; height: 22px; }
    /* Disable tooltip on touch */
    .skill-icon::after { display: none; }

    /* Quote */
    .quote-container { padding: 18px 20px; }
    .quote-content { font-size: 0.82rem; }

    /* Projects */
    .projects-grid { grid-template-columns: 1fr; gap: 12px; }
    .projects-content h3 { font-size: 1.2rem; }
    .filter-buttons { gap: 6px; margin-bottom: 24px; }
    .filter-btn { font-size: 0.7rem; padding: 5px 10px; }
    .project-card { padding: 18px; gap: 10px; }
    .project-title { font-size: 0.9rem; }
    .project-description { font-size: 0.78rem; }
    .tech-tag { font-size: 0.65rem; padding: 2px 8px; }

    /* Categories */
    .categories-content h3 { font-size: 1.2rem; }
    .navigation-links { gap: 8px; }
    .nav-link { font-size: 0.78rem; padding: 9px 16px; }

    /* Gallery */
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-overlay { transform: translateY(0); }
    .gallery-content h3 { font-size: 1.2rem; }

    /* Resume card - anchor to left edge and open upward */
    .resume-card { min-width: 180px; }
}

/* Small phones */
@media (max-width: 480px) {
    .content { padding: 64px 12px 40px; }
    .term-body { padding: 12px 12px 16px; }
    .term-line { font-size: 0.68rem; }

    h1 { font-size: clamp(1.4rem, 9vw, 2rem); }

    .navigation-links { flex-direction: column; align-items: flex-start; }
    .nav-link { width: 100%; }

    .gallery-grid { grid-template-columns: 1fr; }

    .social-link { font-size: 0.68rem; padding: 5px 8px; }
    .social-links { gap: 6px; }

    .about-img { width: 120px; height: 155px; }

    .project-card { padding: 14px; }
    .filter-btn { font-size: 0.65rem; padding: 4px 8px; }

    /* Resume card stays visible within viewport */
    .resume-card { left: 0; right: auto; min-width: 170px; }
}
