/* ==========================================================================
   No Work All Play — standalone game page (no navbar/footer, own stylesheet)
   ========================================================================== */

@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/AlbertSans-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/AlbertSans-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/AlbertSans-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/AlbertSans-ExtraBold.ttf') format('truetype');
}

:root {
  --nwap-yellow: #FFD300;
  --nwap-dark: #101010;
  /* switched by noworkallplay.js, per region, for best contrast with the background */
  --nwap-fg: var(--nwap-yellow);
  --nwap-about: var(--nwap-yellow);
  --nwap-score: var(--nwap-yellow);
  /* 20px at 1920 — same edge margin as the brick grid in the design */
  --nwap-edge: clamp(0.75rem, 1.0417vw, 1.25rem);
  --nwap-color-swap: 0.8s ease;
}

body[data-fg="dark"] { --nwap-fg: var(--nwap-dark); }
body[data-about="dark"] { --nwap-about: var(--nwap-dark); }
body[data-score="dark"] { --nwap-score: var(--nwap-dark); }

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

html, body { margin: 0; height: 100%; }

body.nwap {
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--nwap-dark);
  color: var(--nwap-fg);
  font-family: 'Albert Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Background mix (photos + videos, crossfading) ---------- */
.nwap-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.nwap-bg__item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.nwap-bg__item.is-active { opacity: 1; }

/* Ken Burns on photos — origin, zoom direction and duration are set per photo by JS */
img.nwap-bg__item {
  transform-origin: var(--kb-origin, 50% 50%);
  will-change: transform;
}
img.nwap-bg__item.is-kenburns {
  animation: nwap-kenburns var(--kb-duration, 7.2s) linear both;
}
img.nwap-bg__item.is-kenburns-loop {
  animation: nwap-kenburns var(--kb-duration, 20s) ease-in-out infinite alternate both;
}
@keyframes nwap-kenburns {
  from { transform: scale(var(--kb-from, 1)); }
  to { transform: scale(var(--kb-to, 1.12)); }
}

/* ---------- ABOUT + score (same type, mirrored in the bottom corners) ---------- */
.nwap-about,
.nwap-score {
  position: fixed;
  bottom: var(--nwap-edge);
  margin: 0;
  font-size: clamp(3rem, 6.5625vw, 7.875rem); /* 126px at 1920; the 48px floor keeps a 5-digit score clear of ABOUT on a 375px phone */
  font-weight: 800;
  line-height: 0.74; /* glyph bottom sits on the edge margin, like the design */
  letter-spacing: 0.01em;
  transition: color var(--nwap-color-swap);
}

.nwap-about {
  left: var(--nwap-edge);
  z-index: 5; /* above the game and the yellow panel — it opens and closes the panel */
  color: var(--nwap-about);
}

.nwap-score {
  right: var(--nwap-edge);
  z-index: 3; /* above the game, under the yellow panel */
  text-align: right;
  font-variant-numeric: tabular-nums; /* digits don't jiggle while counting up */
  color: var(--nwap-score);
  pointer-events: none;
}

/* combo multiplier — small "×3" sitting on top of the score, only shown from ×2 */
/* small line on top of the score: session high score + lives left */
.nwap-score__meta {
  display: block;
  min-height: 1em; /* keeps the digits in place whether the line is empty or not */
  font-size: 0.34em;
  line-height: 1;
  letter-spacing: 0.02em;
  /* the digits below overflow their tight 0.74 line box upwards, so clear that first */
  margin-bottom: 0.9em;
}

