/* =============================================================================
   The homepage: a plain black-and-white page from the early web.
   Colour only shows up inside a project's box, once you start playing with it.

   1. Setup & black/white      4. Projects and the box     7. Footer
   2. Page moves               5. The game inside the box  8. Small screens
   3. Masthead & light switch  6. 404                      9. Reduced motion
   ============================================================================= */

/* ============ 1. Setup & black/white ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }

:root {
  --paper: #fff;
  --ink: #000;
  --serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;
  --mono: "Courier New", Courier, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #000; --ink: #fff; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #000; --ink: #fff; color-scheme: dark; }

body { background: var(--paper); color: var(--ink); font: 18px/1.4 var(--serif); }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
a:not(.door):hover { background: var(--ink); color: var(--paper); text-decoration: none; }
hr { height: 0; margin: 0; border: 0; border-top: 2px solid var(--ink); }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px dotted var(--ink); outline-offset: 3px; }
main:focus { outline: none; }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 50; padding: 6px 12px; background: var(--ink); color: var(--paper); font-weight: bold; }
.skip:focus { top: 8px; }
.js-only { display: none; }
.js .js-only { display: block; }

.page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 44px); }

@keyframes blink { 50% { visibility: hidden; } }

/* ============ 2. Page moves ============ */
/* Going to a project page, the browser itself morphs the box into that page (a "view transition").
   It runs on the graphics card, so it stays smooth. Browsers that can't do it just change page. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
::view-transition-group(lb-stage) { animation-duration: .85s; animation-timing-function: cubic-bezier(.7, 0, .18, 1); }
::view-transition-group(lb-w1), ::view-transition-group(lb-w2), ::view-transition-group(lb-w3) { animation-duration: .9s; animation-timing-function: cubic-bezier(.5, 0, .15, 1.15); }
::view-transition-group(lb-w2) { animation-delay: .04s; }
::view-transition-old(lb-stage) { animation-duration: .3s; }
::view-transition-new(lb-stage) { animation-duration: .45s; animation-delay: .1s; }
::view-transition-group(lb-w3) { animation-delay: .08s; }
::view-transition-group(ax-stage) { animation-duration: .85s; animation-timing-function: cubic-bezier(.7, 0, .18, 1); }
::view-transition-old(ax-stage) { animation-duration: .3s; }
::view-transition-new(ax-stage) { animation-duration: .45s; animation-delay: .1s; }
::view-transition-group(ax-house) { animation-duration: .9s; animation-timing-function: cubic-bezier(.5, 0, .15, 1.04); }
::view-transition-group(ax-list) { animation-duration: .9s; animation-delay: .05s; animation-timing-function: cubic-bezier(.5, 0, .15, 1.08); }
/* Only the box that's being opened morphs into its page. */
.to-ax .box.lb, .to-ax .box.lb [data-w],
.to-lb .box.ax, .to-lb .box.ax .ax-house, .to-lb .box.ax .ax-note, .to-lb .box.ax .task-card { view-transition-name: none !important; }

/* ============ 3. Masthead & light switch ============ */
.mast { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); gap: 20px 48px; align-items: end; padding: 140px 0 30px; }
.name { margin: 0; font-size: clamp(44px, 8vw, 100px); line-height: .92; font-weight: bold; letter-spacing: -.015em; overflow-wrap: anywhere; }
.role { margin: 14px 0 0; font-size: clamp(18px, 2vw, 22px); font-style: italic; }
.mast-r { text-align: right; }
.tagline { margin: 0 0 14px; font-size: clamp(19px, 1.9vw, 22px); line-height: 1.3; }
.contact { font-size: 18px; line-height: 1.5; }
.avail { margin: 10px 0 0; font-size: 16px; }
.avail .dot { animation: blink 1s steps(1, end) 6; }

