:root {
    --bg: #f9fafb;
    --ink: #111827;
    --muted: #4b5563;
    --card: #ffffff;
    --border: rgba(17, 24, 39, 0.14);
    --accent: #1f2937;
    --accent-2: #374151;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    --header-bg: rgba(249, 250, 251, 0.9);
    --hero-background: linear-gradient(135deg, rgba(249, 250, 251, 0.86), rgba(229, 231, 235, 0.46));
    --hero-text: #111827;
    --hero-muted: #374151;
    --hero-panel: rgba(255, 255, 255, 0.78);
    --hero-border: rgba(17, 24, 39, 0.14);
    --hero-chip-bg: rgba(255, 255, 255, 0.86);
    --hero-chip-text: #111827;
    --hero-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
    --footer-bg: #f8fafc;
    --footer-text: #334155;
    --footer-border: rgba(15, 23, 42, 0.12);
    --footer-link: #475569;
    --footer-link-hover: #0f172a;
    --footer-chip-bg: rgba(15, 23, 42, 0.03);
    --footer-chip-border: rgba(15, 23, 42, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Verdana, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

body[data-theme="morning"] {
    --bg: #f8f3e8;
    --ink: #1f2937;
    --muted: #4b5563;
    --card: rgba(255, 255, 255, 0.9);
    --border: rgba(17, 24, 39, 0.14);
    --accent: #92400e;
    --accent-2: #b45309;
    --header-bg: rgba(248, 243, 232, 0.88);
    --hero-background: linear-gradient(135deg, rgba(248, 243, 232, 0.82), rgba(255, 255, 255, 0.34));
    --hero-text: #1f2937;
    --hero-muted: #334155;
    --hero-panel: rgba(255, 255, 255, 0.82);
    --hero-border: rgba(17, 24, 39, 0.12);
    --hero-chip-bg: rgba(255, 255, 255, 0.88);
    --hero-chip-text: #1f2937;
    --hero-shadow: 0 26px 60px rgba(15, 23, 42, 0.14);
    --footer-bg: #f8f3e8;
    --footer-text: #3f3f46;
    --footer-border: rgba(146, 64, 14, 0.16);
    --footer-link: #57534e;
    --footer-link-hover: #92400e;
    --footer-chip-bg: rgba(146, 64, 14, 0.08);
    --footer-chip-border: rgba(146, 64, 14, 0.2);
}

body[data-theme="afternoon"] {
    --bg: #f9fafb;
    --ink: #111827;
    --muted: #4b5563;
    --card: rgba(255, 255, 255, 0.9);
    --border: rgba(17, 24, 39, 0.14);
    --accent: #1f2937;
    --accent-2: #374151;
    --header-bg: rgba(249, 250, 251, 0.9);
    --hero-background: linear-gradient(135deg, rgba(249, 250, 251, 0.78), rgba(255, 255, 255, 0.28));
    --hero-text: #111827;
    --hero-muted: #334155;
    --hero-panel: rgba(255, 255, 255, 0.8);
    --hero-border: rgba(17, 24, 39, 0.12);
    --hero-chip-bg: rgba(255, 255, 255, 0.9);
    --hero-chip-text: #111827;
    --hero-shadow: 0 26px 60px rgba(15, 23, 42, 0.14);
    --footer-bg: #f8fafc;
    --footer-text: #334155;
    --footer-border: rgba(15, 23, 42, 0.12);
    --footer-link: #475569;
    --footer-link-hover: #0f172a;
    --footer-chip-bg: rgba(15, 23, 42, 0.03);
    --footer-chip-border: rgba(15, 23, 42, 0.15);
}

body[data-theme="evening"] {
    --bg: #1f2937;
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --card: rgba(17, 24, 39, 0.72);
    --border: rgba(148, 163, 184, 0.22);
    --accent: #e2e8f0;
    --accent-2: #cbd5e1;
    --header-bg: rgba(15, 23, 42, 0.76);
    --hero-background: linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(30, 41, 59, 0.38));
    --hero-text: #f8fafc;
    --hero-muted: #dbe4f0;
    --hero-panel: rgba(15, 23, 42, 0.7);
    --hero-border: rgba(148, 163, 184, 0.22);
    --hero-chip-bg: rgba(15, 23, 42, 0.42);
    --hero-chip-text: #f8fafc;
    --hero-shadow: 0 28px 68px rgba(2, 6, 23, 0.36);
    --footer-bg: rgba(10, 18, 33, 0.92);
    --footer-text: #dbe4f0;
    --footer-border: rgba(148, 163, 184, 0.26);
    --footer-link: #cbd5e1;
    --footer-link-hover: #ffffff;
    --footer-chip-bg: rgba(248, 250, 252, 0.08);
    --footer-chip-border: rgba(148, 163, 184, 0.35);
}

body[data-theme="night"] {
    --bg: #0f172a;
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --card: rgba(15, 23, 42, 0.75);
    --border: rgba(148, 163, 184, 0.22);
    --accent: #93c5fd;
    --accent-2: #60a5fa;
    --header-bg: rgba(15, 23, 42, 0.82);
    --hero-background: linear-gradient(135deg, rgba(2, 6, 23, 0.84), rgba(15, 23, 42, 0.5));
    --hero-text: #f8fafc;
    --hero-muted: #dbe4f0;
    --hero-panel: rgba(15, 23, 42, 0.76);
    --hero-border: rgba(148, 163, 184, 0.24);
    --hero-chip-bg: rgba(15, 23, 42, 0.5);
    --hero-chip-text: #f8fafc;
    --hero-shadow: 0 28px 68px rgba(2, 6, 23, 0.4);
    --footer-bg: rgba(2, 6, 23, 0.96);
    --footer-text: #dbe4f0;
    --footer-border: rgba(148, 163, 184, 0.24);
    --footer-link: #cbd5e1;
    --footer-link-hover: #ffffff;
    --footer-chip-bg: rgba(248, 250, 252, 0.07);
    --footer-chip-border: rgba(148, 163, 184, 0.34);
}

body[data-weather="rain"] {
    --footer-bg: rgba(15, 23, 42, 0.94);
    --footer-text: #dbeafe;
    --footer-border: rgba(147, 197, 253, 0.24);
    --footer-link: #bfdbfe;
    --footer-link-hover: #ffffff;
    --footer-chip-bg: rgba(147, 197, 253, 0.12);
    --footer-chip-border: rgba(147, 197, 253, 0.32);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: Arial, Verdana, sans-serif;
    line-height: 1.15;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 50;
    padding: 0.7rem 0.9rem;
    background: #111827;
    color: #ffffff;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    padding: 1rem 1.4rem;
    backdrop-filter: blur(4px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--ink);
    transition: transform 0.45s ease, letter-spacing 0.45s ease, opacity 0.45s ease;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-trigger {
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.brand-trigger:focus-visible,
nav a:focus-visible,
.btn:focus-visible,
.project:focus-visible,
.modal-close:focus-visible,
.carousel-btn:focus-visible,
.carousel-dot:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.header-avatar-shell {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    overflow: hidden;
    border: 3px solid rgba(17, 24, 39, 0.92);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
    flex-shrink: 0;
}

.header-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.brand.is-animating {
    transform: translateY(-1px);
    letter-spacing: 0.16em;
    opacity: 0.92;
}

@media (max-width: 767px) {
    .header-avatar {
        display: none;
    }
    .header-avatar-image {
        display: block;
    }
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.4rem;
    height: 2.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 0.5rem;
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    background: rgba(17, 24, 39, 0.06);
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease, width 0.28s ease;
}

.nav-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.nav-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.nav-drawer.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(3px);
}

.nav-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 82vw);
    background: var(--ink);
    color: #f8fafc;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(2, 6, 23, 0.38);
    overflow-y: auto;
}

