@font-face {
  font-family: "Pixel Digits";
  src: url("../fonts/jersey-10-latin-400-normal.woff2") format("woff2"),
       url("../fonts/jersey-10-latin-400-normal.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0030-0039;
  size-adjust: 130%;
}
@font-face {
  font-family: "Jersey Logo";
  src: url("../fonts/jersey-10-latin-400-normal.woff2") format("woff2"),
       url("../fonts/jersey-10-latin-400-normal.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --desk: #d5dae3;
  --desk-ink: #232b38;
  --desk-muted: #4f5a6a;
  --shell: #34428a;
  --shell-hi: #4757a8;
  --shell-lo: #232c5e;
  --bezel: #16181f;
  --key: #1d2130;
  --key-ink: #e3e7ff;
  --lcd: #f1f5ee;
  --ink: #18212b;
  --muted: #56626d;
  --rule: #cdd7ca;
  --select: #ffc53d;
  --select-ink: #1d1a10;
  --pixel-on: #18212b;
  --pixel-dim: #e0e7dc;
  --led: #47d16c;
  --pixel: "Pixel Digits", "Pixelify Sans", "Courier New", monospace;
  --read: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #0f1217;
    --desk-ink: #dce1ea;
    --desk-muted: #98a2b2;
    --lcd: #131a21;
    --ink: #e3eaee;
    --muted: #9cabb7;
    --rule: #26313b;
    --pixel-on: #ffc53d;
    --pixel-dim: #1a232c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #0f1217;
  --desk-ink: #dce1ea;
  --desk-muted: #98a2b2;
  --lcd: #131a21;
  --ink: #e3eaee;
  --muted: #9cabb7;
  --rule: #26313b;
  --pixel-on: #ffc53d;
  --pixel-dim: #1a232c;
}
:root[data-shell="crimson"] { --shell: #9b2335; --shell-hi: #b8364a; --shell-lo: #6b1424; }
:root[data-shell="graphite"] { --shell: #3b3e47; --shell-hi: #4d515c; --shell-lo: #25272d; }
:root[data-shell="pearl"] { --shell: #d9d5cc; --shell-hi: #ebe8e1; --shell-lo: #b1ab9e; }
:root[data-shell="teal"] { --shell: #1d6b68; --shell-hi: #2a8681; --shell-lo: #124745; }
:root[data-shell="gold"] { --shell: #c3922f; --shell-hi: #dcab45; --shell-lo: #8a6418; }

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--desk-ink);
  font-family: var(--read);
  font-size: 1.05rem;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--select);
  color: var(--select-ink);
  font-family: var(--pixel);
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
}

.skip:focus {
  top: 1rem;
}

/* Desk and device */

.desk {
  padding: clamp(1rem, 4vw, 3rem) 1rem 2rem;
}

.device {
  width: min(100%, 37rem);
  margin-inline: auto;
}

.device--wide {
  width: min(100%, 50rem);
}

.shell {
  background-color: var(--shell);
  background-image: linear-gradient(180deg, var(--shell-hi), var(--shell) 45%);
  padding: 14px;
  transition: background-color 0.3s;
}

.shell-top {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  border-radius: 22px 22px 8px 8px;
  box-shadow: inset 0 -4px 0 var(--shell-lo);
}

.device--wide .shell-top {
  grid-template-columns: minmax(0, 1fr);
}

.speaker {
  align-self: center;
  height: 55%;
  min-height: 60px;
  background-image: radial-gradient(circle, var(--shell-lo) 1.7px, transparent 2.2px);
  background-size: 7px 7px;
}

.hinge {
  position: relative;
  height: 16px;
  margin-inline: 7%;
  background: linear-gradient(180deg, var(--shell-lo), var(--shell) 55%, var(--shell-lo));
}

.led {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 6px var(--led);
  transition: background 0.2s, box-shadow 0.2s;
}

.shell-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "l . r"
    "pad screen face"
    ". sys .";
  gap: 12px 16px;
  align-items: center;
  border-radius: 8px 8px 26px 26px;
  box-shadow:
    0 10px 0 -4px var(--shell-lo),
    0 26px 40px -20px rgba(20, 28, 70, 0.6);
}

/* Screens */

.screen {
  position: relative;
  min-width: 0;
  background: var(--lcd);
  color: var(--ink);
  border: 10px solid var(--bezel);
  border-radius: 6px;
}

.screen--fixed {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.shell-bottom > .screen {
  grid-area: screen;
}

.screen-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panes {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.pane {
  min-height: 100%;
  padding: 0.75rem 1rem;
}

.pane[hidden] {
  display: none;
}

.pane h2 {
  margin: 0 0 0.5rem;
  font-family: var(--pixel);
  font-weight: 600;
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  line-height: 1.15;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.tabs button {
  font-family: var(--pixel);
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

.tabs button.is-active {
  background: var(--ink);
  color: var(--lcd);
}

.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.splash h1 {
  width: 72%;
  margin: 0;
}

.splash canvas,
.game canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

.splash canvas {
  cursor: crosshair;
  touch-action: pan-y;
}

.tagline {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  line-height: 1.25;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  max-width: 38ch;
}

.now-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.35rem 0.9rem;
  font-size: 0.95rem;
}

.now-list dt {
  font-family: var(--pixel);
  color: var(--muted);
}

.now-list dd {
  margin: 0;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.preview-head {
  display: flex;
  align-items: center;
}

.preview-head h2 {
  margin: 0;
}

.preview-icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.preview p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.preview .skills {
  color: var(--muted);
}

.open-btn {
  align-self: flex-start;
  margin-top: auto;
  font-family: var(--pixel);
  font-size: 1rem;
  text-decoration: none;
  background: var(--select);
  color: var(--select-ink);
  border-radius: 4px;
  padding: 0.35rem 0.85rem;
}

.game {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.game-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--pixel);
  font-size: 0.95rem;
}

.game canvas {
  touch-action: none;
}

.game-status p {
  margin: 0;
  font-family: var(--pixel);
  font-size: 1rem;
  line-height: 1.35;
}

.toast {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  margin: 0;
  max-width: 80%;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--select);
  color: var(--select-ink);
  font-family: var(--pixel);
  font-size: 0.9rem;
}

.toast[hidden] {
  display: none;
}

.status {
  display: flex;
  gap: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 0.85rem;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--pixel);
  font-size: 1.02rem;
  line-height: 1.2;
  text-decoration: none;
}

.menu a.is-selected {
  background: var(--select);
  color: var(--select-ink);
  border-bottom-color: var(--select);
}

.menu a:focus-visible {
  outline-offset: -3px;
  outline-color: var(--ink);
}

.icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

/* Controls */

.key {
  border: 0;
  padding: 0;
  background: var(--key);
  color: var(--key-ink);
  font-family: var(--pixel);
  box-shadow: 0 3px 0 var(--shell-lo);
  transition: transform 0.06s, filter 0.06s;
}

.key:active,
.key.is-pressed {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--shell-lo);
  filter: brightness(1.4);
}

.shoulder {
  width: 76px;
  height: 24px;
  border-radius: 12px 12px 4px 4px;
  font-size: 0.85rem;
}

.shoulder-l { grid-area: l; justify-self: start; }
.shoulder-r { grid-area: r; justify-self: end; }

.pad {
  grid-area: pad;
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
}

.pad .key {
  font-size: 0.7rem;
  box-shadow: none;
}

.pad .key:active,
.pad .key.is-pressed {
  box-shadow: none;
}

.pad .center {
  grid-area: 2 / 2;
  background: var(--key);
}

.pad .up { grid-area: 1 / 2; border-radius: 4px 4px 0 0; }
.pad .left { grid-area: 2 / 1; border-radius: 4px 0 0 4px; }
.pad .right { grid-area: 2 / 3; border-radius: 0 4px 4px 0; }
.pad .down { grid-area: 3 / 2; border-radius: 0 0 4px 4px; }

.face {
  grid-area: face;
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 32px);
}

.round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.95rem;
  place-self: center;
}

.face .btn-x { grid-area: 1 / 2; }
.face .btn-y { grid-area: 2 / 1; }
.face .btn-a { grid-area: 2 / 3; }
.face .btn-b { grid-area: 3 / 2; }

.sys {
  grid-area: sys;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
}

.pill {
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.25rem 0.85rem;
}

.power[aria-pressed="false"] {
  color: #ff8f8f;
}

.device.is-off .led {
  background: #3a3d45;
  box-shadow: none;
}

.device.is-off .screen {
  background: #07090b;
}

.device.is-off .screen-body {
  animation: crt-off 0.35s ease-in forwards;
  pointer-events: none;
}

.device.is-off .toast {
  display: none;
}

@keyframes crt-off {
  0% { transform: scale(1, 1); opacity: 1; filter: brightness(1); }
  60% { transform: scale(1, 0.02); opacity: 1; filter: brightness(3); }
  100% { transform: scale(0, 0.02); opacity: 0; }
}

/* Text around the device */

.desk-footer {
  margin-top: 2.5rem;
  color: var(--desk-muted);
  font-size: 0.95rem;
  text-align: center;
}

.desk-footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Pages inside the top screen */

.screen--page {
  padding: clamp(1.1rem, 4.5vw, 2.5rem);
}

.article h1 {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.5vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 0.4rem;
}

.article h2 {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  line-height: 1.15;
  margin: 2.25rem 0 0.6rem;
  scroll-margin-top: 1rem;
}

.article h3 {
  font-family: var(--read);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 1.5rem 0 0.15rem;
}

.article p,
.article li {
  max-width: 64ch;
}

.article p {
  margin: 0 0 1em;
}

.article ul {
  padding-left: 1.2rem;
}

.article li + li {
  margin-top: 0.35rem;
}

.article code {
  font-size: 0.92em;
}

.article a {
  text-decoration-color: var(--select);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.meta-line,
.role-meta {
  color: var(--muted);
}

.role-meta {
  margin: 0 0 0.5rem;
  font-size: 0.97rem;
}

.project-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-width: 64ch;
  background: var(--pixel-dim);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 30ch;
}

.shot {
  margin: 1.5rem 0;
}

.shot figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: 28rem;
  border-top: 1px solid var(--rule);
}