/* The lights: a heavy old knife switch. */
.switch { display: none; }
.js .switch { position: absolute; top: 22px; right: -10px; z-index: 2; display: grid; justify-items: center; gap: 4px; padding: 4px 8px; border: 0; background: none; color: var(--ink); font: bold 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ks { display: block; width: 104px; height: 92px; overflow: visible; }
.ks-ink { fill: var(--ink); }
.ks-paper { fill: var(--paper); }
.ks-grip { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.ks-sparks { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: square; opacity: 0; }
.ks-blade { transform-box: view-box; transform-origin: 15px 53px; }
.switch[aria-checked="false"] .ks-blade { transform: rotate(-42deg); }
.switch:hover .ks-grip { fill: var(--ink); }
.switch:active .ks { translate: 0 1px; }
.switch.is-opening .ks-blade { animation: ks-open .5s steps(1, end) both; }
.switch.is-closing .ks-blade { animation: ks-close .5s steps(1, end) both; }
.switch.is-closing .ks-sparks { animation: ks-spark .5s steps(1, end) both; }
.ks-label { white-space: nowrap; }
/* A few jerky frames on purpose: it should feel like a GIF of a heavy lever. */
@keyframes ks-open {
  0% { transform: rotate(0deg); } 14% { transform: rotate(-4deg); } 28% { transform: rotate(-17deg); } 42% { transform: rotate(-33deg); }
  56% { transform: rotate(-49deg); } 70% { transform: rotate(-37deg); } 84% { transform: rotate(-45deg); } 100% { transform: rotate(-42deg); }
}
@keyframes ks-close {
  0% { transform: rotate(-42deg); } 16% { transform: rotate(-35deg); } 32% { transform: rotate(-21deg); } 46% { transform: rotate(-6deg); }
  58% { transform: rotate(3deg); } 72% { transform: rotate(-2deg); } 86% { transform: rotate(1deg); } 100% { transform: rotate(0deg); }
}
@keyframes ks-spark { 0%, 52% { opacity: 0; } 58% { opacity: 1; } 66% { opacity: 0; } 72% { opacity: 1; } 80%, 100% { opacity: 0; } }
/* The band that rolls down the screen while the lights flicker. */
.roll { position: fixed; left: 0; right: 0; top: 0; z-index: 100; height: 24vh; background: #fff; mix-blend-mode: difference; pointer-events: none; }

/* ============ 4. Projects and the box ============ */
.work { padding: 26px 0 72px; }
.work-h { margin: 0; font-size: 30px; line-height: 1.1; }
.work-h small { font-size: 20px; font-weight: normal; }
.hint { margin: 6px 0 34px; font-size: 17px; font-style: italic; }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 64px; }
.project { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 24px 44px; align-items: start; }

.info h3 { margin: 4px 0 0; font-size: 28px; line-height: 1.15; }
.info h3 a { text-decoration-thickness: 2px; text-underline-offset: .15em; }
.info p { margin: 8px 0 0; }
.new { display: inline-block; margin-left: 6px; padding: 1px 5px 0; background: var(--ink); color: var(--paper); font: bold 13px/1.2 var(--mono); font-style: normal; vertical-align: 5px; animation: blink 1s steps(1, end) 6; }
.meta { font-style: italic; font-size: 16px; }
.tech { font: 14px/1.4 var(--mono); }
.nudge { font-style: italic; font-size: 16px; }
.nudge::before { content: "\261C  "; font-style: normal; }

/* The box. Idle, it's a black-and-white frame with three plain blocks waiting inside. */
.box {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  transition: border-color .5s, border-radius .5s, background-color .5s, box-shadow .5s;
}
.box.lb { view-transition-name: lb-stage; }
.box.ax { view-transition-name: ax-stage; }
.box.ax .ax-house { view-transition-name: ax-house; }
.box.ax .ax-note, .box.ax .task-card { view-transition-name: ax-list; }
.ax-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.door {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 26px;
  color: var(--ink); text-decoration: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 28%, transparent) 1px, transparent 1.4px) 0 0 / 18px 18px;
}
.door[hidden] { display: none; }
.door:focus-visible { outline: 3px dotted var(--ink); outline-offset: -10px; }
.door-blocks { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 12px; padding: 0 16px; font-size: clamp(22px, 2.6vw, 30px); }
.door-hint { font: 15px var(--mono); }
.door-hint::before { content: "\25B6\00a0"; display: inline-block; animation: blink 1s steps(1, end) 6; }

/* Plain blocks: no colour yet, just ink on paper. */
.blk.plain { --c: var(--paper); --cd: var(--ink); --t: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), 0 4px 0 var(--ink); }
.door .blk { animation: bob 3.4s ease-in-out infinite; transition: translate .3s cubic-bezier(.3, 1.6, .5, 1); }
.door .blk:nth-child(2) { animation-delay: -1.1s; }
.door .blk:nth-child(3) { animation-delay: -2.2s; }
.door:hover .blk, .door:focus-visible .blk { translate: 0 -8px; }
.door:hover .blk:nth-child(2), .door:focus-visible .blk:nth-child(2) { transition-delay: .04s; }
.door:hover .blk:nth-child(3), .door:focus-visible .blk:nth-child(3) { transition-delay: .08s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* The blocks keep their names across pages, so they fly into the LingoBlox page (and back). */
.box [data-w="w1"] { view-transition-name: lb-w1; }
.box [data-w="w2"] { view-transition-name: lb-w2; }
.box [data-w="w3"] { view-transition-name: lb-w3; }

/* First visit: the box "downloads" in a few chunky steps, like an image on a 28.8k modem. */
.js:not(.vt) .box::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 4px 4px;
  transform-origin: bottom; animation: dialup 1s steps(8, end) .2s both;
}
@keyframes dialup { from { scale: 1 1; } to { scale: 1 0; } }

