/* ==========================================================================
   home.css: STUDIO (#studio), CONTACT (#contact), the plain pages
   (404 / thanks / privacy) and the noscript games list.
   Loads on home and plain pages. Scope: .studio-*, .contact-*, .plain*, .prose, .noscript-list
   ========================================================================== */

/* ── Noscript games list (#games without JavaScript) ────────────────── */
.noscript-list {
  list-style: none;
  border-top: 1px solid var(--line);
}
.noscript-list a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--bone-2);
  font-size: 17px;
  line-height: 1.5;
}
.noscript-list a:hover { color: var(--bone); }

/* ══ STUDIO ═══════════════════════════════════════════════════════════ */
.studio { overflow: clip; }
.studio::before {
  /* the moon, very far away, warming the card */
  content: '';
  position: absolute;
  right: -10vw;
  top: 50%;
  width: min(900px, 80vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: radial-gradient(closest-side, rgba(163, 48, 31, .16), rgba(163, 48, 31, .05) 55%, transparent);
  pointer-events: none;
}
.studio-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(48px, 8vw, 132px);
  align-items: center;
}
.studio-copy h2 {
  margin: 20px 0 30px;
  font-size: clamp(42px, 5.8vw, 88px);
  max-width: 11ch;
  text-wrap: balance;
}
.studio-copy .lede { margin-bottom: 22px; }
.studio-copy > p:not(.lede):not(.kicker):not(.studio-motto) {
  max-width: 60ch;
  color: var(--bone-2);
}
.studio-motto {
  margin-top: clamp(30px, 3.6vw, 44px);
  padding-left: 22px;
  border-left: 3px solid var(--seal);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.4;
  color: var(--bone);
  max-width: 30ch;
}

/* the studio card: a registration card with the approval seal stamped on it */
.studio-card {
  position: relative;
  padding: clamp(40px, 4.2vw, 56px) clamp(24px, 3.2vw, 44px) clamp(26px, 3vw, 40px);
  background:
    linear-gradient(180deg, rgba(239, 230, 214, .025), transparent 40%),
    var(--ink-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-hard), var(--shadow-soft);
}
.studio-card::before {
  content: 'Jack Wilds Ltd';
  content: 'Jack Wilds Ltd' / '';
  display: block;
  margin-bottom: 20px;
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.studio-hanko {
  position: absolute;
  top: calc(-1 * clamp(26px, 3vw, 38px));
  right: calc(-1 * clamp(8px, 1.6vw, 26px));
  font-size: clamp(84px, 8.4vw, 118px);
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 .055em var(--seal), inset 0 0 0 .08em rgba(255, 244, 234, .85), 5px 5px 0 rgba(0, 0, 0, .5);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='r'><feTurbulence baseFrequency='.75' numOctaves='2' seed='4'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 1 1 1 1 .55 1'/></feComponentTransfer></filter><rect width='160' height='160' filter='url(%23r)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='r'><feTurbulence baseFrequency='.75' numOctaves='2' seed='4'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 1 1 1 1 .55 1'/></feComponentTransfer></filter><rect width='160' height='160' filter='url(%23r)'/></svg>");
  z-index: 2;
}
.studio-hanko > span { font-size: .6em; }
.studio-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 30px;
  border-top: 1px solid var(--line-2);
}
.studio-facts > div {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.studio-facts > div:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--line); }
.studio-facts > div:nth-child(even) { padding-left: 20px; }
.studio-facts dt {
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--fog);
}
.studio-facts dd {
  margin-top: 4px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(30px, 2.9vw, 42px);
  line-height: 1.1;
  color: var(--bone);
  font-feature-settings: 'palt';
}

