/*
 * Onslaught Studios website.
 * Colours come from the studio logo (Art/Game/_Studio): forged steel, slag-dark iron, and the molten orange that shows
 * through its cracks. The type is the studio's UI type (UI-BIBLE.md): Saira Semi Condensed for headings and buttons,
 * Barlow Semi Condensed for reading. Buttons are the UI's slanted tiles. The one bold thing is the home page's opening:
 * the logo, and under it a seam of molten light along a slanted cut, as in the logo's cracks.
 */
@font-face { font-family: "Saira Semi Condensed"; font-weight: 600; src: url("/fonts/SairaSemiCondensed-SemiBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Saira Semi Condensed"; font-weight: 700; src: url("/fonts/SairaSemiCondensed-Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Saira Semi Condensed"; font-weight: 800; src: url("/fonts/SairaSemiCondensed-ExtraBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; src: url("/fonts/BarlowSemiCondensed-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; src: url("/fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype"); font-display: swap; }

:root {
  color-scheme: dark;
  --slag: #15161a;
  --iron: #1d1f24;
  --plate: #25282e;
  --line: #ffffff1c;
  --bright: #eceef2;
  --steel: #a2a7b0;
  --molten: #ff6b1a;
  --molten-deep: #c43f06;
  --ember: #ffb547;
  --head: "Saira Semi Condensed", "Segoe UI", system-ui, sans-serif;
  --body: "Barlow Semi Condensed", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  /* the studio UI's tile slant, as a horizontal inset at a 50 px height (tan 19.5 deg x 50) */
  --slant: 18px;
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: #ff6b1a33; }
body { margin: 0; background: var(--slag); color: var(--bright); font: 500 18px/1.6 var(--body); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a, button, select, label { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 12px 18px; border-radius: 6px; background: #fff; color: #000; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 5; background: #15161ae8; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px/1 var(--head); }
.brand img { width: 40px; height: 40px; }
.top nav { display: flex; gap: 2px; }
.top nav a { padding: 12px 14px; text-decoration: none; font: 600 16px/1 var(--head); color: var(--steel); transition: color 0.15s; }
.top nav a:hover { color: #fff; }
.top nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--molten); }

/* ---- buttons: the studio UI's slanted tiles ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 calc(22px + var(--slant));
  border: 0; text-decoration: none; cursor: pointer; font: 700 17px/1 var(--head);
  clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
  transition: background-color 0.15s, color 0.15s, translate 0.08s;
}
.btn:active { translate: 0 1px; }
.btn.red { background: linear-gradient(180deg, #ff8233, var(--molten-deep)); color: #1a0a02; }
.btn.red:hover { background: linear-gradient(180deg, #ff9a52, #d94a0a); }
.btn.line { background: var(--plate); color: var(--bright); box-shadow: inset 0 0 0 1px #ffffff2e; }
.btn.line:hover { background: #31353c; color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: default; }
/* clip-path cuts the focus ring off: draw it inside */
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--ember); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 4px; }

/* ---- home: the logo, cut off by a seam of molten light ---- */
.hero {
  --cut: clamp(36px, 6vw, 84px);
  position: relative; padding: clamp(28px, 6vh, 64px) 0 calc(var(--cut) + clamp(28px, 5vh, 56px));
  background: radial-gradient(ellipse 50% 70% at 28% 45%, #2c2f36 0%, var(--iron) 55%, var(--slag) 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
}
/* the seam: a line of molten light along the cut, bright where it starts, cooling across the page */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--cut); pointer-events: none;
  background: linear-gradient(90deg, var(--ember), var(--molten) 18%, #ff6b1a99 55%, #ff6b1a1a);
  clip-path: polygon(0 calc(100% - 3px), 100% 0, 100% 2px, 0 100%);
  filter: drop-shadow(0 0 6px #ff6b1a);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.hero .logo { width: min(100%, 520px); filter: drop-shadow(0 22px 34px #000b); }
.hero h1 { margin: 0; max-width: 15ch; font: 800 clamp(38px, 5.6vw, 68px) / 1.02 var(--head); letter-spacing: -0.01em; color: #fff; }
.hero p { max-width: 44ch; margin: 18px 0 30px; color: var(--steel); font-size: clamp(18px, 1.7vw, 21px); }

/* ---- sections ---- */
section.band { padding: clamp(44px, 8vh, 88px) 0; }
section.band.alt { background: var(--iron); }
h2 { margin: 0 0 14px; font: 800 clamp(30px, 3.6vw, 44px) / 1.1 var(--head); color: #fff; }
.lede { max-width: 60ch; margin: 0 0 28px; color: var(--steel); }
.page-head { padding: clamp(36px, 7vh, 72px) 0 clamp(24px, 4vh, 40px); background: linear-gradient(180deg, var(--iron), var(--slag)); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 10px; font: 800 clamp(36px, 5vw, 56px) / 1.05 var(--head); color: #fff; }
.page-head p { max-width: 60ch; margin: 0; color: var(--steel); }
section[id], .game[id], h2[id] { scroll-margin-top: 80px; }

/* ---- the games ----
   One game is laid out wide, its picture beside its words. Two or more become a grid of the same block. */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: clamp(26px, 3vw, 40px); }
h2 + .games { margin-top: 24px; }
.game { display: grid; align-content: start; gap: 20px; min-width: 0; }
.game:only-child { grid-column: 1 / -1; grid-template-columns: 1.2fr 1fr; gap: clamp(22px, 4vw, 52px); align-items: center; }
/* a game's picture, its right edge cut on the slant like the buttons */
.game .plate { overflow: hidden; background: #000; clip-path: polygon(0 0, 100% 0, calc(100% - 7%) 100%, 0 100%); }
.game .plate img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.game h2, .game h3 { margin: 0 0 10px; font: 800 clamp(28px, 3vw, 40px) / 1.08 var(--head); color: #fff; }
.game p { margin: 0 0 22px; color: var(--steel); max-width: 50ch; }
.game .status { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 600 15px/1.2 var(--head); color: var(--ember); }
.status::before { content: ""; width: 9px; height: 9px; background: currentColor; transform: skewX(-19.5deg); }
.status.demo { color: #7fd99a; }
.soon { margin: 0; color: var(--steel); }

/* ---- home: how demo mode works ---- */
.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.points { margin: 0; display: grid; }
.points > div { padding: 18px 0; border-top: 1px solid var(--line); }
.points > div:last-child { border-bottom: 1px solid var(--line); }
.points dt { font: 700 20px/1.25 var(--head); color: #fff; }
.points dd { margin: 4px 0 0; color: var(--steel); max-width: 54ch; }
.points a { color: var(--bright); text-underline-offset: 3px; }
.points a:hover { color: #fff; }

/* ---- a game's own page: a bar that says what it is, and the game under it ---- */
body.play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.playbar { flex: none; display: flex; align-items: center; gap: 6px 18px; min-height: 52px; padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--slag); font-size: 15px; }
.playbar a, .playbar button { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--bright); font: 600 15px/1 var(--head); text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.playbar a:hover, .playbar button:hover { background: #ffffff14; color: #fff; }
.playbar .back { border-color: #ffffff2e; }
.playbar .back::before { content: ""; width: 8px; height: 8px; margin-right: 9px; border-left: 2px solid; border-bottom: 2px solid; rotate: 45deg; }
.playing { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
.playing h1 { margin: 0; font: 800 19px/1.3 var(--head); color: #fff; }
.playing p { margin: 0; color: var(--steel); font-size: 15px; line-height: 1.35; }
.playbar-actions { flex: none; display: flex; gap: 4px; }
.playbar #full { border-color: #ffffff2e; }
body.play main { flex: 1; min-height: 0; background: #000; }
body.play iframe { display: block; width: 100%; height: 100%; border: 0; }
/* in the game's place while its demo server starts: one heading and one line, in the middle */
body.play main:has(.wait:not([hidden])) { display: grid; place-items: center; }
.wait { max-width: 34rem; padding: 24px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left)); text-align: center; }
.wait h2 { margin: 0 0 10px; font: 800 clamp(22px, 3.4vw, 30px)/1.2 var(--head); color: #fff; }
.wait p { margin: 0; color: var(--steel); }
/* a narrow or a short window (a phone on its side): the bar keeps to one line, and the game says the rest */
@media (max-width: 960px), (max-height: 520px) {
  .playing p { display: none; }
  .playbar { gap: 6px 8px; min-height: 48px; }
}
/* a phone held upright: the three buttons fill the bar, so the game's name is kept for screen readers only (the game shows it) */
@media (max-width: 520px) {
  .playing h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- feedback form ---- */
.form { display: grid; gap: 20px; width: min(680px, 100%); }
.field { display: grid; gap: 7px; }
.field > span, legend { font: 600 17px/1.3 var(--head); color: #fff; padding: 0; }
.field small { color: var(--steel); font-size: 15px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid #ffffff2e; border-radius: 4px; background-color: var(--plate); color: #fff; font: 500 18px/1.5 var(--body);
}
textarea { min-height: 170px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px #ff6b1a55; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 9px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; }
.choice span { display: block; padding: 10px 18px; border: 1px solid #ffffff2e; border-radius: 4px; background: var(--plate); font: 600 16px/1.3 var(--head); }
.choice input:checked + span { border-color: var(--molten); background: #ff6b1a24; color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--ember); outline-offset: 2px; }
.trap { position: absolute; left: -5000px; }
.note { padding: 16px 18px; border-radius: 4px; border: 1px solid var(--line); background: var(--plate); }
.note.good { border-color: #4cc777; }
.note.bad { border-color: var(--molten); }
.note h2 { margin: 0 0 6px; font: 700 21px/1.3 var(--head); color: #fff; }
.note p { margin: 0 0 10px; color: var(--steel); }
.note pre { margin: 0 0 12px; padding: 12px; max-height: 240px; overflow: auto; border-radius: 4px; background: var(--slag); white-space: pre-wrap; font: 14px/1.5 Consolas, monospace; color: var(--bright); }
[hidden] { display: none !important; }

/* ---- inbox ---- */
.inbox { display: grid; gap: 14px; }
.item { padding: 16px 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--plate); }
.item header { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; color: var(--steel); font-size: 15px; }
.item header b { color: #fff; font: 700 17px/1 var(--head); }
.item p { margin: 0; white-space: pre-wrap; }

/* ---- footer ---- */
footer { padding: 36px 0 44px; border-top: 1px solid var(--line); color: var(--steel); font-size: 16px; }
footer p { margin: 0 0 6px; max-width: 70ch; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .logo { width: min(78%, 360px); }
  .game:only-child { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .top nav a { padding: 12px 10px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
