@font-face {
    font-family: "Jersey";
    src: url("fonts/Jersy25.ttf") format("truetype");
    font-display: swap;
}

:root {
    --ink: #1f1f1a;
    --muted: #696966;
    --soft: #9a9a96;
    --paper: #f9f9f8;
    --card: #ffffff;
    --line: #e2e2de;
    --pink: #d74d88;
    --radius: 12px;
    --column: 568px;
}

* { box-sizing: border-box; }

html {
    max-width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100svh;
    color: var(--ink);
    background: var(--paper);
    font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px;
}

.site-header {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    width: max-content;
    max-width: calc(100vw - 24px);
    min-height: 36px;
    margin: 10px auto 0;
    padding: 3px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 31, 26, 0.08);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(31, 31, 26, 0.07);
    backdrop-filter: blur(14px);
}

.brand,
.menu a {
    display: grid;
    place-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease, background-color 160ms ease;
}

.brand {
    width: 28px;
    min-width: 28px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    font-family: "Jersey", ui-monospace, monospace;
    font-size: 20px;
    letter-spacing: 0;
}

.brand:hover { background: #f1f1ef; }

.menu-items {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu a { color: var(--muted); }

.menu a:hover { color: var(--ink); background: #f1f1ef; }

.menu a.active {
    color: var(--paper);
    background: var(--ink);
}

main {
    width: min(var(--column), calc(100vw - 40px));
    margin: 0 auto;
}

.hero {
    display: block;
    min-height: auto;
    padding: 88px 0 0;
    border: 0;
}

.hero-copy {
    display: block;
    padding: 0;
}

.hero h1,
.page-intro h1,
.project-copy h2,
.section-heading h2 {
    font-family: inherit;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.hero h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(32px, 7vw, 48px);
    line-height: 1.04;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding: 9px 13px;
    color: var(--paper);
    background: var(--ink);
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 160ms ease, opacity 160ms ease;
}

.button::after { content: "↓"; font-size: 14px; }
.button:hover { transform: translateY(-2px); opacity: 0.86; }

.hero-art {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 10px;
    min-height: 0;
    margin-top: 52px;
    background: transparent;
}

.hero-art a {
    display: block;
    border-radius: var(--radius);
}

.hero-art img,
.hero-art img:first-child {
    grid-row: auto;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 180ms ease, border-color 180ms ease;
}

.hero-art a:hover img { transform: translateY(-3px); border-color: #aaa9a3; }

.hero-art .snowflake-image,
.snowflake-card img {
    background: #ededeb;
    filter: invert(1);
}

.featured-work {
    width: 100%;
    margin: 0;
    padding: 72px 0 96px;
    scroll-margin-top: 80px;
}

.home-about {
    width: 100%;
    padding-top: 72px;
    scroll-margin-top: 80px;
}

.home-about .about-layout {
    padding-bottom: 72px;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.section-heading h2,
.page-intro h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.33;
}

.text-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

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

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.featured-card {
    overflow: hidden;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.featured-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--card);
    border: 0;
    border-bottom: 1px solid var(--line);
    transition: transform 220ms ease;
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(31, 31, 26, 0.07);
}

.featured-card:hover img { transform: scale(1.02); }

.featured-card h3 {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    font-weight: 500;
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.page-card {
    overflow: hidden;
    min-width: 0;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 160ms ease;
}

.page-card:hover {
    border-color: #bdbdb8;
}

.page-card-game { grid-column: 1 / -1; }

.page-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #efefec;
    border-bottom: 1px solid var(--line);
}

.page-card-game .page-card-media { aspect-ratio: 16 / 7.5; }

.page-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.page-card:hover .page-card-media img { transform: scale(1.025); }

.page-card-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
}

.page-card-copy h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.page-card-copy > span {
    color: var(--muted);
    font-size: 14px;
    transition: transform 160ms ease;
}

.page-card:hover .page-card-copy > span { transform: translate(2px, -2px); }

.page-card-video {
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--ink);
}

.page-card[href="3d.html"] { grid-column: 1 / -1; }

.page-card[href="3d.html"] .page-card-media { aspect-ratio: 16 / 7.5; }

.page-card-3d {
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--ink);
}

