@font-face {
    font-family: "Space Grotesk";
    src: url("robot-showcase/vendor/space-grotesk.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}

:root {
    --theme: #f5f5f0;
    --entry: #fcfcf8;
    --primary: #242e33;
    --secondary: #55626a;
    --tertiary: #e4e8e6;
    --content: #323e44;
    --code-bg: #ebeeeb;
    --border: #d4dad7;
    --darkcolor: #565c3d;
    --site-accent: #6c5738;
    --site-header: #ecf0ed;
    --site-gutter: clamp(18px, 3.8vw, 60px);
}

body.dark {
    --theme: #181e22;
    --entry: #20282d;
    --primary: #eff1ec;
    --secondary: #b0bdc1;
    --tertiary: #3c494f;
    --content: #d5dedf;
    --code-bg: #263037;
    --border: #39464d;
    --darkcolor: #dfc6a3;
    --site-accent: #ddc6a1;
    --site-header: #171d21;
}

body,
body.list,
body.dark.list {
    background: var(--theme);
    font-family: "Space Grotesk", system-ui, sans-serif;
}

.header {
    background: var(--site-header);
    border-bottom: 1px solid var(--border);
}

.header .nav {
    background: none;
    min-height: 64px;
    padding: 0 var(--site-gutter);
    align-items: center;
    gap: 0 22px;
}

.header .logo,
.header #menu {
    margin-inline: 0;
}

.header .logo > a {
    font-size: 1.26rem;
    font-weight: 600;
    letter-spacing: -.025em;
}

.header #menu a {
    font-size: 1.16rem;
    font-weight: 500;
}

.header #menu li + li {
    margin-inline-start: clamp(14px, 2.5vw, 36px);
}

.header #menu a:hover,
.header .logo a:hover,
.footer a:hover {
    color: var(--site-accent);
}

.header #menu .active {
    border-color: var(--site-accent);
}

body :focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 4px;
}

:where(.page-header, .post-header) h1,
.entry-header h2 {
    letter-spacing: -.035em;
}

.robot-home .main {
    max-width: none;
    padding: 0;
}