body[data-theme="evening"] .nav-drawer-panel,
body[data-theme="night"] .nav-drawer-panel {
    background: #0b1220;
    color: #f8fafc;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
}

body[data-theme="evening"] .nav-drawer-link,
body[data-theme="night"] .nav-drawer-link {
    color: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, 0.22);
}

body[data-theme="evening"] .nav-drawer-link:hover,
body[data-theme="night"] .nav-drawer-link:hover {
    color: #bfdbfe;
}

.nav-drawer.is-open .nav-drawer-panel {
    transform: translateX(0);
}

.nav-drawer-close {
    align-self: flex-end;
    width: 2.2rem;
    height: 2.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #f8fafc;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: background 0.15s ease;
}

.nav-drawer-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-drawer-link {
    text-decoration: none;
    font-size: 1.45rem;
    font-weight: 700;
    color: #f8fafc;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.nav-drawer-link:hover {
    color: #93c5fd;
    padding-left: 0.4rem;
}

.nav-drawer-cta {
    margin-top: 2rem;
    width: 100%;
    text-align: center;
    background: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
    font-size: 1rem;
    padding: 0.9rem 1rem;
}

.nav-drawer-cta:hover {
    background: #f1f5f9;
    border-color: #f1f5f9;
}

nav a {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--muted);
}