.page-card-3d span {
    font-family: "Jersey", ui-monospace, monospace;
    font-size: clamp(68px, 16vw, 108px);
    line-height: 1;
}

.page-card-video span {
    display: grid;
    place-items: center;
    width: 52px;
    aspect-ratio: 1;
    padding-left: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 17px;
}

.page-card-about {
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--ink);
}

.page-card-about span {
    font-family: "Jersey", ui-monospace, monospace;
    font-size: 92px;
    line-height: 1;
}

.page-intro,
.projects,
.about-layout,
.video-section {
    width: 100%;
    margin: 0;
}

.page-intro { padding: 78px 0 36px; }

.projects { padding-bottom: 96px; }

.project-row,
.project-row:nth-child(even) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: 92px;
}

.project-row:last-child { border-bottom: 1px solid var(--line); }
.project-row:nth-child(even) .project-image { order: 0; }

.project-image {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.project-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    transition: transform 220ms ease;
}

.project-row:hover .project-image img { transform: scale(1.02); }

.project-copy h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

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

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.download-link:hover,
.download-link:focus-visible {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
}

.download-icon {
    position: relative;
    width: 14px;
    height: 15px;
    background: linear-gradient(currentColor, currentColor) center bottom / 12px 1.5px no-repeat;
}

.download-icon::before {
    position: absolute;
    top: 1px;
    left: 6px;
    width: 1.5px;
    height: 8px;
    background: currentColor;
    border-radius: 999px;
    content: "";
}

.download-icon::after {
    position: absolute;
    top: 5px;
    left: 4px;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: rotate(45deg);
}

.project-copy p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.about-layout {
    display: grid;
    grid-template-columns: 152px 1fr;
    gap: 28px;
    align-items: start;
    padding-bottom: 108px;
}

.about-mark {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    color: var(--paper);
    background: var(--ink);
    border-radius: var(--radius);
    font-family: "Jersey", ui-monospace, monospace;
    font-size: 78px;
    line-height: 1;
}

.about-copy {
    padding-top: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.about-copy p { margin: 0 0 15px; }
.about-copy p:first-child { color: var(--ink); }

.video-section { padding: 0 0 96px; }

.video-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 2px 0;
    color: var(--muted);
    border: 0;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
}

.video-meta p { margin: 0; }

.game-page main {
    width: min(920px, calc(100vw - 40px));
}

.models-page main {
    width: min(920px, calc(100vw - 40px));
}

.models-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.models-intro p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.model-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: 96px;
}

.model-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.model-drag-hint {
    position: absolute;
    top: 238px;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 7px 11px;
    color: var(--paper);
    background: rgba(31, 31, 26, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    box-shadow: 0 7px 18px rgba(31, 31, 26, 0.18);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.model-drag-hint.is-visible {
    animation: model-hint-lifecycle 5s ease forwards;
}

.model-drag-symbol {
    position: relative;
    display: grid;
    place-items: center;
    width: 30px;
    height: 20px;
    animation: model-drag-sweep 1.1s ease-in-out 3;
}

.model-mouse {
    position: relative;
    z-index: 1;
    display: block;
    width: 12px;
    height: 18px;
    background: rgba(31, 31, 26, 0.84);
    border: 1.5px solid currentColor;
    border-radius: 7px;
}

.model-mouse::before {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 1.5px;
    height: 4px;
    background: currentColor;
    border-radius: 999px;
    content: "";
    transform: translateX(-50%);
}

.model-drag-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    color: rgba(255, 255, 255, 0.72);
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
    transform: translate(-50%, -50%);
}

@keyframes model-drag-sweep {
    0%, 100% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}

@keyframes model-hint-lifecycle {
    0% { opacity: 0; transform: translate(-50%, 8px); }
    8%, 82% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -4px); visibility: hidden; }
}

