/* ==========================================================================
   NewPlay Studio — design system
   Hand-written; replaces the generated Webflow stylesheet the site started as.
   Order: tokens, reset, primitives, layout, components, page blocks, motion.
   ========================================================================== */

/* --------------------------------------------------------------- 1. tokens */
:root {
  /* Surfaces. Warm-tinted blacks rather than neutral grey, so the artwork
     (all of it warm) sits on the page instead of on top of it. */
  --ink: #0a0908;
  --surface: #141210;
  --surface-2: #1d1a17;
  --surface-3: #262119;
  --line: #2e2823;
  --line-strong: #453c33;

  /* Brand. The orange is taken from the NewPlay logo and stays the one accent. */
  --flame: #e95201;
  --ember: #ff7c3c;
  --flame-dim: rgba(233, 82, 1, 0.12);

  /* Per-title accents, so each game reads as its own thing. */
  --coffee: #e08a3c;
  --spirit: #5a92f7;
  --sengoku: #d64550;

  --text: #f6f3ef;
  --text-muted: #aca49c;
  --text-dim: #7c736b;

  --font: "Afacad Flux", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale — fluid, so headings stay proportionate without breakpoints. */
  --step-display: clamp(3.2rem, 11vw, 8.5rem);
  --step-1: clamp(2.4rem, 5.5vw, 4.2rem);
  --step-2: clamp(1.8rem, 3.2vw, 2.6rem);
  --step-3: clamp(1.3rem, 1.8vw, 1.6rem);
  --step-body: clamp(1.02rem, 0.45vw + 0.92rem, 1.18rem);
  --step-small: 0.9rem;
  --step-micro: 0.75rem;

  --maxw: 1180px;
  --gutter: 1.25rem;
  --radius: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 4.5rem;
}

@media (min-width: 768px) {
  :root { --gutter: 2rem; }
}

/* ---------------------------------------------------------------- 2. reset */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

/* Skip link — the nav is the first thing in the tab order on every page. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--flame);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ----------------------------------------------------------- 3. primitives */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 760px; }

.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

/* Small tracked-out label above a heading. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  color: var(--flame);
  font-size: var(--step-micro);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.h-display { font-size: var(--step-display); letter-spacing: -0.045em; line-height: 0.88; }
.h1 { font-size: var(--step-1); }
.h2 { font-size: var(--step-2); }
.h3 { font-size: var(--step-3); letter-spacing: -0.01em; }

.lede { color: var(--text-muted); font-size: clamp(1.1rem, 1.3vw, 1.35rem); line-height: 1.55; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--flame); color: #fff; }
.btn--primary:hover { background: var(--ember); }

.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--flame); color: var(--ember); }

.btn__arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Status chip, e.g. "In development" */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.6);
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-size: var(--step-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--flame));
}

.chip--live::before { animation: pulse 2s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* --------------------------------------------------------------- 4. header */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

/* Solid only once the page has scrolled, so the hero art stays uninterrupted. */
.header.is-stuck {
  background: rgba(10, 9, 8, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header__logo img { height: 2.1rem; width: auto; }

.nav { display: flex; align-items: center; gap: 2rem; }

.nav__link {
  position: relative;
  color: var(--text-muted);
  font-size: var(--step-small);
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text); }

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4rem;
  height: 2px;
  background: var(--flame);
  border-radius: 2px;
}

/* Hamburger — only shown on small screens. */
.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

/* Sized in px so the close state lines up exactly: with 2px bars and 4px
   margins the bar centres sit 6px apart, which is the translate below. */
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .nav {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: rgba(10, 9, 8, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    /* Collapsed by default; .is-open is set by app.js. */
    display: none;
  }

  .nav.is-open { display: flex; }

  .nav__link {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.1rem;
  }

  .nav__link[aria-current="page"]::after { display: none; }

  .nav .btn { margin-top: 1.25rem; justify-content: center; }
}

/* ----------------------------------------------------------------- 5. hero */
.hero {
  position: relative;
  min-height: min(100svh, 860px);
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero__media { position: absolute; inset: 0; z-index: 0; }

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

/* Two scrims: one lifts the text off the art, one blends art into the page. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(10, 9, 8, 0.45) 45%, rgba(10, 9, 8, 0.72) 100%),
    radial-gradient(70% 55% at 22% 78%, rgba(10, 9, 8, 0.88), transparent 70%);
}

.hero__inner { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(3rem, 7vw, 6rem); }

.hero__title { max-width: 14ch; }
.hero__title em { font-style: normal; color: var(--flame); }

.hero__lede { max-width: 54ch; margin-top: 1.75rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.25rem; }

/* Marker row under the hero: what the studio is, in three words. */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: var(--step-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- 6. games */
.games { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }

/* Each title is a wide feature block, alternating sides on desktop. */
.game {
  position: relative;
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface) 0%, var(--ink) 65%);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.game:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

@media (min-width: 900px) {
  .game { grid-template-columns: 1.05fr 0.95fr; }
  .game:nth-child(even) .game__media { order: 2; }
}

.game__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}

.game__media img {
  width: 100%;
  height: 100%;
  /* The key art is letterboxed in the source files; cover crops the black bars. */
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.game:hover .game__media img { transform: scale(1.04); }

/* Accent wash so each title carries its own colour. */
.game__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 30%, transparent), transparent 55%);
  pointer-events: none;
}