nav a:hover {
    color: var(--ink);
}

main {
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding-bottom: 5rem;
}

.hero {
    position: relative;
    display: block;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: clamp(2rem, 5vw, 3.2rem) max(1.2rem, calc((100vw - min(1100px, 92vw)) / 2));
    min-height: clamp(28rem, 74vh, 44rem);
    overflow: hidden;
    border-radius: 0;
    background-image: var(--hero-background), var(--hero-background-image, none);
    background-size: cover;
    background-position: center;
    box-shadow: var(--hero-shadow);
    border: 1px solid var(--hero-border);
    color: var(--hero-text);
}

.hero-rain-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

body[data-weather="rain"] .hero-rain-video.is-playing {
    opacity: 1;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(2, 6, 23, 0.24) 100%), radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 36%);
    pointer-events: none;
}

.hero>* {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 42rem;
    padding: clamp(1.1rem, 2.5vw, 1.7rem);
    border-radius: 1.1rem;
    background: var(--hero-panel);
    border: 1px solid var(--hero-border);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}

.hero-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent-2);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 8vw, 5.3rem);
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    color: var(--hero-text);
}

.hero-subtitle {
    max-width: 52ch;
    font-size: clamp(1.05rem, 2.1vw, 1.45rem);
    color: var(--hero-muted);
}

.hero-chips {
    margin-top: 1.4rem;
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.hero-chips span,
.hero-chips a {
    border: 1px solid var(--border);
    background: var(--hero-chip-bg);
    color: var(--hero-chip-text);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.82rem;
}

.hero-cta {
    margin-top: 1.7rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.hero .btn-ghost {
    background: rgba(255, 255, 255, 0.14);
    color: var(--hero-text);
    border-color: var(--hero-border);
    backdrop-filter: blur(8px);
}

.contact-text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.contact-text-link:hover {
    color: #1d4ed8;
}

.hero .contact-text-link {
    color: var(--hero-text);
}

.hero .contact-text-link:hover {
    color: #ffffff;
}

.pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.2rem 0 0.9rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.btn {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--bg);
    padding: 0.76rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#downloadPdfTop,
#downloadPdfHero,
#downloadPdfBottom {
    animation: pdfPulse 2.2s ease-in-out infinite;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.16);
}

@keyframes pdfPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(17, 24, 39, 0.3);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(17, 24, 39, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(17, 24, 39, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #downloadPdfTop,
    #downloadPdfHero,
    #downloadPdfBottom {
        animation: none;
    }
    .header-avatar {
        animation: none;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.btn-small {
    padding: 0.48rem 0.8rem;
    font-size: 0.8rem;
}

.btn-ghost {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--border);
    box-shadow: none;
}

section {
    margin-top: 2.6rem;
}

.glass-panel {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--card);
    box-shadow: var(--shadow);
}

.glass-panel h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 0.8rem;
}

.stats-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.2rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border);
    background: #ffffff;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    font-family: Arial, Verdana, sans-serif;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.timeline h2,
.projects h2,
.skills h2,
.contact h2 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    margin-bottom: 1rem;
}

.timeline-wrap {
    border-left: 2px solid rgba(17, 24, 39, 0.28);
    padding-left: 1.2rem;
    display: grid;
    gap: 1rem;
}

.timeline-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1.1rem;
    overflow: hidden;
}


/* collapsed by default */

.timeline-item ul {
    margin: 0;
    padding-left: 1.1rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.48s ease, opacity 0.38s ease, margin 0.38s ease;
}

.timeline-item.is-expanded ul {
    max-height: 600px;
    opacity: 1;
    margin-top: 0.7rem;
}