.contact-list a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--pixel);
  font-size: 1.15rem;
  text-decoration: none;
}

.contact-list a:hover {
  background: var(--select);
  color: var(--select-ink);
}

/* Sticky bottom half on inner pages */

.dock {
  position: sticky;
  z-index: 5;
  grid-template-areas: "pad screen face";
}

.dock > .round {
  grid-area: pad;
  width: 40px;
  height: 40px;
}

.dock > .pill {
  grid-area: face;
}

.screen--strip {
  padding: 0.35rem 0.5rem;
}

.strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.strip-row a,
.strip-row button {
  font-family: var(--pixel);
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  text-decoration: none;
}

.strip-row a:hover,
.strip-row button:hover,
.strip-row [aria-expanded="true"] {
  background: var(--select);
  color: var(--select-ink);
}

.strip-backlight {
  display: none;
}

.contents {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid var(--rule);
  max-height: 40vh;
  overflow: auto;
}

.contents a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
}

.contents a:hover {
  background: var(--select);
  color: var(--select-ink);
}

/* Small screens */

@media (max-width: 560px) {

  .shell-top {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 16px 16px 6px 6px;
  }

  .speaker {
    display: none;
  }

  .screen {
    border-width: 7px;
  }

  .shell-top .screen--fixed {
    aspect-ratio: auto;
    height: 19rem;
  }

  .shell-bottom {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "l r"
      "screen screen"
      "pad face"
      "sys sys";
    border-radius: 6px 6px 18px 18px;
  }

  .dock {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "screen";
  }

  .dock > .round,
  .dock > .pill {
    display: none;
  }

  .strip-row .strip-backlight {
    display: inline-block;
    margin-left: auto;
  }

  .strip-row a,
  .strip-row button {
    padding: 0.3rem 0.45rem;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device.is-off .screen-body {
    animation: none;
    opacity: 0;
  }

  .key,
  .shell,
  .led {
    transition: none;
  }
}

/* Forms */

.lcd-form {
  display: grid;
  gap: 0.9rem;
  max-width: 34rem;
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field label {
  font-family: var(--pixel);
  font-size: 1rem;
}

.lcd-form input,
.lcd-form select,
.lcd-form textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--pixel-dim);
  border: 2px solid var(--rule);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
}

