:root {
  --pink: #ff9ed2;
  --pink-deep: #ff4fa3;
  --lilac: #d8c9ff;
  --sky: #c3e7ff;
  --gray-text: #8a8a8a;
  --window-bg: #ffffff;
  --window-border: rgba(0, 0, 0, 0.08);
  --dot-red: #ff5f57;
  --dot-yellow: #febc2e;
  --dot-green: #28c840;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #1a1a1a;
  min-height: 100%;
}

button { font-family: inherit; }

/* ---------- desktop / landing (vertically centered composition) ---------- */
.desktop {
  max-width: 1160px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.banner {
  position: relative;
  width: 100%;
  aspect-ratio: 1154 / 316;
  border-radius: clamp(18px, 2.6vw, 30px);
  overflow: hidden;
  /* fallback while WebGL warms up (or if it's unavailable) */
  background: linear-gradient(120deg, #ffe3f1, #e6ddff 45%, #d8f0ff 75%, #ffe3f1);
}

/* ---------- arrival transition (pure CSS, runs on every load) ---------- */
@keyframes arrive {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
/* `backwards` keeps things invisible during their delay, then releases the
   element back to normal styling once done (so hover effects still work) */
.banner { animation: arrive 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0s backwards; }
.icons .icon-btn:nth-child(1) { animation: arrive 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards; }
.icons .icon-btn:nth-child(2) { animation: arrive 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.19s backwards; }
.icons .icon-btn:nth-child(3) { animation: arrive 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.26s backwards; }
.tagline { animation: arrive 0.4s ease 0.34s backwards; }
.banner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.icons {
  display: flex;
  align-items: center; /* folder + orb share a center line */
  justify-content: center;
  gap: clamp(48px, 8vw, 96px);
  margin-top: clamp(36px, 6vh, 72px);
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  text-decoration: none; /* the store icon is a link */
  transition: transform 0.2s ease;
}
.icon-btn:hover { transform: translateY(-3px); }
.icon-btn:active { transform: translateY(0) scale(0.96); }
.icon-btn:focus { outline: none; }
.icon-btn:focus-visible { outline: none; } /* per design: no ring around the desktop icons */

/* pixel-art icons: each width is tuned so its rendered height matches the
   old icon it replaced, keeping the row balanced on its shared center line */
.icon-img {
  height: auto;
  image-rendering: pixelated;
}
.icon-img-folder {
  width: clamp(75px, 9.4vw, 116px);
  filter: drop-shadow(0 12px 20px rgba(47, 141, 224, 0.28));
}
.icon-img-orb {
  width: clamp(73px, 8.8vw, 106px);
  filter: drop-shadow(0 12px 24px rgba(160, 170, 216, 0.45));
}
.icon-img-games {
  width: clamp(86px, 10.8vw, 133px);
  filter: drop-shadow(0 12px 20px rgba(150, 110, 230, 0.3));
}
.icon-img-store {
  width: clamp(62px, 7.4vw, 91px);
  filter: drop-shadow(0 12px 20px rgba(247, 106, 178, 0.35));
}

.icon-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b6b6b;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.icon-btn:hover .icon-label,
.icon-btn:focus-visible .icon-label { opacity: 1; }

.tagline {
  margin: clamp(32px, 5vh, 56px) 0 0;
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--gray-text);
  text-align: center;
}

/* ---------- click-catcher (invisible — no dimming) + windows ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 40;
}

.window {
  position: fixed;
  top: 50%;
  /* vertical centering: translateY(-50%). When GSAP is active it re-creates
     this same offset via yPercent so its animations never fight it. */
  transform: translateY(-50%);
  left: 50%;
  /* centered via margin (not transform) so GSAP can own the transform */
  margin-left: calc(min(1100px, 92vw) / -2);
  width: min(1100px, 92vw);
  /* auto-fit content so there's never a dead white strip below the tiles;
     body scrolls once the cap is hit */
  height: auto;
  max-height: min(84vh, 800px);
  background: var(--window-bg);
  border: 1px solid var(--window-border);
  border-radius: 16px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}
.window[hidden] { display: none; }

/* the moodboard window runs bigger than the info window */
#win-inspo {
  width: min(1280px, 96vw);
  margin-left: calc(min(1280px, 96vw) / -2);
  max-height: min(90vh, 900px);
}

