/* ================================================================
   SanaUllah — Portfolio CSS (Monochrome Editorial Redesign)
   Inspired by samsonzhang.com — containers/layout untouched.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ================================================================
   DESIGN TOKENS — LIGHT (default)
   ================================================================ */
:root {
    --bg:           #ffffff;
    --bg-alt:       #fafafa;
    --surface:      #ffffff;
    --surface2:     #f5f5f5;
    --surface3:     #ededed;
    --border:       #e8e8e8;
    --border-hover: #d2d2d2;
    --border-active:#b5b5b5;

    --accent:       #16a34a;
    --accent-light: #22c55e;
    --accent-dim:   rgba(17,17,20,0.05);
    --green:        #16a34a;
    --green-dim:    rgba(22,163,74,0.06);

    --text:         #111114;
    --text-soft:    #2f2f36;
    --text-muted:   #5f5f66;
    --text-dim:     #9999a0;

    --solid:        #111114;
    --on-solid:     #ffffff;

    --shadow-sm:    0 1px 2px rgba(17,17,20,0.04);
    --shadow:       0 8px 30px rgba(17,17,20,0.08);
    --shadow-lg:    0 18px 60px rgba(17,17,20,0.12);

    --blob1:        rgba(17,17,20,0.07);
    --blob2:        rgba(17,17,20,0.04);

    --radius-sm:    4px;
    --radius:       8px;
    --radius-lg:    12px;
    --radius-xl:    16px;

    --transition:   0.22s ease;
    --font:         'DM Sans', system-ui, -apple-system, sans-serif;
    --serif:        'DM Serif Display', Georgia, serif;

    color-scheme: light;
}

/* ================================================================
   DESIGN TOKENS — DARK
   ================================================================ */
[data-theme="dark"] {
    --bg:           #0b0b0d;
    --bg-alt:       #101013;
    --surface:      #151518;
    --surface2:     #1a1a1e;
    --surface3:     #24242a;
    --border:       #26262c;
    --border-hover: #3a3a44;
    --border-active:#565663;

    --accent:       #4ade80;
    --accent-light: #86efac;
    --accent-dim:   rgba(237,237,240,0.07);
    --green:        #4ade80;
    --green-dim:    rgba(74,222,128,0.10);

    --text:         #ededf0;
    --text-soft:    #c9c9d1;
    --text-muted:   #8a8a94;
    --text-dim:     #52525c;

    --solid:        #ededf0;
    --on-solid:     #0b0b0d;

    --shadow-sm:    0 1px 2px rgba(0,0,0,0.3);
    --shadow:       0 8px 30px rgba(0,0,0,0.35);
    --shadow-lg:    0 18px 60px rgba(0,0,0,0.5);

    --blob1:        rgba(255,255,255,0.07);
    --blob2:        rgba(255,255,255,0.04);

    color-scheme: dark;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* Per-section centered editorial colour blob (CSS-only, no extra markup) */
section {
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(70vw, 640px);
    height: min(70vw, 640px);
    background: radial-gradient(circle, var(--blob1), transparent 62%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

section .container,
#hero .hero-content,
#hero .scroll-indicator {
    position: relative;
    z-index: 1;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition), text-decoration-color var(--transition); }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: var(--text-dim); }
a.btn, a.btn:hover, a.nav-item, a.nav-item:hover, a.nav-logo, a.nav-logo:hover,
a.overlay-btn, a.overlay-btn:hover, .hero-socials a, .hero-socials a:hover,
a.contact-card, a.contact-card:hover, a.exp-company, a.scroll-indicator, a.scroll-indicator:hover,
a.badge, a.badge:hover { text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

/* ================================================================
   READING PROGRESS BAR
   ================================================================ */
#progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--solid);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ================================================================
   SELECTION
   ================================================================ */
::selection { background: var(--accent-dim); color: var(--text); }

/* ================================================================
   CUSTOM SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--solid); }

/* ================================================================
   THEME TOGGLE
   ================================================================ */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--solid);
    color: var(--solid);
    background: var(--accent-dim);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
:root .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ================================================================
   NAVBAR
   ================================================================ */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    transition: all 0.4s ease;
    padding: 1.5rem 0;
}

#navbar.scrolled {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
}
[data-theme="dark"] #navbar.scrolled {
    background: rgba(11,11,14,0.92);
}

.nav-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 400;
    color: var(--text);
    white-space: nowrap;
    position: relative;
    padding: 0.25rem 0;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; color: var(--text); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-item {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    color: var(--text);
    background: var(--accent-dim);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 50%;
    height: 2px;
    background: var(--solid);
    border-radius: 2px;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-item:hover::after,
.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
}