.lcd-form textarea {
  resize: vertical;
}

.lcd-form input:focus,
.lcd-form select:focus,
.lcd-form textarea:focus {
  border-color: var(--ink);
}

.lcd-form .open-btn {
  justify-self: start;
  margin-top: 0.25rem;
  border: 0;
  cursor: pointer;
}

.lcd-form .open-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  margin: 0;
  min-height: 1.6em;
  font-family: var(--pixel);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.article .contact-list {
  padding: 0;
}

.article .contact-list li + li {
  margin-top: 0;
}

/* Project write-ups */

.article h2.first {
  margin-top: 1.5rem;
}

.lede-line {
  font-size: 1.15rem;
  line-height: 1.55;
}

.outcome {
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--select);
  background: var(--pixel-dim);
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.3rem 1.25rem;
  max-width: 64ch;
  margin: 1.25rem 0 1.5rem;
  padding: 0.9rem 0;
  border-block: 1px solid var(--rule);
}

.facts dt {
  font-family: var(--pixel);
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  max-width: 64ch;
  margin: 1.5rem 0;
}

.numbers div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.numbers dt {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.numbers dd {
  margin: 0;
  font-family: var(--pixel);
  font-size: 1.8rem;
  line-height: 1.1;
}

.article .skill-list {
  columns: 2 14rem;
  column-gap: 2rem;
  max-width: 64ch;
}

.article .skill-list li {
  break-inside: avoid;
}

.article pre {
  max-width: 64ch;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: var(--bezel);
  color: #e3eaee;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.article pre code {
  font-size: inherit;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article caption {
  text-align: left;
  font-family: var(--pixel);
  color: var(--muted);
  padding-bottom: 0.4rem;
}

.article th,
.article td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.7rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}

.article th {
  font-weight: 700;
  border-bottom-width: 2px;
}

.article ol {
  padding-left: 1.4rem;
}

/* Mini DS's */

.mini {
  --w: 200px;
  --h: calc(var(--w) * 0.66);
  --key-gray: #2a2f3d;
  position: relative;
  display: block;
  flex: none;
  width: var(--w);
  height: calc(var(--h) * 2 + 4px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  perspective: 900px;
  transform: rotate(var(--r, 0deg));
  -webkit-tap-highlight-color: transparent;
}

.mini:focus-visible {
  outline: 3px solid var(--select);
  outline-offset: 4px;
  border-radius: 12px;
}

.mini[aria-expanded="true"] {
  z-index: 3;
}

.mini-base,
.mini-lid {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--h);
}
.mini-base {
  display: grid;
  grid-template-columns: 18% 1fr 18%;
  align-items: center;
  column-gap: 2%;
  padding: 5% 3% 6%;
  border-radius: calc(var(--w) * 0.03) calc(var(--w) * 0.03) calc(var(--w) * 0.08) calc(var(--w) * 0.08);
  background-color: var(--m-shell);
  background-image: linear-gradient(180deg, var(--m-hi), var(--m-shell) 50%);
  box-shadow:
    0 calc(var(--w) * 0.025) 0 calc(var(--w) * -0.01) var(--m-lo),
    0 calc(var(--w) * 0.07) calc(var(--w) * 0.1) calc(var(--w) * -0.06) rgba(0, 0, 0, 0.55);
}

.m-pad {
  justify-self: center;
  width: 84%;
  aspect-ratio: 1;
  background:
    linear-gradient(var(--key-gray), var(--key-gray)) center / 34% 100% no-repeat,
    linear-gradient(var(--key-gray), var(--key-gray)) center / 100% 34% no-repeat;
  filter: drop-shadow(0 1px 0 var(--m-lo));
}

.m-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--w) * 0.035);
}

.m-face {
  position: relative;
  width: 92%;
  aspect-ratio: 1;
}

.m-face i {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--key-gray);
  box-shadow: 0 1px 0 var(--m-lo), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.m-face i:nth-child(1) { top: 0; left: 33%; }
.m-face i:nth-child(2) { top: 33%; left: 0; }
.m-face i:nth-child(3) { top: 33%; right: 0; }
.m-face i:nth-child(4) { bottom: 0; left: 33%; }

.m-sys {
  display: flex;
  gap: calc(var(--w) * 0.02);
}

.m-sys i {
  width: calc(var(--w) * 0.045);
  height: calc(var(--w) * 0.02);
  border-radius: 999px;
  background: var(--key-gray);
}