/* CSS fallback animation — used only when GSAP fails to load */
.window.css-anim {
  opacity: 0;
  transform: translateY(-50%) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.window.css-anim.is-open { opacity: 1; transform: translateY(-50%) scale(1); }

.win-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #efefef;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}
.traffic { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
}
.dot.red { background: var(--dot-red); cursor: pointer; }
.dot.yellow { background: var(--dot-yellow); }
.dot.green { background: var(--dot-green); }
.win-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #444;
}
/* both titlebars share the same light gray divider */

.win-body {
  flex: 1;
  min-height: 0;
  padding: 26px 30px 34px;
  overflow-y: auto;
  overflow-x: hidden;
}
/* while a game is on screen the window is locked — no scrolling around */
.games-body.game-locked { overflow: hidden; }
/* info window (Connect / Kits / Est.) keeps three side-by-side columns */
.info-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
/* moodboard: one header strip on top, one shared masonry grid below */
.inspo-heads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 20px;
}
.inspo-body .masonry {
  column-count: 3;
  column-gap: 14px;
}
.win-col { min-width: 0; }
.col-head {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}
.col-head-plain { font-size: 24px; }
.col-sub { display: block; font-weight: 400; font-size: 13px; color: var(--gray-text); margin-top: 2px; }
.redacted { letter-spacing: 0.02em; }