.game__chip { position: absolute; top: 0.9rem; left: 0.9rem; z-index: 1; }

.game__body { padding: clamp(0.5rem, 1.5vw, 1.5rem); }

.game__title { margin-bottom: 0.5rem; }

.game__genre {
  color: var(--accent);
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game__text { margin-top: 1rem; color: var(--text-muted); }

.game__specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.game__spec dt {
  color: var(--text-dim);
  font-size: var(--step-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game__spec dd { margin: 0.3rem 0 0; font-size: var(--step-small); }

.game__link { display: inline-flex; margin-top: 1.75rem; }

/* ------------------------------------------------------------- 7. stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat { padding: 1.75rem 1.5rem; background: var(--surface); }

.stat__num {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--flame);
}

.stat__label {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: var(--step-small);
}

/* ----------------------------------------------------------- 8. card grids */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.card__num {
  display: block;
  margin-bottom: 1rem;
  color: var(--flame);
  font-size: var(--step-micro);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.card__title { margin-bottom: 0.65rem; }
.card__text { color: var(--text-muted); font-size: var(--step-small); line-height: 1.65; }

/* ----------------------------------------------------------------- 9. team */
.team { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

.member {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.member:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.member__photo { aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-2); }

.member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.45s var(--ease), transform 0.6s var(--ease);
}

.member:hover .member__photo img { filter: none; transform: scale(1.03); }

.member__body { padding: 1.35rem; }
.member__name { font-size: 1.15rem; }
.member__role { margin-top: 0.3rem; color: var(--flame); font-size: var(--step-small); font-weight: 500; }
.member__bio { margin-top: 0.85rem; color: var(--text-muted); font-size: var(--step-small); line-height: 1.6; }

/* -------------------------------------------------------------- 10. marquee */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }

.marquee__track { display: flex; width: max-content; animation: slide 34s linear infinite; }

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__group { display: flex; align-items: center; gap: clamp(2.5rem, 6vw, 5rem); padding-right: clamp(2.5rem, 6vw, 5rem); }

.marquee img {
  height: clamp(1.5rem, 2.4vw, 2rem);
  width: auto;
  /* Source logos are black artwork; invert them for the dark page. */
  filter: invert(1);
  opacity: 0.5;
  transition: opacity 0.3s var(--ease);
}

.marquee img:hover { opacity: 0.95; }

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ------------------------------------------------------------ 11. CTA band */
.cta {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 120% at 50% 100%, var(--flame-dim), transparent 70%),
    var(--surface);
  text-align: center;
}

.cta__title { max-width: 18ch; margin-inline: auto; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem; margin-top: 2rem; }

/* -------------------------------------------------------------- 12. footer */
.footer { padding-block: 3rem 2.5rem; }

.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.footer__brand img { height: 2.1rem; width: auto; margin-bottom: 0.9rem; }
.footer__blurb { max-width: 30ch; color: var(--text-dim); font-size: var(--step-small); }

.footer__cols { display: flex; flex-wrap: wrap; gap: 3rem; }
.footer__heading { margin-bottom: 0.9rem; color: var(--text-dim); font-size: var(--step-micro); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.footer__list li + li { margin-top: 0.55rem; }
.footer__list a { color: var(--text-muted); font-size: var(--step-small); transition: color 0.2s var(--ease); }
.footer__list a:hover { color: var(--ember); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  color: var(--text-dim);
  font-size: var(--step-small);
}

/* ------------------------------------------------------- 13. page: project */
.page-head { padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 6rem)); }

.project-hero {
  position: relative;
  margin-top: 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--surface-2);
}

.project-hero img { width: 100%; height: 100%; object-fit: cover; }

.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.shot img { width: 100%; height: auto; }

.shot__cap { padding: 0.85rem 1.1rem; color: var(--text-dim); font-size: var(--step-small); border-top: 1px solid var(--line); }

/* --------------------------------------------------------- 14. page: legal */
.legal { max-width: 44rem; margin-inline: auto; }
.legal h1 { margin: 0 0 0.75rem; font-size: var(--step-1); }
.legal h2 { margin: 3rem 0 0.85rem; font-size: 1.45rem; }
.legal h3 { margin: 2rem 0 0.5rem; color: var(--flame); font-size: 1.12rem; }
.legal p, .legal li { color: var(--text-muted); }
.legal p { margin: 0 0 1rem; }
.legal ul { margin: 0 0 1.25rem; padding-left: 1.25rem; list-style: disc; }
.legal li { margin-bottom: 0.4rem; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--ember); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 4.5rem 0; }
.legal h1[id], .legal h2[id] { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }

.legal-table-wrap { overflow-x: auto; margin: 1.25rem 0; }
.legal table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; line-height: 1.5; }
.legal th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.legal td { color: var(--text-muted); }

/* ----------------------------------------------------------- 15. page: 404 */
.error {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--nav-h) var(--gutter) 4rem;
}

.error__code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--flame);
}

/* ---------------------------------------------------------- 16. grain + fx */
/* A faint film grain keeps large flat areas from banding. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("../img/noise.webp");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ----------------------------------------------------------- 17. motion */
/* Elements marked data-reveal fade up once, driven by app.js. */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}