.timeline-item .period {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.timeline-item h3 {
    margin-top: 0.2rem;
    font-size: 1.2rem;
}

.timeline-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.2rem;
    cursor: pointer;
    user-select: none;
}

.timeline-head:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-radius: 0.4rem;
}

.timeline-head h3 {
    margin-top: 0;
    flex: 1;
}

.timeline-chevron {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    color: var(--muted);
    transition: transform 0.32s ease, color 0.2s ease;
    margin-left: auto;
}

.timeline-item.is-expanded .timeline-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.company-logo {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: #ffffff;
    padding: 0.18rem;
    flex-shrink: 0;
}

.company-logo.logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.projects-intro {
    margin: -0.25rem 0 0.9rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.projects-secondary {
    opacity: 1;
}

.projects-secondary h2 {
    font-size: clamp(1rem, 2vw, 1.25rem) !important;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.projects-secondary .projects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.projects-secondary .project {
    min-height: 0;
    padding: 0.85rem 0.9rem 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    overflow: hidden;
}

.projects-secondary .project-icon-wrap {
    position: static;
    transform: none;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: none;
    border-radius: 0.5rem;
}

.projects-secondary .project-logo {
    width: 1rem;
    height: 1rem;
}

.projects-secondary .project-content {
    margin-top: 0;
    width: 100%;
}

.projects-secondary .project p {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.15rem;
}

.projects-secondary .project h3 {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.projects-secondary .project span {
    font-size: 0.77rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projects-secondary .project-pills {
    margin-top: 0.45rem;
    gap: 0.25rem;
}

.projects-secondary .project-pill {
    font-size: 0.62rem;
    padding: 0.15rem 0.4rem;
}

.project {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: stretch;
    min-height: 14.5rem;
    text-decoration: none;
    padding: 1.2rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border);
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-content {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: 1.35rem;
}

.project-icon-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-logo {
    width: 1.55rem;
    height: 1.55rem;
    object-fit: contain;
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.project-logo.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
}

.project:hover {
    transform: translateY(-3px);
    border-color: rgba(17, 24, 39, 0.4);
    box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
}

.project-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.project-pill {
    font-size: 0.7rem;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.2);
    background: #f9fafb;
    color: #111827;
    font-weight: 600;
}

.project p {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 700;
}

.project h3 {
    margin: 0.25rem 0;
}

.project span {
    color: var(--muted);
    font-size: 0.9rem;
}

body[data-theme="evening"] .stat-card,
body[data-theme="night"] .stat-card,
body[data-theme="evening"] .timeline-item,
body[data-theme="night"] .timeline-item,
body[data-theme="evening"] .skills-columns div,
body[data-theme="night"] .skills-columns div,
body[data-theme="evening"] .contact,
body[data-theme="night"] .contact,
body[data-theme="evening"] .project,
body[data-theme="night"] .project {
    background: rgba(15, 23, 42, 0.76) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
}

body[data-theme="evening"] .stat-card span,
body[data-theme="night"] .stat-card span,
body[data-theme="evening"] .timeline-item .period,
body[data-theme="night"] .timeline-item .period,
body[data-theme="evening"] .project span,
body[data-theme="night"] .project span,
body[data-theme="evening"] .skills-columns p,
body[data-theme="night"] .skills-columns p,
body[data-theme="evening"] .contact p,
body[data-theme="night"] .contact p,
body[data-theme="evening"] .projects-intro,
body[data-theme="night"] .projects-intro {
    color: #dbe4f0;
}

body[data-theme="evening"] .timeline-wrap,
body[data-theme="night"] .timeline-wrap {
    border-left-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="evening"] .company-logo,
body[data-theme="night"] .company-logo {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.24);
}

body[data-theme="evening"] .project-pill,
body[data-theme="night"] .project-pill {
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.24);
}

body[data-theme="evening"] .timeline-item ul,
body[data-theme="night"] .timeline-item ul,
body[data-theme="evening"] .project-content,
body[data-theme="night"] .project-content,
body[data-theme="evening"] .skills-columns div,
body[data-theme="night"] .skills-columns div {
    color: #f8fafc !important;
}

body[data-theme="evening"] .project p,
body[data-theme="night"] .project p,
body[data-theme="evening"] .skills-columns h3,
body[data-theme="night"] .skills-columns h3,
body[data-theme="evening"] .timeline-item h3,
body[data-theme="night"] .timeline-item h3,
body[data-theme="evening"] .glass-panel h2,
body[data-theme="night"] .glass-panel h2,
body[data-theme="evening"] .contact h2,
body[data-theme="night"] .contact h2,
body[data-theme="evening"] .projects h2,
body[data-theme="night"] .projects h2 {
    color: #f8fafc;
}

body[data-theme="evening"] .hero-content,
body[data-theme="night"] .hero-content,
body[data-theme="evening"] .hero-aside,
body[data-theme="night"] .hero-aside {
    background: rgba(15, 23, 42, 0.84) !important;
    color: #f8fafc !important;
}

.skills-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.skills-columns div {
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1.1rem;
    background: #ffffff;
}

.skills-columns h3 {
    margin-bottom: 0.45rem;
}

.contact {
    border-radius: 0.8rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    background: #ffffff;
}

.contact p {
    margin-top: 0.5rem;
    max-width: 67ch;
}


/* ── Footer ── */

.site-footer {
    margin-top: 4rem;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--footer-border);
}

