/* Upperture Games — games.uppertureinteractive.in
   Same family as the agency site (Bricolage Grotesque, paper + ink, the same mark).
   Two colours on paper + ink:
     sun (yellow) — the brand surfaces: the hero and the playtest band
     grape        — the game itself (its screen, its cover art) and the buttons that start it
   Inside the game the roles flip: purple screen, yellow arrow. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/BricolageGrotesque-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-Latin.woff2') format('woff2');
}

:root {
  --grape: #4E188B;      /* the contrasting colour: yellow's opposite on the wheel */
  --grape-deep: #3A1068;
  --sun: #FFD23F;        /* the accent: anything playable */
  --sun-deep: #E0AE00;
  --paper: #F5F6F8;
  --paper-2: #ECEEF2;
  --white: #FFFFFF;
  --line: #D9DCE3;
  --ink: #0A0A0B;
  --ink-2: #3D4250;
  --ink-3: #596070;

  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 400;
}
::selection { background: var(--grape); color: var(--white); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; }

/* Focus: ink ring on light surfaces, yellow ring on dark ones */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.playfield :focus-visible, .game-live :focus-visible, .lost-page :focus-visible { outline-color: var(--sun); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--sun); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  font-weight: 500;
  padding: 2px 7px 3px;
  border-radius: 6px;
  border: 1px solid currentColor;
  border-bottom-width: 3px;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border-radius: 999px; border: 0;
  font-family: var(--font); font-size: 17px; font-weight: 650;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