.btn-resume {
    border: 1px solid var(--solid) !important;
    color: var(--accent) !important;
    margin-left: 0.5rem;
    background: transparent !important;
    border-radius: var(--radius-sm) !important;
}
.btn-resume::after { display: none !important; }
.btn-resume:hover {
    background: var(--solid) !important;
    color: var(--on-solid) !important;
    transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.4rem;
    z-index: 1100;
}
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text-soft);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================
   SECTIONS
   ================================================================ */
.section { padding: 150px 0; }

.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.section-title {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-align: left;
    color: var(--text);
    margin-bottom: 3.5rem;
    position: relative;
    padding-bottom: 0.6rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 3px;
    background: var(--solid);
    border-radius: 2px;
}
.section-title::after { display: none; }

.section-title .section-num {
    font-family: var(--font);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}

/* ================================================================
   HERO
   ================================================================ */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 7rem 2rem 6rem;
    background: var(--bg);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.7rem;
    max-width: 780px;
    width: 100%;
    animation: heroFadeIn 1s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar — quiet editorial headshot */
.hero-avatar-wrap {
    position: relative;
    width: 190px; height: 190px;
    flex-shrink: 0;
}

#hero-avatar {
    width: 190px; height: 190px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    position: relative;
    z-index: 2;
    transition: transform 0.5s ease, border-color 0.3s ease;
}
#hero-avatar:hover {
    transform: scale(1.02);
    border-color: var(--solid);
}

.avatar-ring,
.avatar-ring-2,
.avatar-ring-3 {
    display: none;
}

/* Hero text */
.hero-text { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }

.hero-greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-name {
    font-family: var(--serif);
    font-size: clamp(3rem, 9vw, 5.4rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.05;
    color: var(--text);
}

.hero-typed-wrap {
    font-family: var(--font);
    font-size: clamp(0.9rem, 2.2vw, 1.05rem);
    color: var(--accent);
    min-height: 2em;
    padding: 0.35rem 1.1rem;
    display: inline-block;
    position: relative;
}

.cursor {
    display: inline-block;
    font-weight: 400;
    color: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 400;
}

/* CTA buttons */
.hero-cta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--solid);
    color: var(--on-solid);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--on-solid);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-soft);
}
.btn-outline:hover {
    border-color: var(--solid);
    color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-2px);
}

/* Social icons */
.hero-socials {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.hero-socials a {
    width: 46px; height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.98rem;
    border-bottom: 2px solid var(--border);
    transition: all 0.25s ease;
}
.hero-socials a:hover {
    color: var(--solid);
    border-color: var(--solid);
    transform: translateY(-2px);
}

/* Scroll chevron */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-dim);
    font-size: 1rem;
    animation: floatDown 2.5s ease-in-out infinite;
    z-index: 1;
    transition: color var(--transition);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
}
.scroll-indicator:hover { color: var(--solid); }

@keyframes floatDown {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
    50%       { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ================================================================
   ABOUT
   ================================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: start;
}

.about-text h3 {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    font-weight: 400;
    margin-bottom: 1.4rem;
    color: var(--text);
    line-height: 1.2;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.15rem;
    line-height: 1.9;
    font-size: 1rem;
}

.about-text blockquote {
    position: relative;
    border-left: 2px solid var(--solid);
    padding: 1.1rem 1.4rem;
    margin: 1.75rem 0;
    background: var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.7;
}
.about-text blockquote::before {
    content: '\201C';
    position: absolute;
    top: -0.5rem;
    left: 0.8rem;
    font-size: 3rem;
    color: var(--solid);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.about-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.22s ease;
}
.badge:hover {
    color: var(--text);
}
.badge i { color: var(--solid); font-size: 0.8rem; }

/* Stat cards */
.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: sticky;
    top: 100px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.stat-card {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 1.9rem 1.4rem;
    text-align: left;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-card:hover {
    background: var(--accent-dim);
}

.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 3rem;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
    letter-spacing: 0.01em;
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
}

/* ================================================================
   SKILLS
   ================================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.2rem 3rem;
}

.skill-category {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border);
    transition: border-color 0.3s ease;
    position: relative;
}

.skill-category:hover { border-top-color: var(--solid); }

.skill-category h4 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.skill-category h4 i { color: var(--solid); font-size: 0.75rem; }

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.skill-tags span {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
    cursor: default;
    line-height: 1.9;
}
.skill-tags span + span::before {
    content: '·';
    margin: 0 0.5rem;
    color: var(--text-dim);
}
.skill-tags span:hover { color: var(--accent); }

/* ================================================================
   PROJECTS
   ================================================================ */
.year-group { margin-bottom: 5rem; }

.year-label {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 2.2rem;
}
.year-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.year-label span {
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    white-space: nowrap;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.6rem 1.8rem;
}

.project-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: none;
    box-shadow: none;
}

