:root {
    --surface: #f6f8fb;
    --surface-strong: #ffffff;
    --surface-muted: #f2f8ff;
    --text: #101820;
    --text-muted: #5f6f81;
    --line: #dbe3ee;
    --accent: #12706f;
    --accent-soft: #e4f2f0;
    --accent-glow: rgba(18, 112, 111, 0.24);
    --bg-radial-1: rgba(18, 112, 111, 0.1);
    --bg-radial-2: rgba(18, 112, 111, 0.08);
    --bg-sheen: rgba(255, 255, 255, 0.44);
    --header-bg: rgba(246, 248, 251, 0.84);
    --dot-color: rgba(16, 24, 32, 0.055);
    --panel-shadow: 0 20px 55px rgba(15, 27, 40, 0.08);
    --soft-shadow: 0 12px 30px rgba(15, 27, 40, 0.06);
    --signature-inset: rgba(255, 255, 255, 0.85);
    --danger: #b42318;
    --radius-lg: 1.4rem;
    --radius-md: 0.95rem;
    --section-space: clamp(4.5rem, 8vw, 8rem);
}

html[data-theme="dark"] {
    --surface: #070d14;
    --surface-strong: #0f1a25;
    --surface-muted: #142332;
    --text: #e8fbff;
    --text-muted: #a5d7e3;
    --line: #253446;
    --accent: #49d7e8;
    --accent-soft: #143441;
    --accent-glow: rgba(73, 215, 232, 0.28);
    --bg-radial-1: rgba(73, 215, 232, 0.12);
    --bg-radial-2: rgba(73, 215, 232, 0.08);
    --bg-sheen: rgba(7, 13, 20, 0.55);
    --header-bg: rgba(7, 13, 20, 0.84);
    --dot-color: rgba(192, 243, 252, 0.09);
    --panel-shadow: 0 16px 42px rgba(1, 5, 10, 0.5);
    --soft-shadow: 0 10px 26px rgba(1, 5, 10, 0.38);
    --signature-inset: rgba(7, 13, 20, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 16% 10%, var(--bg-radial-1), transparent 34%),
        radial-gradient(circle at 88% 0%, var(--bg-radial-2), transparent 28%),
        linear-gradient(145deg, var(--bg-sheen), transparent 40%),
        var(--surface);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--dot-color) 0.5px, transparent 0.5px);
    background-size: 10px 10px;
    opacity: 0.18;
    z-index: -1;
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
}

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 200;
    background-color: var(--accent);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0 0 0.75rem 0.75rem;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background-color: var(--header-bg);
    border-bottom: 1px solid rgba(219, 227, 238, 0.78);
}

html[data-theme="dark"] .site-header {
    border-bottom-color: rgba(37, 52, 70, 0.86);
}

.brand-link {
    position: relative;
}

.brand-link::after {
    content: "builds-with-intent";
    position: absolute;
    left: 0;
    bottom: -1.05rem;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 1.3rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
    transition: color 180ms ease;
}

.theme-toggle {
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background-color: var(--surface-strong);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.45rem 0.85rem;
    transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.theme-toggle-label {
    line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 8px 18px var(--accent-glow);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
    color: var(--accent);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background-color: var(--accent);
    transition: width 180ms ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
    width: 100%;
}

.menu-btn {
    display: none;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-strong);
    flex-direction: column;
    gap: 0.24rem;
}

.menu-btn span {
    display: block;
    width: 1.15rem;
    height: 2px;
    border-radius: 99px;
    background-color: var(--text);
    transition: all 200ms ease;
}

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

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

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

.section-wrap {
    padding-block: var(--section-space);
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

.section-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.section-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.65rem);
    line-height: 1.12;
}

.section-copy {
    margin: 1.15rem 0 0;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 62ch;
}

.hero {
    min-height: calc(100vh - 76px);
    display: grid;
    gap: 1.5rem;
    align-items: start;
    grid-template-columns: 1.1fr 0.9fr;
    padding-block: clamp(5.2rem, 8vw, 8.4rem) clamp(4rem, 6vw, 5.4rem);
}

.hero-copy {
    position: relative;
}

.dev-signature {
    margin-top: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 0.95rem;
    background: linear-gradient(160deg, var(--surface-muted), var(--surface-strong) 60%);
    padding: 0.95rem;
    box-shadow: inset 0 1px 0 var(--signature-inset);
}

.dev-signature p {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dev-signature ul {
    margin: 0.45rem 0 0;
    padding: 0;
    list-style: none;
}

.dev-signature code {
    color: var(--text);
    font-size: 0.84rem;
    line-height: 1.65;
}

.hero-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: 1.01;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    margin: 1rem 0 0;
    font-weight: 700;
    color: var(--accent);
    font-size: clamp(1.05rem, 2.1vw, 1.42rem);
}

.hero-panel,
.about-card,
.project-card,
.contact-card,
.social-link {
    border: 1px solid var(--line);
    background-color: var(--surface-strong);
    border-radius: var(--radius-lg);
}

.hero-panel {
    padding: 1.25rem;
    box-shadow: var(--panel-shadow);
    animation: float-panel 4.5s ease-in-out infinite;
}

.profile-image {
    width: min(100%, 365px);
    border-radius: 1.25rem;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin-inline: auto;
}