/* ============ 5. The game inside the box ============ */
/* Once you click, the box turns into a tiny LingoBlox screen. */
.box.is-playing { border-color: #dfe5ec; border-radius: 22px; background: #f5f7f6; box-shadow: 0 26px 50px -20px rgb(0 0 0 / .4); }
.box.is-playing::after { display: none; }

.lbg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 16px; color: var(--lb-ink); font: 700 15px/1.3 var(--lb-font); }
.lbg > :not(.lbg-feedback) { animation: lbg-in .45s cubic-bezier(.2, .9, .3, 1) both; }
.lbg > :nth-child(2) { animation-delay: .05s; }
.lbg > :nth-child(3) { animation-delay: .1s; }
.lbg > :nth-child(4) { animation-delay: .15s; }
.lbg > :nth-child(5) { animation-delay: .2s; }
.lbg > :nth-child(6) { animation-delay: .25s; }
.lbg > :nth-child(7) { animation-delay: .3s; }
@keyframes lbg-in { from { opacity: 0; translate: 0 8px; } }

.lbg-top { display: flex; align-items: center; gap: 10px; }
.lbg-back { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: #fff; color: var(--lb-ink); box-shadow: 0 2px 6px rgb(0 0 0 / .08); cursor: pointer; }
.lbg-back svg { width: 18px; height: 18px; }
.lbg-back:focus-visible { outline: 3px solid var(--lb-blue); outline-offset: 2px; }
.lbg-title { flex: 1; min-width: 0; }
.lbg-title b { display: block; font-weight: 900; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbg-title i { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: #e6ebf0; overflow: hidden; }
.lbg-title i::before { content: ""; display: block; width: 18%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ff7a3d, #ffc94d); transition: width .6s cubic-bezier(.2, .9, .3, 1); }
.lbg.won .lbg-title i::before { width: 100%; }
.lbg-hearts { display: flex; gap: 1px; font-size: 16px; }
.lbg-hearts span { display: inline-block; transition: filter .3s, opacity .3s; }
.lbg-hearts span.lost { filter: grayscale(1); opacity: .45; }
.lbg-xp { flex: none; padding: 7px 10px 6px; border-radius: 999px; background: #e5f8ee; color: #1b8a5a; font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }

.lbg-label { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--lb-muted); font: 900 11.5px/1 var(--lb-font); letter-spacing: .07em; text-transform: uppercase; }
.lbg-label .kubi { width: 34px; margin: -14px 0 -6px auto; }

.lbg-sentence, .lbg-tray { position: relative; flex: 1; min-height: 62px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 16px 18px; padding: 12px 10px 10px; border-radius: 16px; background: #fff; }
.lbg-sentence { border: 2px dashed #cbd3dd; }
.lbg-sentence:empty::before { content: attr(data-empty); color: #aab3bf; font-weight: 800; font-size: 14px; }
.lbg-tray { border: 2px solid #e7ecf1; }
.lbg-tray:empty::before { content: "All placed. Press Check!"; color: #aab3bf; font-weight: 800; font-size: 14px; }
.lbg .blk { font-size: 20px; transition: translate .1s, box-shadow .45s, background-color .45s, color .45s; }
.lbg .blk.placed .plus { scale: 0; }

.lbg-rule { margin: 0; color: var(--lb-muted); font-size: 12.5px; font-weight: 800; text-align: center; }
.lbg-rule b { font-weight: 900; }
.lbg-rule .c-blue { color: var(--lb-blue); }
.lbg-rule .c-red { color: var(--lb-red); }
.lbg-rule .c-green { color: var(--lb-green-d); }

.lbg-actions { display: flex; gap: 10px; }
.lbg-actions .lb-btn { min-height: 46px; font-size: 16px; }
.lbg-actions [data-check] { flex: 1; }
.lbg-actions svg { width: 18px; height: 18px; }

/* Right or wrong: a sheet slides up from the bottom, like in the app. */
.lbg-feedback { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 14px 18px; font-weight: 900; font-size: 16px; translate: 0 105%; transition: translate .35s cubic-bezier(.2, 1, .3, 1); }
.lbg-feedback.is-ok { translate: 0 0; background: #d9f9e6; color: #12844a; }
.lbg-feedback.is-err { translate: 0 0; background: #ffe2e5; color: #d32a3a; }
.lbg-feedback .icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: currentColor; }
.lbg-feedback .icon svg { width: 18px; height: 18px; color: #fff; }

/* ---- The ApexPlus box. Idle, it's a pen drawing of a house with three things wrong with it. ---- */
.box.ax .door { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; align-items: center; place-content: stretch; gap: 0 8px; padding: 12px 24px 18px 8px; }
.box.ax .door .ax-house { grid-area: 1 / 1; justify-self: center; width: min(100%, 330px); --line: var(--ink); --lw: 2px; transition: translate .3s cubic-bezier(.3, 1.6, .5, 1); }
.box.ax .door:hover .ax-house, .box.ax .door:focus-visible .ax-house { translate: 0 -6px; }
.box.ax .door .house .h-shadow, .box.ax .door .house .h-body, .box.ax .door .house .h-roof-fill, .box.ax .door .house .h-wins,
.box.ax .door .house .h-lit, .box.ax .door .house .h-door, .box.ax .door .house .patch { display: none; }
.box.ax .door .house .h-roof { stroke: var(--ink); stroke-width: 3.5px; }
.box.ax .door .house .h-knob { fill: var(--ink); }
.box.ax .door .house .h-dim { stroke: var(--ink); }
.box.ax .door .house .h-label { fill: var(--ink); font: bold 16px var(--mono); }
.box.ax .door .house .hole { fill: var(--ink); stroke: var(--ink); }
.box.ax .door .house .plate { fill: var(--paper); }
.box.ax .door .house .puddle { fill: none; stroke: var(--ink); stroke-width: 1.5px; opacity: 1; }
.box.ax .door .fx-drip { background: var(--ink); }
.box.ax .door .fx-spark svg { stroke: var(--ink); stroke-width: 2.4; }
.box.ax .ax-note { grid-area: 1 / 2; display: grid; gap: 7px; padding: 11px 14px 13px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); font-size: 17px; line-height: 1.15; rotate: 2.5deg; }
.box.ax .ax-note b { margin-bottom: 2px; font: bold 12px/1.25 var(--mono); letter-spacing: .03em; text-transform: uppercase; }
.box.ax .ax-note span::before { content: "\2610"; margin-right: 7px; }
.box.ax .door .door-hint { grid-area: 2 / 1 / 3 / 3; justify-self: center; }

/* Once you click: the blueprint from apexplus.ca, with a belt of tools. */
.box.ax.is-playing { border-color: #1e293b; border-radius: 22px; background: var(--ax-navy-2); box-shadow: 0 26px 50px -20px rgb(0 0 0 / .45); }
.box.ax.is-playing::after { display: none; }
.axg {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px 14px;
  color: #fff; font: 700 14px/1.3 var(--ax-font);
  background:
    radial-gradient(90% 70% at 40% 105%, rgb(255 102 0 / .26), transparent 65%),
    linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--ax-navy-2);
}
.axg > :not(.axg-msg, .tool-ghost) { animation: lbg-in .45s cubic-bezier(.2, .9, .3, 1) both; }
.axg-top { display: flex; align-items: center; gap: 10px; }
.axg-back { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgb(255 255 255 / .12); border-radius: 12px; background: rgb(255 255 255 / .06); color: #fff; cursor: pointer; }
.axg-back .i { font-size: 18px; }
.axg-back:focus-visible { outline: 3px solid var(--ax-orange-3); outline-offset: 2px; }
.axg .ap-logo { font-size: 18px; }
.axg-count { margin-left: auto; padding: 7px 11px 6px; border-radius: 999px; background: rgb(255 255 255 / .08); color: rgb(226 232 240 / .9); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.axg-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; min-height: 0; }
.axg-stage { height: 100%; min-height: 0; container-type: size; display: grid; place-items: center; }
.axg-stage .ax-house { width: min(100cqw, 100cqh); }
.axg .task-card { width: 166px; padding: 12px 13px 12px; border-radius: 14px; font-size: 13.5px; }
.axg .task-head { margin-bottom: 10px; font-size: 10px; letter-spacing: .1em; }
.axg .task-card ul { gap: 9px; }
.axg .task-card .tick { width: 18px; height: 18px; border-radius: 5px; }
.axg .task-bar { margin-top: 12px; height: 5px; }
.axg-bottom { display: flex; align-items: center; gap: 8px; }
.axg .belt { flex-wrap: nowrap; gap: 6px; }
.axg .tool { min-width: 0; width: 58px; padding: 8px 2px 7px; gap: 5px; border-radius: 14px; font-size: 9.5px; }
.axg .tool .i { font-size: 25px; }
.axg [data-done] { flex: 1; min-height: 52px; padding: 0 12px; font-size: 16px; }
.axg.is-home [data-done]:not(:disabled) { animation: ax-nudge 1.6s ease-in-out .4s 3; }
@keyframes ax-nudge { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }
.axg-msg {
  position: absolute; left: 50%; bottom: 84px; z-index: 5; max-width: calc(100% - 28px); width: max-content;
  padding: 9px 14px; border-radius: 12px; background: #fff; color: var(--ax-navy); box-shadow: 0 14px 30px -12px rgb(0 0 0 / .6);
  font-size: 14px; translate: -50% 10px; opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s;
}
.axg-msg[data-kind="ok"] { color: var(--ax-green-d); }
.axg-msg[data-kind="err"] { color: #be123c; }
.axg-msg.show { opacity: 1; translate: -50% 0; }
.axg-msg.pop { animation: none; }

/* ============ 6. 404 ============ */
.lost { max-width: 860px; padding: 8px 16px 40px; }
.lost h1 { margin: 21px 0; font-size: 32px; }
.lost code { font: 17px var(--mono); }
.lost address { margin-top: 8px; }

/* ============ 7. Footer ============ */
.foot { display: grid; gap: 10px; padding: 24px 0 44px; font-size: 15px; text-align: center; }
.foot p { margin: 0; }
.odo { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: 1px; }
.odo span { display: inline-block; width: 1.15em; padding: 2px 0 1px; background: var(--ink); color: var(--paper); font: bold 15px/1.2 var(--mono); text-align: center; }
.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
.b88 { display: inline-flex; width: 88px; height: 31px; overflow: hidden; border: 1px solid var(--ink); font: bold 7px/1.1 var(--mono); letter-spacing: -.02em; text-transform: uppercase; text-align: center; }
.b88 > b { display: grid; place-items: center; flex: none; width: 30px; background: var(--ink); color: var(--paper); font-size: 10px; letter-spacing: -.02em; }
.b88 > span { display: grid; place-items: center; flex: 1; padding: 0 2px; }

/* ============ 8. Small screens ============ */
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mast { grid-template-columns: 1fr; gap: 18px; padding: 30px 0 26px; }
  .mast-l { padding-right: 104px; }
  .mast-r { text-align: left; }
  .js .switch { top: 18px; right: -4px; }
  .work-h { font-size: 26px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .ks { width: 80px; height: 71px; }
  .mast-l { padding-right: 88px; }
  .box { aspect-ratio: 4 / 5; }
  .lbg { padding: 12px 12px 14px; }
  .lbg .blk { font-size: 17px; }
  .box.ax .door { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; padding: 10px 14px 16px; }
  .box.ax .door .ax-house { width: min(100%, 300px); }
  .box.ax .ax-note { grid-area: 2 / 1; justify-self: center; grid-template-columns: repeat(3, auto); gap: 4px 12px; padding: 9px 12px 10px; font-size: 14px; white-space: nowrap; rotate: -1deg; }
  .box.ax .ax-note span::before { margin-right: 4px; }
  .box.ax .ax-note b { grid-column: 1 / -1; font-size: 11px; }
  .box.ax .door .door-hint { grid-area: 3 / 1; }
  .axg { padding: 10px 10px 12px; gap: 6px; }
  .axg .ap-logo b { display: none; }
  .axg-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .axg .task-card { width: auto; padding: 8px 10px; justify-self: stretch; }
  .axg .task-head, .axg .task-bar { display: none; }
  .axg .task-card ul { grid-auto-flow: column; justify-content: space-between; font-size: 12px; gap: 6px; }
  .axg .task-card li { gap: 5px; }
  .axg .task-card .tick { width: 16px; height: 16px; }
  .axg-bottom { flex-wrap: wrap; }
  .axg .belt { width: 100%; justify-content: space-between; }
  .axg .tool { width: calc(25% - 5px); }
  .axg [data-done] { flex: 1 1 100%; min-height: 46px; }
  .axg-msg { top: 54px; bottom: auto; translate: -50% -8px; font-size: 13px; }
}

/* ============ 9. Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .door .blk, .new, .avail .dot, .door-hint::before, .lbg > *, .axg > *, .axg [data-done] { animation: none !important; }
  .box.ax .door .ax-house, .axg-msg { transition: none; }
  .js .box::after { display: none; }
  .box, .door .blk, .lbg .blk, .lbg-feedback { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