.mini-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--lcd);
  color: var(--ink);
  border: calc(var(--w) * 0.022) solid var(--bezel);
  border-radius: 3px;
  text-align: center;
}

.mini-base .mini-screen,
.lid-front .mini-screen {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.mini-screen [hidden] {
  display: none;
}

.mini-screen canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.mini-label,
.mini-text {
  font-family: var(--pixel);
  line-height: 1.2;
  padding: 2px calc(var(--w) * 0.025);
}

.mini-label {
  font-size: calc(var(--w) * 0.055);
}

.mini-text {
  font-size: calc(var(--w) * 0.058);
}
.mini-lid {
  z-index: 1;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.3, 1);
}

.mini[aria-expanded="true"] .mini-lid {
  transform: rotateX(-180deg);
}

.lid-back,
.lid-front {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background-color: var(--m-shell);
  background-image: linear-gradient(180deg, var(--m-hi), var(--m-shell) 60%);
}

.lid-back {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--w) * 0.03) calc(var(--w) * 0.03) calc(var(--w) * 0.08) calc(var(--w) * 0.08);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 3px 0 var(--m-lo);
}

.lid-logo {
  display: inline-block;
  font-family: "Jersey Logo", var(--pixel);
  font-size: calc(var(--w) * 0.19);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--m-lo);
}
.lid-front {
  display: grid;
  grid-template-columns: 9% 1fr 9%;
  align-items: center;
  column-gap: 3%;
  padding: 5% 4%;
  border-radius: calc(var(--w) * 0.08) calc(var(--w) * 0.08) calc(var(--w) * 0.03) calc(var(--w) * 0.03);
  transform: rotateX(180deg);
}

.m-spk {
  height: 55%;
  background-image: radial-gradient(circle, var(--m-lo) 1px, transparent 1.5px);
  background-size: calc(var(--w) * 0.03) calc(var(--w) * 0.03);
  background-position: center;
}

