/* DevPlayGames portfolio.
   Palette comes from the logo: ink + a copper pill, on cool porcelain. Game art supplies the colour. */
:root {
  --porcelain: #ecefec;
  --paper: #f8f9f7;
  --ink: #17262b;
  --ink-soft: #4d5f66;
  --copper: #b87d48;
  --copper-deep: #8a5527;
  --night: #0f1b1f;
  --line: rgb(23 38 43 / 0.16);
  --line-night: rgb(236 239 236 / 0.18);

  --display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --measure: 62ch;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --step-3: clamp(2.1rem, 1.3rem + 3.4vw, 3.75rem);
  --step-4: clamp(2.9rem, 1.1rem + 8.2vw, 7.5rem);
}

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

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

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font: 400 var(--step-0) / 1.55 var(--text);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); border-radius: 0 0 8px 8px;
}
.skip:focus { top: 0; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.display {
  font-family: var(--display);
  font-variation-settings: 'wdth' 82, 'opsz' 96;
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 0.92;
  text-wrap: balance;
}

.wrap { padding-inline: var(--gutter); max-width: 96rem; margin-inline: auto; }

/* ---------- header ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.25rem; }
.site-head .brand img { width: clamp(9.5rem, 16vw, 13rem); }
.site-nav { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); font-weight: 600; }
.site-nav a { text-decoration: none; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current='page'] { border-bottom-color: var(--copper); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.4rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--copper-deep); }
.btn-play { background: var(--copper); color: var(--night); }
.btn-play:hover { background: #cf9358; }
.btn-quiet { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-quiet:hover { background: rgb(23 38 43 / 0.08); }
.btn svg { width: 0.85em; height: 0.85em; flex: none; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(1.5rem, 5vw, 4.5rem); }
.hero h1 { font-size: var(--step-4); max-width: 13ch; }
.hero-lede { margin-top: clamp(1.25rem, 2.5vw, 2rem); max-width: 54ch; font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); }

/* The deal: every game as a card laid on the table. */
.deal { position: relative; margin-top: clamp(1.75rem, 4vw, 3.25rem); }
.deal-track {
  display: flex; gap: clamp(0.9rem, 1.6vw, 1.5rem);
  padding: 1.75rem var(--gutter) 2.25rem;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.deal-track::-webkit-scrollbar { display: none; }
.card-slot { flex: none; width: clamp(11.5rem, 19vw, 16.5rem); scroll-snap-align: start; }
.card { display: block; text-decoration: none; }
.card-face {
  display: block; position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 14px;
  background: var(--night);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 0 14px 28px -16px rgb(23 38 43 / 0.55), 0 2px 5px rgb(23 38 43 / 0.2);
  transform: rotate(var(--tilt, 0deg)); transform-origin: 50% 85%;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card-face img { width: 100%; height: 100%; object-fit: cover; }
.card-slot:nth-child(4n + 1) { --tilt: -2.2deg; }
.card-slot:nth-child(4n + 2) { --tilt: 1.4deg; }
.card-slot:nth-child(4n + 3) { --tilt: -0.8deg; }
.card-slot:nth-child(4n) { --tilt: 2.4deg; }
.card:hover .card-face, .card:focus-visible .card-face { transform: rotate(0deg) translateY(-10px); }
.card:focus-visible { outline: none; }
.card:focus-visible .card-face { outline: 3px solid var(--copper); outline-offset: 3px; }
.card-cue {
  position: absolute; inset: auto 0 0 0; padding: 2.5rem 0.9rem 0.8rem;
  background: linear-gradient(to top, rgb(15 27 31 / 0.92), rgb(15 27 31 / 0));
  color: var(--paper); font-weight: 700; font-size: var(--step--1);
  display: flex; align-items: center; gap: 0.5rem;
  opacity: 0; transition: opacity 0.2s;
}
.card-cue svg { width: 0.8em; height: 0.8em; }
.card:hover .card-cue, .card:focus-visible .card-cue { opacity: 1; }
.card-name { display: block; margin-top: 0.95rem; font: 700 var(--step-1) / 1.15 var(--display); font-variation-settings: 'wdth' 88; letter-spacing: -0.015em; }
.card-type { display: block; margin-top: 0.2rem; font-size: var(--step--1); color: var(--ink-soft); }
.deal-nav { display: flex; gap: 0.5rem; justify-content: flex-end; padding-inline: var(--gutter); max-width: 96rem; margin-inline: auto; }
.deal-nav button {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.deal-nav button:hover:not(:disabled) { background: var(--paper); border-color: var(--ink); }
.deal-nav button:disabled { opacity: 0.35; cursor: default; }
.deal-nav svg { width: 1rem; height: 1rem; }

/* ---------- catalogue ---------- */
.section { padding-block: clamp(3rem, 8vw, 7rem); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem 2rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { max-width: 46ch; color: var(--ink-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.filters button {
  padding: 0.5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; cursor: pointer; font-weight: 600;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filters .count { opacity: 0.6; margin-left: 0.3rem; font-weight: 500; }

.sheet { width: 100%; margin-top: 1.5rem; border-collapse: collapse; }
.sheet th { text-align: left; font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.sheet th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.sheet th button:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 4px; }
.sheet th button::after { content: ''; width: 0.5rem; height: 0.5rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); opacity: 0.35; }
.sheet th[aria-sort='ascending'] button::after { transform: translateY(2px) rotate(-135deg); opacity: 1; }
.sheet th[aria-sort='descending'] button::after { opacity: 1; }
.sheet td { padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet .num { text-align: right; font-weight: 600; white-space: nowrap; }
.sheet th.num { text-align: right; }
.sheet .act { text-align: right; padding-right: 0; width: 1%; }
.sheet tbody tr:hover { background: rgb(248 249 247 / 0.75); }
.game-cell { display: flex; align-items: center; gap: 1rem; text-decoration: none; min-width: 15rem; }
.game-cell img { width: 3rem; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; flex: none; background: var(--night); }
.game-cell strong { display: block; font: 700 var(--step-1) / 1.15 var(--display); font-variation-settings: 'wdth' 88; letter-spacing: -0.015em; }
.game-cell span { display: block; font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.15rem; }
.game-cell:hover strong { text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 0.18em; }
/* The filter hides rows with [hidden]; the phone layout sets display on rows, so say it explicitly. */
.sheet tr[hidden] { display: none; }
.sheet-note { margin-top: 1.25rem; font-size: var(--step--1); color: var(--ink-soft); max-width: var(--measure); }

@media (max-width: 860px) {
  .sheet thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet, .sheet tbody { display: block; }
  .sheet tr:not([hidden]) { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
  .sheet td { display: block; padding: 0; border: 0; }
  .sheet td.game { grid-column: 1 / -1; }
  .sheet td.layout { grid-column: 1 / -1; color: var(--ink-soft); font-size: var(--step--1); }
  .sheet td.kind { display: none; }
  .sheet td.num { text-align: left; font-weight: 500; font-size: var(--step--1); grid-column: 1; }
  .sheet td.num::before { content: attr(data-label) ' '; color: var(--ink-soft); font-weight: 400; }
  .sheet td.act { grid-column: 2; grid-row: 3 / span 2; align-self: center; width: auto; }
  .game-cell { min-width: 0; }
}

/* ---------- studio (dark band) ---------- */
.band { background: var(--ink); color: var(--porcelain); }
.band h2 { font-size: var(--step-3); max-width: 16ch; }
.band .lede { margin-top: 1.25rem; max-width: 52ch; font-size: var(--step-1); line-height: 1.45; color: rgb(236 239 236 / 0.78); }
.crafts { margin-top: clamp(2rem, 5vw, 4rem); display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem clamp(1.5rem, 4vw, 4rem); }
.crafts h3 { font: 700 var(--step-1) / 1.2 var(--display); font-variation-settings: 'wdth' 88; padding-top: 1rem; border-top: 1.5px solid var(--copper); }
.crafts p { margin-top: 0.6rem; color: rgb(236 239 236 / 0.78); max-width: 40ch; }

/* ---------- contact + footer ---------- */
.contact h2 { font-size: var(--step-3); max-width: 15ch; }
.contact p { margin-top: 1.25rem; max-width: 50ch; font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); }
.contact .mail { display: inline-block; margin-top: 1.75rem; font: 800 var(--step-2) / 1.1 var(--display); font-variation-settings: 'wdth' 84; letter-spacing: -0.02em; text-decoration-color: var(--copper); text-decoration-thickness: 0.09em; text-underline-offset: 0.16em; overflow-wrap: anywhere; }
.contact .mail:hover { color: var(--copper-deep); }

.site-foot { background: var(--night); color: rgb(236 239 236 / 0.72); font-size: var(--step--1); }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 3rem; padding-block: 2rem; }
.site-foot img { width: 9rem; }
.site-foot p { max-width: 62ch; }

/* ---------- game page ---------- */
.crumb { font-size: var(--step--1); color: var(--ink-soft); padding-top: 0.5rem; }
.crumb a { text-underline-offset: 0.2em; }
.game-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: clamp(1rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.game-top h1 { font-size: var(--step-4); }
.game-top .kind { margin-top: 0.9rem; font-size: var(--step-1); color: var(--ink-soft); }

.stage {
  position: relative; background: var(--night); color: var(--porcelain); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px -40px rgb(23 38 43 / 0.7);
}
.stage-view { position: relative; aspect-ratio: 16 / 9; max-height: 82vh; width: 100%; }
.stage-view > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage-start {
  position: absolute; inset: 0; display: grid; place-items: end start; padding: clamp(1rem, 3vw, 2.25rem);
  background: linear-gradient(to top, rgb(15 27 31 / 0.82), rgb(15 27 31 / 0) 55%);
}
.stage-start .btn { font-size: var(--step-1); padding: 1rem 1.9rem; }
.stage-start small { display: block; margin-top: 0.8rem; color: rgb(236 239 236 / 0.8); font-size: var(--step--1); }
.stage-bar { display: none; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem 0.5rem 1rem; border-bottom: 1px solid var(--line-night); }
.stage-bar strong { margin-right: auto; font: 700 1rem/1 var(--display); font-variation-settings: 'wdth' 88; }
.stage-bar span { font-size: var(--step--1); color: rgb(236 239 236 / 0.65); margin-right: 0.5rem; }
.stage-bar button, .stage-bar a {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.8rem; border-radius: 999px; border: 0; cursor: pointer;
  background: rgb(236 239 236 / 0.1); color: inherit; font-size: var(--step--1); font-weight: 600; text-decoration: none;
}
.stage-bar button:hover, .stage-bar a:hover { background: rgb(236 239 236 / 0.2); }
.stage.is-live .stage-bar { display: flex; }
.stage.is-live .stage-start, .stage.is-live .stage-view > img { display: none; }
.stage:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.stage:fullscreen .stage-view { flex: 1; aspect-ratio: auto; max-height: none; }

@media (max-width: 760px) {
  .stage-view { aspect-ratio: 4 / 3; }
  .stage.is-live { position: fixed; inset: 0; z-index: 40; border-radius: 0; display: flex; flex-direction: column; }
  .stage.is-live .stage-view { flex: 1; aspect-ratio: auto; max-height: none; }
  .stage-bar span, .stage-bar .hide-narrow { display: none; }
  body.stage-open { overflow: hidden; }
}

.game-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2.5rem, 6vw, 5rem); }
.game-body .about { font-size: var(--step-1); line-height: 1.5; max-width: 34em; }
.game-body h2 { font: 700 var(--step-2) / 1.1 var(--display); font-variation-settings: 'wdth' 86; letter-spacing: -0.02em; margin-bottom: 1rem; }
.game-body .about + h2 { margin-top: 2.75rem; }
.points li { position: relative; padding: 0.7rem 0 0.7rem 1.6rem; border-top: 1px solid var(--line); max-width: 34em; }
.points li::before { content: ''; position: absolute; left: 0.1rem; top: 1.25rem; width: 0.8rem; height: 0.4rem; border-radius: 99px; background: var(--copper); }
.spec { border-top: 1.5px solid var(--ink); }
.spec div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--ink-soft); }
.spec dd { font-weight: 600; }
.spec dd ul li + li { margin-top: 0.3rem; }
.spec dd ul li { font-weight: 500; }
.spec-note { margin-top: 1rem; font-size: var(--step--1); color: var(--ink-soft); }
@media (max-width: 860px) { .game-body { grid-template-columns: minmax(0, 1fr); } }

.more h2 { font-size: var(--step-3); }
.more .deal { margin-top: 0.5rem; }

/* ---------- 404 ---------- */
.lost { min-height: 60vh; display: grid; align-content: center; gap: 1.5rem; }
.lost h1 { font-size: var(--step-4); }

@media (max-width: 560px) {
  .site-nav a:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-face, .card-cue, .btn { transition: none; }
}
