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

:root {
    --paper: #f1f5f9;
    --paper-dark: #e0e7ff;
    --paper-mid: #eef2ff;
    --white: #ffffff;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #64748b;
    --accent: #3730a3;
    --accent-hover: #4f46e5;
    --accent-bright: #6366f1;
    --accent-teal: #0f766e;
    --accent-teal-soft: rgba(15, 118, 110, 0.12);
    --accent-tint: rgba(55, 48, 163, 0.1);
    --accent-tint-strong: rgba(79, 70, 229, 0.15);
    --rule: #c7d2fe;
    --rule-strong: #a5b4fc;
    --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "Source Sans 3", system-ui, sans-serif;
    --nav-h: 64px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --radius: 6px;
    --shadow: 0 2px 8px rgba(55, 48, 163, 0.07);
    --shadow-lg: 0 16px 48px rgba(49, 46, 129, 0.12);
    --gradient-page: linear-gradient(165deg, #eef2ff 0%, #f1f5f9 38%, #f8fafc 100%);
    --gradient-accent: linear-gradient(135deg, #3730a3 0%, #2563eb 55%, #0d9488 100%);
    --gradient-hero-bar: linear-gradient(180deg, #4f46e5, #0d9488);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-soft);
    background: var(--gradient-page);
    background-color: var(--paper-mid);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

main,
footer {
    position: relative;
}

body > header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.navbar {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    min-height: var(--nav-h);
}

.navbar .logo {
    margin-right: auto;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.navbar .logo span {
    color: var(--muted);
    font-weight: 500;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--ink);
    background: rgba(15, 23, 42, 0.06);
    outline: none;
}

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

.nav-links .social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--muted);
    font-size: 1.15rem;
}

.nav-links .social-links a:hover {
    color: var(--accent);
    background: var(--accent-tint);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0 11px;
}

.hamburger span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}

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

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

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

.hero {
    padding: calc(var(--nav-h) + 2.75rem) 1.5rem 3.5rem;
    max-width: 1080px;
    margin: 0 auto;
}

.hero-masthead {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-column {
    max-width: 42rem;
    width: 100%;
}

.hero-content {
    position: relative;
    padding-top: 0.5rem;
    padding-left: 1.5rem;
    margin-left: 0;
}

.hero-content::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 3px;
    background: var(--gradient-hero-bar);
}

.hero-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-teal);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 6vw, 3.75rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.hero-tagline {
    font-family: var(--font-serif);
    font-size: clamp(1.125rem, 2.2vw, 1.35rem);
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.hero .lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 1.75rem;
    max-width: 38rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.cta-button--primary {
    background-color: var(--accent);
    background-image: var(--gradient-accent);
    color: #fff;
    border: 1px solid rgba(55, 48, 163, 0.35);
}

.cta-button--primary:hover {
    filter: brightness(1.08) saturate(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-tint-strong);
}

.cta-button--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule-strong);
}

.cta-button--ghost:hover {
    border-color: var(--accent-bright);
    color: var(--accent);
    background: var(--white);
    box-shadow: 0 2px 12px var(--accent-tint);
}

.hero-metrics {
    padding-top: 1.25rem;
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    border-top: 1px solid var(--rule);
}

.hero-stats {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.5rem;
    margin: 0;
    padding: 0;
    width: 100%;
}

.hero-stats li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
}

.hero-stats strong {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-stats span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: lowercase;
    line-height: 1.3;
}

.achievements-certs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0;
    border-top: none;
}

.cert-lockup {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cert-lockup img {
    display: block;
    height: clamp(56px, 8vw, 76px);
    width: auto;
    max-width: min(200px, 36vw);
    object-fit: contain;
    object-position: bottom;
    background: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.07)) drop-shadow(0 6px 16px rgba(15, 23, 42, 0.06));
}

.achievements-certs .cert-lockup img {
    height: clamp(64px, 14vw, 92px);
    max-width: min(240px, 100%);
}

section {
    padding: 4.5rem 1.5rem;
    scroll-margin-top: calc(var(--nav-h) + 12px);
}

.section-header {
    max-width: 36rem;
    margin: 0 auto 3rem;
    text-align: left;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-bright);
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 0.5rem;
}

section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.875rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.about {
    background: linear-gradient(180deg, #e8edff 0%, var(--paper-dark) 50%, #dce5ff 100%);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.about .section-header {
    margin-left: auto;
    margin-right: auto;
    max-width: 1080px;
    width: 100%;
}

.about-content {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: stretch;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.achievements {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--white);
    border: 1px solid var(--rule);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.profile-photo {
    flex-shrink: 0;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--rule);
}

.achievements-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.achievements-content h3 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.achievements-certifications {
    margin-top: 1.25rem;
}

.achievements-certifications h3 {
    margin-top: 0;
}

.achievements-list {
    list-style: none;
}

.achievements-list li {
    font-size: 0.9375rem;
    color: var(--ink-soft);
    padding: 0.4rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--rule);
    margin-bottom: 0.25rem;
    transition: border-color 0.2s;
}