/* stamp-down: home.js arms it, then stamps once when it scrolls into view */
.studio-armed .studio-hanko { opacity: 0; }
.studio-armed .studio-hanko.is-stamped { animation: hankoDown .6s var(--ease-out) both; }
.studio-card.is-hit { animation: cardHit .32s steps(4, end) both; }
@keyframes hankoDown {
  0%   { opacity: 0; transform: rotate(-16deg) scale(2.2); }
  48%  { opacity: 1; transform: rotate(-7deg) scale(.9); }
  70%  { transform: rotate(-8.5deg) scale(1.04); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes cardHit {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 2px); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, 1px); }
  100% { transform: none; }
}

/* ══ CONTACT ══════════════════════════════════════════════════════════ */
.contact {
  background: linear-gradient(180deg, transparent 0, rgba(19, 16, 9, .9) 22%, rgba(19, 16, 9, .9) 78%, transparent 100%);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head form"
    "addr form";
  column-gap: clamp(40px, 7vw, 120px);
  row-gap: clamp(22px, 3vw, 40px);
  align-items: start;
}
.contact-head { grid-area: head; margin-bottom: 0; }
.contact-head .lede { max-width: 34ch; }
.contact-form, .contact-done { grid-area: form; }
.contact-addr {
  grid-area: addr;
  display: grid;
  gap: 2px;
  justify-self: start;
  padding: 18px 22px 18px 20px;
  border-left: 3px solid var(--seal);
  background: linear-gradient(90deg, rgba(239, 230, 214, .04), transparent);
  font-style: normal;
  font-size: 15px;
  line-height: 1.6;
  color: var(--bone-2);
}
.contact-addr-k {
  margin-bottom: 6px;
  font-family: var(--f-pixel);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--fog);
}
.contact-addr-name { color: var(--bone); font-weight: 700; }
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
  padding: clamp(24px, 3.4vw, 44px);
  background:
    linear-gradient(180deg, rgba(239, 230, 214, .03), transparent 50%),
    var(--ink-2);
}
.contact-form > * { grid-column: 1 / -1; min-width: 0; }
.contact-form > .contact-field--half { grid-column: auto; }
.contact-field { display: grid; gap: 8px; align-content: start; }
.contact-form textarea.input { min-height: 168px; }
.contact-form .input[aria-invalid="true"] { border-color: var(--seal-hot); }
.contact-err {
  display: flex;
  gap: .55em;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.45;
  color: var(--seal-hot);
}
.contact-err::before {
  content: '';
  flex: none;
  width: 7px; height: 7px;
  background: currentColor;
  transform: translateY(-1px);
}
.contact-form .btn { justify-self: start; margin-top: 4px; }
.contact-form .btn:disabled { cursor: progress; }
.contact-form.is-sending .btn { opacity: .75; }
.contact-form .form-status:empty { display: none; }
.contact-form .form-status[data-state="error"] {
  padding: 12px 14px;
  border: 1px solid rgba(240, 96, 63, .45);
  background: rgba(217, 72, 44, .08);
  line-height: 1.5;
}

/* success: the form becomes a warm, stamped confirmation card */
.contact-done {
  position: relative;
  padding: clamp(40px, 4.6vw, 60px) clamp(24px, 3.4vw, 44px) clamp(28px, 3.4vw, 44px);
  background:
    radial-gradient(ellipse at 85% 0%, rgba(217, 72, 44, .14), transparent 60%),
    var(--ink-2);
  border-color: var(--line-2);
}
.contact-done:focus { outline: none; }
.contact-done .kicker { margin-bottom: 18px; }
.contact-done-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.05;
  color: var(--bone);
  margin-bottom: 16px;
  max-width: 14ch;
}
.contact-done-copy { color: var(--bone-2); max-width: 42ch; margin-bottom: 28px; }
.contact-hanko {
  position: absolute;
  top: calc(-1 * clamp(22px, 2.6vw, 32px));
  right: clamp(18px, 3vw, 40px);
  font-size: clamp(76px, 7vw, 100px);
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 .055em var(--seal), inset 0 0 0 .08em rgba(255, 244, 234, .85), 5px 5px 0 rgba(0, 0, 0, .5);
  animation: hankoDown .6s var(--ease-out) .12s both;
}
.contact-hanko > span { font-size: .6em; }