.spares-hint {
  display: none;
}
@media (min-width: 1100px) {
  .desk {
    position: relative;
  }

  .spares {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .spares .mini {
    position: absolute;
    pointer-events: auto;
  }

  .spares .mini[data-side="left"] {
    left: calc((50% - 18.5rem) / 2 - var(--w) / 2 + var(--dx, 0px));
  }

  .spares .mini[data-side="right"] {
    right: calc((50% - 18.5rem) / 2 - var(--w) / 2 + var(--dx, 0px));
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .spares .mini {
    --w: 180px;
  }
}
@media (max-width: 1099px) {
  .spares {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 0.5rem 1.25rem;
    width: min(100%, 46rem);
    margin: 0.75rem auto 0;
  }

  .spares .mini {
    --w: 168px;
    height: calc(var(--h) + 4px);
    transition: height 0.45s cubic-bezier(0.25, 0.8, 0.3, 1);
  }

  .spares .mini[aria-expanded="true"] {
    height: calc(var(--h) * 2 + 4px);
  }

  .spares-hint {
    display: block;
    width: 100%;
    margin: 0.75rem 0 0;
    text-align: center;
    color: var(--desk-muted);
    font-size: 0.92rem;
  }
}
@media (max-width: 760px) {
  .spares {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-items: end;
  }

  .spares-hint {
    grid-column: 1 / -1;
  }

  .spares .mini {
    --w: min(160px, calc((100vw - 4.5rem) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-lid,
  .spares .mini {
    transition: none;
  }
}

/* Phones */

@media (max-width: 560px) {
  .desk:has(.menu) {
    padding-top: 0.5rem;
  }

  .shell {
    padding: 8px;
  }

  .hinge {
    height: 12px;
  }

  .led {
    top: 3px;
  }

  .shell-top .screen--fixed {
    height: clamp(11rem, min(calc((100svh - 1rem - 150px) * 0.56), calc(100svh - 1rem - 150px - 12.4rem)), 19rem);
  }

  .shell-bottom:not(.dock) {
    position: relative;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "screen screen screen"
      "pad sys face";
    gap: 10px 8px;
    padding-top: 14px;
  }

  .shell-bottom:not(.dock) > .screen--fixed {
    aspect-ratio: auto;
    height: clamp(12.4rem, calc((100svh - 1rem - 150px) * 0.44), 17rem);
  }

  .shoulder {
    position: absolute;
    top: -9px;
    z-index: 2;
    width: 64px;
    height: 20px;
    font-size: 0.75rem;
  }

  .shoulder-l {
    left: 12px;
  }

  .shoulder-r {
    right: 12px;
  }

  .pad {
    justify-self: start;
    grid-template-columns: repeat(3, 26px);
    grid-template-rows: repeat(3, 26px);
  }

  .face {
    justify-self: end;
    grid-template-columns: repeat(3, 27px);
    grid-template-rows: repeat(3, 27px);
  }

  .face .round {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .sys {
    flex-wrap: wrap;
    align-content: center;
    gap: 6px;
  }

  .sys .pill {
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
  }

  .menu a {
    padding: 0.32rem 0.75rem;
    font-size: 0.98rem;
  }

  .status {
    padding: 0.2rem 0.7rem;
  }

  .tabs {
    padding: 0.1rem 0.35rem;
  }

  .tabs button {
    padding: 0.1rem 0.45rem;
  }

  .pane {
    padding: 0.5rem 0.8rem;
  }

  .splash {
    gap: 0.35rem;
  }

  .hint {
    font-size: 0.8rem;
    line-height: 1.35;
  }
}
@media (max-width: 560px) and (max-height: 620px) {
  .menu a {
    padding: 0.24rem 0.75rem;
  }

  .status {
    padding: 0.1rem 0.7rem;
  }
}
.panes {
  container-type: size;
}

@media (max-width: 560px) {
  .splash h1 {
    width: min(72%, 76cqh);
  }
}

@container (max-height: 190px) {
  .hint {
    display: none;
  }
}

/* No double-tap zoom */

.device,
.spares,
.key,
.mini,
.menu a,
.tabs button,
.strip-row a,
.strip-row button {
  touch-action: manipulation;
}

.key,
.mini,
.tabs button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Tablets and short laptops */

@media (min-width: 561px) {
  .desk:has(.menu) {
    padding-top: clamp(0.75rem, calc((100svh - 830px) / 2), 3rem);
  }

  .device:not(.device--wide) {
    width: min(100%, 37rem, calc((100svh - 2rem + 107px) / 1.5));
  }

  .splash h1 {
    width: min(72%, 90cqh);
  }
}
@media (min-width: 561px) and (max-height: 900px) {
  .menu a {
    padding: 0.3rem 0.8rem;
    font-size: 0.98rem;
  }

  .status {
    padding: 0.18rem 0.75rem;
  }

  .tabs {
    padding: 0.1rem 0.4rem;
  }

  .pane {
    padding: 0.55rem 0.9rem;
  }

  .splash {
    gap: 0.35rem;
  }

  .hint {
    font-size: 0.82rem;
    line-height: 1.35;
  }
}
@media (min-width: 561px) and (max-height: 760px) {
  .shell-bottom:not(.dock) {
    gap: 8px 12px;
  }

  .pad {
    grid-template-columns: repeat(3, 26px);
    grid-template-rows: repeat(3, 26px);
  }

  .face {
    grid-template-columns: repeat(3, 27px);
    grid-template-rows: repeat(3, 27px);
  }

  .face .round {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .shoulder {
    height: 20px;
    font-size: 0.75rem;
  }

  .sys .pill {
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
  }

  .splash h1 {
    width: min(72%, 78cqh);
  }

  .menu a {
    padding: 0.26rem 0.8rem;
  }
}

/* Desktop home page */

@media (min-width: 1100px) {
  .desk:has(.menu) {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100svh;
    min-height: 540px;
    padding: 0.75rem 1rem 3.5rem;
    overflow: hidden;
  }

  .desk:has(.menu) .device {
    flex: none;
  }

  .desk:has(.menu) .device {
    width: min(37rem, calc((100svh - 0.75rem - 3.5rem + 107px) / 1.5));
  }

  .desk:has(.menu) .desk-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.9rem;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 1.25rem;
  }

  .desk:has(.menu) .desk-footer p {
    margin: 0;
  }

  .spares .mini {
    --w: clamp(150px, 21svh, 200px);
    top: calc((100% - var(--h) * 2 - 4px - 48px) * var(--yp, 0) + 24px);
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .spares .mini {
    --w: clamp(150px, 19svh, 180px);
  }
}

/* Write-up pages */

.dock {
  bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -10px 20px -14px rgba(20, 28, 70, 0.55);
}
@media (min-width: 1100px) and (max-height: 700px) {
  .menu a {
    padding: 0.2rem 0.75rem;
    font-size: 0.92rem;
  }

  .menu .icon {
    width: 18px;
    height: 18px;
  }

  .status {
    padding: 0.08rem 0.7rem;
    font-size: 0.78rem;
  }

  .tabs button {
    font-size: 0.82rem;
    padding: 0.05rem 0.4rem;
  }

  .pane {
    padding: 0.4rem 0.8rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  .hint {
    font-size: 0.76rem;
  }

  .splash h1 {
    width: min(72%, 70cqh);
  }
}

@container (max-height: 205px) {
  .hint {
    display: none;
  }
}

/* Footer */
.desk-footer,
.desk:has(.menu) .desk-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0;
}

.desk-footer p {
  margin: 0;
}

.desk-footer ul,
.desk:has(.menu) .desk-footer ul {
  align-items: center;
  gap: 0.25rem 0;
}

.desk-footer li {
  display: flex;
  align-items: center;
}
.desk-footer li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  color: var(--desk-muted);
  margin: 0 0.75rem;
  flex: none;
}
@media (max-width: 560px) {
  .desk-footer li:first-child::before {
    display: none;
  }
}

.mini-lid,
.lid-back,
.lid-front {
  -webkit-transform-style: preserve-3d;
}

.lid-back {
  transform: translateZ(0.5px);
}

.mini:focus:not(:focus-visible) {
  outline: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .spares .mini {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.45s cubic-bezier(0.25, 0.8, 0.3, 1);
  }

  .spares .mini[aria-expanded="false"]:hover {
    transform: translateY(-8px) rotate(calc(var(--r, 0deg) * 0.3)) scale(1.05);
  }
  .spares .mini[aria-expanded="false"]:hover .mini-lid {
    transform: rotateX(-14deg);
    transition-delay: 0.08s;
  }

  .spares .mini[aria-expanded="false"]:hover .lid-logo {
    animation: logo-wiggle 0.5s ease-in-out;
  }
}

@keyframes logo-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
}

/* Desk background */

:root,
:root[data-sky="day"] {
  --desk-top: #e3e9f1;
  --desk: #d2d9e3;
  --trace: rgba(150, 98, 58, 0.16);
  --pulse: #ffad33;
}

:root[data-sky="dawn"] {
  --desk-top: #f5ddcf;
  --desk: #d8dae6;
  --desk-ink: #2a2633;
  --desk-muted: #5b5366;
  --trace: rgba(176, 104, 66, 0.18);
  --pulse: #ff9447;
}

:root[data-sky="dusk"] {
  --desk-top: #efc6b0;
  --desk: #c6c1dc;
  --desk-ink: #2a2338;
  --desk-muted: #564b66;
  --trace: rgba(150, 76, 70, 0.19);
  --pulse: #ff7657;
}

:root[data-sky="night"] {
  --desk-top: #2c3354;
  --desk: #161a2d;
  --desk-ink: #e0e4f1;
  --desk-muted: #a4acc6;
  --trace: rgba(150, 170, 230, 0.14);
  --pulse: #ffd36b;
}
:root[data-theme="dark"][data-sky] {
  --desk-ink: #dce1ea;
  --desk-muted: #98a2b2;
  --trace: rgba(255, 190, 120, 0.08);
  --pulse: #ffc53d;
}
:root[data-theme="dark"][data-sky="day"] { --desk-top: #161c26; --desk: #0f1217; }
:root[data-theme="dark"][data-sky="dawn"] { --desk-top: #211a20; --desk: #0f1217; }
:root[data-theme="dark"][data-sky="dusk"] { --desk-top: #231a2a; --desk: #0f1217; }
:root[data-theme="dark"][data-sky="night"] { --desk-top: #0d1120; --desk: #07090f; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-sky] {
    --desk-ink: #dce1ea;
    --desk-muted: #98a2b2;
    --trace: rgba(255, 190, 120, 0.08);
    --pulse: #ffc53d;
  }
  :root:not([data-theme="light"])[data-sky="day"] { --desk-top: #161c26; --desk: #0f1217; }
  :root:not([data-theme="light"])[data-sky="dawn"] { --desk-top: #211a20; --desk: #0f1217; }
  :root:not([data-theme="light"])[data-sky="dusk"] { --desk-top: #231a2a; --desk: #0f1217; }
  :root:not([data-theme="light"])[data-sky="night"] { --desk-top: #0d1120; --desk: #07090f; }
}

body {
  transition: background-color 0.6s;
}
.board {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--desk-top), var(--desk));
}

.desk {
  position: relative;
  z-index: 1;
}
.led.blink {
  animation: led-blink 0.7s ease-out;
}

@keyframes led-blink {
  0%, 40% { background: var(--select); box-shadow: 0 0 12px 3px var(--select); }
  100% { background: var(--led); box-shadow: 0 0 6px var(--led); }
}

/* Bottom screen status bar */

.status {
  align-items: center;
  overflow: hidden;
}

.status .clock {
  margin-left: 0;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  white-space: nowrap;
}

.status-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.weather[hidden] {
  display: none;
}

.weather svg {
  width: 1.1em;
  height: 0.88em;
  fill: currentColor;
  shape-rendering: crispEdges;
}
.status-name,
.status-info {
  flex-shrink: 0;
}

.status.no-wday .wday,
.status.no-name .status-name {
  display: none;
}

.status.no-name .status-info {
  margin-left: 0;
  width: 100%;
  justify-content: space-between;
}

.mini-label span {
  display: block;
}

.mini-sub {
  margin-top: 0.25em;
  font-size: 0.78em;
  color: var(--muted);
}
.mini.poked .mini-screen {
  animation: mini-poke 0.22s ease-out;
}

@keyframes mini-poke {
  0% { filter: brightness(0.82); }
  100% { filter: none; }
}
.mini[data-cart="secret"] .mini-label {
  font-size: calc(var(--w) * 0.05);
  line-height: 1.15;
}

/* Cheat code handheld */
.konami {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: calc(var(--w) * 0.008);
}

.konami svg {
  flex: none;
  width: calc(var(--w) * 0.046);
  height: calc(var(--w) * 0.046);
  fill: currentColor;
  shape-rendering: crispEdges;
}

.konami-gap {
  width: calc(var(--w) * 0.012);
}
.mini[data-cart="secret"] .mini-base .mini-screen,
.mini[data-cart="life"] .mini-base .mini-screen {
  position: relative;
  padding-bottom: calc(var(--w) * 0.085);
}

.mini[data-cart="secret"] .mini-sub,
.mini[data-cart="life"] .mini-sub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--w) * 0.012);
  margin: 0;
}

@media (max-width: 1099px) {
  .spares {
    width: min(100%, 54rem);
  }

  .spares .mini {
    --w: min(192px, calc((100vw - 6rem) / 4));
  }
}

@media (max-width: 760px) {
  .spares {
    gap: 1.4rem 1.25rem;
  }

  .spares .mini {
    --w: min(186px, calc((100vw - 4rem) / 2));
  }
}

@media (min-width: 1100px) {
  .spares .mini {
    --w: clamp(170px, 24svh, 232px);
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .spares .mini {
    --w: clamp(165px, 21svh, 205px);
  }
}

.desk:has(.device--wide) {
  padding-bottom: 0;
}

.device--wide {
  margin-bottom: 0;
}
.page-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

.page-footer li::before {
  color: var(--muted);
}

.page-footer a {
  color: var(--muted);
}
.now-list dt,
.tabs button,
.menu a,
.status {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0;
}

.now-list dt {
  letter-spacing: 0.03em;
}
@container (max-width: 420px) {
  #now h2 {
    display: none;
  }

  .now-list {
    grid-template-columns: 6.4em minmax(0, 1fr);
    gap: 0.3rem 0.6rem;
    font-size: 0.86rem;
    line-height: 1.3;
  }

  .now-list dt {
    font-size: 0.8rem;
    line-height: 1.25;
  }
}

@container (max-height: 15rem) {
  #now h2 {
    display: none;
  }

  .now-list {
    gap: 0.15rem 0.6rem;
    line-height: 1.25;
  }
}

.panes:has(#now:not([hidden])) {
  overflow-y: auto;
}

@container (max-width: 300px) {
  .now-list {
    grid-template-columns: 5.6em minmax(0, 1fr);
    font-size: 0.8rem;
    gap: 0.2rem 0.5rem;
  }

  .now-list dt {
    font-size: 0.74rem;
  }
}

.now-updated {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

@container (max-height: 17rem) {
  #now {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .now-list {
    row-gap: 0.12rem;
  }

  .now-updated {
    margin-top: 0.3rem;
  }
}
#now:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.now-updated {
  margin-top: auto;
  padding-top: 0.5rem;
  text-align: right;
}
.now-updated {
  font-family: "Pixelify Sans", "Courier New", monospace;
}

.panes:has(#stats:not([hidden])) {
  overflow-y: auto;
}

/* Trophy case */

.trophies:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.trophy-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.trophy-head h2 {
  margin: 0;
}

.trophy-count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 0.95rem;
}
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(100%, calc((100cqh - 6.6rem) * 3));
  margin-inline: auto;
}

.trophy {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 20%;
  border: 2px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background-color 0.12s;
}

.trophy svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.trophy.is-locked {
  color: var(--muted);
  opacity: 0.5;
  border-style: dashed;
}
.trophy.is-secret {
  border-color: #d4a017;
  color: #b8860b;
}

:root[data-theme="dark"] .trophy.is-secret {
  color: var(--select);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .trophy.is-secret {
    color: var(--select);
  }
}

.trophy.is-current {
  border-color: var(--ink);
  background: var(--pixel-dim);
}

.trophy.is-current.is-secret {
  border-color: #d4a017;
}

@media (hover: hover) and (pointer: fine) {
  .trophy:hover {
    transform: translateY(-2px);
  }
}

.trophy:focus-visible {
  outline: 3px solid var(--select);
  outline-offset: 1px;
}

.trophy-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--rule);
  min-height: 3.2em;
}