.achievements-list li:hover {
    border-left-color: var(--accent-teal);
}

.about-text {
    width: 100%;
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--rule);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow);
}

.about-text p {
    margin-bottom: 1.15rem;
    color: var(--ink-soft);
    max-width: none;
}

.about-text .sign-off {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--font-serif);
}

.projects {
    padding-bottom: 5rem;
}

.projects .section-header {
    margin-left: auto;
    margin-right: auto;
    max-width: 1080px;
    width: 100%;
}

.project-grid {
    counter-reset: proj;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-index::before {
    content: counter(proj, decimal-leading-zero) ".";
    font-variant-numeric: tabular-nums;
}

.project-card {
    counter-increment: proj;
    background: var(--white);
    border: 1px solid var(--rule);
    border-bottom: none;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.project-card:last-child {
    border-bottom: 1px solid var(--rule);
}

.project-card:hover {
    background: linear-gradient(90deg, rgba(238, 242, 255, 0.9) 0%, #ffffff 18%);
    box-shadow: inset 4px 0 0 var(--accent-bright);
}

.project-content {
    padding: 1.5rem 1.75rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.35rem 1.5rem;
    align-items: start;
    width: 100%;
}

.project-card .project-meta {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.project-card .project-index {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
}

.project-card:hover .project-index {
    color: var(--accent);
}

.project-card .view-hint {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.project-card:hover .view-hint {
    color: var(--accent);
}

.project-card h3 {
    grid-column: 1;
    grid-row: 1;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.3;
    padding-right: 1rem;
}

.project-card p {
    grid-column: 1 / -1;
    grid-row: 2;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0.5rem 0 0;
}

.project-tags {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.project-tags span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    background: var(--accent-tint);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

@media (max-width: 640px) {
    .project-content {
        grid-template-columns: 1fr;
    }

    .project-card .project-meta {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .project-card h3 {
        grid-row: 1;
    }

    .project-card p {
        grid-row: 3;
    }

    .project-tags {
        grid-row: 4;
    }
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem 1rem;
    scroll-behavior: smooth;
}

.modal-content {
    position: relative;
    background: var(--white);
    margin: 0 auto 2rem;
    padding: 2rem 2.25rem;
    width: 100%;
    max-width: 800px;
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.35s var(--ease);
    max-height: min(90vh, 880px);
    overflow-y: auto;
}

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

.close-modal {
    position: sticky;
    top: 0;
    float: right;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius);
    border: 1px solid var(--rule);
    background: var(--paper);
    transition: color 0.2s, border-color 0.2s;
    z-index: 2;
}

.close-modal:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.modal-body {
    margin-top: 0.5rem;
    clear: both;
}

.modal-body h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--ink);
    margin-bottom: 1.25rem;
    padding-right: 3rem;
}

.modal-body h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin: 1.25rem 0 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-body p {
    margin-bottom: 0.85rem;
    color: var(--ink-soft);
    line-height: 1.7;
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.1rem;
    position: relative;
    color: var(--ink-soft);
}

.modal-body ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--accent-teal);
}

.modal-body .project-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-body .project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.modal-body .project-gallery img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--rule);
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-body .project-gallery img:hover {
    opacity: 0.92;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, 0.94);
    z-index: 3000;
    cursor: pointer;
}

.lightbox img {
    max-width: 92%;
    max-height: 88vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    border-radius: var(--radius);
}

.close-lightbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 3001;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

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

.lightbox-controls {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 0.75rem;
    z-index: 3001;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: var(--radius);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox img.loading {
    opacity: 0;
}

.lightbox img.loaded {
    opacity: 1;
    transition: opacity 0.3s;
}

footer {
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--rule);
    background: linear-gradient(180deg, var(--paper-dark) 0%, #ddd6fe 100%);
}

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

footer p {
    color: var(--muted);
    font-size: 0.875rem;
}

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

.footer-links a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.submit-button {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-accent);
    color: var(--white);
    border: 1px solid rgba(55, 48, 163, 0.35);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.form-message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 900px) {
    .hero-content {
        padding-left: 1.25rem;
    }

    .hero-metrics {
        padding-left: 1.25rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        row-gap: 0.5rem;
        column-gap: 0;
    }

    .hero-stats li {
        flex-direction: column;
        gap: 0.2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    .section-header {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .nav-links {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.75rem;
        background: var(--white);
        border-bottom: 1px solid var(--rule);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links a {
        padding: 0.85rem 1rem;
        text-align: center;
    }

    .nav-links .social-links {
        justify-content: center;
        padding: 0.5rem;
        border-top: 1px solid var(--rule);
        margin-top: 0.25rem;
    }

    .hamburger {
        display: flex;
        margin-left: auto;
    }

    .modal-body .project-details {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    section {
        padding: 3rem 1rem;
    }

    .hero {
        padding-top: calc(var(--nav-h) + 2rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-content {
        padding-left: 1rem;
        margin-left: 0;
    }

    .hero-metrics {
        padding-left: 1rem;
    }
}