/* The coin-op button. On yellow and paper it's purple, the colour of the game screen it opens. */
.btn-primary {
  background: var(--grape); color: var(--white);
  box-shadow: 0 4px 0 var(--grape-deep);
}
.btn-primary:hover { background: #5C21A3; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--grape-deep); }
/* On dark surfaces (inside the game, the Upshot card, the 404) it flips to yellow */
.panel .btn-primary, .game-live .btn-primary, .lost-page .btn-primary {
  background: var(--sun); color: var(--ink);
  box-shadow: 0 4px 0 var(--sun-deep);
}
.panel .btn-primary:hover, .game-live .btn-primary:hover, .lost-page .btn-primary:hover { background: #FFDA5E; }
.panel .btn-primary:active, .game-live .btn-primary:active, .lost-page .btn-primary:active {
  box-shadow: 0 1px 0 var(--sun-deep);
}

.btn-line {
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
  font-weight: 550;
}
.btn-line:hover { background: rgba(255, 255, 255, .35); }
.btn-ghost {
  background: transparent; color: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(245, 246, 248, .45);
  font-weight: 500;
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--paper); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero {
  background: var(--sun);
  color: var(--ink);
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
}
.nav {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 32px;
  position: relative; z-index: 3;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-tile {
  width: 40px; height: 40px; border-radius: 12px; background: var(--white);
  display: grid; place-items: center; flex: none;
}
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand-sticker {
  display: inline-block; transform: rotate(-5deg) translateY(-6px);
  background: var(--grape); color: var(--white);
  font-size: 13px; font-weight: 700; padding: 2px 9px 3px; border-radius: 6px;
  box-shadow: 0 2px 0 var(--grape-deep);
}
.nav-links { display: flex; align-items: center; gap: 0 28px; font-size: 16px; font-weight: 500; }
.nav-links a { text-decoration: none; padding: 12px 0; }
.nav-links a:hover { color: var(--grape); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.hero-grid {
  width: 100%; max-width: var(--max); margin: 0 auto;
  flex: 1 0 auto;
  padding: 0 var(--gutter) clamp(20px, 3vw, 36px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr);
  gap: 32px clamp(32px, 5vw, 72px);
}
.hero-copy {
  align-self: center;
  padding: clamp(24px, 5vh, 64px) 0 clamp(32px, 6vh, 72px);
}
.boot {
  font-family: var(--mono); font-size: 15px; letter-spacing: .04em;
  color: var(--ink);
  display: flex; align-items: center; gap: 2px;
}
.cursor {
  display: inline-block; width: .62em; height: 1.05em; background: var(--grape);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-title {
  margin-top: 18px;
  font-size: clamp(50px, 6.9vw, 104px);
  line-height: .93;
  letter-spacing: -0.04em;
}
.hero-title span { display: block; }
/* The old life whispers, the new one shouts.
   Two sentences, one variable font, the two ends of its weight range. */
.t-quiet { font-weight: 200; letter-spacing: -0.03em; }
.t-loud  { font-weight: 800; }

.hero-lede {
  margin-top: 28px; max-width: 33em;
  font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55;
  color: var(--ink);
}
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-keys { margin-top: 18px; font-size: 15px; color: var(--ink); }

/* ---------- Playfield: the game screen ---------- */
.playfield {
  position: relative;
  min-height: 560px;
  margin-top: 8px;
  background: var(--grape);
  color: var(--white);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(58, 16, 104, .6);
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.playfield canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: manipulation;
  cursor: pointer;
}
.playfield canvas:focus-visible { outline-offset: -4px; border-radius: 28px; }

.hud {
  position: absolute; left: 24px; right: 22px; top: 18px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
  text-shadow: 0 0 2px var(--grape), 0 0 6px var(--grape), 0 0 12px var(--grape);
}
.hud-score { display: flex; flex-direction: column; line-height: 1; }
.hud-num {
  font-family: var(--mono); font-weight: 800; font-size: 56px; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hud-label { margin-top: 6px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .78); }
.hud-right { padding-top: 8px; padding-right: 48px; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .82); }
.hud-best b { font-family: var(--mono); font-weight: 700; color: var(--white); }
.hud.is-cheat .hud-label::after { content: ' · cheat on'; color: var(--sun); font-weight: 700; }

.sound {
  position: absolute; right: 14px; top: 14px;
  width: 44px; height: 44px; border-radius: 12px; border: 0;
  background: rgba(255, 255, 255, .12); color: var(--white);
  display: grid; place-items: center; cursor: pointer;
}
.sound:hover { background: rgba(255, 255, 255, .2); }
.sound[aria-pressed="true"] .mute { display: none; }
.sound[aria-pressed="false"] .wave { display: none; }

.panel {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(calc(100% - 32px), 360px);
  background: var(--ink); color: var(--paper);
  border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 24px 50px -24px rgba(10, 10, 11, .6);
  font-size: 15px; line-height: 1.45;
}
.panel[hidden] { display: none; }
.panel-attract { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.panel-attract p { flex: 1 1 auto; }
.panel-attract .btn { flex: none; }
.panel-hint { text-align: center; pointer-events: none; }
.panel-hint kbd { color: var(--sun); }
.panel-over { top: 50%; bottom: auto; transform: translate(-50%, -50%); text-align: center; padding: 26px 22px 22px; }
.over-score { font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -0.03em; }
.over-score #over-score { font-family: var(--mono); color: var(--sun); }
.over-score #over-unit { font-size: .5em; font-weight: 500; letter-spacing: 0; }
.over-best { margin-top: 10px; color: rgba(245, 246, 248, .75); }
.over-best.is-new { color: var(--sun); font-weight: 600; }
.over-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.noscript { bottom: auto; top: 50%; transform: translate(-50%, -50%); }

/* ---------- Shelf ---------- */
.shelf { padding: clamp(72px, 9vw, 128px) 0; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; }
.shelf-head h2, .rules h2 {
  font-weight: 800; font-size: clamp(38px, 4.8vw, 64px); line-height: 1; letter-spacing: -0.035em;
}
.shelf-head p { max-width: 26em; color: var(--ink-2); }

.shelf-grid {
  margin-top: 48px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px;
  align-items: start;
}
.game { border-radius: 24px; overflow: hidden; position: relative; }
.game-art { position: relative; }
.game-art svg { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.game-status {
  position: absolute; left: 18px; top: 18px;
  font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.status-live { background: var(--sun); color: var(--ink); }
.status-wip { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.game-body { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.game h3 { font-weight: 800; font-size: clamp(32px, 3.4vw, 44px); line-height: 1; letter-spacing: -0.03em; }
.game-pitch { font-size: 20px; font-weight: 500; line-height: 1.35; }

.game-live { background: var(--ink); color: var(--paper); }
.game-live .game-body > p:not(.game-pitch) { color: rgba(245, 246, 248, .78); max-width: 36em; }
.game-live .game-pitch { color: var(--paper); }

.specs {
  width: 100%; margin: 6px 0 8px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #2A2D35;
}
.specs > div { padding: 12px 0; border-bottom: 1px solid #2A2D35; }
.specs > div:nth-child(odd) { padding-right: 16px; }
.specs dt { font-size: 13px; color: rgba(245, 246, 248, .6); }
.specs dd { font-size: 16px; font-weight: 500; }

.game-wip { background: var(--paper); outline: 2px dashed var(--ink-3); outline-offset: -2px; }
.game-wip .game-art { border-bottom: 2px dashed var(--ink-3); }
.game-wip .game-pitch { color: var(--ink-3); }
.game-wip .game-body > p:not(.game-pitch) { color: var(--ink-2); }
.text-link {
  color: var(--grape); font-weight: 650; text-decoration: underline;
  text-underline-offset: 5px; text-decoration-thickness: 2px;
}
.text-link:hover { color: var(--ink); }

/* ---------- House rules ---------- */
.rules { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(72px, 9vw, 128px) 0; }
.rules-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px clamp(40px, 6vw, 96px); }
.rules-intro p { margin-top: 20px; color: var(--ink-2); max-width: 28em; }
.rules-intro { position: sticky; top: 32px; align-self: start; }
.rules-list > div { border-top: 2px solid var(--ink); padding: 22px 0 36px; }
.rules-list dt { font-weight: 750; font-size: clamp(28px, 3vw, 40px); line-height: 1.05; letter-spacing: -0.025em; }
.rules-list dd { margin-top: 12px; color: var(--ink-2); max-width: 32em; font-size: 18px; }

/* ---------- Playtest ---------- */
.playtest { background: var(--sun); color: var(--ink); overflow: hidden; }
.playtest-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px;
  padding-top: clamp(72px, 9vw, 120px); padding-bottom: clamp(72px, 9vw, 120px);
}
.playtest h2 { font-weight: 800; font-size: clamp(36px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -0.035em; max-width: 14em; }
.playtest-copy > p:first-of-type { margin-top: 22px; max-width: 34em; font-size: clamp(18px, 1.5vw, 20px); color: var(--ink); }
.playtest .btn { margin-top: 32px; }
.playtest-note { margin-top: 16px; font-size: 15px; color: var(--ink); }
.playtest-note a { color: var(--ink); font-weight: 650; text-underline-offset: 4px; }
.playtest-mark { width: clamp(170px, 20vw, 260px); height: auto; transform: rotate(-6deg); filter: drop-shadow(0 22px 30px rgba(58, 16, 104, .35)); }

/* ---------- Footer ---------- */
.footer { background: var(--white); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; }
.footer-bridge { padding: 28px 0 22px; border-bottom: 1px solid var(--line); font-size: 17px; color: var(--ink-2); }
.footer-bridge a { color: var(--grape); font-weight: 650; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.footer-bridge a:hover { color: var(--ink); }
.footer-row { padding: 18px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-links { display: flex; gap: 0 24px; }
.footer-links a { color: var(--ink-3); padding: 12px 0; display: inline-block; }
.footer-links a:hover { color: var(--grape); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, calc(100% + 48px));
  visibility: hidden;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 14px; font-size: 15px;
  box-shadow: 0 0 0 2px var(--sun), 0 20px 40px -20px rgba(10, 10, 11, .6);
  transition: transform .25s ease, visibility 0s linear .25s;
  max-width: calc(100% - 32px);
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease, visibility 0s; }

/* ---------- 404: the arcade "Continue?" screen ---------- */
.lost-page { background: var(--grape); color: var(--white); }
.lost { min-height: 100svh; display: grid; align-items: center; padding: 48px var(--gutter); }
.lost-inner { max-width: 640px; margin: 0 auto; width: 100%; }
.lost-count {
  font-family: var(--mono); font-weight: 800; font-size: clamp(120px, 26vw, 220px);
  line-height: .85; color: var(--sun); letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.lost h1 { margin-top: 16px; font-weight: 800; font-size: clamp(48px, 9vw, 88px); line-height: .95; letter-spacing: -0.04em; }
.lost-text { margin-top: 20px; font-size: 20px; max-width: 28em; color: rgba(255, 255, 255, .88); }
.lost .btn { margin-top: 32px; }
.lost-small { margin-top: 40px; font-size: 14px; color: rgba(255, 255, 255, .65); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding-bottom: 0; }
  .playfield { min-height: 0; height: min(76svh, 660px); border-radius: 22px; }
  .playfield canvas:focus-visible { border-radius: 22px; }
  .hero-keys { display: none; }
  .shelf-grid { grid-template-columns: minmax(0, 1fr); }
  .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .rules-intro { position: static; }
}
@media (max-width: 720px) {
  .nav-links li:not(:first-child):not(:last-child) { display: none; }
  .nav-links { gap: 0 18px; font-size: 15px; }
  .brand-name { font-size: 17px; }
  .playtest-inner { grid-template-columns: minmax(0, 1fr); }
  .playtest-mark { display: none; }
  .hud-num { font-size: 44px; }
}
@media (max-width: 440px) {
  .brand-name { display: none; }
  .brand-sticker { transform: rotate(-5deg); }
  .hero-actions .btn { flex: 1 1 auto; }
  .panel-attract { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn, .toast { transition: none; }
}
