:root {
    --bg: #f6f7fb;
    --bg-elevated: #ffffff;
    --text: #12141c;
    --muted: #5c6578;
    --line: #e4e7ef;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #6366f1;
    --on-primary: #ffffff;
    --chip: #f3f4f8;
    --glow: rgba(99, 102, 241, 0.18);
    --shadow: 0 18px 40px rgba(18, 20, 28, 0.06);
    --nav: rgba(246, 247, 251, 0.86);
    --radius: 1.25rem;
    --font: "Inter", "Segoe UI", sans-serif;
    --display: "Space Grotesk", "Segoe UI", sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0b0d12;
    --bg-elevated: #141822;
    --text: #f4f6fb;
    --muted: #b7c0d0;
    --line: #2a3142;
    --primary: #818cf8;
    --primary-hover: #c7d2fe;
    --accent: #818cf8;
    --on-primary: #0b0d12;
    --chip: #1c2230;
    --glow: rgba(129, 140, 248, 0.22);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --nav: rgba(11, 13, 18, 0.82);
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--primary-hover);
}

h1,
h2,
h3,
.brand {
    font-family: var(--display);
    letter-spacing: -0.03em;
    line-height: 1.12;
}

h1 {
    font-size: clamp(2.6rem, 8vw, 4.6rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 600;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

::selection {
    background: color-mix(in srgb, var(--accent) 32%, transparent);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3.5rem;
    z-index: 40;
    background: var(--primary);
    color: var(--on-primary);
    text-decoration: none;
    padding: 0.65rem 1rem;
    border-radius: 0.7rem;
    font-weight: 600;
}

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

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.narrow {
    width: min(760px, calc(100% - 2rem));
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: var(--bg-elevated);
}

@supports (backdrop-filter: blur(16px)) {
    .navbar {
        background: var(--nav);
        backdrop-filter: blur(16px);
    }
}

.nav-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 4.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.nav-menu {
    display: none;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0 0.9rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
}

.nav-menu.is-open {
    display: flex;
}

.nav-link {
    display: block;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.7rem 0.2rem;
    border-radius: 999px;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--text);
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.icon-button,
.menu-toggle {
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
}

.icon-button:hover,
.menu-toggle:hover {
    background: var(--chip);
}

.icon-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: block;
}

.menu-toggle {
    position: relative;
}

.menu-toggle span {
    position: absolute;
    left: 0.85rem;
    width: 1.05rem;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.menu-toggle span:nth-child(1) { top: 0.95rem; }
.menu-toggle span:nth-child(2) { top: 1.32rem; }
.menu-toggle span:nth-child(3) { top: 1.7rem; }

.menu-toggle[aria-expanded="true"] span:nth-child(1),
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    top: 1.32rem;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg);
}

.hero {
    position: relative;
    background: var(--bg);
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.75rem;
    padding: 2.75rem 0 4rem;
}

.kicker {
    color: var(--primary);
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.05rem;
    min-height: 1.4em;
    margin-bottom: 0.75rem;
}

.typing::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 0.9em;
    margin-left: 3px;
    background: var(--accent);
    vertical-align: -0.08em;
    animation: blink 1s steps(1) infinite;
}