#trophy-name {
  font-family: var(--pixel);
  font-size: 1rem;
}

#trophy-desc {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
}
@container (max-width: 420px) {
  .trophy-head h2 {
    font-size: 1rem;
  }

  .trophy-grid {
    gap: 0.25rem;
  }

  .trophy {
    border-width: 1.5px;
  }

  #trophy-name {
    font-size: 0.9rem;
  }

  #trophy-desc {
    font-size: 0.78rem;
  }
}

@container (max-height: 15rem) {
  .trophies:not([hidden]) {
    gap: 0.3rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .trophy-grid {
    width: min(100%, calc((100cqh - 5.4rem) * 3));
  }

  .trophy-info {
    padding-top: 0.25rem;
    min-height: 0;
  }
}
.toast--page {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  max-width: calc(100% - 2rem);
}

/* Home screen */

.tagline span {
  display: block;
  white-space: nowrap;
}
.splash .tagline {
  font-size: min(clamp(1rem, 3.4vw, 1.2rem), 5.4cqw);
}
.splash h1 {
  margin-top: auto;
}

.splash .hint {
  margin-top: auto;
  max-width: none;
  padding-bottom: 0.1rem;
}

.splash .hint {
  text-wrap: balance;
}
.splash h1,
.desk .splash h1 {
  width: min(86%, calc((100cqh - 8.6rem) * 2));
  margin-bottom: 0.55rem;
}

.splash .tagline {
  font-size: min(clamp(1.1rem, 3.9vw, 1.42rem), 5.5cqw);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Menu previews */

.preview:not([hidden]) {
  align-items: center;
  text-align: center;
}

.preview-icon svg {
  width: 36px;
  height: 36px;
}

.preview #pv-desc {
  max-width: 40ch;
  text-wrap: balance;
}
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 30rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features[hidden] {
  display: none;
}

.features li {
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}

.preview .open-btn {
  align-self: center;
}
.preview .skills {
  letter-spacing: 0.02em;
}

.preview .skills[hidden] {
  display: none;
}

.preview:not([hidden]) {
  justify-content: flex-start;
}

.preview .preview-head {
  margin-top: auto;
}

.preview .skills {
  margin-top: auto;
}
.features li {
  font-family: "Pixelify Sans", "Courier New", monospace;
}

.panes:has(#preview:not([hidden])) {
  overflow-y: auto;
}

.preview:not([hidden]) {
  gap: 0.5rem;
}

.preview-head {
  flex-direction: column;
  gap: 0.4rem;
}

.preview-icon svg {
  width: clamp(44px, 16cqh, 64px);
  height: clamp(44px, 16cqh, 64px);
}

.preview .preview-head h2 {
  font-size: clamp(1.25rem, 6cqw, 1.9rem);
}
.preview #pv-desc {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.features {
  gap: 0.3rem;
}

