:root {
    --bg: #050b14;
    --bg2: #08111e;
    --panel: #0b1422;
    --panel2: #0e1828;
    --text: #f5f7fb;
    --muted: #9ba7b7;
    --line: #202c3e;
    --purple: #9b5cff;
    --purple2: #6f35ef;
    --green: #31c46c;
    --amber: #d99925;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: radial-gradient(circle at 70% -10%,#121a31 0,#050b14 38%,#040911 100%);
    color: var(--text);
    font-family: Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    line-height: 1.55;
}

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

img,
video {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: min(1180px,calc(100% - 40px));
    margin: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(4,9,17,.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.nav {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    margin-right: auto;
    font-weight: 900;
    letter-spacing: .03em;
}

    .brand small {
        display: block;
        color: var(--purple);
        font-size: 11px;
        letter-spacing: .12em;
    }

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 14px;
}

    .nav-links a {
        color: #d9ddea;
    }

        .nav-links a.active,
        .nav-links a:hover {
            color: #fff;
        }

            .nav-links a.active:after {
                content: "";
                display: block;
                height: 2px;
                background: var(--purple);
                margin-top: 7px;
            }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}

    .btn.primary {
        border-color: transparent;
        background: linear-gradient(135deg,var(--purple),var(--purple2));
    }

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

.mobile-menu {
    display: none;
}

.hero {
    display: grid;
    grid-template-columns: .88fr 1.3fr;
    min-height: 420px;
    border-bottom: 1px solid var(--line);
}

.hero-copy {
    padding: 52px 34px 44px 0;
    align-self: center;
}

.eyebrow {
    color: #b783ff;
    font-weight: 700;
}

.hero h1 {
    font-size: clamp(35px,6vw,56px);
    line-height: .96;
    margin: 10px 0 14px;
    letter-spacing: -.045em;
}

    .hero h1 span {
        display: block;
        color: var(--purple);
        font-size: .72em;
        margin-top: 12px;
    }

.lead {
    color: #bdc7d6;
    max-width: 580px;
}

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

    .socials a {
        display: flex;
        align-items: center;
        gap: 7px;
        color: #bdc7d6;
    }

.social-icon {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
}

.hero-art {
    min-height: 420px;
    background: linear-gradient(90deg,var(--bg) 0,transparent 18%),url("../images/hero-workspace.webp") center/cover no-repeat;
}

.section {
    padding: 34px 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

    .section-title:after {
        content: "";
        width: 36px;
        height: 2px;
        background: var(--purple);
    }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ghost-link {
    color: #c7ccd7;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.grid {
    display: grid;
    gap: 18px;
}

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

.project-card {
    background: linear-gradient(180deg,rgba(15,25,41,.98),rgba(8,16,28,.98));
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: .2s;
}

    .project-card:hover {
        transform: translateY(-4px);
        border-color: #4b3375;
    }

.project-thumb {
    aspect-ratio: 2.14/1;
    object-fit: cover;
    width: 100%;
}

.project-body {
    padding: 15px;
}

.project-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.project-card h3 {
    font-size: 20px;
    margin: 0;
}

.tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.tag,
.status {
    font-size: 11px;
    border-radius: 7px;
    padding: 4px 8px;
    border: 1px solid #493474;
    color: #c9a8ff;
    text-transform: uppercase;
}

    .status.released {
        background: #10351e;
        border-color: #1f5d34;
        color: #73e49a;
    }

    .status.unreleased {
        background: #33250e;
        border-color: #5d451e;
        color: #ffc65d;
    }

    .status.prototype {
        background: #2c1851;
        border-color: #523086;
        color: #c99dff;
    }

.project-card p {
    color: var(--muted);
    font-size: 14px;
    min-height: 44px;
}

.case-link {
    display: inline-flex;
    gap: 8px;
    color: #b677ff;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    margin-top: 4px;
}

.about-preview {
    grid-template-columns: 1fr .95fr 1fr;
    align-items: stretch;
}

.panel {
    background: rgba(10,18,31,.94);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}

    .panel h3 {
        margin-top: 0;
    }

.portrait {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    border-radius: 13px;
}

.checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .checklist li {
        padding: 5px 0;
        color: #cbd3df;
    }

        .checklist li:before {
            content: "✓";
            color: var(--purple);
            margin-right: 9px;
        }

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

.timeline-item {
    position: relative;
    padding-left: 24px;
}

    .timeline-item:before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        width: 9px;
        height: 9px;
        background: var(--purple);
        border-radius: 50%;
        box-shadow: 0 0 0 5px rgba(155,92,255,.12);
    }

    .timeline-item:not(:last-child):after {
        content: "";
        position: absolute;
        left: 4px;
        top: 20px;
        bottom: -22px;
        width: 1px;
        background: #4a2c78;
    }

    .timeline-item strong {
        display: block;
    }

    .timeline-item small {
        color: #a37adc;
    }

