button,
select {
    font: inherit;
}
button,
select,
summary {
    cursor: pointer;
}
button,
select {
    color: inherit;
    background: #211b24e8;
    border: 1px solid var(--line);
    border-radius: 4px;
    min-height: 44px;
    padding: 9px 14px;
}
button:hover,
select:hover {
    border-color: var(--accent);
}
button[aria-pressed='true'] {
    background: #4b2c37;
    border-color: var(--accent);
}
button:disabled {
    opacity: 0.45;
    cursor: wait;
}
.hero {
    --hero-gutter: 4vw;
    --hero-gap: clamp(12px, 2.5dvh, 26px);
    position: relative;
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(#766280, #c299a9 50%, #4b3c49);
}
#canvas-container {
    position: absolute;
    inset: 0;
    z-index: -2;
}
#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(#17101b65, transparent 23%, transparent 57%, #151316ed);
}
.site-header {
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: var(--hero-gap) var(--hero-gutter);
}
.site-header nav {
    display: flex;
    gap: 28px;
    font-size: 13px;
}
.site-header nav a {
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1px solid transparent;
}
.site-header nav a:hover {
    border-color: var(--accent);
}
.hero-copy {
    grid-row: 2;
    align-self: end;
    min-height: 0;
    margin: 0 var(--hero-gutter) var(--hero-gap);
    max-width: 430px;
    transition: opacity 0.2s;
}
.hero-copy h1 {
    font:
        400 clamp(32px, 3.4vw, 52px)/1.12 Georgia,
        serif;
    letter-spacing: -0.035em;
    margin: 12px 0;
}
.hero-copy p:last-child {
    max-width: 340px;
    color: #ddd2dc;
    font-size: 14px;
}
.hero[data-interior='true'] .hero-copy,
.hero[data-driving='true'] .hero-copy {
    opacity: 0;
    pointer-events: none;
}
.drive-speed {
    position: absolute;
    top: 106px;
    left: 4vw;
    color: #ffb2a8;
    font:
        24px/1.3 'Courier New',
        monospace;
    text-shadow: 0 0 12px #ff220066;
    pointer-events: none;
}
.turbo-panel {
    position: relative;
    pointer-events: auto;
    width: 19rem;
    max-width: 100%;
    justify-self: start;
    border: 1px solid #77676c;
    border-radius: 4px;
    box-shadow: 0 8px 24px #0005;
    font:
        0.625rem/1.4 'Courier New',
        monospace;
}
.cockpit-caption {
    display: flex;
    justify-content: space-between;
    padding: 7px 10px;
    background: #19161bec;
    color: #c9b8bd;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.cockpit-caption span:last-child {
    color: #edb5a3;
}
.cockpit-caption span:last-child::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
}
.dashboard-inset {
    position: relative;
    aspect-ratio: 1.2;
    isolation: isolate;
}
#turbo-boost,
#silent-mode,
#oil-slick,
#smoke-release {
    position: absolute;
    min-height: 44px;
    min-width: 44px;
    transform: translate(-50%, -50%);
    padding: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    touch-action: manipulation;
}
#turbo-boost[aria-disabled='true'],
#oil-slick[aria-disabled='true'],
#smoke-release[aria-disabled='true'] {
    cursor: default;
}
/* Adjacent active targets are inset slightly from the projected faces so they
   cannot overlap. Other switches retain the larger 44px target. */
