:root {
    color-scheme: dark;
    --bg: #151515;
    --surface: #1b1b1b;
    --fg: #ededeb;
    --muted: #a3a3a0;
    --line: #ffffff16;
    --glass: #242424b0;
    --dot: #ffffff0b;
    --max: 1180px;
}

html[data-theme=light] {
    color-scheme: light;
    --bg: #f4f3ef;
    --surface: #e9e8e4;
    --fg: #222321;
    --muted: #62635f;
    --line: #00000018;
    --glass: #ffffffe0;
    --dot: #0000000c;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.6 Inter,Arial,sans-serif;
    transition: background .3s,color .3s;
}

body:not(.frame-body) {
    background-image: radial-gradient(var(--dot) 1px,transparent 1px);
    background-size: 24px 24px;
}

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

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

button:focus-visible,a:focus-visible {
    outline: 2px solid #769de5;
    outline-offset: 5px;
}

.nav {
    position: sticky;
    top: 16px;
    z-index: 10;
    margin: 16px auto 0;
    width: min(calc(100% - 32px),760px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 #ffffff20,0 8px 40px #00000012;
}

.logo {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -3px;
    line-height: 1;
}

.logo span {
    color: var(--muted);
}

nav {
    display: flex;
    gap: clamp(12px,4vw,36px);
    font-size: 13px;
    color: var(--muted);
}

nav a:hover {
    color: var(--fg);
}

#close {
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    width: 40px;
    height: 40px;
}

main:not(.detail),footer {
    max-width: var(--max);
    margin: auto;
    padding-inline: clamp(20px,5vw,64px);
}

.hero {
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 0;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

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

h1,h2,h3 {
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.045em;
}

h1 {
    font-size: clamp(44px,7vw,100px);
}

h1 span {
    color: var(--muted);
}

h2 {
    font-size: clamp(34px,5vw,60px);
}

h3 {
    font-size: clamp(24px,3vw,38px);
}

.intro,.muted {
    color: var(--muted);
}

.pill {
    display: inline-flex;
    gap: 24px;
    align-items: center;
    border: 1px solid var(--line);
    padding: 12px 20px;
    border-radius: 100px;
    background: var(--surface);
    font-size: 13px;
}

.pill[hidden] {
    display: none;
}

.sectionhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.sectionhead>span {
    color: var(--muted);
    font-size: 12px;
}

.project {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0;
    margin: 32px 0 90px;
}

.visual {
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    display: grid;
    place-items: center;
}

.visual::before {
    content: "";
    position: absolute;
    inset: 15%;
    border: 1px solid var(--line);
    border-radius: 32px;
    transform: rotate(-12deg) translateY(var(--shift,0px));
    box-shadow: 0 0 0 40px var(--line),0 0 0 80px var(--line);
}

.visual-1::before {
    transform: rotate(15deg) translateY(var(--shift,0px));
    border-radius: 50%;
}

.visual-2::before {
    transform: rotate(-25deg) translateY(var(--shift,0px));
    border-radius: 100px;
}

.visual img {
    width: 100%;
    height: calc(100% + 50px);
    object-fit: cover;
    position: absolute;
    transform: translateY(var(--shift,0px));
    transition: filter .3s;
}

.project:hover img {
    filter: brightness(.85);
}

.placeholder {
    font-size: clamp(70px,16vw,180px);
    color: var(--muted);
    opacity: .25;
    line-height: 1;
}

.asset-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 10px;
    letter-spacing: .15em;
    color: var(--muted);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
}

.arrow {
    font-size: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
}

.project:hover .arrow {
    background: var(--fg);
    color: var(--bg);
}

.about,.resume {
    padding: 90px 0;
    border-top: 1px solid var(--line);
}

.about>p:last-child {
    max-width: 650px;
    color: var(--muted);
    font-size: 20px;
}

#resume-content {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-block: 40px;
    color: var(--muted);
    font-size: 12px;
}

.locked {
    overflow: hidden;
}

dialog {
    padding: 0;
    width: min(1100px,94vw);
    height: min(760px,88dvh);
    max-width: none;
    max-height: none;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
}

dialog[open] {
    display: flex;
    flex-direction: column;
}

dialog::backdrop {
    background: #0009;
    backdrop-filter: none;
}

.dialogbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}

.dialogbar span {
    margin: 0;
}

