:root {
  --charcoal: #0F1113;
  --ivory: #F5F2EA;
  --amber: #E6A23C;
  /* Accessible amber for text on ivory only. #E6A23C is 1.96:1 on #F5F2EA;
     this is 5.24:1. Never use it on charcoal — the emblem and every dark
     section keep the approved --amber. */
  --amber-on-light: #8C5A0E;
  --muted-light: #60615D;
  --muted-dark: #B9B6AE;
  --line-light: rgba(15, 17, 19, .16);
  --line-dark: rgba(245, 242, 234, .16);
  --shell: 1240px;
  --pad: clamp(20px, 4vw, 56px);
  /* Landscape on a notched phone puts the notch on one side; the page uses
     viewport-fit=cover, so the shell has to step in from whichever inset is
     larger. Resolves to 0px everywhere else, including every desktop width. */
  --safe-x: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ivory); }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--charcoal);
  background: var(--ivory);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
/* height:auto lets the width/height attributes drive the aspect ratio
   (they are there to reserve layout space) instead of fixing the box
   height. Rules that set an explicit height win on specificity. */
img, svg { display: block; max-width: 100%; height: auto; }
::selection { color: var(--charcoal); background: var(--amber); }

/* Multi-part lines (studio · city, address · KRS · NIP) wrap at their
   separators. A non-breaking space in the markup binds each "·" to the part
   before it, so a wrapped line ends with "·" instead of starting with one;
   .nb then keeps a registration number from splitting across the break.
   Deliberately applied to the short identifiers only — a long nowrap run
   would force horizontal scroll once text is scaled up. */
.nb { white-space: nowrap; }

/* Nothing here wraps oddly at normal sizes, but at large text-zoom settings
   a single long word can outgrow a 320px column; breaking it beats a
   horizontal scrollbar. Inert whenever the word already fits. */
h1, h2, h3, p, .eyebrow, .section-label, .email-link, .footer-legal {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--amber-on-light);
  outline-offset: 4px;
  border-radius: 3px;
}
/* --amber-on-light clears 3:1 against every background this page actually
   shows a focus ring on, including the skip link's own charcoal fill (3.23:1)
   — so only the two genuinely charcoal contexts below need the brighter
   --amber; forcing it everywhere would fail the far more common ivory case
   (1.96:1), which is the bug this rule exists to fix. */
.header.on-dark :focus-visible,
.mission :focus-visible {
  outline-color: var(--amber);
}

.shell {
  width: min(var(--shell), calc(100% - ((var(--pad) + var(--safe-x)) * 2)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -64px;
  left: 16px;
  padding: 10px 14px;
  color: var(--ivory);
  background: var(--charcoal);
}
.skip-link:focus { top: 16px; }

.header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  /* 0px in normal Safari browsing; keeps the bar clear of the status area
     if the page is ever opened from the home screen. */
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--charcoal);
  background: var(--ivory);
  border-bottom: 1px solid var(--line-light);
}
.header.on-dark {
  color: var(--ivory);
  background: var(--charcoal);
  border-color: var(--line-dark);
}
.header.on-dark .nav-contact {
  color: var(--ivory);
  border-color: var(--ivory);
}
.header.on-dark .nav-contact::after,
.header.on-dark .nav-contact:hover { color: var(--amber); }

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  width: auto;
  height: 48px;
  object-fit: contain;
}
.nav-logo--light { display: none; }
.header.on-dark .nav-logo--dark { display: none; }
.header.on-dark .nav-logo--light { display: block; }
/* The two approved lockups carry different canvas padding: artwork fills
   0.839 of the charcoal canvas height and 0.877 of the ivory one. Scaling
   the ivory variant by 0.839/0.877 makes the mark render at the same
   optical size through the header transition. Artwork is not modified. */
.nav-logo--light { height: 46px; }

.nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0 7px;
  border-bottom: 1px solid currentColor;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-contact::after { content: "↗"; color: var(--amber-on-light); }
.nav-contact:hover { color: var(--amber-on-light); }

.hero {
  display: flex;
  align-items: center;
  padding: clamp(126px, 13vw, 164px) 0 clamp(76px, 8vw, 104px);
  color: var(--charcoal);
  background: var(--ivory);
  border-bottom: 1px solid var(--line-light);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr);
  gap: clamp(34px, 5vw, 66px);
  align-items: center;
}

.hero-copy { max-width: 760px; }