.robot-world {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

.robot-home [hidden] {
    display: none !important;
}

.home-profile {
    display: flex;
    gap: 14px;
    padding: 17px var(--site-gutter) 19px;
}

.home-profile > img {
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.home-profile h1 {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.home-profile-intro > p {
    margin: 3px 0 0;
    color: var(--secondary);
    font-size: .95rem;
    line-height: 1.35;
}

.home-profile .social-icons {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.home-profile .social-icons a {
    display: grid;
    width: 30px;
    min-height: 30px;
    place-items: center;
    padding: 0;
    border-radius: 4px;
    color: var(--scene-ink);
    pointer-events: auto;
}

.home-profile .social-icons a:hover {
    color: var(--scene-accent);
    background: #e6e9e318;
}

.home-profile .social-icons svg {
    width: 16px;
    height: 16px;
}

.robot-landscape {
    --scene-ink: #f4f5ec;
    --scene-accent: #e3c69e;
    position: relative;
    flex: 1 0 580px;
    isolation: isolate;
    overflow: hidden;
    background: #3a454c var(--world-still) center / cover no-repeat;
    color: var(--scene-ink);
    border-block: 1px solid var(--border);
}

.robot-landscape::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    pointer-events: none;
    background: linear-gradient(0deg, #10171de8, #151e238c 10%, transparent 27%);
}

.robot-viewport,
.robot-viewport canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.robot-viewport canvas {
    cursor: grab;
    touch-action: none;
}

.robot-viewport canvas:active {
    cursor: grabbing;
}

.robot-viewport canvas:focus-visible {
    outline-offset: -5px;
}

.robot-landscape .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.scene-overlay {
    position: absolute;
    z-index: 3;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    pointer-events: none;
    color: var(--scene-ink);
    background: linear-gradient(180deg, #152027f5, #19242baf 52%, transparent);
}

.scene-overlay .header {
    grid-area: 1 / 2;
    padding-top: 10px;
    background: none;
    border: 0;
}

.scene-overlay .nav {
    display: flex;
    flex-wrap: nowrap;
    min-height: 54px;
}

.scene-overlay .header .logo > a {
    display: none;
}

.scene-overlay .header .logo {
    order: 1;
}

.scene-overlay .header .logo-switches {
    margin-inline: 0;
}

.scene-overlay .header a,
.scene-overlay .header button,
.scene-overlay .home-profile h1 {
    color: var(--scene-ink);
}

.scene-overlay .header a,
.scene-overlay .header button {
    pointer-events: auto;
}

.scene-overlay .header a:hover {
    color: var(--scene-accent);
}

.scene-overlay .home-profile {
    grid-area: 1 / 1;
    padding: 26px 0 24px var(--site-gutter);
}

.scene-overlay .home-profile-intro > p {
    color: #dbe1e2;
}

.robot-world-status {
    grid-column: 1 / -1;
    padding: 0 var(--site-gutter) 8px;
    font-size: .87rem;
    color: #fff1d6;
    text-shadow: 0 1px 4px #192127;
}

.robot-world-label {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -100%);
    width: max-content;
    padding: 4px 8px;
    border-radius: 4px;
    background: #151d24e8;
    border: 1px solid #e3c69e9c;
    color: var(--scene-ink);
    font-size: .85rem;
    pointer-events: none;
}

.robot-world-footer {
    position: absolute;
    z-index: 2;
    inset: auto var(--site-gutter) clamp(12px, 2.5vh, 24px);
    pointer-events: none;
}

.robot-world-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.robot-world-tools p {
    color: var(--scene-ink);
    font-size: .85rem;
    line-height: 1.3;
    text-shadow: 0 1px 4px #0b1414;
}

.robot-world-tools button,
.robot-world-robots button:not(:disabled) {
    pointer-events: auto;
}

.robot-world-tools button {
    min-height: 35px;
    margin-left: auto;
    padding: 0 10px;
    color: var(--scene-ink);
    background: #192229ec;
    border: 1px solid #c6d2d578;
    font-size: .85rem;
    white-space: nowrap;
}

.robot-world-robots {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #c7d5d451;
    border: 1px solid #c6d2d578;
    border-radius: 4px;
    overflow: hidden;
}

.robot-world-robots button {
    min-height: 42px;
    padding: 5px 6px;
    background: #1a242bec;
    color: var(--scene-ink);
    font-size: .88rem;
    line-height: 1.2;
}

.robot-world-robots button:disabled {
    cursor: default;
}

.robot-world-robots button:not(:disabled):hover,
.robot-world-robots button[aria-pressed="true"],
.robot-world-tools button:hover {
    color: #1b242a;
    background: var(--scene-accent);
}

.robot-world-robots button:focus-visible {
    z-index: 1;
    outline-offset: -3px;
}

@media (max-aspect-ratio: 4/5) {
    .robot-landscape {
        background-image: var(--world-still-portrait);
    }
}

@media (max-width: 670px) {
    .robot-world-robots {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .robot-world-robots button {
        min-height: 38px;
        font-size: .79rem;
    }
}

@media (max-width: 500px) {
    .header .nav {
        display: block;
    }

    .header .logo,
    .header #menu {
        line-height: 36px;
    }

    .header #menu {
        justify-content: space-between;
    }

    .header #menu a {
        font-size: clamp(.94rem, 4vw, 1.06rem);
    }

}

@media (max-width: 750px) {
    .scene-overlay {
        grid-template-columns: minmax(0, 1fr);
    }

    .scene-overlay .home-profile {
        padding: 18px var(--site-gutter) 0;
    }

    .scene-overlay .header {
        grid-area: 2 / 1;
        padding-top: 0;
    }

    .scene-overlay .nav {
        display: flex;
        gap: 0 clamp(5px, 1.5vw, 9px);
        min-height: 42px;
    }

    .scene-overlay .header #menu {
        flex: 1;
        justify-content: space-between;
    }

    .scene-overlay .header #menu li + li {
        margin-inline-start: clamp(7px, 2.9vw, 14px);
    }

}

.robot-work {
    position: absolute;
    z-index: 3;
    top: clamp(142px, 19vh, 194px);
    right: var(--site-gutter);
    width: min(325px, calc(100% - 2 * var(--site-gutter)));
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 282px);
    overflow: hidden;
    padding: 13px 15px;
    background: #192228f7;
    border: 1px solid #a2b6be75;
    border-radius: 7px;
    color: var(--scene-ink);
    box-shadow: 0 9px 24px #11181dc0;
}

.robot-work-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.robot-work-header p {
    color: #bcc9cf;
    font-size: .78rem;
    line-height: 1.25;
}

.robot-work-header h2 {
    margin-top: 2px;
    color: var(--scene-ink);
    font-size: 1.2rem;
    font-weight: 600;
}

.robot-work-header button {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    color: var(--scene-ink);
    font-size: 1.22rem;
    line-height: 1;
}

.robot-work-header button:hover {
    background: #e6e9e318;
}

.robot-work-list {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    list-style: none;
    margin: 11px 0 0;
}

.robot-work-list li {
    padding: 7px 0;
    border-top: 1px solid #a2b6be48;
    font-size: .93rem;
    line-height: 1.28;
}

.robot-work-list li:last-child {
    padding-bottom: 0;
}

.robot-work-list a {
    color: var(--scene-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.robot-work-list a:hover {
    color: #ffdfb0;
}

.robot-work-list p {
    margin: 3px 0 0;
    color: #cfdbde;
    font-size: .82rem;
}

@media (max-width: 750px) {
    .robot-work {
        top: auto;
        right: var(--site-gutter);
        bottom: calc(clamp(12px, 2.5vh, 24px) + 128px);
        left: var(--site-gutter);
        width: auto;
        max-height: min(34svh, 242px);
    }
}