iframe {
    border: 0;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.detail {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 40px;
    padding: clamp(20px,5vw,50px);
    align-items: center;
    min-height: 90vh;
}

.detail h1 {
    font-size: clamp(30px,5vw,55px);
}

.detail-media {
    min-height: 240px;
    aspect-ratio: 4/3;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    overflow: hidden;
}

.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

@media (max-width:650px) {
    .hero {
        min-height: 65vh;
    }

    .nav {
        padding: 8px 12px;
    }

    .project {
        margin-bottom: 55px;
    }

    .detail {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .about,.resume {
        padding: 55px 0;
    }

    .visual {
        aspect-ratio: 4/3;
    }

    footer {
        flex-wrap: wrap;
    }

}

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

    .cursor {
        display: none;
    }

}

@media (pointer:coarse) {
    .cursor {
        display: none;
    }

}

/* V2 — editorial composition */
:root {
    --bg: #111111;
    --surface: #1b1b1b;
    --max: 1440px;
    --dot: #ffffff12;
}

html[data-theme=light] {
    --bg: #f4f3ef;
    --surface: #e9e8e4;
    --dot: #00000012;
}

body {
    overflow-x: clip;
}

h1,h2,h3 {
    font-weight: 650;
    letter-spacing: -.065em;
}

.hero {
    min-height: 55vh;
    text-align: center;
    align-items: center;
    padding: 100px 0 45px;
}

.hero h1 {
    font-family: "Cal Sans",sans-serif;
    font-size: clamp(44px,7.8vw,112px);
    font-weight: 1000;
    line-height: 1.15;
    letter-spacing: 0em;
}

.hero .intro {
    font-size: clamp(16px,2vw,22px);
}

.splash {
    height: clamp(260px,48vw,620px);
    overflow: hidden;
    position: relative;
    margin-inline: calc(-1 * clamp(20px,5vw,64px));
    mask-image: linear-gradient(transparent,#000 9%,#000 85%,transparent);
}

#hero-images {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
    padding: 0 12px;
    transform: scale(1);
}

.hero-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-column img {
    display: block;
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 12px;
}

.hero-column:nth-child(2) {
    margin-top: -70px;
}

.about {
    display: grid;
    grid-template-columns: 1fr 2.4fr;
    gap: 30px;
    padding: 110px 0;
    border: 0;
}

.about h2 {
    font-size: clamp(28px,4vw,58px);
    max-width: 900px;
}

.about #about-description {
    max-width: 690px;
    color: var(--muted);
    font-size: 19px;
}

.portrait img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}

.skills {
    max-width: 1050px;
    margin: 0 auto 100px;
}

.skill {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    margin: 6px 0;
    transition: background .35s;
}

.skill.open {
    background: #080808;
    color: #eee;
}

.skill button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    padding: 25px 32px;
    background: none;
    border: 0;
    text-align: left;
    font-size: clamp(20px,3vw,34px);
    letter-spacing: -.04em;
}

.skill button span:last-child {
    font-size: 13px;
    color: var(--muted);
}

.skill-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .55s cubic-bezier(.22,1,.36,1);
}

.skill.open .skill-panel {
    grid-template-rows: 1fr;
}

.skill-inner {
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 20px;
}

.skill-inner p {
    padding: 0 32px 32px;
    margin: 0;
    color: #b5b5b5;
    max-width: 550px;
}

.skill-art {
    height: 150px;
    display: flex;
    align-items: end;
    justify-content: center;
    overflow: hidden;
    mask-image: linear-gradient(90deg,transparent,#000 25%);
}

.skill-art i {
    display: block;
    width: 9%;
    height: var(--h);
    background: linear-gradient(0deg,#7778,#3330);
    transform: translateY(100%);
    transition: transform .65s cubic-bezier(.22,1,.36,1);
    transition-delay: calc(var(--i)*35ms);
}

.skill.open .skill-art i {
    transform: translateY(0);
}

.skill:nth-child(2n) .skill-art {
    transform: scaleX(-1);
}

.skill:nth-child(3n) .skill-art i {
    border-radius: 100% 100% 0 0;
}

.clients {
    text-align: center;
    padding: 90px 0 110px;
    border-top: 1px solid var(--line);
}

#client-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 30px;
    margin: 50px auto 0;
    max-width: 950px;
}

.client {
    display: grid;
    place-items: center;
    min-width: 0;
}
.client img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 220px;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    opacity: .85;
}
html[data-theme="dark"] .client img {
    filter: invert(1);
}
.client:hover img {
    opacity: 1;
}

#projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px,6vw,90px);
    align-items: start;
}

.project {
    margin: 0 0 45px;
}

.project:nth-child(even) {
    margin-top: 100px;
}

.project .visual {
    aspect-ratio: 4/5;
}

.visual img {
    height: 112%;
    top: -6%;
    transition: opacity .35s,scale .6s;
}

.visual .motion {
    opacity: 0;
}

.project.playing .motion {
    opacity: 1;
}

.project:hover .visual img {
    scale: 1.035;
    filter: none;
}

.project-meta h3 {
    font-size: clamp(22px,3vw,38px);
}

.work .sectionhead {
    margin-bottom: 45px;
}

.nav a[aria-current] {
    color: var(--fg);
}

.logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.resume {
    margin-top: 60px;
}

.frame-body .detail h1 {
    font-weight: 600;
}