/* ---------- inspiration masonry ---------- */
.masonry {
  column-gap: 14px;
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 14px;
  border-radius: 6px;
  break-inside: avoid;
  overflow: hidden;
}
/* images keep their natural aspect ratio — true masonry like the OG site */
.tile img {
  display: block;
  width: 100%;
  height: auto;
}
.tile img[data-broken] { display: none; }
/* a tile whose image hasn't been added yet shows a soft square placeholder */
.tile.tile-empty {
  aspect-ratio: 1 / 1;
  background: linear-gradient(150deg, #ffe3f1, #e6ddff 50%, #d8f0ff);
}

/* ---------- connect/kits list ---------- */
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.link-list a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14.5px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-list a:hover { color: var(--pink-deep); border-color: var(--pink-deep); }

/* ---------- games window ---------- */
.games-svg {
  width: clamp(84px, 10.4vw, 126px);
  filter: drop-shadow(0 12px 20px rgba(169, 143, 237, 0.4));
}
.games-body { display: flex; flex-direction: column; }
/* explicit display values would otherwise defeat the hidden attribute */
.games-menu[hidden], .game-playwrap[hidden], .game-ui[hidden], .game-stage[hidden] { display: none !important; }
.games-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-content: start;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: #fff;
  border: 1px solid #f0e6ee;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: #ffd0e6; box-shadow: 0 16px 36px rgba(255, 79, 163, 0.14); }
.game-card-soon { border-style: dashed; cursor: default; }
.game-card-soon:hover { transform: none; box-shadow: none; border-color: #f0e6ee; }
.game-card-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}
.game-card-art img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.2); }
.game-card-art img[data-broken] { display: none; }
.game-card-fallback,
.game-logo-fallback {
  font-weight: 800;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.02em;
  background: linear-gradient(92deg, #ff2f9c, #ff8ec8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.game-card-name { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #1a1a1a; text-align: center; }
.game-card-soon .game-card-name { color: #b48aa0; font-style: italic; text-transform: none; letter-spacing: 0.02em; }
.game-soon-spark {
  font-size: 44px;
  background: linear-gradient(135deg, #ff4fa3, #c86dd7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: soonPulse 2.4s ease-in-out infinite;
}
@keyframes soonPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ----- game stage ----- */
/* fixed height so the play screen and the game are the exact same window size */
.game-stage { position: relative; display: flex; flex-direction: column; height: clamp(480px, 64vh, 620px); }
.game-stage[hidden] { display: none; }

/* hyperp!nk game card + embedded stage */
.game-card-art-hyperpink img { transform: none; }
.hp-stage { padding-top: 34px; }
.hp-frame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 12px;
  background: #111111;
  display: block;
}
.game-back {
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #b48aa0;
  padding: 6px 8px;
}
.game-back:hover { color: #ff2f9c; }

.game-playwrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.game-play {
  border: none;
  cursor: pointer;
  background: #f26bbd;
  color: #ffffff;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(20px, 3vw, 34px);
  letter-spacing: 0.04em;
  padding: 0.6em 0.8em 0.5em;
  transition: transform 0.15s ease, background 0.15s ease;
}
.game-play:hover { transform: scale(1.05); background: #ff4fa3; }
.game-play:active { transform: scale(0.97); }

.game-ui {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-bottom: 44px; /* keep the sliders clear of the hyveout credit */
}
.game-ui[hidden] { display: none; }
.game-logo-float {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoBob 3.4s ease-in-out infinite;
}
.game-logo-float img {
  width: min(560px, 80vw);
  /* the source png is square with lots of padding — crop it visually */
  max-height: 280px;
  object-fit: contain;
  transform: scale(1.35);
}
.game-logo-float img[data-broken] { display: none; }
@keyframes logoBob { 0%, 100% { transform: translateY(-7px) rotate(-1.2deg); } 50% { transform: translateY(7px) rotate(1.2deg); } }

.game-swatches { display: flex; gap: 14px; }
.game-swatch {
  width: clamp(70px, 9vw, 104px);
  height: clamp(52px, 6.6vw, 76px);
  border-radius: 4px;
  border: 2px solid #1a1a1a;
}
.game-hint {
  margin: 0;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 11px;
  color: #f26bbd;
}
.game-sliders { display: flex; flex-direction: column; gap: 18px; width: min(340px, 68%); }

.game-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  border-radius: 4px;
  outline: none;
  border: 2px solid #1a1a1a;
}
.game-range-hue {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.game-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #ffffff;
  border: 2.5px solid #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.game-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #ffffff;
  border: 2.5px solid #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.game-win {
  position: absolute;
  inset: -26px -30px -34px; /* cover the window body padding too */
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.game-win.show { opacity: 1; }
.game-win[hidden] { display: none; }
.game-win-text {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(18px, 2.8vw, 32px);
  letter-spacing: 0.06em;
  color: #f26bbd;
  animation: winPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s backwards;
}
.game-credit {
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 10px;
  color: #c9c9c9;
  pointer-events: none;
  z-index: 6; /* stays visible above the white win overlay too */
}
@keyframes winPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  /* 2x2 grid with equal columns so stacked icons share a vertical axis
     (wrapped flex rows center independently and drift out of column) */
  .icons { display: grid; grid-template-columns: repeat(2, 1fr); justify-items: center; gap: 28px; }
  .games-menu { grid-template-columns: 1fr; }
  .info-body { grid-template-columns: 1fr; }
  .window { max-height: 90vh; }
  /* headers stack on small screens (like the OG site's mobile view) */
  .inspo-heads { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
  /* game fits the locked window on phones: smaller logo, tighter stack */
  .game-stage { height: clamp(420px, 62vh, 560px); }
  .game-logo-float img { width: 66vw; max-height: 150px; transform: scale(1.15); }
  .game-ui { gap: 14px; padding-bottom: 40px; }
  .game-sliders { width: min(300px, 76%); }
}
@media (max-width: 480px) {
  .icon-img-folder { width: 68px; }
  .icon-img-orb { width: 64px; }
  .icon-img-games { width: 79px; }
  .icon-img-store { width: 62px; }
  .tagline { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .window.css-anim { transition: none; }
  .banner, .icons .icon-btn, .tagline { animation: none; }
  .game-logo-float, .game-soon-spark, .game-win-text { animation: none; }
}
