/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light (default) */
    --bg:          #ffffff;
    --bg-2:        #f5f5f7;
    --bg-3:        #e8e8ed;
    --text:        #1d1d1f;
    --text-2:      #6e6e73;
    --text-3:      #aeaeb2;
    --border:      #d2d2d7;
    --accent:      #0071e3;
    --accent-dark: #0077ed;
    --radius:      14px;
}

[data-theme="dark"] {
    --bg:          #000000;
    --bg-2:        #1c1c1e;
    --bg-3:        #2c2c2e;
    --text:        #f5f5f7;
    --text-2:      #98989d;
    --text-3:      #636366;
    --border:      #3a3a3c;
    --accent:      #2997ff;
    --accent-dark: #0a84ff;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============================================
   HEADER / NAV
   ============================================ */
header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

[data-theme="dark"] header {
    background: rgba(0,0,0,0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

nav {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 0;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    font-size: 0.82rem;
    color: var(--text-2);
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--bg-3);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.nav-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--accent);
    border-radius: 980px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-cv-btn:hover {
    background: var(--accent);
    color: #fff;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    font-size: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-3);
    color: var(--text);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    font-size: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hamburger:hover {
    background: var(--bg-3);
}

/* ============================================
   DRAWER (mobile)
   ============================================ */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-2);
    z-index: 1000;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
}

.drawer-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    font-size: 1.1rem;
    padding: 0.25rem;
}

.drawer-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    transition: background 0.2s;
}

.drawer-link:hover {
    background: var(--bg-3);
}

.drawer-cv {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--accent);
    color: #fff;
    border-radius: 980px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.drawer-cv:hover { opacity: 0.85; }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border-radius: 980px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover {
    opacity: 0.86;
    transform: scale(1.01);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: var(--accent);
    border-radius: 980px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
    background: var(--bg-2);
    border-color: var(--accent);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 7rem 2rem 5rem;
}

.hero-inner {
    max-width: 680px;
}

.eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.05rem;
    line-height: 1.72;
    color: var(--text-2);
    max-width: 560px;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.25rem;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-3);
}

.dot-sep { opacity: 0.5; }

.available-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #34c759;
    font-weight: 500;
}

.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34c759;
    animation: pulse-anim 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   STATS STRIP
   ============================================ */
.stats-strip {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stats-strip::-webkit-scrollbar { display: none; }

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 3rem;
    text-align: center;
    flex-shrink: 0;
}

.stat strong {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
}

.stat span {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-top: 0.25rem;
    white-space: nowrap;
}

.stat-sep {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 6rem 2rem;
    border-top: 1px solid var(--border);
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 0.6rem;
}

h2.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 3rem;
}

/* ============================================
   SKILLS TABLE
   ============================================ */
.skills-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.skill-row {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.18s;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row:hover {
    background: var(--bg-2);
}

.skill-category-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    min-width: 180px;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-items span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: 980px;
    transition: background 0.15s, color 0.15s;
}

.skill-row:hover .skill-items span {
    border-color: var(--accent);
}

/* ============================================
   TIMELINE (Experience)
   ============================================ */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl-item {
    display: flex;
    gap: 3rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
}

.tl-item:last-child {
    border-bottom: none;
}

.tl-left {
    min-width: 60px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.tl-year {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-3);
    letter-spacing: 0.04em;
}

.tl-right {
    flex: 1;
}

.tl-role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.tl-org {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-bottom: 0.5rem;
}

.tl-detail {
    font-size: 0.875rem;
    color: var(--text-3);
    line-height: 1.65;
    max-width: 560px;
}

/* ============================================
   EDUCATION
   ============================================ */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.edu-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.2s;
}

.edu-card:hover {
    border-color: var(--accent);
}

.edu-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.edu-flag {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.edu-uni {
    font-size: 0.975rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.edu-degree {
    font-size: 0.85rem;
    color: var(--text-2);
}

.edu-period {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.project-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    background: var(--bg-3);
}

.pc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
    border: 1px solid var(--border);
}

.pc-arrow {
    color: var(--text-3);
    font-size: 0.8rem;
    transition: color 0.2s, transform 0.2s;
    margin-top: 0.2rem;
}

.project-card:hover .pc-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.project-card h3 {
    font-size: 0.975rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-card p {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1.25rem;
}

.pc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pc-tags span {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 980px;
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.ach-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, background 0.2s;
}

.ach-card:hover {
    border-color: var(--accent);
    background: var(--bg-3);
}

.ach-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--accent);
    flex-shrink: 0;
}

.ach-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.ach-desc {
    font-size: 0.82rem;
    color: var(--text-3);
    line-height: 1.55;
}

/* ============================================
   CONTACT STRIP
   ============================================ */
.contact-strip {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 5rem 2rem;
}

.contact-strip h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.contact-strip p {
    font-size: 1rem;
    color: var(--text-2);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.contact-strip-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 2rem;
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-3);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-3);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    padding: 2.5rem;
    position: relative;
    transform: scale(0.97) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-overlay.open .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--bg-3);
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-2);
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: var(--accent);
    color: #fff;
}

.modal-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.modal-card p {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.modal-tags {
    font-size: 0.8rem !important;
    color: var(--text-3) !important;
    margin-bottom: 1.75rem !important;
}

/* ============================================
   REVEAL ANIMATION
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .hero { padding: 4rem 1.5rem 3rem; }
    .section { padding: 4rem 1.5rem; }
    .stat { padding: 1.5rem 1.75rem; }
    .tl-item { flex-direction: column; gap: 0.5rem; }
    .tl-left { min-width: auto; }
    .skill-row { flex-direction: column; gap: 0.75rem; }
    .skill-category-name { min-width: auto; }
    .edu-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    nav { padding: 0 1.25rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.25rem; }
    .stats-strip { justify-content: flex-start; }
}