.footer-inner {
    max-width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 3rem 1.4rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 2.5rem;
    align-items: start;
}

.footer-monogram {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--footer-text);
    margin-bottom: 0.55rem;
}

.footer-tagline {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--footer-link);
    max-width: 30ch;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    justify-self: start;
    text-align: left;
}

.footer-nav a {
    display: block;
    width: 100%;
    text-align: left;
    text-decoration: none;
    font-size: 0.87rem;
    color: var(--footer-link);
    transition: color 0.15s ease;
}

.footer-nav a:hover {
    color: var(--footer-link-hover);
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    border: 1px solid var(--footer-chip-border);
    color: var(--footer-link);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-social a:hover {
    color: var(--footer-link-hover);
    border-color: var(--footer-chip-border);
    background: var(--footer-chip-bg);
}

.footer-social svg {
    width: 1rem;
    height: 1rem;
}

.footer-bottom {
    border-top: 1px solid var(--footer-border);
    padding: 1.1rem 1.4rem;
    display: flex;
    justify-content: center;
}

.footer-pill {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--footer-chip-border);
    background: var(--footer-chip-bg);
    color: var(--footer-text);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.6rem;
        padding-bottom: 1.5rem;
        justify-items: start;
        text-align: left;
    }
    .footer-nav {
        width: 100%;
    }
    .footer-social {
        flex-direction: row;
        justify-content: flex-start;
    }
}

@media (min-width: 768px) {
    .hero-cta {
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .footer-bottom {
        justify-content: center !important;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(8px);
    z-index: 40;
}

.modal-backdrop.is-open {
    display: flex;
}


/* ── Modal: full-width immersive layout ── */

.modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(860px, 96vw);
    max-height: min(94vh, 920px);
    overflow: hidden;
    border-radius: 1.6rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 48px 120px rgba(2, 6, 23, 0.72);
    background: #0f172a;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2.5rem;
    height: 2.5rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.modal-close:hover {
    background: rgba(248, 250, 252, 0.18);
    border-color: rgba(255, 255, 255, 0.55);
}


/* Hero photo band */

.modal-hero {
    position: relative;
    height: 240px;
    flex-shrink: 0;
    overflow: hidden;
}

.modal-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url("assets/media/hero-tech.jpg");
    background-size: cover;
    background-position: center 35%;
    filter: brightness(0.7) saturate(1.3);
}

.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( 180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.62) 100%);
}

.modal-hero-text {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.75rem 2rem;
    gap: 0.6rem;
}

.modal-headline {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
    max-width: 52ch;
}

.modal-sub {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.55;
    max-width: 62ch;
}


/* Stats row */

.modal-body {
    padding: 1.6rem 2rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: none;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    border-radius: 0.9rem;
    background: rgba(248, 250, 252, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.14);
    text-align: center;
}

.modal-stat strong {
    display: block;
    font-size: 1.6rem;
    font-family: Arial, Verdana, sans-serif;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1;
}

.modal-stat span {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.35;
}

.modal-about {
    margin-top: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding-top: 1.25rem;
}

.modal-about p {
    font-size: 0.92rem;
    line-height: 1.68;
    color: #cbd5e1;
}

.modal-signoff {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 0.88rem;
}


/* Scrolling marquee */