.features li {
  padding: 0.05rem 0.5rem;
  border-width: 1px;
  color: var(--muted);
  font-size: 0.7rem;
}
.preview .open-btn {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
}

.preview .skills {
  font-size: 0.72rem;
}
@container (max-height: 19rem) {
  .preview:not([hidden]) {
    gap: 0.35rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .preview-icon svg {
    width: 40px;
    height: 40px;
  }
}
@container (max-height: 17.5rem) {
  .preview:not([hidden]) {
    gap: 0.35rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .preview-head {
    flex-direction: row;
    gap: 0.55rem;
  }

  .preview-icon svg {
    width: 34px;
    height: 34px;
  }

  .preview #pv-desc {
    font-size: 0.78rem;
  }

  .features li {
    font-size: 0.66rem;
  }

  .preview .skills {
    font-size: 0.66rem;
  }
}
@container (max-height: 14.5rem) {
  .preview:not([hidden]) {
    gap: 0.25rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

  .preview-icon svg {
    width: 28px;
    height: 28px;
  }

  .preview #pv-desc {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .features {
    gap: 0.2rem;
  }

  .features li {
    padding: 0 0.4rem;
    font-size: 0.62rem;
  }

  .preview .open-btn {
    margin-top: 0.15rem;
  }
}
.preview .preview-head h2 {
  font-family: "Jersey Logo", var(--pixel);
  font-weight: 400;
  font-size: clamp(1.6rem, 7.8cqw, 2.45rem);
  letter-spacing: 0.04em;
  line-height: 1;
}
.preview .open-btn {
  min-height: 40px;
  padding: 0.35rem 1.25rem;
  font-size: 0.98rem;
}
.preview .features {
  margin-top: 0.15rem;
}

@container (max-height: 17.5rem) {
  .preview .preview-head h2 {
    font-size: 1.65rem;
  }

  .preview .open-btn {
    min-height: 36px;
    padding: 0.25rem 1.1rem;
    font-size: 0.92rem;
  }
}

@container (max-height: 14.5rem) {
  .preview .preview-head h2 {
    font-size: 1.45rem;
  }

  .preview .open-btn {
    min-height: 32px;
    padding: 0.15rem 0.95rem;
    font-size: 0.86rem;
  }
}
.preview .features:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: 0.3rem;
}