#silent-mode,
#smoke-release {
    min-height: 24px;
}
#turbo-boost:hover,
#silent-mode:hover,
#oil-slick:hover,
#smoke-release:hover {
    border-color: transparent;
}
#turbo-boost::after,
#silent-mode::after,
#oil-slick::after,
#smoke-release::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--switch-width);
    height: var(--switch-height);
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 2px;
    pointer-events: none;
}
#turbo-boost:hover::after,
#silent-mode:hover::after,
#oil-slick:hover::after,
#smoke-release:hover::after {
    border-color: #ffd9b7;
    box-shadow: 0 0 8px #ffbb8855;
}
#turbo-boost:focus-visible,
#silent-mode:focus-visible,
#oil-slick:focus-visible,
#smoke-release:focus-visible {
    outline: 2px solid #fff3dd;
    outline-offset: 3px;
}
#silent-mode[aria-pressed='true']::after,
#oil-slick[data-lit='true']::after,
#smoke-release[data-lit='true']::after {
    border-color: #ffd9b7;
}
.turbo-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    background: #19161bf5;
    color: #d6c9c6;
}
.oil-status,
.smoke-status {
    padding: 0 10px 7px;
    background: #19161bf5;
    color: #d6c9c6;
}
.turbo-hint kbd {
    font: inherit;
    text-transform: uppercase;
    border: 1px solid #6e5a60;
    border-radius: 2px;
    padding: 1px 4px;
}
#turbo-charge {
    display: block;
    appearance: none;
    width: 100%;
    height: 2px;
    border: 0;
    background: #3c1915;
    color: #ffe3bb;
    accent-color: #ffe3bb;
}
#turbo-charge::-webkit-progress-bar {
    background: #3c1915;
}
#turbo-charge::-webkit-progress-value {
    background: #ffe3bb;
}
#turbo-charge::-moz-progress-bar {
    background: #ffe3bb;
}
@media (max-width: 700px), (max-height: 740px) {
    .turbo-panel {
        width: 15rem;
    }
    .turbo-hint {
        font-size: 0.5625rem;
        gap: 5px;
    }
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
#canvas-container canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -4px;
}
.scene-hud {
    grid-row: 3;
    position: relative;
    min-width: 0;
    margin: 0 var(--hero-gutter);
    padding-bottom: max(var(--hero-gap), env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    pointer-events: none;
}
.scene-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 24px;
}
.scene-toolbar a,
.scene-toolbar button,
.scene-toolbar select {
    pointer-events: auto;
}
.scene-more,
.scene-more-tools {
    display: contents;
}
.scene-more > summary {
    display: none;
    color: inherit;
    background: #211b24e8;
    border: 1px solid var(--line);
    border-radius: 4px;
    min-height: 44px;
    padding: 9px 12px;
    font-size: 12px;
    list-style: none;
    pointer-events: auto;
}
.scene-more > summary::-webkit-details-marker {
    display: none;
}
.scene-more > summary:hover,
.scene-more[open] > summary {
    border-color: var(--accent);
}
.scene-tools {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
#sound-scene {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 111px;
}
#sound-scene svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#sound-scene[aria-pressed='false'] .sound-waves,
#sound-scene[aria-pressed='true'] .sound-muted {
    display: none;
}
.scene-tools button,
.scene-tools select {
    font-size: 12px;
    padding: 9px 12px;
}
.scene-feedback {
    margin: 0;
    font:
        11px/1.5 'Courier New',
        monospace;
    color: #dfd1dd;
    text-align: right;
}
#loading-status {
    position: absolute;
    top: 106px;
    left: 4vw;
    color: var(--paper);
    font:
        12px/1.5 'Courier New',
        monospace;
}
.scene-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0712b8;
    z-index: 1000;
}
.scene-help {
    position: fixed;
    top: 90px;
    right: 4vw;
    z-index: 1001;
}
.scene-panel,
dialog {
    background: #211c24;
    border: 1px solid #69505e;
    border-radius: 8px;
    padding: 26px;
    width: min(500px, calc(100vw - 32px));
    max-height: 75svh;
    overflow-y: auto;
    color: var(--paper);
    box-shadow: 0 20px 80px #0008;
}
.scene-panel h2,
dialog h2 {
    font:
        28px Georgia,
        serif;
    margin-top: 0;
}
.scene-panel label {
    display: block;
    margin: 12px 0;
    font-size: 13px;
}
.scene-panel input[type='range'] {
    display: block;
    width: 100%;
    margin-top: 5px;
    accent-color: var(--accent);
}
.scene-panel > button {
    float: right;
}
.scene-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.scene-help dl {
    display: grid;
    grid-template-columns: 55px 1fr;
    gap: 8px;
    font-size: 13px;
}
.scene-help dt {
    color: var(--accent);
}
.scene-help dd {
    margin: 0;
}
.scene-help p {
    font-size: 13px;
    color: var(--muted);
}
dialog::backdrop {
    background: #0a0712b8;
}
dialog p {
    color: var(--muted);
}
.scene-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.scene-help {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    max-width: none;
    max-height: none;
}
.scene-help .scene-panel {
    width: 100%;
    max-height: calc(100svh - 40px);
}
@media (max-width: 700px) {
    .hero {
        --hero-gutter: 22px;
    }
    .site-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    .site-header .identity small {
        display: none;
    }
    .wordmark {
        font-size: 35px;
    }
    .site-header nav {
        gap: 18px;
        font-size: 12px;
    }
    .hero-copy {
        max-width: 320px;
    }
    .hero-copy h1 {
        font-size: 34px;
    }
    .hero-copy p:last-child {
        font-size: 13px;
        max-width: 290px;
    }
    .scene-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .scene-tools {
        justify-content: flex-start;
        gap: 5px;
    }
    .scene-tools button,
    .scene-tools select {
        padding: 9px 10px;
    }
    #sound-scene {
        min-width: 44px;
        width: 44px;
    }
    #sound-scene span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .scene-feedback {
        text-align: left;
        font-size: 10px;
    }
    #loading-status {
        top: 142px;
        left: 22px;
    }
    .drive-speed {
        top: 154px;
        left: 22px;
    }
    .scene-help {
        top: 20px;
        right: 16px;
    }
}
@media (max-width: 380px) {
    .hero {
        --hero-gutter: 16px;
    }
    .scene-tools {
        gap: 4px;
    }
    .scene-tools button,
    .scene-more > summary {
        padding-inline: 8px;
    }
}
@media (max-width: 1000px), (max-height: 600px) {
    .scene-more {
        display: block;
        pointer-events: auto;
    }
    .scene-more > summary {
        display: block;
    }
    .scene-more-tools {
        position: absolute;
        bottom: calc(100% + 8px);
        right: 0;
        z-index: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: min(300px, calc(100vw - 2 * var(--hero-gutter)));
        max-height: calc(100dvh - 140px);
        overflow-y: auto;
        padding: 12px;
        background: #211b24;
        border: 1px solid #69505e;
        border-radius: 4px;
        box-shadow: 0 8px 24px #0005;
    }
    .scene-more-tools select {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
    }
}
@media (max-height: 600px) {
    .hero-copy h1 {
        font-size: clamp(28px, 6dvh, 36px);
    }
    .hero-copy .eyebrow {
        margin-block: 0;
    }
    .hero-copy p:last-child {
        margin-bottom: 0;
    }
    .turbo-panel {
        width: 11rem;
    }
    .cockpit-caption,
    .turbo-hint,
    .oil-status,
    .smoke-status {
        padding-block: 3px;
    }
    .turbo-hint {
        min-height: 0;
    }
    .drive-speed,
    #loading-status {
        top: 76px;
    }
}
@media (max-height: 420px) {
    .site-header .identity small,
    .hero-copy .eyebrow,
    .hero-copy p:last-child {
        display: none;
    }
    .wordmark {
        font-size: 32px;
    }
    .hero-copy h1 {
        margin: 0;
        font-size: 26px;
    }
    .cockpit-caption,
    .oil-status,
    .smoke-status,
    .turbo-hint kbd {
        display: none;
    }
    .hero[data-driving='true'] .drive-speed {
        top: 68px;
        left: auto;
        right: var(--hero-gutter);
        font-size: 18px;
    }
    .hero[data-driving='true'] .scene-feedback {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
