@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --bg: #f5f5f3;
    --paper: #ffffff;
    --ink: #111111;
    --muted: #5b6068;
    --line: rgb(17 17 17 / 0.16);
    --wash: rgb(17 17 17 / 0.05);
    --good: #1d6b45;
    --bad: #9b2335;
    --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-ui: cubic-bezier(0.33, 1, 0.68, 1);
    --edge: 40px;
    --col: calc(50% + 10px);
    --m: #111111;
    --m-deep: #111111;
    --m-light: #8a8d92;
    --accent: var(--m);
}

[data-mod="pedal"] { --m: #0a78c2; --m-light: #8ecbf2; --m-deep: #064a7a; }
[data-mod="chem"] { --m: #6243d6; --m-light: #b9a8f5; --m-deep: #33208a; }
[data-mod="physics"] { --m: #d63a1e; --m-light: #f7a48f; --m-deep: #8a2010; }
[data-mod="scioly"] { --m: #0b8457; --m-light: #7fd2ac; --m-deep: #075237; }
[data-mod="aime"] { --m: #1f4fd8; --m-light: #9db4f4; --m-deep: #122f86; }
[data-mod="amc"] { --m: #087f8c; --m-light: #7fcdd5; --m-deep: #054f57; }
[data-mod="amino"] { --m: #cf2a5c; --m-light: #f29ab4; --m-deep: #84163a; }
[data-mod] { --accent: var(--m); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
img, svg, canvas { display: block; }
img { max-width: 100%; height: auto; }
sub, sup { font-size: 0.68em; line-height: 0; }
[hidden] { display: none !important; }
fieldset { min-width: 0; }
a, button, summary, label, select, input, textarea { touch-action: manipulation; }

::selection { background: color-mix(in srgb, var(--m) 22%, transparent); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.arr { display: inline-block; width: 0.72em; height: 0.72em; margin-left: 0.28em; vertical-align: baseline; overflow: visible; transition: transform 240ms var(--ease-ui); }
.arr path { fill: none; stroke: currentColor; stroke-width: 1.7; vector-effect: non-scaling-stroke; }
@media (hover: hover) { a:hover .arr { transform: translate(2px, -2px); } }

.num { font-variant-numeric: tabular-nums; }

.top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    align-items: center;
    min-height: 84px;
    padding: 0 var(--edge);
    font-size: 16px;
    font-weight: 500;
}
.brand { display: inline-flex; align-items: center; gap: 18px; min-height: 44px; justify-self: start; white-space: nowrap; }
.mark { display: flex; gap: 2px; height: 22px; }
.mark i { width: 4px; background: var(--m); }
.top-right { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.top-nav { display: flex; gap: 28px; }
.top-nav a, .top-out { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.top a { transition: color 180ms var(--ease-ui); }
@media (hover: hover) { .top-nav a:hover, .top-out:hover, .brand:hover { color: var(--muted); } }

.switcher {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.switcher::-webkit-scrollbar { display: none; }
.switcher a {
    flex: none;
    padding: 31px 0 29px;
    color: var(--muted);
    white-space: nowrap;
    transition: color 180ms var(--ease-ui);
}
.switcher a[aria-current="page"] { color: var(--ink); }
@media (hover: hover) { .switcher a:hover { color: var(--ink); } }
.switcher:not(.has-line) a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--m); }
.switcher-line {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 2px;
    background: var(--m);
    transform-origin: 0 0;
    pointer-events: none;
}
.switcher-line.is-ready { transition: transform 420ms var(--ease), background-color 420ms var(--ease); }

.hero { padding: 132px var(--edge) 150px; }
.hero h1 {
    margin-left: var(--col);
    max-width: 11.6em;
    font-size: clamp(34px, 4.2vw, 62px);
    line-height: 1.02;
    font-weight: 500;
    letter-spacing: -0.038em;
    text-wrap: balance;
    animation: rise 900ms var(--ease) both;
}

.folio { display: flex; height: clamp(540px, 76vh, 720px); }
.strip {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    background: var(--m);
    color: #ffffff;
    --p-a: #ffffff;
    --p-b: var(--m-light);
    --p-f: var(--m);
    transition: flex-grow 620ms var(--ease);
    animation: wipe 820ms var(--ease) backwards;
}
.strip:nth-child(2) { animation-delay: 50ms; }
.strip:nth-child(3) { animation-delay: 100ms; }
.strip:nth-child(4) { animation-delay: 150ms; }
.strip:nth-child(5) { animation-delay: 200ms; }
.strip:nth-child(6) { animation-delay: 250ms; }
.strip:nth-child(7) { animation-delay: 300ms; }
.strip.is-open { flex-grow: 4.6; }
.strip:focus-visible { outline: 2px solid #ffffff; outline-offset: -10px; }
.strip-side {
    position: absolute;
    left: 40px;
    bottom: 36px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-size: 27px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.025em;
    transition: opacity 220ms var(--ease-ui) 200ms;
}
.strip.is-open .strip-side { opacity: 0; transition-delay: 0ms; }
.strip-open {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(100vw * 4.6 / 10.6);
    padding: 36px 40px;
    display: grid;
    grid-template-rows: auto 1fr;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms var(--ease-ui), visibility 0ms 200ms;
}
.strip.is-open .strip-open { opacity: 1; visibility: visible; transition: opacity 420ms var(--ease) 240ms, visibility 0ms 0ms; }
.strip-title { font-size: clamp(48px, 6.1vw, 92px); line-height: 0.94; font-weight: 500; letter-spacing: -0.048em; }
.strip-foot { display: flex; align-items: flex-end; justify-content: space-between; }
.strip-go { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.strip-go .arr { transition: transform 240ms var(--ease-ui); }
@media (hover: hover) { .strip:hover .strip-go .arr { transform: translateX(6px); } }
.strip-motif { width: clamp(150px, 17vw, 250px); aspect-ratio: 4 / 5; margin: 0 -6px -10px 0; }
@media (hover: hover) { .strip.is-open:hover .motif [style] { transform: var(--mv); } }

.label { margin: 0 var(--edge); padding-top: 24px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 500; }

.also { padding: 150px 0; }
.also ul { margin: 96px var(--edge) 0 var(--col); display: grid; justify-items: start; }
.also li a { font-size: clamp(34px, 4.2vw, 62px); line-height: 1.08; font-weight: 500; letter-spacing: -0.038em; transition: color 200ms var(--ease-ui); }
@media (hover: hover) { .also li a:hover { color: var(--muted); } }

.foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 0 var(--edge);
    padding: 44px 0 56px;
    border-top: 1px solid var(--line);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}
.foot-mark { font-size: clamp(120px, 20vw, 292px); line-height: 0.74; font-weight: 700; letter-spacing: -0.07em; margin: 0 0 0 -0.04em; padding-bottom: 0.06em; }
.foot-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 20px; align-content: space-between; min-height: 360px; }
.foot-id { display: grid; justify-items: start; align-content: start; }
@media (hover: hover) { .foot-id a:hover { color: var(--muted); } }
.foot-cols ul { color: var(--muted); }
.foot-cols ul a { white-space: nowrap; transition: color 180ms var(--ease-ui); }
@media (hover: hover) { .foot-cols ul a:hover { color: var(--ink); } }
.foot-legal { grid-column: 1 / -1; align-self: end; color: var(--muted); }
.foot-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.band {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    min-height: clamp(260px, 34vh, 340px);
    padding: 36px var(--edge) 0;
    overflow: hidden;
    background: var(--m);
    color: #ffffff;
    --p-a: #ffffff;
    --p-b: var(--m-light);
    --p-f: var(--m);
}
.band-title {
    font-size: clamp(48px, 6.1vw, 92px);
    line-height: 0.94;
    font-weight: 500;
    letter-spacing: -0.048em;
    animation: rise 820ms var(--ease) 80ms both;
}
.band-motif {
    align-self: end;
    width: clamp(150px, 17vw, 250px);
    aspect-ratio: 4 / 5;
    margin: 0 -6px -42px 0;
    animation: rise 900ms var(--ease) 160ms both;
}
@media (hover: hover) { .band:hover .motif [style] { transform: var(--mv); } }

.motif { width: 100%; height: 100%; overflow: visible; }
.motif text { font-family: var(--sans); font-weight: 600; }
.motif [style] { transform-box: fill-box; transform-origin: center; transition: transform 700ms var(--ease); }

.desk {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
    padding: 72px var(--edge) 150px;
    animation: rise 700ms var(--ease) 160ms both;
}
.desk-side { position: sticky; top: 32px; display: grid; gap: 64px; padding-right: 64px; }
.stage { min-width: 0; min-height: 520px; }

.config { display: grid; justify-items: start; gap: 28px; max-width: 560px; }
.config-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; }

.field { display: grid; gap: 10px; min-width: 0; }
.field-label { color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1.3; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 0;
    background: var(--accent);
    color: #ffffff;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 180ms var(--ease-ui), color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui);
}
@media (hover: hover) { .btn:not(:disabled):hover { background: var(--m-deep); } }
.btn:disabled { background: rgb(17 17 17 / 0.1); color: var(--muted); cursor: default; }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) { .btn-quiet:not(:disabled):hover { background: var(--wash); } }
.btn-quiet:disabled { background: transparent; color: rgb(17 17 17 / 0.4); }

.text-btn {
    color: var(--m-deep);
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    text-decoration-color: color-mix(in srgb, var(--m-deep) 40%, transparent);
    transition: text-decoration-color 180ms var(--ease-ui);
}
@media (hover: hover) { .text-btn:hover { text-decoration-color: var(--m-deep); } }
.text-btn:disabled { color: var(--muted); cursor: default; }

.segmented {
    position: relative;
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: inset 0 0 0 1px var(--line);
}
.segmented label { position: relative; z-index: 1; display: flex; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 180ms var(--ease-ui), color 220ms var(--ease-ui);
}
.segmented label + label span { box-shadow: inset 1px 0 0 var(--line); }
@media (hover: hover) { .segmented label:hover input:not(:checked):not(:disabled) + span { background: var(--wash); } }
.segmented input:checked + span { background: var(--accent); color: #ffffff; box-shadow: none; }
.segmented-thumb {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: var(--accent);
    transform-origin: 0 0;
    pointer-events: none;
}
.segmented-thumb.is-ready { transition: transform 320ms var(--ease), opacity 180ms var(--ease-ui); }
.segmented.has-thumb input:checked + span { background: transparent; }
.segmented.has-thumb label:has(input:checked) + label span { box-shadow: none; }
.segmented input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.segmented input:disabled { cursor: default; }
.segmented input:disabled + span { color: rgb(17 17 17 / 0.4); }

.select, .picker summary {
    display: flex;
    align-items: center;
    height: 52px;
    min-width: 132px;
    padding: 0 44px 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111111' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 16px center;
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 16px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    transition: background-color 180ms var(--ease-ui);
}
@media (hover: hover) { .select:hover, .picker summary:hover { background-color: var(--wash); } }
.select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.select option { color: var(--ink); background: var(--paper); }
select[name="event"] { width: min(100%, 420px); }

.picker { position: relative; }
.picker summary { min-width: 220px; white-space: nowrap; list-style: none; }
.picker summary::-webkit-details-marker { display: none; }
.picker[open] summary { background-color: var(--wash); }
.picker-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: max-content;
    min-width: 300px;
    max-width: min(560px, calc(100vw - 2 * var(--edge)));
    max-height: 380px;
    overflow-y: auto;
    padding: 16px 20px 18px;
    background: var(--paper);
    box-shadow: inset 0 0 0 1px var(--line);
    scrollbar-width: none;
    animation: drop 260ms var(--ease-ui) both;
}
.picker-panel::-webkit-scrollbar { display: none; }
.picker-actions { display: flex; gap: 24px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 24px; }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--m); }

.error { color: var(--bad); font-size: 16px; font-weight: 500; }
.error:empty { display: none; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.muted { color: var(--muted); }
.loading { color: var(--muted); font-size: 18px; font-weight: 500; }

.ledger { display: grid; gap: 32px; }
.ledger dl { display: flex; flex-wrap: wrap; gap: 20px 48px; }
.ledger dl div { display: grid; gap: 4px; min-width: 0; }
.ledger dt { color: var(--muted); font-size: 15px; font-weight: 500; }
.ledger dd { font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.progress { display: flex; flex-wrap: wrap; gap: 6px; }
.progress button {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--muted);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: background-color 180ms var(--ease-ui), color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui);
}
@media (hover: hover) { .progress button:hover { background: var(--wash); color: var(--ink); } }
.progress button.is-right { color: var(--good); }
.progress button.is-wrong { color: var(--bad); }
.progress button[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.progress button[aria-current="true"].is-right { color: var(--good); }
.progress button[aria-current="true"].is-wrong { color: var(--bad); }
.ledger-note { max-width: 40ch; color: var(--muted); font-size: 15px; }

.stage-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-bottom: 28px; color: var(--muted); font-size: 15px; font-weight: 500; }
.stage-meta span:first-child { color: var(--m-deep); }
.stage-meta span:empty { display: none; }

.context { max-width: 62ch; margin-bottom: 20px; color: var(--muted); font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }

.prompt {
    max-width: 30em;
    font-size: clamp(21px, 1.75vw, 26px);
    line-height: 1.32;
    font-weight: 450;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.choices { display: grid; margin: 36px 0 0; padding: 0; border: 0; }
.choice {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 4px;
    padding: 16px;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 450;
    letter-spacing: -0.012em;
    box-shadow: inset 0 -1px 0 var(--line);
    cursor: pointer;
    transition: background-color 180ms var(--ease-ui), color 180ms var(--ease-ui);
}
.choice:first-child { box-shadow: inset 0 -1px 0 var(--line), inset 0 1px 0 var(--line); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-key { font-weight: 500; color: var(--m-deep); transition: color 180ms var(--ease-ui); }
.choice-text { min-width: 0; overflow-wrap: anywhere; }
.choice-mark { padding-left: 16px; font-size: 15px; font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .choice:not(:has(input:checked)):hover { background: var(--wash); } }
.choice:has(input:checked) { background: var(--accent); color: #ffffff; box-shadow: none; }
.choice:has(input:checked) .choice-key { color: #ffffff; }
.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 1; }
.choices.is-locked .choice { cursor: default; }
@media (hover: hover) { .choices.is-locked .choice:not(:has(input:checked)):hover { background: transparent; } }
.choices.is-locked .choice:has(input:checked) { background: var(--bad); }
.choices.is-locked .choice.is-right:has(input:checked) { background: var(--good); }
.choices.is-locked .choice:has(input:checked) .choice-mark { color: #ffffff; }
.choices.is-locked .choice.is-right:not(:has(input:checked)) { color: var(--good); font-weight: 600; }
.choices.is-locked .choice.is-right:not(:has(input:checked)) .choice-key { color: var(--good); }

.integer-field { display: grid; justify-items: start; gap: 14px; margin-top: 40px; }
.integer-input, .text-input {
    padding: 0 0 6px;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    background: transparent;
    font-weight: 500;
    caret-color: var(--m);
    transition: border-color 180ms var(--ease-ui), color 180ms var(--ease-ui);
}
.integer-input { width: 3.2ch; font-size: 80px; line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.text-input { width: min(100%, 520px); font-size: 26px; line-height: 1.2; }
.integer-input::placeholder, .text-input::placeholder { color: rgb(17 17 17 / 0.22); }
.integer-input:focus-visible, .text-input:focus-visible { outline: none; border-bottom-color: var(--m); }
.integer-input:disabled, .text-input:disabled { color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }

.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 36px; }

.verdict { display: grid; gap: 6px; margin-top: 36px; font-size: 18px; line-height: 1.45; }
.verdict strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.verdict span { color: var(--ink); overflow-wrap: anywhere; }

.solution { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.solution h3 { margin-bottom: 10px; color: var(--muted); font-size: 15px; font-weight: 600; }
.solution p { font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }

.summary { display: grid; gap: 28px; max-width: 620px; }
.summary h2 { font-size: clamp(34px, 3.4vw, 52px); line-height: 1.02; font-weight: 500; letter-spacing: -0.038em; }
.summary ul { display: grid; }
.summary li { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; font-variant-numeric: tabular-nums; }
.summary li:first-child { border-top: 1px solid var(--line); }
.summary .stage-actions { margin-top: 8px; }

.verdict:not([hidden]), .summary:not([hidden]) { animation: rise 320ms var(--ease-ui) both; }
.solution:not([hidden]) { animation: rise 420ms var(--ease-ui) 60ms both; }

body mjx-container[jax="CHTML"] { max-width: calc(100% + 1em); padding-left: 0.5em; padding-right: 0.5em; margin-left: -0.5em; margin-right: -0.5em; }
mjx-container[jax="CHTML"][display="true"] { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
mjx-container[jax="CHTML"]:not([display="true"]) { display: inline-block; overflow-x: auto; overflow-y: hidden; vertical-align: middle; scrollbar-width: none; }
mjx-container::-webkit-scrollbar { display: none; }

.desk-pedal { display: block; }
.pv-stage { position: relative; height: clamp(340px, 52vh, 560px); background: var(--paper); }
.pv-stage canvas { width: 100%; height: 100%; }
.pv-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
}
.pv-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 28px 48px; padding-top: 36px; }
.pv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.pv-pedal { display: grid; gap: 4px; margin-left: auto; text-align: right; }
.pv-pedal strong { font-size: clamp(34px, 3.4vw, 52px); line-height: 1; font-weight: 500; letter-spacing: -0.038em; transition: color 220ms var(--ease-ui); }
.pv-status { margin-top: 28px; color: var(--muted); font-size: 16px; font-weight: 500; }
.state-up { color: var(--muted); }
.state-down { color: var(--m-deep); }
.state-release { color: #8a2010; }
.telemetry { margin-top: 48px; border-top: 1px solid var(--line); }
.telemetry summary { width: max-content; padding: 22px 0; font-size: 16px; font-weight: 500; cursor: pointer; list-style: none; }
.telemetry summary::-webkit-details-marker { display: none; }
.telemetry summary::after { content: " +"; color: var(--muted); }
.telemetry[open] summary::after { content: " \2212"; }
.telemetry dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 20px; padding-bottom: 8px; }
.telemetry dl div { display: grid; gap: 4px; min-width: 0; }
.telemetry dt { color: var(--muted); font-size: 15px; font-weight: 500; }
.telemetry dd { font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.desk-amino { display: block; }
.aw-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: end; }
.aw-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px; }
.aw-stats { display: flex; gap: 48px; }
.aw-stats div { display: grid; gap: 4px; }
.aw-stats span { color: var(--muted); font-size: 15px; font-weight: 500; }
.aw-stats strong { font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.aw-note { min-height: 1.4em; margin: 20px 0 32px; color: var(--muted); font-size: 16px; font-weight: 500; }

.aw-board { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.aw-col { display: grid; align-content: start; gap: 18px; min-width: 0; }
.aw-figure { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #ffffff; transition: background-color 320ms var(--ease-ui); }
.aw-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.aw-figure img[src$="-2d.webp"] { filter: brightness(1.0408); transform: scale(1.25); }
.aw-board.is-waiting .aw-figure { background: rgb(17 17 17 / 0.06); }
.aw-board.is-waiting .aw-figure img { visibility: hidden; }
.aw-start { position: absolute; inset: 0 0 82px; display: grid; place-items: center; }
.tile {
    display: grid;
    place-items: center;
    height: 64px;
    border-bottom: 2px solid var(--line);
    font-size: 44px;
    line-height: 1;
    font-weight: 500;
    transition: border-color 180ms var(--ease-ui), color 180ms var(--ease-ui);
}
.tile.is-cursor { border-bottom-color: var(--m); }
.tile.is-filled { border-bottom-color: var(--ink); }
.tile.is-right { color: var(--good); border-bottom-color: var(--good); }
.tile.is-wrong { color: var(--bad); border-bottom-color: var(--bad); }
.tile.is-flipping { animation: tile-flip 200ms var(--ease-ui) both; }

.aw-play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; padding-top: 48px; }
.aw-play > * { grid-column: 1; }
.keys { display: grid; gap: 6px; }
.keys-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.keys-row.is-actions { grid-template-columns: 1fr 1fr; }
.key {
    height: 56px;
    padding: 0;
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    transition: background-color 180ms var(--ease-ui), color 180ms var(--ease-ui);
}
@media (hover: hover) { .key:not(:disabled):hover { background: var(--wash); } }
.key:disabled { color: rgb(17 17 17 / 0.4); cursor: default; }
.key.is-wide { font-size: 17px; }
.key.is-primary { background: var(--accent); color: #ffffff; box-shadow: none; }
@media (hover: hover) { .key.is-primary:not(:disabled):hover { background: var(--m-deep); } }
.key.is-primary:disabled { background: rgb(17 17 17 / 0.1); color: var(--muted); }
.keys .error { margin-top: 10px; }

.aw-result { display: grid; gap: 28px; }
.aw-result:not([hidden]) { animation: rise 320ms var(--ease-ui) both; }
.aw-result h2 { font-size: clamp(34px, 3.4vw, 52px); line-height: 1.02; font-weight: 500; letter-spacing: -0.038em; }
.decode { display: grid; }
.decode li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 56px 28px; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 18px; font-variant-numeric: tabular-nums; }
.decode li:first-child { border-top: 1px solid var(--line); }
.decode li > span:first-child { color: var(--muted); }
.decode li > strong { font-weight: 600; text-align: right; }
.aw-result .stage-actions { margin-top: 0; }

.reference { margin-top: 72px; border-top: 1px solid var(--line); }
.reference summary { width: max-content; padding: 22px 0; font-size: 16px; font-weight: 500; cursor: pointer; list-style: none; }
.reference summary::-webkit-details-marker { display: none; }
.reference summary::after { content: " +"; color: var(--muted); }
.reference[open] summary::after { content: " \2212"; }
.reference ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 20px; padding-bottom: 8px; font-size: 16px; }
.reference li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; }
.reference li strong { font-weight: 600; }
.reference li span:last-child { color: var(--muted); padding-right: 24px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tile-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

@media (max-width: 1120px) {
    .top-module { grid-template-columns: 1fr; padding-top: 22px; }
    .top-module .switcher { justify-content: flex-start; margin: 6px calc(-1 * var(--edge)) 0; padding: 0 var(--edge); gap: 28px; }
    .top-module .switcher a { padding: 12px 0 16px; }
    .desk-side { padding-right: 24px; }
    .telemetry dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .top-right .top-nav { display: none; }
    .top-right { justify-content: flex-end; }
    .hero { padding: 72px var(--edge) 88px; }
    .hero h1 { margin-left: 0; }
    .also { padding: 88px 0; }
    .also ul { margin: 48px var(--edge) 0; }
    .folio { flex-direction: column; height: auto; }
    .strip { flex: none; height: 76px; transition: height 520ms var(--ease); }
    .strip.is-open { height: 360px; }
    .strip-side { writing-mode: horizontal-tb; transform: none; left: var(--edge); bottom: auto; top: 24px; }
    .strip-open { width: 100%; padding: 22px var(--edge); }
    .strip-motif { width: 150px; }
    .top:not(.top-module) { display: flex; flex-wrap: wrap; justify-content: space-between; align-content: center; padding-top: 12px; padding-bottom: 12px; }
    .foot { grid-template-columns: 1fr; }
    .foot-cols { grid-template-columns: 1fr 1fr; min-height: 0; gap: 32px 20px; }
    .foot-id { grid-column: 1 / -1; }
    .desk { grid-template-columns: minmax(0, 1fr); padding-top: 48px; padding-bottom: 96px; }
    .desk-side { display: contents; }
    .config { order: 1; max-width: none; }
    .stage { order: 2; min-height: 0; margin-top: 56px; }
    .ledger { order: 3; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
    .aw-bar { grid-template-columns: 1fr; row-gap: 28px; }
    .aw-play { grid-template-columns: 1fr; }
    .pv-pedal { margin-left: 0; text-align: left; width: 100%; }
}

@media (max-width: 760px) {
    :root { --edge: 20px; }
    .top { min-height: 68px; }
    .top-module { padding-top: 16px; }
    .top-module .switcher { gap: 24px; }
    .band { min-height: 208px; padding-top: 24px; }
    .band-title { font-size: clamp(40px, 12vw, 48px); }
    .band-motif { position: absolute; right: calc(var(--edge) - 6px); bottom: -26px; width: clamp(108px, 30vw, 150px); margin: 0; }
    .config { gap: 22px; }
    .config .field, .config-row { width: 100%; }
    .config-row { flex-wrap: nowrap; gap: 12px; }
    .config-row .field { flex: 1 1 0; }
    .config-row .btn { flex: 1 1 0; min-width: 0; padding: 0 16px; }
    .config > .btn { width: 100%; }
    .config .select, .picker summary, select[name="event"] { width: 100%; min-width: 0; }
    .segmented { display: flex; width: 100%; }
    .segmented label { flex: 1 1 0; min-width: 0; }
    .segmented span { justify-content: center; width: 100%; padding: 0 6px; font-size: 15px; line-height: 1.2; text-align: center; white-space: normal; }
    .picker-panel { left: 0; right: 0; width: auto; min-width: 0; max-width: none; max-height: 340px; scroll-margin-bottom: 20px; }
    .prompt { font-size: 20px; }
    .choice { grid-template-columns: 32px minmax(0, 1fr); padding: 14px 12px; font-size: 17px; }
    .choice-mark { grid-column: 2; padding: 4px 0 0; }
    .integer-input { font-size: 64px; }
    .stage-actions .btn { flex: 1 1 auto; }
    .stage { margin-top: 40px; }
    .ledger { gap: 24px; margin-top: 48px; padding-top: 24px; }
    .ledger dl { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 16px 28px; }
    .ledger dd { font-size: 22px; overflow-wrap: anywhere; }
    .pv-stage { height: 340px; }
    .pv-controls > .field, .pv-group { width: 100%; }
    .pv-group { gap: 12px; }
    .pv-group .btn { flex: 1 1 auto; padding: 0 16px; }
    .telemetry dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .telemetry dd, .aw-stats strong { font-size: 24px; }
    .aw-toolbar, .aw-toolbar .field, .aw-toolbar .select { width: 100%; }
    .aw-stats { gap: 32px; }
    .aw-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
    .aw-col { gap: 10px; }
    .aw-start { inset: 0; }
    .tile { height: 52px; font-size: 34px; }
    .keys-row { gap: 4px; }
    .keys { gap: 4px; }
    .key { height: 50px; font-size: 16px; }
    .reference ul { grid-template-columns: 1fr 1fr; }
    .reference li span:last-child { padding-right: 8px; }
    .decode li { grid-template-columns: 24px minmax(0, 1fr) 44px 20px; font-size: 16px; }
    .foot-mark { font-size: 132px; }
}

@media (max-width: 420px) {
    .ledger dd { font-size: 20px; }
    .telemetry dd { font-size: 22px; }
    .telemetry dl div:last-child { grid-column: 1 / -1; }
    .aw-stats { gap: 28px; }
    .keys { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .keys-row { display: contents; }
    .keys-row.is-actions { display: grid; grid-column: 1 / -1; margin-top: 2px; }
    .keys .error { grid-column: 1 / -1; }
    .reference ul { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
    .foot-id a, .foot-cols ul a, .also li a { display: inline-flex; align-items: center; min-height: 44px; }
    .foot-legal { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }
}