.preview .features li {
  font-size: 0.8rem;
  padding: 0.08rem 0.6rem;
  text-align: center;
}

@container (max-height: 17.5rem) {
  .preview .features li {
    font-size: 0.74rem;
  }
}

@container (max-height: 14.5rem) {
  .preview .features:not([hidden]) {
    gap: 0.2rem;
  }

  .preview .features li {
    font-size: 0.68rem;
    padding: 0 0.45rem;
  }
}

.preview .skills .skill {
  white-space: nowrap;
}
.preview .features:not([hidden]) {
  grid-template-columns: repeat(2, minmax(0, max-content));
  max-width: 100%;
}

.preview .features li {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
@container (max-width: 420px) {
  .preview .features li {
    font-size: 0.66rem;
    padding: 0.04rem 0.45rem;
  }
}
.preview .features li {
  border-radius: 10px;
}

@container (max-width: 280px) {
  .preview .features:not([hidden]) {
    gap: 0.2rem;
  }

  .preview .features li {
    font-size: 0.58rem;
    padding: 0.02rem 0.35rem;
  }
}
.preview:has(#pv-skills[hidden])::after {
  content: "";
  margin-top: auto;
}

/* Hinge */

.hinge {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hinge-logo {
  font-family: "Jersey Logo", var(--pixel);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.08em;
  user-select: none;
}

.leds {
  position: absolute;
  top: 50%;
  display: flex;
  gap: 7px;
  transform: translateY(-50%);
}

.leds .led {
  position: static;
  margin: 0;
  width: 6px;
  height: 6px;
}
.leds .led-sound {
  background: #2c3040;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4);
}

:root[data-sound="on"] .leds .led-sound {
  background: #ff9f43;
  box-shadow: 0 0 6px #ff9f43;
}

.device.is-off .leds .led,
:root[data-sound="on"] .device.is-off .leds .led-sound {
  background: #3a3d45;
  box-shadow: none;
}

@media (max-width: 560px) {
  .hinge-logo {
    font-size: 10px;
  }

  .leds {
    gap: 5px;
    right: calc(9% + 8px);
  }

  .leds .led {
    width: 5px;
    height: 5px;
  }
}
.hinge-logo {
  color: rgba(255, 255, 255, 0.3);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
@media (max-width: 560px) {

  .device:not(.device--wide) .leds {
    right: auto;
    left: calc(50% + 22px);
  }
}
.leds {
  right: 18px;
}

@media (max-width: 560px) {
  .device--wide .leds {
    right: 12px;
  }
}
.mini[data-cart="life"] .mini-sub {
  font-size: calc(var(--w) * 0.05 * 0.78);
}

/* Links styled as buttons */
.article a.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 1.15rem;
  font-family: var(--pixel);
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  background: var(--select);
  color: var(--select-ink);
  border-radius: 4px;
}

.article a.link-btn:hover {
  filter: brightness(1.06);
}

.article a.link-btn:active {
  transform: translateY(1px);
}
.mini[data-cart="pong"] .mini-base .mini-screen {
  position: relative;
}

.mini[data-cart="pong"] .mini-sub + .mini-sub {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--w) * 0.012);
  margin: 0;
  font-size: calc(var(--w) * 0.05 * 0.78);
}
.mini[data-cart="pong"] .mini-main + .mini-sub {
  margin-top: 0.15em;
  font-size: 1em;
  color: inherit;
}
.project-media--fit {
  aspect-ratio: auto;
  background: none;
  border: 0;
  border-radius: 0;
}

.project-media--fit img {
  height: auto;
  object-fit: contain;
}

/* Smallest phones */
@container (max-height: 11rem) {
  .preview:not([hidden]) {
    gap: 0.25rem;
  }

  .preview .skills {
    display: none;
  }

  .now-list {
    font-size: 0.7rem;
    line-height: 1.12;
    row-gap: 0.05rem;
  }

  .now-list dt {
    font-size: 0.64rem;
  }

  .preview #pv-desc {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .preview .open-btn {
    min-height: 30px;
  }

  .trophy-grid {
    width: min(100%, calc((100cqh - 6.6rem) * 3));
  }

  .now-updated {
    padding-top: 0.2rem;
    font-size: 0.66rem;
  }

  #trophy-desc {
    font-size: 0.7rem;
    line-height: 1.25;
  }
}