.nwap-hi {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nwap-hi.is-on {
  opacity: 1;
  transform: none;
}

/* one small square per life, same shape as the ball */
.nwap-lives {
  display: inline-flex;
  gap: 0.3em;
  margin-left: 0.8em;
}
.nwap-lives i {
  display: block;
  width: 0.62em;
  height: 0.62em;
  background: currentColor;
}
/* an extra life (30s without a miss) pops in with a little overshoot */
.nwap-lives i.is-new {
  animation: nwap-life-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes nwap-life-in {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.nwap-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nwap-about__btn {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.nwap-about__btn:hover { opacity: 0.7; }
.nwap-about__btn:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 0.15em;
}

/* while the panel is open the title sits on yellow — switch fast so it never vanishes */
body.about-open .nwap-about {
  color: var(--nwap-dark);
  transition-duration: 0.2s;
}

/* ---------- ABOUT panel: yellow fill growing out of the bottom-left corner ---------- */
.nwap-about-panel {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: var(--nwap-yellow);
  clip-path: circle(0 at 0 100%);
  visibility: hidden;
  /* closing: keep visibility until the circle is gone (0.9s = CLOSE_MS in JS) */
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s linear 0.9s;
}
.nwap-about-panel.is-open {
  /* --nwap-reveal-r is the exact viewport diagonal (set by JS), so the circle ends
     right as it reaches the far corner and the whole ease-in-out stays visible;
     142vmax is a fallback that is always big enough */
  clip-path: circle(var(--nwap-reveal-r, 142vmax) at 0 100%);
  visibility: visible;
  transition: clip-path 1.2s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s;
}

.nwap-about-panel {
  color: var(--nwap-dark);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nwap-about-panel__inner {
  max-width: 100rem;
  /* left/top follow the 20px edge of the brick grid; the bottom keeps clear of
     the fixed ABOUT title (its font-size × 0.74 line box + room to breathe) */
  padding:
    max(var(--nwap-edge), 1rem)
    max(var(--nwap-edge), 1rem)
    calc(clamp(3rem, 6.5625vw, 7.875rem) * 0.74 + 4rem);
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nwap-about-panel.is-open .nwap-about-panel__inner {
  opacity: 1;
  transform: none;
  /* comes in while the yellow is rolling out */
  transition: opacity 0.6s ease 0.45s, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s;
}

.nwap-about-panel__body {
  max-width: 24em;
  margin: 0;
  font-size: clamp(1.75rem, 1rem + 2.6vw, 4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.nwap-about-panel__body strong { font-weight: 800; }
.nwap-about-panel__body u {
  text-decoration-line: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.12em;
}

.nwap-about-panel__cta,
.nwap-about-panel__links {
  font-size: clamp(1.125rem, 0.9rem + 0.7vw, 1.75rem);
  line-height: 1.35;
}

.nwap-about-panel__cta {
  margin: clamp(2rem, 4vw, 4.5rem) 0 0;
  font-weight: 400;
}
.nwap-about-panel__cta-label,
.nwap-about-panel__services { display: block; }
.nwap-about-panel__services { font-weight: 700; }

.nwap-about-panel__links {
  display: grid;
  gap: 0.2em;
  margin: 1.8em 0 0;
  padding: 0;
  list-style: none;
  font-weight: 400;
}

/* no underline at rest; on hover a line draws in from the left, and on leave it
   runs out to the right (anchored right while shrinking) instead of retracting */
.nwap-about-panel__links a {
  color: inherit;
  text-decoration: none;
  padding-bottom: 0.12em;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.nwap-about-panel__links a:hover,
.nwap-about-panel__links a:focus-visible {
  background-position: 0% 100%;
  background-size: 100% 1.5px;
}
.nwap-about-panel__links a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0.15em;
}

/* small credit in the bottom-right corner, on the same edge line as ABOUT; it sits
   in the panel, so it is revealed (and clipped) with the yellow */
.nwap-about-panel__credit {
  position: fixed;
  right: var(--nwap-edge);
  bottom: var(--nwap-edge); /* same edge line as the ABOUT glyphs */
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 1rem);
  font-weight: 600;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}
.nwap-about-panel__credit:hover,
.nwap-about-panel__credit:focus-visible { opacity: 1; }
.nwap-about-panel__credit:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0.2em;
}

/* ---------- Game layer ---------- */
.nwap-game {
  position: fixed;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

/* bricks + paddle use the Figma SVGs as a mask, so their shape stays exactly the
   design asset while the colour can follow the background contrast */
.nwap-brick,
.nwap-paddle {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background-color: var(--nwap-fg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  transition: background-color var(--nwap-color-swap);
}

.nwap-brick {
  -webkit-mask-image: url('../images/nwap-brick.svg');
  mask-image: url('../images/nwap-brick.svg');
  transition: background-color var(--nwap-color-swap), opacity 0.18s ease, transform 0.18s ease;
}
.nwap-brick.is-hit {
  opacity: 0;
  transform: scale(0.6);
}

/* intro: each brick pops in after its own delay (set inline by JS, reading order) */
.nwap-brick.is-entering {
  animation: nwap-brick-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
@keyframes nwap-brick-in {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

.nwap-paddle {
  -webkit-mask-image: url('../images/nwap-vaus.svg');
  mask-image: url('../images/nwap-vaus.svg');
  will-change: transform;
}

.nwap-ball {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background-color: var(--nwap-fg);
  transition: background-color var(--nwap-color-swap);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .nwap-brick.is-entering { animation: none; }
  img.nwap-bg__item.is-kenburns,
  img.nwap-bg__item.is-kenburns-loop { animation: none; }

  .nwap-bg__item,
  .nwap-about-panel,
  .nwap-about-panel.is-open,
  .nwap-about-panel__inner,
  .nwap-about-panel.is-open .nwap-about-panel__inner { transition-duration: 0.01s; transition-delay: 0s; }
}