.tools-wrap {
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.04);
    padding: 10px 0;
}

.tools-track {
    display: flex;
    width: max-content;
    gap: 10px;
    padding: 6px 0;
    animation: marquee 28s linear infinite;
}

    .tools-track.reverse {
        animation-direction: reverse;
        animation-duration: 32s;
    }

.tool-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    background: #0c1524;
    border: 1px solid #27334a;
    border-radius: 9px;
    white-space: nowrap;
    color: #e4e8ef;
}

.tool-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #413068, #111a28);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

    .tool-logo img {
        width: 18px;
        height: 18px;
        object-fit: contain;
        display: block;
    }

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

.cta {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    align-items: center;
    gap: 20px;
    padding: 30px;
    border-radius: 16px;
    background: radial-gradient(circle at 75% 20%,rgba(155,92,255,.22),transparent 35%),linear-gradient(135deg,#16132a,#0b1120);
    border: 1px solid #332a51;
    text-align: center;
}

.cta-orb {
    font-size: 64px;
    color: #8f55ff;
}

.cta h2 {
    font-size: 30px;
    margin: 0 0 8px;
}

.footer {
    border-top: 1px solid var(--line);
    padding: 22px 0 30px;
    color: #8d98aa;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    min-height: 320px;
}

    .page-hero h1 {
        font-size: 56px;
        margin: 0 0 12px;
    }

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 26px;
}

.filter {
    border: 1px solid var(--line);
    background: #0b1422;
    color: #d5dbea;
    border-radius: 10px;
    padding: 11px 18px;
    cursor: pointer;
}

    .filter.active {
        background: linear-gradient(135deg,var(--purple),var(--purple2));
        border-color: transparent;
    }

.projects-all {
    grid-template-columns: repeat(3,1fr);
}

.project-detail-top {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 28px 0 18px;
}

.project-icon {
    aspect-ratio: 1/1;
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.project-info {
    padding: 14px 0;
}

    .project-info h1 {
        font-size: 54px;
        margin: 0 0 4px;
    }

    .project-info .subtitle {
        color: #b576ff;
        font-size: 22px;
        font-weight: 800;
    }

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

.meta-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px;
    background: #0b1422;
}

    .meta-card small {
        display: block;
        color: #8e9aac;
        text-transform: uppercase;
        font-size: 10px;
    }

.media-panel {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
    background: #091321;
}

.media-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 17px;
}

.media-tab {
    border: 0;
    background: transparent;
    color: #aab4c2;
    padding: 8px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

    .media-tab.active {
        color: #fff;
        border-color: var(--purple);
    }

.media-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(155px,1fr);
    overflow: auto;
    gap: 13px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.media-item {
    position: relative;
    scroll-snap-align: start;
    min-height: 265px;
    border: 1px solid #2a3549;
    border-radius: 13px;
    overflow: hidden;
    background: #111a28;
}

    .media-item img,
    .media-item video {
        width: 100%;
        height: 265px;
        object-fit: cover;
    }

.play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 32px;
    background: linear-gradient(transparent 40%,rgba(0,0,0,.4));
    pointer-events: none;
}

.media-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    background: linear-gradient(transparent,rgba(0,0,0,.88));
    font-size: 12px;
    text-align: center;
}

.case-stack {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
}

.case-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
    background: #081321;
}

    .case-row:last-child {
        border-bottom: 0;
    }

.case-title {
    color: #b477ff;
    font-size: 20px;
    font-weight: 850;
}

.case-content {
    color: #c2ccda;
}