.project-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--surface2);
    border-radius: var(--radius);
}

.project-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-card:hover .project-img-wrap img { transform: scale(1.03); }

.project-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(to top, rgba(15,15,20,0.6), rgba(15,15,20,0.1) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.1rem;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay { opacity: 1; }

.overlay-btn {
    background: var(--solid);
    color: var(--on-solid);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    transform: translateY(10px);
    opacity: 0;
}
.project-card:hover .overlay-btn {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease 0.05s;
}
.overlay-btn:hover {
    background: var(--solid);
    color: var(--on-solid);
}

.project-info {
    padding: 1.3rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.project-info h3 {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.25;
}

.project-info p {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: auto;
    padding-top: 0.55rem;
    border-top: none;
}

.project-tags span {
    font-size: 0.8rem;
    font-family: var(--font);
    background: transparent;
    color: var(--text-dim);
    border-radius: 0;
    padding: 0;
    border: none;
    letter-spacing: 0.02em;
    font-weight: 500;
}
.project-tags span + span::before {
    content: '·';
    margin: 0 0.45rem;
    color: var(--text-dim);
}

/* ================================================================
   EXPERIENCE SNAKE LAYOUT
   ================================================================ */
.exp-snake {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.exp-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
}

.exp-row-reverse {
    direction: rtl;
}
.exp-row-reverse .exp-card {
    direction: ltr;
}

.exp-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.exp-card:hover {
    transform: none;
    box-shadow: none;
}

.exp-card-thumb {
    width: 100%;
    height: 150px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface2);
    border: 1px solid var(--border);
}

.exp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.5s ease;
}
.exp-card:hover .exp-card-thumb img {
    transform: scale(1.04);
}

.exp-thumb-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.exp-thumb-duo img { border-radius: var(--radius-sm); }

.exp-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    position: relative;
}

.exp-card-body h3 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text);
}

.exp-company {
    font-size: 0.74rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.exp-company::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
}

.exp-date {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Connectors & Z-Pattern Snake */
.exp-row::before {
    content: '';
    position: absolute;
    top: 78px;
    left: var(--card-center, 16.66%);
    right: var(--card-center, 16.66%);
    height: 2px;
    background: var(--solid);
    z-index: 1;
    border-radius: 2px;
    opacity: 0.16;
}

.exp-row:not(.exp-row-reverse):not(:last-child)::after {
    content: '';
    position: absolute;
    top: 78px;
    right: calc(var(--card-center, 16.66%) - 140px);
    width: 140px;
    bottom: calc(-3rem - 78px - 2px);
    border: 2px solid var(--solid);
    border-left: none;
    border-top-right-radius: 250px;
    border-bottom-right-radius: 250px;
    z-index: 1;
    opacity: 0.16;
}

.exp-row.exp-row-reverse:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 78px;
    left: calc(var(--card-center, 16.66%) - 140px);
    width: 140px;
    bottom: calc(-3rem - 78px - 2px);
    border: 2px solid var(--solid);
    border-right: none;
    border-top-left-radius: 250px;
    border-bottom-left-radius: 250px;
    z-index: 1;
    opacity: 0.16;
}

.exp-connector {
    display: none !important;
}

/* Response for Snake */
@media (max-width: 992px) {
    .exp-row { grid-template-columns: 1fr; }
    .exp-connector { display: none; }
    .exp-row-reverse { direction: ltr; }

    .exp-snake::before {
        content: '';
        position: absolute;
        top: 78px;
        bottom: 50px;
        left: 50%;
        width: 2px;
        background: var(--solid);
        transform: translateX(-50%);
        opacity: 0.14;
        z-index: 1;
    }
    .exp-row::before, .exp-row::after {
        display: none !important;
    }
}

/* Mobile Performance & Smoothness Enhancements */
@media (max-width: 640px) {
    .exp-card:hover, .project-card:hover, .stat-card:hover, .highlight-card:hover, .cert-card:hover {
        transform: none !important;
    }
    #navbar.scrolled {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ================================================================
   LIGHTBOX
   ================================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15,15,20,0.94);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--solid);
    transform: scale(1.1) rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================================================
   CERTIFICATES
   ================================================================ */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 2.2rem 1.6rem;
}

.cert-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}
.cert-card:hover {
    transform: none;
    box-shadow: none;
}

.cert-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cert-card:hover img { transform: scale(1.02); }

.cert-label {
    padding: 0.8rem 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    text-align: left;
    border-top: none;
}

/* ================================================================
   HIGHLIGHTS
   ================================================================ */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.4rem 1.6rem;
}

.highlight-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}
.highlight-card:hover {
    transform: none;
    box-shadow: none;
}