@media (max-width:700px) {
    .hero {
        min-height: 48vh;
        padding-top: 65px;
    }

    .about {
        grid-template-columns: 1fr;
        padding: 65px 0;
    }

    .skills {
        margin-bottom: 50px;
    }

    .skill button {
        padding: 20px;
    }

    .skill-inner p {
        padding: 0 20px 20px;
        font-size: 14px;
    }

    .skill-art {
        height: 110px;
    }

    #client-grid {
        grid-template-columns: repeat(2,1fr);
        gap: 12px;
    }

    .clients {
        padding: 55px 0;
    }

    #projects {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .project:nth-child(even) {
        margin-top: 0;
    }

    .project {
        margin-bottom: 20px;
    }

    .project .visual {
        aspect-ratio: 4/3 !important;
    }

    .splash {
        height: 240px;
    }

    #hero-images {
        gap: 6px;
    }

    .hero-column {
        gap: 6px;
    }

    .hero-column:nth-child(2) {
        margin-top: -20px;
    }

}

@media (prefers-reduced-motion:reduce) {
    .skill-panel,.skill-art i {
        transition: none !important;
    }

    .hero-column {
        transform: none !important;
    }

}

/* Global prototype cursor — shared by the page and native project dialog. */
.cursor, #project-dialog .modal-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px !important;
    height: 24px !important;
    z-index: 99999;
    pointer-events: none;
    border: .75px solid rgba(255,255,255,.9) !important;
    border-radius: 50%;
    background: rgba(180,180,180,.15) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 0;
    transition: opacity .15s ease,width .15s ease,height .15s ease,background .15s ease;
}

.cursor.visible,#project-dialog .modal-cursor.visible {
    opacity: 1;
}

.cursor.active,#project-dialog .modal-cursor.active {
    width: 40px !important;
    height: 40px !important;
    background: rgba(180,180,180,.25) !important;
}

.hero h1 span {
    font-family: inherit;
    font-weight: inherit;
}

@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
    html.custom-pointer,html.custom-pointer body,html.custom-pointer body * {
        cursor: none !important;
    }

}

@media (pointer:coarse),(hover:none),(prefers-reduced-motion:reduce) {
    .cursor,#project-dialog .modal-cursor {
        display: none !important;
    }

}

.arrow {
    display: grid;
    place-items: center;
    line-height: 1;
    padding-top: 3px;
    box-sizing: border-box;
}

/* Floating project cards */

.project .visual {
    transition: translate 0.45s cubic-bezier(0.2, 0.75, 0.25, 1);
}

@media (hover: hover) and (pointer: fine) {
    .project:hover .visual {
        translate: 0 -5px;
    }
}
/* V3: shared lightweight cursor and media surfaces. */
.logo svg { display: block; width: 36px; height: 36px; fill: currentColor; }
.visual video.motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.project.playing video.motion { opacity: 1; }
.cursor, #project-dialog .modal-cursor { transition: none; }
body.locked .nav { backdrop-filter: none; -webkit-backdrop-filter: none; }
body.locked *, body.locked *::before, body.locked *::after { animation-play-state: paused !important; }
body.locked #project-dialog *, body.locked #project-dialog *::before { animation-play-state: running !important; }

/* Remove decorative placeholders behind project imagery. */
.project .visual::before { display: none; }

/* Liquid glass theme switch */
#theme {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    place-items: center;
    flex-shrink: 0;
    width: 82px;
    height: 40px;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.02));
    box-shadow: inset 0 2px 5px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.08);
    isolation: isolate;
}
#theme .theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 36px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(145deg,rgba(255,255,255,.28),rgba(255,255,255,.07));
    border: 1px solid rgba(255,255,255,.3);
    box-shadow: inset 0 1px 2px rgba(255,255,255,.25), inset 0 -1px 2px rgba(255,255,255,.06), 0 3px 8px rgba(0,0,0,.2);
    transform: translateX(38px);
    transition: transform .35s cubic-bezier(.22,1,.36,1);
    pointer-events: none;
}
#theme svg {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity .25s ease;
    pointer-events: none;
}
#theme .theme-sun { opacity: .45; }
#theme .theme-moon { opacity: 1; }
html[data-theme="light"] #theme {
    background: rgba(0,0,0,.05);
    border-color: rgba(0,0,0,.12);
}
html[data-theme="light"] #theme .theme-thumb {
    transform: translateX(0);
    background: linear-gradient(145deg,rgba(255,255,255,.95),rgba(255,255,255,.4));
    border-color: rgba(255,255,255,.9);
}
html[data-theme="light"] #theme .theme-sun { opacity: 1; }
html[data-theme="light"] #theme .theme-moon { opacity: .45; }
@media (max-width: 420px) {
    .nav { padding-inline: 8px; gap: 6px; }
    .nav nav { gap: 8px; font-size: 12px; }
    .nav .logo svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    #theme .theme-thumb, #theme svg { transition: none; }
}

/* Stability: simulated glass avoids live sampling of scrolling layers. */
.nav { background: linear-gradient(145deg,#303030f5,#242424f2); backdrop-filter:none; -webkit-backdrop-filter:none; }
html[data-theme="light"] .nav { background:linear-gradient(145deg,#fffffff5,#f0efedf5); }
#hero-images { transform:none; }
@media (prefers-reduced-motion:reduce) { html {scroll-behavior:auto} .project,.project .visual,.project .visual img {transform:none!important;translate:none!important;scale:none!important;transition:none!important} }