.modal-marquee {
    overflow: hidden;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    padding: 0.85rem 0;
    flex-shrink: 0;
    /* fade edges */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.modal-marquee-track {
    display: flex;
    gap: 1.4rem;
    width: max-content;
    animation: marqueeScroll 28s linear infinite;
    align-items: center;
}

.modal-marquee-track span {
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.04em;
}

@keyframes marqueeScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-marquee-track {
        animation: none;
    }
}

@media (max-width: 767px) {
    .modal-backdrop {
        align-items: flex-start;
        padding: 0.5rem;
    }
    .modal-dialog {
        width: 100%;
        max-height: calc(100dvh - 1rem);
        border-radius: 1rem;
        overflow-y: auto;
    }
    .modal-hero {
        height: auto;
        min-height: 220px;
    }
    .modal-hero-text {
        justify-content: flex-start;
        padding: 4.4rem 1.2rem 1.2rem;
    }
    .modal-headline {
        font-size: 1.6rem;
        max-width: none;
    }
    .modal-sub {
        font-size: 0.92rem;
        max-width: none;
    }
    .modal-body {
        padding: 1.2rem;
    }
    .modal-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }
    .modal-stats .modal-stat:nth-child(5) {
        grid-column: 1 / -1;
    }
    .modal-stat {
        padding: 0.85rem 0.75rem;
    }
    .modal-stat strong {
        font-size: 1.45rem;
    }
    .modal-stat span {
        font-size: 0.74rem;
    }
    .modal-stats .modal-stat:nth-child(4),
    .modal-stats .modal-stat:nth-child(5) {
        grid-column: span 1;
    }
    .modal-about {
        margin-top: 1.1rem;
        padding-top: 1rem;
    }
    .modal-about p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    .modal-marquee {
        display: none;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

#pdfResume {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 7.5in;
    background: #ffffff;
    color: #111111;
    padding: 0.45in 0.5in 0.5in;
    font-family: Arial, Verdana, sans-serif;
    font-size: 0.76rem;
    line-height: 1.45;
}


/* Header band */

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 0.28rem;
    border-bottom: 3px solid #1e3a5f;
    margin-bottom: 0.36rem;
}

.pdf-header-name h1 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.1rem;
    color: #111827;
    line-height: 1;
}

.pdf-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

.pdf-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.72rem;
    color: #374151;
    text-align: right;
}


/* Section blocks */

.pdf-block {
    margin-top: 0.32rem;
    padding-top: 0.22rem;
}

.pdf-block h2,
.pdf-three-col h2 {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1e3a5f;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.08rem;
    margin-bottom: 0.22rem;
}

.pdf-block>p {
    font-size: 0.74rem;
    margin-bottom: 0.22rem;
    color: #1f2937;
    line-height: 1.5;
}


/* Job entries */

.pdf-job {
    margin-bottom: 0.28rem;
}

.pdf-job-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.08rem;
}

.pdf-job-head strong {
    font-size: 0.78rem;
    color: #111827;
}

.pdf-company {
    font-size: 0.72rem;
    color: #374151;
    font-style: italic;
}

.pdf-company::before {
    content: "·";
    margin-right: 0.3rem;
    color: #9ca3af;
}

.pdf-dates {
    font-size: 0.68rem;
    color: #6b7280;
    margin-left: auto;
}

.pdf-block ul,
.pdf-three-col ul {
    margin: 0 0 0.14rem;
    padding-left: 0.85rem;
}

.pdf-block li,
.pdf-three-col li {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
    color: #1f2937;
    line-height: 1.45;
}


/* Three-column bottom section */

.pdf-three-col {
    margin-top: 0.32rem;
    display: grid;
    grid-template-columns: 2fr 1.4fr 1.3fr;
    gap: 0.5rem;
    padding-top: 0.22rem;
}

.pdf-page-break {
    break-before: page;
    page-break-before: always;
    height: 0;
}

.pdf-cover-letter-page p {
    margin-bottom: 0.35rem;
}

.pdf-cover-letter-page {
    page-break-inside: avoid;
    break-inside: avoid-page;
}

.pdf-cover-signoff {
    margin-top: 0.5rem;
    font-weight: 700;
}

.pdf-blank-page {
    height: 10.4in;
    min-height: 10.4in;
    max-height: 10.4in;
    background: #ffffff;
    page-break-inside: avoid;
    break-inside: avoid-page;
}

