:root {
    --accent: #d9467a;
    --accent-dark: #9f174d;
    --accent-soft: #fde7ef;
    --accent-pale: #fff4f8;
    --navy: #1f2937;
    --ink: #2f3440;
    --muted: #667085;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e5e7eb;
    --line-accent: rgba(217, 70, 122, 0.24);
    --shadow: 0 18px 48px rgba(31, 41, 55, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Poppins", Arial, sans-serif;
    color: var(--ink);
    background: var(--surface-soft);
    line-height: 1.7;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

button,
input,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.navbar {
    width: min(1140px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 600;
}

.nav-links a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-dark);
    border-color: var(--accent);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.08);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--accent-dark);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

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

.section {
    width: min(1140px, calc(100% - 32px));
    margin: 0 auto;
    padding: 88px 0;
    scroll-margin-top: 84px;
}

.hero {
    min-height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.78fr);
    align-items: center;
    gap: 56px;
}

.hero-content {
    max-width: 720px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2 {
    font-family: "Playfair Display", Georgia, serif;
    color: var(--navy);
}

h1 {
    margin-bottom: 20px;
    font-size: clamp(3rem, 7vw, 5.1rem);
    line-height: 1.02;
}

h2 {
    margin-bottom: 16px;
    font-size: clamp(2rem, 4vw, 2.85rem);
    line-height: 1.16;
}

h3 {
    margin-bottom: 10px;
    color: var(--navy);
    line-height: 1.35;
}

.hero-lead,
.about-copy,
.cv-card p,
.project-card p,
.skill-card p,
.timeline p,
.focus-panel li {
    color: var(--muted);
}

.hero-lead {
    max-width: 680px;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    background: var(--accent-dark);
    color: var(--surface);
    box-shadow: 0 14px 28px rgba(159, 23, 77, 0.22);
}

.btn.secondary {
    background: var(--surface);
    color: var(--accent-dark);
    border-color: var(--line-accent);
}

.btn.ghost {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-color: var(--line-accent);
}

.profile-card,
.focus-panel,
.skill-card,
.project-card,
.cv-card,
.timeline,
.contact-card,
.contact-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.profile-card {
    padding: 32px;
    text-align: center;
}

.portrait-wrap {
    width: min(280px, 100%);
    aspect-ratio: 4 / 5;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--line-accent);
}

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

.portrait-fallback {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-dark);
    color: var(--surface);
    box-shadow: 0 18px 36px rgba(159, 23, 77, 0.18);
}

.portrait-fallback span {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 3.2rem;
    font-weight: 700;
}

.profile-card h2 {
    margin-bottom: 4px;
    font-size: 2rem;
}

.profile-card p {
    color: var(--muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 22px;
}

.profile-stats span {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 8px;
    background: var(--accent-pale);
    color: var(--muted);
    font-size: 0.78rem;
}

.profile-stats strong {
    display: block;
    color: var(--accent-dark);
    font-size: 1.2rem;
    line-height: 1.1;
}

.profile-stats small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.about-grid,
.cv-layout,
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
    gap: 24px;
    align-items: stretch;
}

.about-copy {
    font-size: 1.02rem;
}

.focus-panel,
.cv-card,
.timeline,
.contact-card,
.contact-form {
    padding: 26px;
}

.focus-panel ul {
    margin: 14px 0 0;
    padding-left: 20px;
}

.focus-panel li + li {
    margin-top: 8px;
}

.skills-grid,
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.skill-card,
.project-card {
    padding: 24px;
}

.skill-card span,
.project-tag {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.skill-card:nth-child(2n) span,
.project-card:nth-child(2n) .project-tag {
    background: #eef2ff;
    color: #3730a3;
}

.skill-card:nth-child(3n) span,
.project-card:nth-child(3n) .project-tag {
    background: #ecfdf3;
    color: #027a48;
}

.skill-card p,
.project-card p {
    margin-bottom: 0;
}

.project-grid {
    grid-template-columns: repeat(2, 1fr);
}

.project-card dl {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.project-card dl div {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.project-card dt {
    color: var(--navy);
    font-weight: 800;
}

.project-card dd {
    margin: 3px 0 0;
    color: var(--muted);
}

.cv-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.cv-card p {
    margin-bottom: 24px;
}

.note {
    display: block;
    margin-top: 14px;
    color: var(--muted);
}

.note code {
    color: var(--accent-dark);
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 16px;
}

.timeline div {
    padding-left: 18px;
    border-left: 3px solid var(--accent);
}

.timeline span {
    display: block;
    color: var(--accent-dark);
    font-weight: 800;
}

.timeline p {
    margin-bottom: 0;
}

.contact-card {
    display: grid;
    gap: 12px;
}

.contact-card a {
    min-height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent-pale);
    color: var(--accent-dark);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.contact-card small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.contact-form {
    display: grid;
    gap: 14px;
}

.contact-form label {
    display: grid;
    gap: 7px;
    color: var(--navy);
    font-weight: 700;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(217, 70, 122, 0.14);
}

.upgrades {
    padding-top: 64px;
}

.upgrade-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.upgrade-list span {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--navy);
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.06);
}

.site-footer {
    padding: 30px 16px;
    background: var(--navy);
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.site-footer p {
    margin: 4px 0;
}

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

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

@media (max-width: 980px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        min-height: 46px;
        padding: 0 10px;
        border-bottom: 0;
    }

    .hero,
    .about-grid,
    .cv-layout,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid,
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .navbar,
    .section {
        width: min(100% - 24px, 1140px);
    }

    .section {
        padding: 68px 0;
    }

    .hero {
        gap: 32px;
        min-height: auto;
        padding-top: 56px;
    }

    .hero-actions,
    .btn {
        width: 100%;
    }

    .profile-card,
    .focus-panel,
    .skill-card,
    .project-card,
    .cv-card,
    .timeline,
    .contact-card,
    .contact-form {
        padding: 22px;
    }

    .profile-stats,
    .skills-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .portrait-fallback {
        width: 132px;
        height: 132px;
    }
}