.panel-copy {
    margin: 1rem 0 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.metrics-grid {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.metric-card {
    border-radius: 0.8rem;
    background-color: var(--accent-soft);
    padding: 0.7rem;
    text-align: center;
}

.metric-value {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
}

.metric-label {
    margin: 0.18rem 0 0;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.button-row {
    display: flex;
    gap: 0.85rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    min-height: 2.95rem;
    padding: 0.72rem 1.3rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn-primary {
    border: 1px solid var(--accent);
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 14px 28px var(--accent-glow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(18, 112, 111, 0.34);
}

.btn-primary:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.btn-secondary {
    border: 1px solid var(--line);
    color: var(--text-muted);
    background-color: var(--surface-strong);
}

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

.about-card {
    padding: 1.35rem;
    box-shadow: var(--soft-shadow);
}

.about-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.2rem;
}

.skills-list {
    list-style: none;
    margin: 0.95rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.skill-pill,
.tech-pill {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
}

.skill-pill {
    border: 1px solid var(--line);
    background-color: var(--surface-strong);
    color: var(--text-muted);
}

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

.filters-wrap {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.filter-chip {
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.42rem 0.9rem;
    transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
}

.filter-chip.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.project-card {
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease;
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(15, 27, 40, 0.12);
    border-color: #c2d5e8;
}

.project-card.is-hidden {
    display: none;
}

.project-card img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

.project-content {
    padding: 1.05rem;
}

.project-content h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.16rem;
    color: var(--text);
}

.project-content p {
    margin: 0.6rem 0 0;
    color: var(--text-muted);
    line-height: 1.62;
    font-size: 0.94rem;
}

.tech-stack {
    margin: 0.9rem 0 0;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-pill {
    border: 1px solid var(--line);
    background-color: var(--surface-muted);
    color: var(--text-muted);
}

.project-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.55rem;
}

.project-link {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.38rem 0.8rem;
    transition: border-color 180ms ease, color 180ms ease;
}

.project-link:hover,
.project-link:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.contact-card {
    padding: clamp(1.3rem, 3vw, 1.9rem);
    box-shadow: 0 16px 40px rgba(15, 27, 40, 0.08);
}

.contact-form {
    display: grid;
    gap: 0.35rem;
    margin-top: 1.35rem;
}

.contact-form label {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
    border: 1px solid var(--line);
    background-color: var(--surface-strong);
    border-radius: 0.8rem;
    padding: 0.78rem 0.85rem;
    font: inherit;
    color: var(--text);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 112, 111, 0.18);
}

.contact-form input.is-invalid,
.contact-form textarea.is-invalid {
    border-color: var(--danger);
}

.field-error {
    margin: 0.22rem 0 0;
    min-height: 1.05rem;
    font-size: 0.78rem;
    color: var(--danger);
}

.contact-form-status {
    margin: 0.5rem 0 0;
    min-height: 1.2rem;
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.contact-form-status.success {
    color: #146c43;
}

.contact-form-status.error {
    color: var(--danger);
}

.social-grid {
    display: grid;
    gap: 0.8rem;
    align-content: start;
}

.social-link {
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-weight: 700;
    transition: transform 200ms ease, border-color 200ms ease, color 200ms ease;
}

.social-link span:last-child {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.social-link:hover,
.social-link:focus-visible {
    transform: translateX(4px);
    border-color: var(--accent);
    color: var(--accent);
}

.footer-link {
    color: var(--text-muted);
    font-weight: 600;
    transition: color 180ms ease;
}

body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
    transition:
        background-color 300ms ease,
        color 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease,
        fill 300ms ease,
        stroke 300ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: var(--accent);
}

.reveal {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(18px) scale(0.985);
    transition: opacity 620ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 620ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
}

.project-modal.is-open {
    display: grid;
    place-items: center;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 40, 0.5);
    backdrop-filter: blur(2px);
    animation: fade-in 240ms ease;
}

.project-modal-panel {
    position: relative;
    width: min(760px, calc(100% - 1.4rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 1.2rem;
    padding: 1.05rem;
    box-shadow: 0 24px 54px rgba(15, 27, 40, 0.25);
    animation: modal-pop 290ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-close {
    margin-left: auto;
    margin-bottom: 0.7rem;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    border-radius: 999px;
    padding: 0.38rem 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.modal-image {
    width: 100%;
    height: clamp(160px, 30vw, 320px);
    object-fit: cover;
    border-radius: 0.9rem;
    border: 1px solid var(--line);
}

.modal-meta {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

.modal-title {
    margin: 0.32rem 0 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.modal-description {
    margin: 0.55rem 0 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.modal-highlights {
    margin: 0.85rem 0 0;
    padding-left: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

@keyframes float-panel {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1024px) {

    .hero,
    .section-grid,
    .contact-shell {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .layout-wrap {
        width: min(1120px, calc(100% - 1.2rem));
    }

    .menu-btn {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.35rem);
        left: 0.65rem;
        right: 0.65rem;
        padding: 0.95rem;
        border: 1px solid var(--line);
        border-radius: 0.9rem;
        background-color: var(--surface-strong);
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        display: none;
    }

    .nav-links[data-open="true"] {
        display: flex;
    }

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

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .brand-link::after {
        display: none;
    }

    .project-modal-panel {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }
}

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

    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}