.model-card model-viewer {
    display: block;
    width: 100%;
    height: 340px;
    background: linear-gradient(145deg, #f5f5f2, #e9e9e5);
    border-bottom: 1px solid var(--line);
    --poster-color: transparent;
    --progress-bar-color: var(--pink);
    --progress-bar-height: 2px;
}

.model-poster {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
}

.model-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
}

.model-card-meta h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.model-card-meta button {
    padding: 6px 8px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease;
}

.model-card-meta button:hover {
    color: var(--ink);
    border-color: #bdbdb8;
}

.game-intro {
    width: min(var(--column), 100%);
}

.game-section { padding-bottom: 96px; }

.game-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.control-list,
.game-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-list span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

kbd {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    margin-right: 3px;
    padding: 2px 6px;
    color: var(--ink);
    background: #f1f1ef;
    border: 1px solid #d8d8d3;
    border-bottom-width: 2px;
    border-radius: 6px;
    font: inherit;
    font-size: 11px;
    line-height: 1;
}

.game-actions button {
    min-height: 32px;
    padding: 0 10px;
    color: var(--ink);
    background: #f1f1ef;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.game-actions button:last-child { color: var(--paper); background: var(--ink); }
.game-actions button:hover { opacity: 0.78; }

.game-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.game-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 2px 0;
    color: var(--muted);
    font-size: 13px;
}

.game-meta p { margin: 0; }

.game-meta a {
    color: var(--ink);
    font-weight: 500;
    text-underline-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;
}

.footer {
    display: flex;
    justify-content: space-between;
    width: min(var(--column), calc(100vw - 40px));
    margin: 0 auto;
    padding: 22px 0 30px;
    color: var(--soft);
    background: transparent;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
    .model-drag-symbol { animation: none; }
}

@media (max-width: 620px) {
    body { font-size: 14px; }

    .site-header {
        width: max-content;
        max-width: calc(100vw - 16px);
        justify-content: center;
    }

    .menu a { padding-inline: 9px; }

    main,
    .footer { width: min(100% - 32px, var(--column)); }

    .game-page main { width: calc(100% - 24px); }
    .models-page main { width: calc(100% - 24px); }

    .hero,
    .page-intro { padding-top: 58px; }

    .hero h1 { font-size: 34px; }
    .hero-art { margin-top: 40px; }
    .featured-work { padding: 54px 0 72px; }
    .featured-grid { grid-template-columns: 1fr; }
    .page-grid { grid-template-columns: 1fr; }
    .page-card-game { grid-column: auto; }
    .page-card-game .page-card-media { aspect-ratio: 16 / 10; }
    .page-card[href="3d.html"] { grid-column: auto; }
    .page-card[href="3d.html"] .page-card-media { aspect-ratio: 16 / 10; }

    .featured-card {
        display: grid;
        grid-template-columns: 112px 1fr;
        align-items: center;
    }

    .featured-card img {
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .featured-card h3 { padding: 16px; }

    .project-row,
    .project-row:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 0 28px;
    }

    .about-layout {
        grid-template-columns: 96px 1fr;
        gap: 20px;
        padding-bottom: 76px;
    }

    .about-mark { font-size: 54px; }
    .about-copy { font-size: 16px; }
    .video-section { padding-bottom: 72px; }
    .video-meta { flex-direction: column; gap: 2px; }
    .game-section { padding-bottom: 72px; }
    .game-toolbar { align-items: stretch; flex-direction: column; }
    .control-list { flex-wrap: wrap; }
    .game-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .game-meta { flex-direction: column; gap: 4px; }
    .model-gallery { grid-template-columns: 1fr; padding-bottom: 72px; }
    .model-card model-viewer { height: min(78vw, 420px); }
    .model-drag-hint { top: calc(min(78vw, 420px) - 102px); }
}

@media (max-width: 420px) {
    .site-header { max-width: calc(100vw - 12px); }
    .menu a { font-size: 11px; padding-inline: 7px; }
    .brand { display: none; }
    .hero-art { gap: 7px; }
    .about-layout { grid-template-columns: 1fr; }
    .about-mark { width: 96px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
}