/* ══ PLAIN PAGES (404, thanks, privacy) ══════════════════════════════ */
body[data-page="plain"] .plain {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + var(--safe-t) + clamp(36px, 8vh, 110px)) 0 clamp(56px, 10vh, 120px);
  overflow: clip;
}
.plain-inner { position: relative; z-index: 1; }
.plain-title {
  margin: 20px 0 24px;
  font-size: clamp(60px, 11vw, 168px);
  text-wrap: balance;
}
.plain .lede { margin-bottom: 36px; }

/* the set, far behind the error and thanks pages */
.plain--404::before,
.plain--thanks::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/brand/arcade-night-m.webp') right center / cover no-repeat;
  opacity: .42;
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, #000 72%);
  mask-image: linear-gradient(90deg, transparent 18%, #000 72%);
  pointer-events: none;
}

/* ── 404: CONTINUE? ─────────────────────────────────────────────────── */
.plain--404 .plain-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker count"
    "title  count"
    "lede   count"
    "btns   count";
  column-gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.plain--404 .kicker { grid-area: kicker; justify-self: start; }
.plain--404 .plain-title { grid-area: title; }
.plain--404 .lede { grid-area: lede; }
.plain--404 .btn-row { grid-area: btns; }
.plain-continue {
  grid-area: count;
  align-self: center;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 21.5rem;
  max-width: 100%;
  padding: 26px 26px 24px;
  background: rgba(6, 5, 4, .72);
  border: 2px solid var(--line-2);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* CRT scanlines over the whole screen */
.plain-continue::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .3) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.plain-continue:focus-visible { outline-offset: 5px; }
.pc-label {
  font-family: var(--f-pixel);
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.2;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(242, 177, 62, .45);
}
.pc-num {
  display: block;
  min-width: 1.1ch;
  font-family: var(--f-pixel);
  font-size: clamp(150px, 17vw, 250px);
  line-height: 1.02;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
  text-shadow: .035em .035em 0 var(--seal-deep), 0 0 .2em rgba(217, 72, 44, .35);
  transition: color .2s;
}
.pc-num.is-tick { animation: pcTick .42s steps(4, end) both; }
.plain-continue.is-low .pc-num { color: var(--seal-hot); }
.plain-continue.is-over .pc-num { color: var(--fog-2); text-shadow: none; }
.plain-continue.is-over .pc-label { color: var(--seal-hot); text-shadow: 0 0 14px rgba(217, 72, 44, .5); }
.pc-hint {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  font-family: var(--f-pixel);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fog);
  text-align: center;
}
.plain-continue.is-over .pc-hint { color: var(--gold); animation: pcBlink 1.2s steps(1, end) infinite; }
.plain-continue.is-coin { animation: pcCoin .3s steps(3, end); }
#continueBtn.is-pulsing { animation: pcPulse 1.2s steps(6, end) infinite; }
@keyframes pcTick {
  0% { transform: scale(1.16); opacity: .35; }
  100% { transform: none; opacity: 1; }
}
@keyframes pcBlink { 0%, 100% { opacity: 1; } 70% { opacity: 0; } }
@keyframes pcCoin { 0% { border-color: var(--gold); } 100% { border-color: var(--line-2); } }
@keyframes pcPulse {
  0%   { box-shadow: 4px 4px 0 rgba(0, 0, 0, .55), 0 0 0 0 rgba(240, 96, 63, .75); }
  100% { box-shadow: 4px 4px 0 rgba(0, 0, 0, .55), 0 0 0 18px rgba(240, 96, 63, 0); }
}

/* ── Thanks: the hanko stamps in (CSS alone; home.js adds the sound) ─── */
.plain-hanko {
  display: inline-grid;
  font-size: clamp(96px, 11vw, 150px);
  margin-bottom: clamp(26px, 3vw, 40px);
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 .055em var(--seal), inset 0 0 0 .08em rgba(255, 244, 234, .85), 6px 6px 0 rgba(0, 0, 0, .5);
  margin-left: .05em;
  animation: hankoDown .62s var(--ease-out) .35s both;
}
.plain-hanko > span { font-size: .6em; }
.plain--thanks .plain-inner > .kicker { display: flex; }

