:root {
  scrollbar-gutter: stable;
  --ink: #28213d;
  --paper: #fff9e9;
  --yellow: #ffce48;
  --lavender: #f2ecfa;
  --purple: #56418a;
  font: 100%/1.55 "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, figure, h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a:focus-visible, video:focus-visible { outline: .22rem solid #1670ad; outline-offset: .22rem; }
.skip { position: absolute; z-index: 2; top: -6rem; padding: .5rem 1rem; background: white; }
.skip:focus { top: 0; }
footer, .hero-inner, .shelf, .utilities { width: min(100% - 3rem, 75rem); margin-inline: auto; }
footer, nav, .heading { display: flex; align-items: center; }
footer, .heading { justify-content: space-between; }
header { background: var(--lavender); }
header nav { width: min(100% - 3rem, 75rem); margin-inline: auto; min-height: 3.6rem; justify-content: flex-end; }
nav { gap: clamp(.8rem, 3vw, 2.3rem); }
nav a { font-weight: 800; text-decoration: none; }
nav a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: .23em; }
.hero { background: var(--lavender); border-bottom: 2px solid var(--ink); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); padding-block: 1rem 2.5rem; }
.site-logo { display: block; width: 100%; height: auto; }
h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 900; }
.intro p { font-size: clamp(1.1rem, 1.7vw, 1.4rem); margin-bottom: 1.3rem; }
.intro .disclosure { font-size: 1rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { display: inline-block; background: var(--yellow); text-decoration: none; font-weight: 800; border: 2px solid var(--ink); border-radius: .45rem; padding: .6rem 1.2rem; box-shadow: 3px 3px var(--ink); }
.button:hover { background: #ffdb72; transform: translateY(-1px); }
.button.secondary { background: var(--paper); }
.button.secondary:hover { background: white; }
.shelf, .utilities { padding-top: 3.2rem; scroll-margin-top: 1.4rem; }
.heading { gap: 1rem; margin-bottom: 1.25rem; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.12; letter-spacing: -.055em; }
.heading span { font-size: .88rem; font-weight: 700; }
.cards { display: grid; gap: 2rem; }
h3 { font-size: 1.65rem; line-height: 1.14; letter-spacing: -.037em; }
.game-card {
  --board: #abc4af; --patch: #d8bef4; --streamer: #ffe7ab;
  --triangle: polygon(0 0, 100% 10%, 76% 100%);
  --clip-width: 55%; --focal-point: 50% 45%;
  --patch-inset: 3%; --tilt: -4deg;
  position: relative; isolation: isolate; overflow: hidden;
  border: 2px solid var(--ink); border-radius: 1.05rem;
  background: var(--board); box-shadow: 4px 5px var(--ink);
  padding: clamp(.8rem, 2vw, 1.5rem);
}
.game-card:nth-child(even) { --triangle: polygon(100% 0, 0 10%, 24% 100%); --tilt: 4deg; }
.game-card.castle { --focal-point: 43% 30%; }
.game-card.sanctum { --board: #cec3df; --patch: #ffdaa0; --streamer: #e6edc0; --clip-width: 52%; --focal-point: 50% 100%; }
.game-card.park { --board: #f2c99e; --patch: #b4d9c3; --streamer: #ffedb6; --focal-point: 57% 56%; }
.card-art {
  position: relative; display: grid; align-items: start;
  min-height: clamp(12rem, 20vw, 15rem);
  padding-block: clamp(1rem, 2.5vw, 2rem) 1.5rem;
}
.pennant, .pennant-fill { position: absolute; inset: 0; clip-path: var(--triangle); }
.pennant { background: var(--ink); }
.pennant-fill {
  inset: 4px 5px 5px 14px;
  background: repeating-linear-gradient(24deg, transparent 0 26px, #ffffff45 27px 29px, transparent 30px 54px), var(--streamer);
}
.game-card:nth-child(even) .pennant-fill { left: 5px; right: 14px; }
.pennant video { position: absolute; right: 0; top: 0; width: var(--clip-width); height: 100%; object-fit: cover; object-position: var(--focal-point); }
.game-card:nth-child(even) video { right: auto; left: 0; }
.sanctum .pennant video { object-view-box: inset(34% 0 0); }
.title-patch {
  position: relative; z-index: 1; justify-self: start; margin-inline: var(--patch-inset);
  width: fit-content; max-width: 39%; padding: .32em .5em .38em;
  border: 3px solid var(--ink); border-radius: 27% 17% 23% 17% / 38% 35% 44% 39%;
  background: var(--patch); box-shadow: 2px 4px var(--ink);
  transform: rotate(var(--tilt)); color: #241d31; text-align: center;
  text-wrap: balance; font-size: clamp(1.85rem, 4.65vw, 4.3rem);
  font-weight: 900; letter-spacing: -.065em; line-height: .99;
}
.game-card:nth-child(even) .title-patch { justify-self: end; }
.sanctum .title-patch { font-size: clamp(1.45rem, 3.4vw, 3.1rem); max-width: 42%; }
.card-copy { position: relative; width: min(70%, 40rem); margin: .35rem 3% 0; font-size: clamp(1rem, 1.55vw, 1.25rem); line-height: 1.45; }
.game-card:nth-child(even) .card-copy { margin-left: auto; text-align: right; }
.genre { font-size: .89rem; font-weight: 800; margin-bottom: .3rem; color: #39304a; }
.card-actions { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: .9rem 1% .2rem 3%; min-height: 2.3rem; }
.card-actions .button { flex: none; white-space: nowrap; }
.park .card-actions { flex-wrap: wrap; }
.park .button[data-player] { margin-inline-start: auto; font-size: 1.3rem; padding: .6em 1.2em; }
.game-card:nth-child(even) .card-actions { flex-direction: row-reverse; margin-inline: 1% 3%; }
.text-link, .preview-toggle, .viewer-close { font: 700 .94rem/1.4 "Trebuchet MS", "Segoe UI", sans-serif; }
.text-link { text-underline-offset: .22em; padding-block: .4rem; }
.media-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.preview-toggle, .viewer-close { color: var(--ink); cursor: pointer; background: var(--paper); border: 1.5px solid currentColor; border-radius: 2rem; padding: .5rem .95rem; }
.preview-toggle:hover, .viewer-close:hover { background: #f3ead1; }
.preview-toggle:focus-visible, .viewer-close:focus-visible { outline: .22rem solid #1670ad; outline-offset: .2rem; }
.utilities { padding-block: 3.2rem 3.7rem; }
.drawer {
  border: 2px solid var(--ink); border-radius: 1rem; overflow: hidden;
  background: #cfa17e; box-shadow: 4px 5px var(--ink);
}
.drawer-tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding: .85rem; }
.tool-slot {
  min-width: 0; display: flex; flex-direction: column; padding: clamp(1rem, 2.2vw, 2rem);
  border: 2px solid var(--ink); border-radius: .55rem .8rem .5rem .65rem;
  background: #c8dac8; box-shadow: inset 2px 3px #96aa98;
}
.shade-slot { background: #dfd1ed; box-shadow: inset 2px 3px #b9a8ca; }
.instrument { width: min(100%, 25rem); margin: .4rem auto 1.4rem; }
.meter-face, .monitor-pair { height: clamp(6.5rem, 10.5vw, 8.4rem); }
.meter-face {
  display: flex; align-items: center; justify-content: center; padding: .35rem;
  background: #193537; color: #b4f4d0; border: 3px solid var(--ink); border-radius: .85rem;
  box-shadow: 3px 4px var(--ink), inset 0 0 0 3px #58756c; transform: rotate(-1.5deg);
}
.mesh-sample {
  width: 50%; aspect-ratio: 420 / 178;
  background: url("assets/framebench-mesh.webp") center / contain no-repeat;
}
.meter-reading { padding: 0 .4rem; font: 700 clamp(.7rem, 1.2vw, .88rem)/1.2 Consolas, monospace; }
.meter-reading strong { display: block; margin-top: .2rem; font-size: clamp(1.7rem, 3.4vw, 2.8rem); font-variant-numeric: tabular-nums; }
.meter-reading small { font-size: .42em; }
.monitor-pair { display: flex; align-items: center; justify-content: center; padding-bottom: .6rem; }
.mini-monitor {
  position: relative; display: grid; width: 44%; height: 82%; padding: .32rem .32rem .55rem;
  background: #f5d484; border: 3px solid var(--ink); border-radius: .65rem;
  box-shadow: 2px 3px var(--ink); transform: rotate(-4deg);
}
.mini-monitor::before {
  content: ""; border: 1.5px solid var(--ink); border-radius: .22rem;
  background: url("assets/goork.jpg") center 46% / 180% auto no-repeat;
  filter: brightness(var(--brightness, 100%));
}
.mini-monitor::after {
  content: ""; position: absolute; top: 100%; left: 32%; right: 32%; height: .56rem;
  background: var(--ink); border-radius: 0 0 35% 35%;
}
.mini-monitor.adjustable { --brightness: 65%; background: #bca6d4; transform: translateY(.38rem) rotate(4deg); }
.instrument-control {
  min-height: 2.6rem; display: flex; align-items: center; justify-content: center; gap: .65rem;
  margin-top: .8rem; font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.instrument-control select { font: inherit; color: var(--ink); border: 1.5px solid var(--ink); border-radius: .4rem; background: var(--paper); padding: .25rem .35rem; }
.instrument-control input { width: min(32%, 8rem); min-width: 2rem; accent-color: var(--purple); }
.instrument-control output { min-width: 4ch; }
.instrument-control :focus-visible { outline: 3px solid #165a89; outline-offset: 3px; }
.tool-label { border-top: 1px solid #28213d65; padding-top: 1rem; }
.tool-label h3 { font-size: clamp(1.85rem, 3vw, 2.65rem); }
.tool-label p { max-width: 45ch; margin-top: .45rem; font-size: clamp(1rem, 1.3vw, 1.12rem); }
.drawer-front { display: grid; place-items: center; height: 2.7rem; background: #e5ba93; border-top: 2px solid var(--ink); }
.drawer-front::after {
  content: ""; width: 5.5rem; height: .55rem; border: 2px solid var(--ink); border-radius: 1rem;
  background: #f7d07c; box-shadow: 0 3px var(--ink);
}
@media (max-width: 47rem) {
  .drawer-tray { grid-template-columns: 1fr; gap: .65rem; padding: .65rem; }
}
footer { padding-block: 1.1rem; border-top: 1px solid #bdb4bb; font-size: .9rem; }
@media (max-width: 53rem) {
  .hero-inner { gap: 1rem; }
}
@media (max-width: 39rem) {
  footer, .hero-inner, .shelf, .utilities { width: min(100% - 2rem, 75rem); }
  header nav { justify-content: center; }
  nav { font-size: .94rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.4rem; padding-block: .5rem 2rem; }
  .intro { text-align: center; }
  .intro-actions { justify-content: center; }
  .game-card { --patch-inset: 1%; }
  .game-card.castle { --focal-point: 68% 30%; }
  .card-art { min-height: clamp(6.75rem, 32vw, 12rem); padding-block: 1rem 1.1rem; }
  .pennant-fill { inset: 3px 4px 4px 8px; }
  .game-card:nth-child(even) .pennant-fill { left: 4px; right: 8px; }
  .title-patch { font-size: clamp(1.45rem, 6.8vw, 2.5rem); }
  .sanctum .title-patch { font-size: clamp(1.1rem, 5.5vw, 2rem); }
  .card-copy, .game-card:nth-child(even) .card-copy { width: auto; margin: .65rem .45rem 0; }
  .card-actions, .game-card:nth-child(even) .card-actions { margin: .8rem .45rem .2rem; }
  .cards { gap: 1.35rem; }
  .heading { align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; }
}
@media (max-width: 23rem) {
  .card-actions { flex-wrap: wrap; align-items: start; gap: .6rem; }
}

.media-viewer {
  width: min(54rem, 88vw); max-width: none; max-height: 90dvh; margin: auto;
  padding: 0; color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: .9rem; box-shadow: 4px 5px var(--ink);
}
.media-viewer::backdrop { background: rgb(28 22 38 / 72%); }
html:has(.media-viewer[open]) { overflow: hidden; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .9rem; }
.viewer-bar h2 { font-size: clamp(1.1rem, 3vw, 1.6rem); letter-spacing: -.03em; }
.viewer-bar button { flex: none; }
.viewer-media > * { display: block; width: 100%; max-height: 68dvh; object-fit: contain; background: #211d27; }
.player-viewer[open] {
  display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
  width: min(98vw, 100rem); height: 96dvh; max-height: none;
}
.player-viewer .viewer-bar { padding-block: .2rem; }
.player-viewer iframe { width: 100%; height: 100%; max-height: none; border: 0; }
@media (max-width: 40rem), (max-height: 32rem) {
  .player-viewer[open] { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
}
