:root {
    --bg: #060606;
    --surface: #111111;
    --text: #f5f5f5;
    --muted: #a7a7a7;
    --line: #242424;
    --primary: #f5f5f5;
    --primary-strong: #d4d4d4;
    --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    z-index: 999;
}

body.bw-mode {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #111111;
    --muted: #5f6c76;
    --line: #d9dee4;
    --primary: #111111;
    --primary-strong: #2c2c2c;
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.container {
    width: min(980px, 92vw);
    margin: 0 auto;
}

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

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 1.08rem;
}

.menu-btn {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bw-toggle {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.bw-toggle:hover {
    background: #eef2f6;
}

body.bw-mode .bw-toggle {
    background: #000;
    color: #fff;
}

.main-nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.main-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(245, 245, 245, 0.25);
    outline-offset: 2px;
}

.hero {
    padding: 4.2rem 0 2.6rem;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 1.6rem;
}

.hero-content {
    min-width: 0;
}

.hero-photo {
    justify-self: end;
    width: min(340px, 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    padding: 0.45rem;
    box-shadow: var(--shadow-soft);
}

.hero-photo img {
    width: 100%;
    display: block;
    border-radius: 12px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

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

h1 {
    margin-top: 0.7rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.18;
    max-width: 15ch;
}

.lead {
    margin-top: 1rem;
    color: var(--muted);
    max-width: 58ch;
    line-height: 1.75;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
}

.btn-light {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

.social-link {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.section {
    padding: 2.35rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.section + .section {
    border-top: 1px solid var(--line);
}

.section h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
    margin-bottom: 0.8rem;
}

.section p {
    color: var(--muted);
    max-width: 68ch;
}

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

.stats > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: var(--shadow-soft);
}

.stats strong {
    display: block;
    font-size: 1rem;
}

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

.inline-link {
    color: inherit;
    text-underline-offset: 0.18em;
}

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

.project-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255, 255, 255, 0.08);
}

.project-card h3 {
    font-size: 1.05rem;
}

.project-card p {
    margin-top: 0.55rem;
}

.links {
    margin-top: 0.85rem;
    display: flex;
    gap: 0.5rem;
}

.links a {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.86rem;
    font-weight: 600;
    background: var(--surface);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.links a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--line);
}

.contact-form {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.45rem;
    max-width: 620px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.contact-form label {
    font-weight: 600;
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem 0.7rem;
    font: inherit;
    resize: vertical;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.form-note {
    min-height: 1.2rem;
    margin-top: 0.6rem;
    color: var(--primary-strong);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.form-note.success {
    color: #6ce69f;
}

.form-note.error {
    color: #f38a8a;
}

.form-note a {
    color: var(--primary);
    text-decoration: underline;
}

.form-note a:hover,
.form-note a:focus {
    color: var(--text);
}

.site-footer {
    padding: 1.1rem 0 1.6rem;
}

.footer-wrap {
    border-top: 1px solid var(--line);
    padding-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
}

.footer-wrap p {
    color: var(--muted);
}

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

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease;
}

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

.skill-icon {
    width: 40px;
    height: 40px;
    fill: var(--primary);
    margin-bottom: 0.5rem;
}

.skill-item span {
    font-size: 0.9rem;
    font-weight: 600;
}

.experience-list,
.education-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.experience-item,
.education-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.experience-item h3,
.education-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.company,
.institution {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.experience-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.experience-item li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.experience-item li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.tech-stack span {
    background: var(--line);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.contact-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

.social-links a {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.social-links svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.social-links a:hover {
    border-color: #c6ced6;
    color: var(--primary);
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-photo {
        justify-self: start;
        width: min(300px, 100%);
    }

    .stats,
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .menu-btn {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        right: 4vw;
        top: 60px;
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0.5rem;
        min-width: 140px;
        margin-left: 0;
    }

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

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

    .footer-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}