/* Single-image highlight */
.hl-imgs {
    position: relative;
    overflow: hidden;
    background: var(--bg);
    aspect-ratio: 16/9;
    border-radius: var(--radius);
}

.hl-imgs img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.5s ease;
}
.highlight-card:hover .hl-imgs img { transform: scale(1.03); }

/* Highlight Carousel */
.hl-carousel {
    position: relative;
}

.hl-carousel .hl-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.hl-carousel .hl-slide.active {
    opacity: 1;
    position: relative;
    z-index: 2;
}

/* Carousel nav arrows */
.hl-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(15,15,20,0.5);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.25s ease;
}
.hl-carousel-btn.hl-prev { left: 8px; }
.hl-carousel-btn.hl-next { right: 8px; }
.highlight-card:hover .hl-carousel-btn {
    opacity: 1;
}
.hl-carousel-btn:hover {
    background: var(--solid);
    border-color: var(--solid);
    color: var(--on-solid);
    transform: translateY(-50%) scale(1.1);
}

/* Carousel dots */
.hl-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 6px;
}

.hl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}
.hl-dot.active {
    background: var(--solid);
    border-color: var(--solid);
    transform: scale(1.2);
}
.hl-dot:hover:not(.active) {
    background: rgba(255,255,255,0.4);
    transform: scale(1.15);
}

.hl-info {
    padding: 0.95rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-top: none;
    position: relative;
    z-index: 1;
}

.hl-info h3 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text);
}

.hl-year {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    transition: color 0.25s ease;
}
.highlight-card:hover .hl-year {
    color: var(--accent);
}

/* ================================================================
   CONTACT
   ================================================================ */
.contact-sub {
    text-align: center;
    color: var(--text-muted);
    max-width: 560px;
    margin: -1.5rem auto 3rem;
    line-height: 1.8;
    font-size: 1rem;
}

.contact-grid { display: flex; justify-content: center; }

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    max-width: 720px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.contact-card {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-card i {
    font-size: 1.5rem;
    color: var(--solid);
    transition: color 0.3s ease;
}

.contact-card:hover {
    border-right-color: var(--solid);
    color: var(--text);
    background: var(--accent-dim);
}

.resume-card {
    border: 1px solid var(--solid) !important;
    background: transparent;
    grid-column: 1 / -1;
    padding: 1.4rem;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}
.resume-card i { font-size: 1.2rem; }
.resume-card:hover { background: var(--solid); color: var(--on-solid); }
.resume-card:hover i { color: var(--on-solid); }

/* ================================================================
   FOOTER
   ================================================================ */
#footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 3.5rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.footer-copy {
    font-size: 0.74rem;
    color: var(--text-dim);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.footer-heart {
    color: var(--accent);
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25%       { transform: scale(1.3); }
    50%       { transform: scale(1.1); }
}

/* ================================================================
   BACK TO TOP
   ================================================================ */
#back-to-top {
    position: fixed;
    bottom: 2.25rem;
    right: 2.25rem;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: all 0.3s ease;
    z-index: 999;
}
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
#back-to-top:hover {
    background: var(--solid);
    border-color: var(--solid);
    color: var(--on-solid);
    transform: translateY(-3px);
}

/* ================================================================
   SCROLL REVEAL
   ================================================================ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.projects-grid .project-card:nth-child(2) { transition-delay: 0.07s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.14s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.21s; }
.certs-grid .cert-card:nth-child(2) { transition-delay: 0.06s; }
.certs-grid .cert-card:nth-child(3) { transition-delay: 0.12s; }
.certs-grid .cert-card:nth-child(4) { transition-delay: 0.18s; }
.highlights-grid .highlight-card:nth-child(2) { transition-delay: 0.07s; }
.highlights-grid .highlight-card:nth-child(3) { transition-delay: 0.14s; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-stats { position: static; }
    .contact-cards { grid-template-columns: repeat(2, 1fr); }
    .resume-card { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg);
        backdrop-filter: blur(16px);
        padding: 1rem 1.25rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.2rem;
    }
    .nav-links.open { display: flex; }
    .nav-item { text-align: center; padding: 0.65rem; }

    .timeline::before { left: 10px; }
    .timeline-item { padding-left: 40px; }
    .timeline-dot { left: 2px; width: 14px; height: 14px; }
    .timeline-card::before { display: none; }
    .tl-header { flex-direction: column; gap: 0.5rem; }

    .section { padding: 110px 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .certs-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
    .highlights-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .contact-cards { grid-template-columns: 1fr 1fr; }
    .resume-card { flex-direction: column; gap: 0.5rem; }
    .hero-cta { flex-direction: column; align-items: center; }
    .certs-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .stat-num { font-size: 2.4rem; }
}
