:root {
    --bg: #0b1220;
    --panel: #111a2b;
    --panel2: #16213a;
    --text: #e5e7eb;
    --muted: #c7cbd6;
    --muted2: #9aa3b2;
    --border: #27324a;
    --shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    --accentA: #ff6fae;
    --accentB: #7c4dff;
    --radius: 20px;
    --radius2: 24px;
    --max: 1120px;
    --focus: 0 0 0 3px rgba(124, 77, 255, .35);
}

[data-theme="light"] {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel2: #f2f4f8;
    --text: #111827;
    --muted: #374151;
    --muted2: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    --focus: 0 0 0 3px rgba(124, 77, 255, .25);
}

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

html,
body {
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background:
        radial-gradient(1200px 600px at 80% 0%, rgba(255, 111, 174, .18), transparent 60%),
        radial-gradient(900px 500px at 10% 20%, rgba(124, 77, 255, .16), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
    overflow-x: clip;
}

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

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

.container {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding-inline: 16px;
}

.skip-link {
    position: absolute;
    left: -999px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    padding: 10px 14px;
    background: var(--panel2);
    border-radius: 12px;
    box-shadow: var(--focus);
    z-index: 9999;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
    border-bottom: 1px solid var(--border);
}

.nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-block: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-text {
    min-width: 0;
}

.logo {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
    box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
}

.logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand .name {
    font-weight: 800;
    line-height: 1.1;
}

.brand .tag {
    font-size: 12px;
    line-height: 1.2;
    color: var(--muted2);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navlinks {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.navlinks.open {
    display: flex;
}

.navlinks a {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--muted);
    white-space: normal;
}

.navlinks a:hover,
.navlinks a[aria-current="page"] {
    background: var(--panel2);
    color: var(--text);
}

.btn,
.iconbtn {
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
}

.btn {
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.btn.primary {
    border: none;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
    color: white;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .4);
}

.iconbtn {
    width: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

main {
    padding: 28px 0 56px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    width: 100%;
    overflow: hidden;
}

.card.pad {
    padding: 20px;
}

h1 {
    margin: 14px 0 10px;
    font-size: clamp(30px, 8vw, 52px);
    line-height: 1.05;
    overflow-wrap: break-word;
}

h2,
h3 {
    margin-top: 0;
    overflow-wrap: break-word;
}

.page-hero {
    font-size: clamp(28px, 7vw, 44px);
}

.lead {
    color: var(--muted);
    max-width: 62ch;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--panel2);
    border-radius: 999px;
    font-size: 13px;
    max-width: 100%;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
    flex-shrink: 0;
}

.cta-row {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.featured-project {
    margin-top: 22px;
}

.featured-image {
    width: 100%;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    margin-top: 14px;
    margin-bottom: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.grid {
    display: grid;
    gap: 18px;
    width: 100%;
}

.cols-2,
.cols-3,
.project-grid {
    grid-template-columns: 1fr;
}

.project-grid {
    display: grid;
    gap: 18px;
    width: 100%;
}

.project {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.project img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid var(--border);
    background: var(--panel2);
}

.project .body {
    padding: 16px;
    min-width: 0;
}

.project p {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 12px;
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--panel2);
    border: 1px solid var(--border);
    color: var(--muted);
    max-width: 100%;
}

.project .actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-form {
    margin-top: 20px;
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    min-width: 0;
}

.field label {
    font-weight: 600;
}

.input,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

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

.resume-frame-wrap {
    display: none;
}

footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
    color: var(--muted2);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-links {
    margin-top: 10px;
}

@media (min-width: 640px) {
    .btn {
        width: auto;
    }

    .cta-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .featured-image {
        aspect-ratio: 16 / 9;
    }
}

@media (min-width: 769px) {
    .container {
        padding-inline: 20px;
    }

    .nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .brand .tag {
        display: block;
    }

    .menu-toggle {
        display: none;
    }

    .navlinks {
        grid-column: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-top: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .navlinks a {
        padding: 10px 14px;
        white-space: nowrap;
    }

    .cta-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .btn {
        width: auto;
    }

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

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

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

    .resume-mobile-note {
        display: none;
    }

    .resume-frame-wrap {
        display: block;
        margin-top: 28px;
        width: 100%;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--panel2);
    }

    .resume-frame {
        width: 100%;
        height: 900px;
        border: 0;
        display: block;
    }
}

@media (min-width: 981px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}