.pdf-blank-page-marker {
    display: block;
    width: 1px;
    height: 1px;
    color: transparent;
    font-size: 1px;
    line-height: 1;
    overflow: hidden;
}

@media (max-width: 900px) {
    .stats-grid,
    .projects-grid,
    .skills-columns {
        grid-template-columns: 1fr;
    }
    .site-header > nav {
        display: none;
    }
    .nav-hamburger {
        display: flex;
    }
    .hero {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        padding-left: 1rem;
        padding-right: 1rem;
        min-height: 30rem;
    }
    .timeline-head {
        align-items: flex-start;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-dialog {
        max-height: 92vh;
    }
    .carousel-viewport {
        min-height: 320px;
    }
}

@media (max-width: 767px) {
    .site-header {
        padding: 0.9rem 1rem;
        align-items: center;
    }
    .hero {
        min-height: 26rem;
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }
    .hero-subtitle {
        max-width: 100%;
    }
    .hero-chips,
    .hero-cta {
        gap: 0.55rem;
    }
    .hero-chips span,
    .hero-chips a,
    .btn,
    .btn-small {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    /* Personal projects: 2-column on mobile, larger text */
    .projects-secondary .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
    .projects-secondary .project {
        padding: 1rem;
    }
    .projects-secondary .project h3 {
        font-size: 0.95rem;
    }
    .projects-secondary .project span {
        font-size: 0.82rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .projects-secondary .project p {
        font-size: 0.7rem;
    }
    .projects-secondary .project-icon-wrap {
        width: 2rem;
        height: 2rem;
    }
    .projects-secondary .project-logo {
        width: 1.1rem;
        height: 1.1rem;
    }
    .timeline-wrap {
        padding-left: 0.85rem;
    }
    .timeline-item ul {
        transition: max-height 0.28s ease, opacity 0.24s ease, margin 0.24s ease;
    }
    .timeline-item,
    .glass-panel,
    .skills-columns div,
    .contact,
    .project {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .project {
        min-height: auto;
    }
    .project-icon-wrap {
        width: 3rem;
        height: 3rem;
    }
    .carousel-viewport {
        min-height: 260px;
    }
    .carousel-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

body[data-theme="evening"] .stat-card,
body[data-theme="night"] .stat-card,
body[data-theme="evening"] .timeline-item,
body[data-theme="night"] .timeline-item,
body[data-theme="evening"] .skills-columns div,
body[data-theme="night"] .skills-columns div,
body[data-theme="evening"] .contact,
body[data-theme="night"] .contact,
body[data-theme="evening"] .project,
body[data-theme="night"] .project {
    background-color: rgba(15, 23, 42, 0.82) !important;
    background-image: none !important;
}

body[data-theme="evening"] .project-icon-wrap,
body[data-theme="night"] .project-icon-wrap,
body[data-theme="evening"] .company-logo,
body[data-theme="night"] .company-logo {
    background-color: rgba(15, 23, 42, 0.94) !important;
}

body[data-theme="evening"] .project-pill,
body[data-theme="night"] .project-pill {
    background-color: rgba(15, 23, 42, 0.98) !important;
}


/* ── PDF Preview Modal ── */

#pdfPreviewModal {
    padding: 0.75rem;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(8px);
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.pdf-preview-dialog {
    width: min(820px, 98vw);
    background: #f3f4f6;
    border-radius: 1.1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 48px 100px rgba(2, 6, 23, 0.64);
    margin: auto;
}

.pdf-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f172a;
    padding: 0.75rem 1.2rem;
    flex-shrink: 0;
    gap: 1rem;
}

.pdf-preview-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.pdf-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

#pdfPreviewDownload {
    background: #9ca3af;
    border-color: #9ca3af;
    color: #0f172a;
}

#pdfPreviewDownload:hover {
    background: #6b7280;
    border-color: #6b7280;
    color: #f8fafc;
}

.pdf-preview-close {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.pdf-preview-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.pdf-preview-frame {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 4rem);
    background: #ffffff;
}


/* Make the injected resume content visible inside the frame */

.pdf-preview-frame #pdfResume {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    display: block !important;
}

@media (max-width: 767px) {
    .pdf-preview-frame {
        padding: 1rem;
    }
}