/* ── Privacy: readable prose ─────────────────────────────────────────── */
.plain--privacy { align-items: start; }
.prose {
  max-width: calc(68ch + 2 * var(--gutter));
}
.prose .plain-title { font-size: clamp(46px, 7vw, 100px); }
.prose .lede { max-width: none; margin-bottom: 12px; }
.prose h2 {
  margin: 2.1em 0 .55em;
  font-size: clamp(25px, 2.6vw, 34px);
  line-height: 1.15;
  color: var(--bone);
}
.prose p, .prose li { color: var(--bone-2); }
.prose p + p { margin-top: 1em; }
.prose ul { list-style: none; display: grid; gap: 12px; }
.prose li { position: relative; padding-left: 24px; }
.prose li::before {
  content: '';
  position: absolute;
  left: 2px; top: .72em;
  width: 7px; height: 7px;
  background: var(--seal);
}
.prose strong { color: var(--bone); font-weight: 700; }
.prose a {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--seal);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s;
}
.prose a:hover { color: var(--gold); }
.prose .muted { margin-top: 2.6em; font-family: var(--f-pixel); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

/* ══ Responsive ══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .studio-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; }
  /* tablets: the address sits beside the heading, the form runs full width beneath */
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "head addr"
      "form form";
    column-gap: 40px;
    row-gap: 44px;
  }
  .contact-addr { align-self: end; }
  .contact-head .lede { max-width: 52ch; }
}
@media (max-width: 860px) {
  .studio-grid { grid-template-columns: 1fr; gap: 72px; }
  .studio-copy h2 { font-size: clamp(42px, 7.6vw, 64px); max-width: 13ch; }
  .studio-card { max-width: 520px; }
  .plain--404 .plain-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "kicker" "title" "lede" "count" "btns";
  }
  .plain-continue { justify-self: start; margin-bottom: 32px; }
}
@media (max-width: 860px) and (min-width: 700px) {
  /* iPad portrait: the card becomes a wide registration strip, four facts in a row */
  .studio-card { max-width: none; margin-right: 18px; }
  .studio-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .studio-facts > div:nth-child(n) { padding: 18px 16px 16px; border-right: 1px solid var(--line); }
  .studio-facts > div:first-child { padding-left: 0; }
  .studio-facts > div:last-child { border-right: 0; }
  .studio-card .btn { max-width: 340px; }
}
@media (max-width: 699px) {
  .studio-copy h2 { font-size: clamp(40px, 11.5vw, 56px); margin: 16px 0 24px; }
  .studio-card { margin-right: 10px; }
  .studio-hanko { right: -10px; }
  .studio-facts dd { font-size: 32px; }
  /* phones: the form comes straight after the heading; the address signs off beneath it */
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "form" "addr";
    row-gap: 32px;
  }
  .contact-addr { align-self: start; padding: 14px 18px 14px 16px; font-size: 14.5px; }
  .contact-form { grid-template-columns: 1fr; padding: 22px 18px 24px; gap: 20px; }
  .contact-form > .contact-field--half { grid-column: 1 / -1; }
  .contact-form .btn { justify-self: stretch; }
  .plain-title { font-size: clamp(54px, 16vw, 80px); }
  .plain--404::before, .plain--thanks::before {
    background-image: url('/assets/brand/arcade-scene.webp');
    background-position: 70% 30%;
    opacity: .3;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
    mask-image: linear-gradient(180deg, #000, transparent 75%);
  }
  .plain-continue { justify-self: stretch; width: auto; padding: 20px 16px 18px; }
  .pc-num { font-size: clamp(120px, 40vw, 180px); }
  .plain .btn-row .btn { flex: 1 1 100%; }
}
