@font-face {
    font-family: "Noto Sans SC";
    src: url("fonts/noto-sans-sc-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Noto Sans SC";
    src: url("fonts/noto-sans-sc.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+3000-303F, U+3400-9FFF, U+F900-FAFF, U+FF00-FFEF;
}

@font-face {
    font-family: "Noto Color Emoji";
    src: url("fonts/noto-color-emoji.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #f5f6fa;
    --white: #fff;
    --ink: #141727;
    --muted: #555d71;
    --line: #dce0eb;
    --blue: #264ad4;
    --night: #030510;
    --header-height: 3.8125rem;
    --sans: "Noto Sans SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1rem/1.5 var(--sans);
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
#main { scroll-margin-top: var(--header-height); }

.shell { width: min(100% - 4rem, 75rem); margin-inline: auto; }

.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    position: fixed;
    z-index: 3;
    top: .75rem;
    left: .75rem;
    padding: .625rem 1rem;
    border-radius: .5rem;
    background: var(--white);
}

.site-header {
    position: sticky;
    z-index: 2;
    top: 0;
    border-bottom: 1px solid rgb(171 186 229 / .15);
    background: rgb(5 8 17 / .92);
    color: #f3f5ff;
    backdrop-filter: blur(20px);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: calc(var(--header-height) - 1px);
}

.wordmark {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    gap: .625rem;
    white-space: nowrap;
    font: 750 1.1rem/1 var(--sans);
}

.mark {
    display: grid;
    grid-template-columns: repeat(2, .3125rem);
    grid-template-rows: repeat(2, .3125rem);
    place-content: center;
    gap: .125rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #6f88ff;
    border-radius: .5rem;
    background: #17234b;
}
.mark i { background: #a5b9ff; border-radius: 1px; }
.mark i:nth-child(2) { opacity: .42; }

.site-nav { display: flex; gap: clamp(.75rem, 3vw, 2.375rem); }
.site-nav a, .header-github {
    padding-block: .625rem;
    color: #d0d7eb;
    font-size: .9rem;
    font-weight: 600;
}
.site-nav a:hover, .header-github:hover { color: var(--white); }
.header-github { justify-self: end; }
.site-header :focus-visible, .hero :focus-visible, .feature-game :focus-visible { outline-color: #a9baff; }

.hero {
    background: var(--night);
    color: #f6f7ff;
    text-align: center;
}

.hero-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: clip;
    background: var(--night);
}

.hero.has-scroll-scene::after {
    display: block;
    block-size: clamp(16rem, 62svh, 35rem);
    content: "";
}

.has-scroll-scene .hero-stage {
    position: sticky;
    top: var(--header-height);
    min-block-size: calc(100svh - var(--header-height));
}

.has-scroll-scene .hero-art {
    align-self: center;
    max-block-size: 54svh;
}

.has-scroll-scene .hero-content.is-faded:not(:focus-within) { pointer-events: none; }
.hero.has-scroll-scene h1 { font-size: clamp(3.5rem, min(8.45vw, 14svh), 8rem); }

.hero-progress { display: none; }
.has-scroll-scene .hero-progress {
    position: absolute;
    z-index: 1;
    inset: auto 0 1.375rem;
    display: block;
    width: 3.125rem;
    height: 2px;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 999px;
    background: #343f60;
    pointer-events: none;
}
.hero-progress span {
    display: block;
    height: 100%;
    transform-origin: left center;
    background: #adc0ff;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: clamp(3.75rem, 6vw, 5.25rem);
}
.hero h1 {
    font: 800 clamp(3.5rem, 8.45vw, 8rem)/1.03 var(--sans);
    letter-spacing: -.06em;
    text-wrap: balance;
}
.hero h1 span { color: #7d9aff; }
.hero p {
    margin-top: clamp(1rem, 2vw, 1.5rem);
    color: #cbd2e8;
    font-size: clamp(1.0625rem, 2vw, 1.4375rem);
    text-wrap: balance;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.625rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.875rem;
    padding: .625rem 1.1875rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .9375rem;
    font-weight: 700;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.button-primary { background: #adc0ff; color: #0d1738; }
.button-primary:hover { background: #d2ddff; }
.button-secondary { border-color: #5b6a9a; background: #10182c; color: #f1f4ff; }
.button-secondary:hover { border-color: #9aaceb; background: #1a284d; }

.hero-art {
    display: grid;
    place-items: center;
    width: min(100%, 73rem);
    height: clamp(19rem, 37vw, 30rem);
    margin: -1.25rem auto 0;
    mix-blend-mode: lighten;
    pointer-events: none;
}

.hero-art picture {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    transform: translate3d(var(--orbit-x, 0), var(--orbit-y, 0), 0);
    mask-image: radial-gradient(ellipse 68% 68% at center, black 68%, transparent 92%);
    transition: transform .45s cubic-bezier(.2, .65, .3, 1);
}
.hero-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.featured {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1rem;
}
.hero.has-scroll-scene + .featured {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * clamp(3rem, 9svh, 6rem));
}
.feature {
    position: relative;
    isolation: isolate;
    min-height: 26rem;
    overflow: hidden;
    border-radius: 1.5rem;
    text-align: center;
}
.feature-game {
    background: radial-gradient(ellipse at 60% 94%, #5736b1, transparent 62%), #17122d;
    color: #f7f4ff;
}
.feature-tool {
    background: radial-gradient(ellipse at 54% 95%, #98b2ff, transparent 74%), #e8eeff;
    color: #151e40;
}
.feature-copy { position: relative; z-index: 1; padding: 2.25rem 1rem 0; }
.feature-copy h3 {
    font: 800 clamp(2rem, 4.3vw, 3.5rem)/1.02 var(--sans);
    letter-spacing: -.035em;
    text-wrap: balance;
}
.feature-copy p { margin-top: .625rem; }
.feature-game p { color: #dcd3f3; }
.feature-tool p { color: #3e4a71; }
.feature-button { margin-top: 1rem; min-height: 2.625rem; }
.feature-game .feature-button { background: #e3d7ff; color: #261648; }
.feature-game .feature-button:hover { background: #f4edff; }
.feature-tool .feature-button { background: #243f9b; color: var(--white); }
.feature-tool .feature-button:hover { background: #152a74; }

.tile-art, .code-art {
    position: absolute;
    left: 50%;
    box-shadow: 0 1.5rem 3.75rem rgb(6 9 30 / .42);
    pointer-events: none;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.tile-art {
    top: 13rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .375rem;
    width: clamp(14rem, 26vw, 20rem);
    padding: .5rem;
    border: 1px solid #aa8bfa;
    border-radius: 1rem;
    background: #22163c;
    transform: translateX(-50%) perspective(40rem) rotateX(13deg) rotateZ(-8deg);
}
.tile-art span {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border-radius: .5rem;
    background: #573b84;
    color: #f7ebff;
    font: 750 clamp(.8rem, 1.7vw, 1.4rem)/1 var(--sans);
}
.tile-art span:empty { background: #322251; }
.tile-art span:nth-child(10), .tile-art span:nth-child(11) { background: #7650b9; }
.tile-art span:nth-child(13), .tile-art span:nth-child(14) { background: #9761df; color: #120c26; }
.tile-art .winning-tile { background: #ddc0ff; color: #251341; box-shadow: 0 0 1rem #b484fa; }

.code-art {
    top: 13.25rem;
    width: min(80%, 25rem);
    overflow: hidden;
    border: 1px solid #667bb7;
    border-radius: 1rem;
    background: #121b35;
    color: #e6edff;
    text-align: left;
    transform: translateX(-50%) perspective(46rem) rotateX(10deg) rotateZ(6deg);
}
.code-bar {
    display: flex;
    align-items: center;
    gap: .3125rem;
    padding: .625rem .875rem;
    border-bottom: 1px solid #39466a;
    background: #1e2949;
    color: #d6dff7;
    font-size: .875rem;
}
.code-bar i { width: .375rem; height: .375rem; border-radius: 50%; background: #9eb0e6; }
.code-bar span { margin-left: .5rem; }
.code-art pre {
    margin: 0;
    padding: 1rem;
    font: 500 clamp(.75rem, 1.4vw, 1rem)/1.6 var(--sans);
}
.code-art code { font: inherit; }
.code-key { color: #adc6ff; }
.code-string { color: #a5e7d7; }

.catalog { margin-top: clamp(3.75rem, 8vw, 7rem); }
.catalog-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.catalog-heading h2 {
    font: 800 clamp(2.5rem, 5.7vw, 4.75rem)/.99 var(--sans);
    letter-spacing: -.065em;
}
.catalog-heading p { margin-top: .75rem; color: var(--muted); }

.search { position: relative; width: min(100%, 21rem); }
.search::before, .search::after {
    position: absolute;
    pointer-events: none;
    content: "";
}
.search::before {
    top: calc(50% - 8px);
    left: 16px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--muted);
    border-radius: 50%;
}
.search::after {
    top: calc(50% + 4px);
    left: 27px;
    width: 7px;
    height: 2px;
    transform: rotate(48deg);
    background: var(--muted);
}
.search input, .genre-filter select {
    min-height: 2.875rem;
    border: 1px solid #c7cedf;
    border-radius: 999px;
    background: var(--white);
    color: var(--ink);
}
.search input { width: 100%; padding: .5rem 1rem .5rem 2.625rem; }
.search input::placeholder { color: var(--muted); }
.genre-filter { position: relative; }
.genre-filter::after {
    position: absolute;
    top: 50%;
    right: 1.125rem;
    width: .4375rem;
    height: .4375rem;
    transform: translateY(-70%) rotate(45deg);
    border: solid var(--muted);
    border-width: 0 1.5px 1.5px 0;
    pointer-events: none;
    content: "";
}
.genre-filter select { appearance: none; padding: .5rem 2.25rem .5rem 1rem; font-size: .9375rem; }
.genre-filter select:disabled, .genre-filter:has(select:disabled)::after { opacity: .55; }

.catalog-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-bottom: 1.125rem;
    border-bottom: 1px solid var(--line);
}
.filters {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #e9edf7;
}
.filters button, .expand, .empty-state button {
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
}
.filters button { min-height: 2.375rem; padding: .375rem 1rem; background: transparent; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.filters button[aria-pressed="false"]:hover { background: #dce4f8; color: var(--ink); }

.catalog-group { margin-block: 2rem; scroll-margin-top: calc(var(--header-height) + 9rem); }
.group-heading { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .875rem; }
.group-heading h3 { font: 750 1.8rem/1.1 var(--sans); letter-spacing: -.045em; }
.group-count { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.entry {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: 3.625rem;
    height: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--line);
    border-radius: .875rem;
    background: var(--white);
    font-size: .9375rem;
    font-weight: 650;
    line-height: 1.3;
    overflow-wrap: anywhere;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.entry:hover { border-color: #98aaf3; background: #f3f6ff; color: var(--blue); }
.entry-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: .625rem;
    background: #efebfe;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.0625rem;
    font-weight: 400;
}
#tools .entry-icon, #services .entry-icon { background: #e9f0ff; }

.expand, .empty-state button {
    min-height: 2.75rem;
    padding: .5rem 1rem;
    background: #e5ebfd;
    color: #284399;
}
.expand { margin-top: .875rem; }
.expand:hover, .empty-state button:hover { background: #d9e4ff; }
.empty-state { padding: 2rem 0; color: var(--muted); }
.empty-state button { margin-top: .75rem; }

.site-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 1rem;
    margin-top: 3.5rem;
}
.info-card {
    padding: clamp(1rem, 3vw, 1.75rem);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--white);
}
.info-card h2 {
    font: 750 clamp(1.375rem, 2.5vw, 1.875rem)/1.05 var(--sans);
    letter-spacing: -.04em;
}
#services { scroll-margin-top: calc(var(--header-height) + 1rem); }
#services .entry { height: auto; margin-top: .875rem; background: var(--paper); }
.profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: .75rem 1rem;
}
.profile-avatar {
    grid-row: span 2;
    width: clamp(3.375rem, 7vw, 5rem);
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #e8edff;
    object-fit: cover;
}
.profile-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .375rem .875rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-size: .875rem;
    font-weight: 700;
}
.profile-links a:hover { border-color: #98aaf3; color: var(--blue); }
.profile-links .profile-mark { gap: 3px; color: var(--blue); }
.profile-mark i { width: 5px; height: 5px; border: 1px solid currentColor; transform: rotate(45deg); }
.profile-mark i:first-child { background: currentColor; }

.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); }
.footer-inner {
    display: flex;
    justify-content: flex-end;
    padding-block: 1.375rem;
    color: var(--muted);
    font-size: .9375rem;
}
.footer-inner a:hover { color: var(--blue); text-decoration: underline; }

@media (max-width: 58rem) {
    .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 42rem) {
    .shell { width: calc(100% - 2rem); }
    .hero-content { padding-top: 3.25rem; }
    .hero-art { height: clamp(16rem, 65vw, 24rem); margin-top: -.375rem; }
    .hero.has-scroll-scene::after { block-size: clamp(14rem, 50svh, 24rem); }
    .has-scroll-scene .hero-art { transform-origin: 50% 40%; }
    .featured { grid-template-columns: 1fr; }
    .feature { min-height: 23rem; }
    .tile-art { width: 15rem; }
    .tile-art span { font-size: 1.0625rem; }
    .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-group { scroll-margin-top: calc(var(--header-height) + 12.5rem); }
    .site-info { grid-template-columns: 1fr; }
}

@media (max-width: 29rem) {
    .header-inner { grid-template-columns: 1fr auto; gap: .625rem; }
    .header-github { display: none; }
    .site-nav a { font-size: .875rem; }
    .hero h1, .hero.has-scroll-scene h1 { font-size: clamp(2.75rem, 12.5vw, 3.5rem); }
    .hero p { max-width: 25ch; margin-inline: auto; }
    .search { width: 100%; }
    .entry { padding-inline: .5rem; gap: .5rem; }
    .entry-icon { width: 1.75rem; height: 1.75rem; font-size: .9375rem; }
    .catalog-group { scroll-margin-top: calc(var(--header-height) + 15rem); }
}

@media (max-width: 22rem) {
    .header-inner { gap: .375rem; }
    .wordmark { gap: .375rem; font-size: .9375rem; }
    .mark { width: 1.5rem; height: 1.5rem; }
    .site-nav { gap: .625rem; }
    .entry-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    @supports (animation-timeline: view()) {
        @keyframes feature-arrive {
            from { translate: 0 2rem; }
        }
        .tile-art, .code-art {
            animation: feature-arrive linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 100%;
        }
    }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .feature-game:focus-within .tile-art, .feature-game:hover .tile-art {
        transform: translateX(-50%) perspective(40rem) rotateX(7deg) rotateZ(-4deg) translateY(-.375rem);
    }
    .feature-tool:focus-within .code-art, .feature-tool:hover .code-art {
        transform: translateX(-50%) perspective(46rem) rotateX(5deg) rotateZ(3deg) translateY(-.375rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-art picture { transform: none; }
}