.lede {
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 38rem;
    margin-top: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.hero-photo {
    position: relative;
    width: min(220px, 64vw);
    aspect-ratio: 1;
    perspective: 900px;
}

.hero-orb {
    position: absolute;
    z-index: 0;
    left: 50%;
    top: 50%;
    width: 240%;
    height: 240%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: radial-gradient(
        ellipse 32% 32% at var(--ox, 58%) var(--oy, 40%),
        var(--glow) 0%,
        var(--glow) 18%,
        transparent 100%
    );
}

.hero-photo picture {
    position: relative;
    z-index: 1;
    display: block;
    height: 100%;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 50%;
    box-shadow:
        0 0 0 4px var(--bg-elevated),
        0 0 0 6px var(--accent),
        0 22px 48px rgba(15, 23, 42, 0.16);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.18s ease-out;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}

.section {
    padding: 4.25rem 0;
}

.section-title {
    margin-bottom: 1.6rem;
}

.section-title::after {
    content: "";
    display: block;
    width: 2.4rem;
    height: 3px;
    margin-top: 0.8rem;
    border-radius: 999px;
    background: var(--accent);
}

.about-copy {
    display: grid;
    gap: 1rem;
    max-width: 46rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.facts {
    list-style: none;
    display: grid;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.facts li,
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.facts li {
    padding: 1rem 1.1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.facts li:hover,
.card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: var(--shadow);
}

.facts span,
.meta,
.contact-list span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.bento,
.edu-grid,
.contact-grid {
    display: grid;
    gap: 1rem;
}

.card {
    padding: 1.35rem 1.3rem 1.45rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card p {
    color: var(--muted);
    margin-top: 0.45rem;
}

.card-feature p {
    margin: 0.55rem 0 1rem;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tags li {
    border: 1px solid var(--line);
    background: var(--chip);
    color: var(--text);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.tags li:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.place {
    color: var(--muted);
    margin-top: 0.2rem;
}

.points {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    margin-top: 1.1rem;
    color: var(--muted);
}

.points li {
    position: relative;
    padding-left: 1rem;
}

.points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--accent);
}

.project {
    margin-top: 0.25rem;
}

.shot {
    margin-top: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.shot:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: var(--shadow);
}

.shot a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.shot img {
    width: 100%;
    height: auto;
    background: #f4f5f7;
}

.shot figcaption {
    padding: 0.75rem 1rem 0.95rem;
    font-weight: 600;
}

.contact-list {
    list-style: none;
    display: grid;
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.contact-list a {
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-list a:hover {
    text-decoration: underline;
}

.contact-list small {
    display: block;
    color: var(--muted);
    margin-top: 0.15rem;
}

.contact-form {
    display: grid;
    gap: 0.9rem;
}

.field {
    display: grid;
    gap: 0.35rem;
}

.field label {
    font-weight: 600;
    font-size: 0.92rem;
}

.field input,
.field textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.8rem 0.9rem;
}

.field textarea {
    resize: vertical;
    min-height: 8rem;
}

.field input:hover,
.field textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: #b91c1c;
}

.recaptcha {
    min-height: 78px;
}

.form-status {
    min-height: 1.3em;
    font-size: 0.95rem;
}

.form-status.is-error {
    color: #b91c1c;
}

.form-status.is-ok {
    color: var(--primary);
}

[data-theme="dark"] .form-status.is-error {
    color: #fca5a5;
}

.btn:disabled {
    opacity: 0.65;
    cursor: progress;
    transform: none;
}

.contact-form .btn {
    width: 100%;
}

.footer {
    border-top: 1px solid var(--line);
    padding: 1.4rem 0 2rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--d, 0ms);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

section:focus {
    outline: none;
}

section:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

@keyframes blink {
    50% { opacity: 0; }
}

@media (min-width: 700px) {
    .facts {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 800px) {
    .bento {
        grid-template-columns: 1.35fr 1fr;
    }

    .card-feature {
        grid-row: span 2;
    }

    .edu-grid,
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .contact-form .btn {
        width: auto;
        justify-self: start;
    }
}

@media (min-width: 900px) {
    .menu-toggle {
        display: none;
    }

    .navbar nav {
        display: flex;
        justify-content: flex-end;
        flex: 1;
    }

    .nav-menu,
    .nav-menu.is-open {
        display: flex;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 0.15rem;
        width: auto;
        padding: 0;
        background: transparent;
        border: 0;
        transform: none;
    }

    .nav-link {
        padding: 0.45rem 0.75rem;
    }

    .nav-link:hover,
    .nav-link[aria-current="page"] {
        background: var(--chip);
    }

    .hero {
        min-height: calc(100vh - 4.25rem);
        display: flex;
        align-items: center;
    }

    .hero-layout {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        align-items: center;
        text-align: left;
        gap: 3rem;
        padding: 3rem 0;
        width: min(1120px, calc(100% - 2rem));
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-photo {
        justify-self: end;
        width: 360px;
    }

    .section {
        padding: 6.25rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .reveal,
    .typing::after {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn:hover,
    .card:hover,
    .facts li:hover,
    .shot:hover,
    .hero-photo img {
        transform: none;
        transition: none;
    }
}