.eyebrow {
  margin-bottom: 22px;
  color: var(--amber-on-light);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 30px;
  font-size: clamp(3.6rem, 7.2vw, 7.1rem);
  line-height: .93;
  letter-spacing: -.058em;
  font-weight: 720;
  text-wrap: balance;
}
h1 .accent { color: var(--amber-on-light); }

.hero-copy p {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted-light);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.65;
}

.hero-symbol {
  display: grid;
  justify-items: center;
  align-self: center;
}
.hero-symbol img {
  width: clamp(132px, 14vw, 194px);
}

.mission {
  padding: clamp(96px, 11vw, 150px) 0;
  color: var(--ivory);
  background: var(--charcoal);
}

.games {
  padding: clamp(82px, 10vw, 128px) 0;
  background: var(--ivory);
}
.games-intro { max-width: 720px; margin-bottom: clamp(34px, 5vw, 56px); }
.games h2 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.05em;
}
.games-intro p { margin: 0; color: var(--muted-light); font-size: 1.08rem; line-height: 1.6; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.game-card {
  min-height: 506px;
  overflow: hidden;
  display: grid;
  grid-template-rows: clamp(246px, 27vw, 332px) auto;
  color: var(--ivory);
  border-radius: 14px;
  border: 1px solid rgba(245, 242, 234, .15);
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}
.game-card:focus { outline: none; }
.game-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.game-card--starby { background: #110a1d; }
.game-card--kolo { background: #0b0614; }
.game-card__art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.game-card__art::before {
  position: absolute;
  inset: 0;
  content: "";
  z-index: -1;
  opacity: .74;
  transition: opacity .24s ease;
}
.game-card__art::after {
  position: absolute;
  inset: 0;
  content: "";
  z-index: -1;
  pointer-events: none;
}
.game-card__art--starby {
  background:
    radial-gradient(ellipse 70% 96% at 50% 58%, rgba(120, 61, 199, .43), transparent 66%),
    radial-gradient(ellipse 46% 68% at 83% 7%, rgba(177, 115, 255, .28), transparent 72%),
    linear-gradient(135deg, #090612 0%, #170a2a 54%, #090512 100%);
}
.game-card__art--starby::before {
  background: radial-gradient(ellipse 45% 58% at 50% 52%, rgba(193, 119, 255, .42), transparent 72%);
}
.game-card__art--starby::after {
  opacity: .34;
  background:
    radial-gradient(circle at 14% 25%, rgba(237, 224, 255, .72) 0 1px, transparent 1.6px),
    radial-gradient(circle at 78% 21%, rgba(237, 224, 255, .5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 87% 68%, rgba(237, 224, 255, .4) 0 1px, transparent 1.6px),
    radial-gradient(circle at 24% 77%, rgba(237, 224, 255, .35) 0 1px, transparent 1.6px);
}
.game-card__art--kolo {
  background:
    radial-gradient(ellipse 60% 88% at 76% 48%, rgba(31, 205, 235, .19), transparent 70%),
    radial-gradient(ellipse 58% 80% at 25% 72%, rgba(255, 117, 72, .22), transparent 71%),
    radial-gradient(ellipse 72% 96% at 50% 52%, rgba(129, 50, 155, .5), transparent 68%),
    linear-gradient(135deg, #0b0617 0%, #25102d 54%, #0b0617 100%);
}
.game-card__art--kolo::before {
  background:
    radial-gradient(ellipse 44% 62% at 68% 50%, rgba(35, 211, 239, .29), transparent 72%),
    radial-gradient(ellipse 40% 58% at 34% 66%, rgba(255, 139, 76, .25), transparent 73%);
}
.game-card__art--kolo::after {
  opacity: .44;
  background: radial-gradient(ellipse 52% 76% at 50% 52%, rgba(9, 5, 23, .56), transparent 74%);
}
.game-card__icon {
  position: relative;
  z-index: 1;
  width: min(46%, 248px);
  aspect-ratio: 1;
  border-radius: 24%;
  box-shadow: 0 24px 42px rgba(0, 0, 0, .44), 0 0 34px rgba(193, 119, 255, .2);
  transform: scale(1);
  transition: transform .24s ease;
}
.game-card__art--starby .game-card__icon {
  box-shadow: 0 24px 42px rgba(0, 0, 0, .46), 0 0 38px rgba(170, 93, 255, .27);
}
.game-card__art--kolo .game-card__icon {
  box-shadow: 0 24px 42px rgba(0, 0, 0, .46), 14px 0 34px rgba(35, 211, 239, .14), -14px 8px 34px rgba(255, 126, 73, .14);
}
.game-card__copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(25px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0));
}
.game-card__eyebrow { color: inherit; opacity: .72; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.game-card strong { font-size: clamp(2rem, 3.4vw, 3.35rem); line-height: .96; letter-spacing: -.055em; }
.game-card__description { max-width: 36ch; color: rgba(245,242,234,.78); font-size: .98rem; line-height: 1.55; }
.game-card__cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 10px; color: var(--amber); font-size: .86rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.game-card__cta b { display: inline-block; font-size: 1.2rem; font-weight: 500; transition: transform .24s ease; }

@media (hover: hover) and (pointer: fine) {
  .game-card:hover {
    border-color: rgba(245, 242, 234, .36);
    box-shadow: 0 12px 28px rgba(15, 17, 19, .13);
    transform: translateY(-2px);
  }
  .game-card:hover .game-card__art::before { opacity: 1; }
  .game-card:hover .game-card__icon { transform: scale(1.025); }
  .game-card:hover .game-card__cta b { transform: translateX(5px); }
}

.mission-intro {
  display: grid;
  grid-template-columns: minmax(100px, .28fr) minmax(0, 1.72fr);
  gap: clamp(42px, 7vw, 96px);
  align-items: start;
  margin-bottom: clamp(64px, 8vw, 104px);
}

.mission-mark { width: clamp(86px, 10vw, 142px); }

/* Base is the dark mission section; the contact section sits on ivory. */
.section-label {
  margin-bottom: 20px;
  color: var(--amber);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.contact .section-label { color: var(--amber-on-light); }

.mission h2 {
  max-width: 920px;
  margin-bottom: 24px;
  font-size: clamp(2.75rem, 5.6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.046em;
  font-weight: 700;
  text-wrap: balance;
}

.mission-intro p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted-dark);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.65;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.principle {
  min-height: 255px;
  padding: 34px clamp(22px, 3vw, 42px) 38px;
  border-right: 1px solid var(--line-dark);
}
.principle:first-child { padding-left: 0; }
.principle:last-child {
  padding-right: 0;
  border-right: 0;
}

.principle-number {
  display: block;
  margin-bottom: 38px;
  color: var(--amber);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .14em;
}

.principle h3 {
  max-width: 290px;
  margin-bottom: 18px;
  font-size: clamp(1.65rem, 2.5vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 680;
}

.principle p {
  max-width: 330px;
  margin-bottom: 0;
  color: var(--muted-dark);
  font-size: .96rem;
  line-height: 1.6;
}

.contact {
  padding: clamp(70px, 7.5vw, 96px) 0 38px;
  color: var(--charcoal);
  background: var(--ivory);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: end;
}

.contact h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(3rem, 6.4vw, 6.2rem);
  line-height: .94;
  letter-spacing: -.052em;
  font-weight: 710;
  text-wrap: balance;
}

.contact-aside {
  padding-top: 24px;
  border-top: 1px solid var(--charcoal);
}

.contact-aside p {
  margin-bottom: 18px;
  color: var(--muted-light);
  line-height: 1.6;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--charcoal);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  font-weight: 700;
  transition: color .2s ease, border-color .2s ease;
}
.email-link::after { content: "↗"; color: var(--amber-on-light); }
.email-link:hover {
  color: var(--amber-on-light);
  border-color: var(--amber-on-light);
}

.footer {
  margin-top: clamp(72px, 8vw, 98px);
  padding-top: 24px;
  border-top: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 36px;
  align-items: end;
  color: var(--muted-light);
  font-size: .76rem;
  line-height: 1.7;
}

.footer-logo {
  width: auto;
  height: 58px;
  object-fit: contain;
}
.footer-legal { text-align: right; }

.footer-link {
  display: inline-block;
  margin-top: 4px;
  /* keeps the target at least 24px tall (WCAG 2.2 SC 2.5.8) */
  padding: 3px 0;
  border-bottom: 1px solid var(--line-light);
}
.footer-link:hover {
  color: var(--amber-on-light);
  border-color: var(--amber-on-light);
}

/* --- Mobile vertical rhythm -------------------------------------------
   Everything below 861px stacks into one column, so the desktop side-by-side
   spacing turns into stacked spacing and the page grows far taller than it
   needs to. These two blocks re-tune that rhythm only; nothing here applies
   at 861px and up, so the desktop composition is untouched. Bounded clamp()
   is used in preference to per-device rules. */
@media (max-width: 860px) {
  .hero {
    padding-top: calc(clamp(94px, 12vw, 116px) + env(safe-area-inset-top, 0px));
    padding-bottom: clamp(46px, 6vw, 64px);
  }
  /* minmax(0, 1fr) rather than 1fr: a bare 1fr track takes its minimum from
     the item's min-content, so one long word at a large text-zoom setting
     widens the track past the viewport and the whole page scrolls
     sideways. Identical at normal text sizes, where nothing exceeds it. */
  .hero-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-grid { gap: clamp(20px, 3.4vw, 30px); }

  .eyebrow { margin-bottom: clamp(16px, 2vw, 22px); }

  .hero-symbol {
    justify-items: start;
    margin-top: 0;
  }
  .hero-symbol img { width: clamp(112px, 16vw, 138px); }

  .mission {
    padding-top: clamp(60px, 8vw, 104px);
    padding-bottom: clamp(64px, 8vw, 104px);
  }
  .mission-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 2.4vw, 26px);
    margin-bottom: clamp(42px, 6vw, 72px);
  }
  .mission-mark { width: clamp(68px, 9vw, 88px); }

  .principles {
    grid-template-columns: minmax(0, 1fr);
  }
  .principle {
    min-height: 0;
    padding: clamp(24px, 3.2vw, 32px) 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }
  .principle:last-child { border-bottom: 0; }
  .principle-number { margin-bottom: clamp(12px, 1.6vw, 18px); }
  .principle h3 { margin-bottom: 12px; }

  .contact {
    padding-top: clamp(56px, 7vw, 96px);
    /* Safari's collapsed toolbar floats over the bottom of the viewport;
       the inset keeps the footer clear of it. 0px where there is no inset. */
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  }
  .contact-grid { gap: clamp(30px, 5vw, 48px); }
  .contact-aside { padding-top: 18px; }
  .contact-aside p { margin-bottom: 16px; }

  .footer {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    margin-top: clamp(44px, 6vw, 72px);
    gap: 20px;
  }
  .footer-legal { text-align: left; }
}

@media (max-width: 520px) {
  :root { --pad: 20px; }

  .nav { min-height: 64px; }
  .nav-logo { height: 40px; }
  /* Same 0.839/0.877 optical correction as the desktop pair — see above. */
  .nav-logo--light { height: 38px; }
  .nav-contact span { display: none; }
  .nav-contact::before { content: "Contact"; }

  .hero {
    padding-top: calc(90px + env(safe-area-inset-top, 0px));
    padding-bottom: clamp(38px, 11vw, 50px);
  }
  .hero-grid { gap: clamp(16px, 5vw, 24px); }
  .hero-symbol img { width: clamp(110px, 33vw, 132px); }

  /* Tracking only — the type size stays at .7rem. At .18em the eyebrow needs
     296px and wraps at 320px wide; at .1em it needs 268px against the 280px
     available, so it holds one line across the whole mobile range. The .nb
     spans are the fallback: any wrap lands after "studio ·", never inside a
     word or at the head of a line. */
  .eyebrow {
    margin-bottom: 16px;
    letter-spacing: .1em;
  }
  h1 {
    margin-bottom: 26px;
    font-size: clamp(3.25rem, 15vw, 4.4rem);
  }
  .section-label { margin-bottom: 14px; }

  .mission {
    padding-top: 54px;
    padding-bottom: 60px;
  }
  .mission-intro {
    gap: 16px;
    margin-bottom: 40px;
  }
  .mission-mark { width: 74px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .game-card { min-height: 452px; grid-template-rows: 228px auto; }
  .game-card__icon { width: min(44%, 184px); }
  .mission h2 {
    margin-bottom: 18px;
    font-size: clamp(2.4rem, 11.7vw, 2.85rem);
  }

  .principle { padding: 24px 0; }
  .principle-number { margin-bottom: 12px; }

  .contact { padding-top: 52px; }
  .contact h2 { font-size: clamp(2.75rem, 12.8vw, 3.2rem); }

  .footer {
    margin-top: 44px;
    font-size: .75rem;
  }
  .footer-logo { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .game-card,
  .game-card__art::before,
  .game-card__icon,
  .game-card__cta b { transition: none; }
}