.loop {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.loop-item {
    padding: 14px 18px;
    border: 1px solid #35425a;
    border-radius: 11px;
    background: #0e1929;
}

.loop-arrow {
    color: #b577ff;
    font-size: 24px;
}

.about-hero {
    display: grid;
    grid-template-columns: 1fr .8fr 1fr;
    gap: 20px;
    align-items: center;
    padding: 34px 0;
}

    .about-hero h1 {
        font-size: 48px;
        line-height: 1;
    }

.info-list {
    display: grid;
    gap: 0;
}

    .info-list div {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
    }

.strength-grid {
    grid-template-columns: repeat(5,1fr);
}

.strength-card {
    text-align: center;
}

.strength-icon {
    font-size: 34px;
    color: #ad70ff;
}

.work-grid {
    grid-template-columns: repeat(6,1fr);
}

.step {
    text-align: center;
    position: relative;
}

    .step b {
        display: block;
        color: #b477ff;
        font-size: 20px;
    }

.resume-grid {
    grid-template-columns: 320px 1fr;
}

.resume-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.resume-section {
    margin-bottom: 18px;
}

.contact-grid {
    grid-template-columns: 1.4fr .8fr;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

    .form-grid .wide {
        grid-column: 1/-1;
    }

.field {
    display: grid;
    gap: 7px;
}

    .field input,
    .field textarea,
    .field select {
        width: 100%;
        background: #081321;
        border: 1px solid var(--line);
        color: white;
        border-radius: 10px;
        padding: 12px;
    }

    .field textarea {
        min-height: 170px;
        resize: vertical;
    }

.notice {
    color: #8f9bad;
    font-size: 13px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .modal.open {
        display: flex;
    }

.modal-inner {
    max-width: min(1000px,96vw);
    max-height: 90vh;
    position: relative;
}

.modal img,
.modal video {
    max-height: 86vh;
    border-radius: 12px;
}

.modal-close {
    position: absolute;
    right: -12px;
    top: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: white;
    color: #111;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width:900px) {
    .nav-links,
    .nav > .btn {
        display: none;
    }

    .mobile-menu {
        display: block;
        margin-left: auto;
    }

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

    .hero-art {
        min-height: 300px;
        order: -1;
    }

    .hero-copy {
        padding: 34px 0;
    }

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

    .about-preview,
    .about-hero,
    .resume-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

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

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

    .project-detail-top {
        grid-template-columns: 220px 1fr;
    }

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

    .case-row {
        grid-template-columns: 1fr;
    }

    .resume-sidebar {
        position: static;
    }

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

    .cta-orb {
        display: none;
    }
}

@media (max-width:620px) {
    .container {
        width: min(100% - 24px,1180px);
    }

    .project-grid,
    .projects-all,
    .strength-grid,
    .work-grid {
        grid-template-columns: 1fr;
    }

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

    .project-icon {
        max-width: 260px;
    }

    .project-info h1,
    .page-hero h1 {
        font-size: 40px;
    }

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

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

    .nav {
        min-height: 62px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .page-hero {
        grid-template-columns: 1fr;
    }

        .page-hero .hero-art {
            display: none;
        }

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

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

    .tools-track {
        animation: none;
    }
}

/* ===== SPA additions ===== */
html {
    background: #050b14;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
}

.page-content {
    animation: pageIn .22s ease both;
}

@keyframes pageIn {
    from {
        opacity: .25;
        transform: translateY(4px);
    }

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

::view-transition-old(root) {
    animation: fadeOut .14s ease both;
}

::view-transition-new(root) {
    animation: fadeIn .18s ease both;
}

@keyframes fadeOut {
    to {
        opacity: .18;
    }
}

@keyframes fadeIn {
    from {
        opacity: .18;
    }

    to {
        opacity: 1;
    }
}

.nav-links a,
.brand,
.case-link,
.ghost-link,
.btn[data-route] {
    cursor: pointer;
}

.project-card {
    position: relative;
}

    .project-card .case-link {
        position: relative;
        z-index: 2;
    }

.project-card-click {
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.empty-note {
    color: var(--muted);
    margin: 0;
}

.media-strip {
    scrollbar-width: thin;
    scrollbar-color: #5a3a88 transparent;
}

.media-item {
    cursor: pointer;
}

.route-error {
    padding: 80px 0;
    text-align: center;
}

    .route-error h1 {
        font-size: 48px;
        margin-bottom: 10px;
    }

@media (prefers-reduced-motion:reduce) {
    .page-content {
        animation: none;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}
