/* ============================================================
   Rojeh Games - Chloe's night sky, puzzle boards and pixel UI
   ============================================================ */
:root {
  --sky: #1a1c2c;            /* Chloe's night sky */
  --ink: #f4f1e8;
  --muted: #a9adc4;
  --navy: #2a1f33;           /* sprite outline colour */
  --board: #f2f1ee;          /* Chloe's white floor tiles */
  --board-edge: #b8bfd3;     /* the darker band under each floor tile */
  --board-text: #2b2a3d;
  --coral: #e96045;          /* menu orange */
  --coral-dark: #9c3a27;
  --gold: #f6c453;
  --blue: #a0d2e5;           /* Chloe's splash blue */
  --line: rgba(255, 255, 255, .08);
  --pxclip: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 400 17px/1.6 Poppins, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold); }
main, footer, .gnav { position: relative; z-index: 1; }

/* ---------- twinkling pixel sky ---------- */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#sky img {
  position: absolute; image-rendering: pixelated; opacity: .2;
  animation: twinkle var(--tw, 4s) steps(5, end) infinite, drift var(--dr, 14s) steps(8, end) infinite alternate;
  animation-delay: var(--d1, 0s), var(--d2, 0s);
}
@keyframes twinkle { 0%, 100% { opacity: .15; } 45% { opacity: 1; } 60% { opacity: .5; } }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(var(--dy, -12px)); } }

/* ---------- nav ---------- */
.gnav { position: sticky; top: 0; z-index: 10; height: 58px; background: rgba(26, 28, 44, .92); backdrop-filter: blur(10px); border-bottom: 4px solid var(--navy); }
.gnav-inner { max-width: 1180px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 400 20px "Bungee Inline", sans-serif; text-decoration: none; }
.logo img { width: 26px; }
.gnav nav { display: flex; gap: 20px; }
.gnav nav a { color: var(--ink); font: 700 14px "Pixelify Sans", sans-serif; text-decoration: none; opacity: .8; letter-spacing: .5px; }
.gnav nav a:hover { opacity: 1; color: var(--gold); }

/* ---------- type ---------- */
section { position: relative; }
h1, .display { font-family: "Bungee Inline", sans-serif; font-weight: 400; margin: 0; letter-spacing: .5px; }
h1 { font-size: clamp(44px, 7.5vw, 92px); line-height: 1.02; }
.display { font-size: clamp(38px, 6vw, 76px); line-height: 1.04; }
.display.small { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.06; }
.sub { font-size: clamp(18px, 2.1vw, 23px); line-height: 1.4; color: var(--muted); max-width: 720px; margin: 16px auto 0; font-weight: 500; }
.kicker { font: 700 15px "Pixelify Sans", sans-serif; color: var(--gold); margin: 0 0 14px; letter-spacing: 1px; text-transform: uppercase; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.lv { background: var(--coral); color: #fff; padding: 3px 10px 4px; box-shadow: inset 0 -4px 0 var(--coral-dark); font-size: 13px; clip-path: var(--pxclip); }
.grad { color: var(--gold); text-shadow: 0 5px 0 #9c7a2a; }
.grad-blue { color: var(--blue); text-shadow: 0 5px 0 #4f7d92; }

/* ---------- chunky game buttons ---------- */
.links { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.pill, .more {
  display: inline-block; font: 700 16px "Pixelify Sans", sans-serif; letter-spacing: .5px; text-decoration: none;
  padding: 12px 22px 15px; color: #fff; background: var(--coral); box-shadow: inset 0 -5px 0 var(--coral-dark);
  clip-path: var(--pxclip); transition: transform .06s;
}
.more { background: #3a3d5c; box-shadow: inset 0 -5px 0 #24263f; }
.tile .more { background: #fff; color: var(--board-text); box-shadow: inset 0 -5px 0 var(--board-edge), inset 0 0 0 3px var(--navy); }
.pill:hover, .more:hover { transform: translateY(-2px); filter: brightness(1.06); }
.pill:active, .more:active { transform: translateY(2px); }
.big { font-size: clamp(16px, 2vw, 20px) !important; padding: 16px 28px 19px !important; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(70px, 10vw, 120px) 22px 30px; }
.hero-art { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 3vw, 36px); margin: 120px auto 0; max-width: 520px; }
.hero-art img { width: clamp(120px, 18vw, 210px); }
.bob { animation: bob 2.4s steps(4, end) infinite; }
.bob.late { animation-delay: -1.2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Chloe's speech bubble (like the in-game 9-patch) */
.bubble {
  position: absolute; left: 4%; bottom: calc(100% + 22px);
  width: min(360px, 86vw); min-height: 58px; padding: 12px 16px 14px; text-align: left;
  background: #fff; color: #31203a; font: 700 15px/1.45 "Pixelify Sans", monospace;
  border: 4px solid var(--navy); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); border-radius: 6px;
}
.bubble::after { content: ""; position: absolute; left: 34px; bottom: -14px; width: 18px; height: 14px; background: #fff; clip-path: polygon(0 0, 100% 0, 0 100%); }
.bubble::before { content: ""; position: absolute; left: 30px; bottom: -22px; width: 26px; height: 22px; background: var(--navy); clip-path: polygon(0 0, 100% 0, 0 100%); }
.bubble .caret { display: inline-block; width: 8px; height: 14px; background: #31203a; margin-left: 2px; vertical-align: -2px; animation: pulse .8s steps(2, end) infinite; }

/* ---------- puzzle boards (Chloe's white floor) ---------- */
.tile {
  text-align: center; margin: 14px; padding: clamp(56px, 7vw, 84px) 22px clamp(44px, 5vw, 64px);
  color: var(--board-text); overflow: hidden;
  background-color: var(--board);
  background-image: linear-gradient(rgba(42, 31, 51, .05) 2px, transparent 2px), linear-gradient(90deg, rgba(42, 31, 51, .05) 2px, transparent 2px);
  background-size: 56px 56px;
  border: 5px solid var(--navy); border-radius: 22px;
  box-shadow: 0 14px 0 var(--board-edge), 0 18px 0 var(--navy), 0 40px 60px rgba(0, 0, 0, .35);
}
.tile-xl { max-width: 1180px; margin: 30px auto 70px; }
.tile .display { color: var(--board-text); }
.tile .sub { color: #5c5a72; }
.tile .kicker { color: #8a5a10; }
.flagship { background-color: #fff6dc; }
.flagship .display { text-shadow: 0 5px 0 var(--gold); }
.chloe-tile { background-color: #eaf6fb; }
.panda-tile { background-color: #eef7e4; }
.coco-tile { background-color: #fbecef; }

.flag-art { max-width: 920px; margin: 44px auto 0; }
.flag-art .art { width: 100%; border: 5px solid var(--navy); border-radius: 14px; box-shadow: 0 10px 0 rgba(42, 31, 51, .25); }
.flag-art .art.shot { width: 76%; margin: -11% auto 0; position: relative; }
.video { position: relative; max-width: 760px; margin: 34px auto 0; aspect-ratio: 16 / 9; border: 5px solid var(--navy); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 0 rgba(42, 31, 51, .25); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 920px; margin: 44px auto 0; }
.facts div { background: #fff; border: 4px solid var(--navy); border-radius: 12px; padding: 14px 12px; box-shadow: 0 6px 0 var(--board-edge); }
.facts b { display: block; font: 700 19px "Pixelify Sans", sans-serif; color: var(--board-text); }
.facts span { color: #6a6880; font-size: 14px; }

/* ---------- story ---------- */
.story { text-align: center; max-width: 980px; margin: 0 auto; padding: clamp(50px, 8vw, 100px) 22px clamp(30px, 5vw, 60px); }
.big-copy { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.45; font-weight: 500; color: #d9dbe8; margin: 32px auto 0; max-width: 820px; }
.divider { display: flex; justify-content: center; padding: 30px 0 0; position: relative; z-index: 1; }
.divider img { width: 60px; animation: bob 2.4s steps(4, end) infinite; }

.gif-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 44px auto 0; max-width: 1080px; }
.gif-row figure { margin: 0; background: var(--sky); border: 4px solid var(--navy); border-radius: 14px; padding: 14px 10px 10px; box-shadow: 0 8px 0 rgba(42, 31, 51, .25); }
.gif-row img { width: 100%; margin: 0 auto; }
.gif-row figcaption { color: var(--muted); font: 700 14px "Pixelify Sans", sans-serif; margin-top: 8px; }

/* ---------- gate button ---------- */
.gate-sec { text-align: center; padding: clamp(80px, 11vw, 130px) 22px; }
.gate-stage { position: relative; margin: 44px auto 0; width: 300px; height: 260px; background: none; border: 0; cursor: pointer; display: block; }
.gate-stage .gate { position: absolute; left: 186px; top: 0; transform: translateX(-100%); }
.gate-stage .pad { position: absolute; left: 50%; bottom: 40px; width: 130px; transform: translateX(-50%); transition: transform .05s; }
.gate-stage:hover .pad { transform: translateX(-50%) translateY(2px); }
.gate-stage .hint { position: absolute; left: 0; right: 0; bottom: 0; color: var(--gold); font: 700 16px "Pixelify Sans", sans-serif; animation: pulse 1.6s steps(2, end) infinite; }
.gate-stage.pressed .hint { animation: none; opacity: 0; }
.gate-stage:focus-visible { outline: 3px dashed var(--gold); outline-offset: 8px; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- mobile games ---------- */
.app-icon { width: 108px; border-radius: 24px; margin: 0 auto 20px; border: 4px solid var(--navy); box-shadow: 0 8px 0 rgba(42, 31, 51, .25); }
.banner { max-width: 1000px; margin: 44px auto 0; }
.banner img { width: 100%; border: 5px solid var(--navy); border-radius: 14px; box-shadow: 0 10px 0 rgba(42, 31, 51, .25); }
.phones { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px 6vw 22px; margin: 0 -22px; scrollbar-width: none; }
.phones::-webkit-scrollbar { display: none; }
.phones img { width: clamp(170px, 21vw, 240px); border-radius: 22px; flex: none; scroll-snap-align: center; border: 6px solid var(--navy); box-shadow: 0 10px 0 rgba(42, 31, 51, .25); }

/* ---------- gallery ---------- */
.gallery { text-align: center; max-width: 1200px; margin: 0 auto; padding: clamp(70px, 10vw, 120px) 22px 30px; }
.masonry { columns: 3 300px; column-gap: 16px; margin-top: 44px; text-align: left; }
.masonry figure { margin: 0 0 16px; break-inside: avoid; border: 4px solid var(--navy); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 8px 0 #0e0f19; }
.masonry img { width: 100%; transition: transform .4s steps(4, end); }
.masonry figure:hover img { transform: scale(1.04); }

/* ---------- events ---------- */
.events { text-align: center; max-width: 1200px; margin: 0 auto; padding: clamp(70px, 10vw, 120px) 22px 20px; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-top: 44px; text-align: left; }
.event { background: var(--board); color: var(--board-text); border: 4px solid var(--navy); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 0 var(--board-edge), 0 14px 0 var(--navy); }
.event img, .event .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 4px solid var(--navy); }
.event .ph { background: repeating-linear-gradient(45deg, #e9e7e2 0 16px, #f2f0ec 16px 32px); }
.event div:last-child { padding: 14px 16px 18px; }
.event b { display: block; font: 700 18px "Pixelify Sans", sans-serif; }
.event span { color: #6a6880; font-size: 14px; }

/* ---------- partners ---------- */
.partners { text-align: center; max-width: 1100px; margin: 0 auto; padding: clamp(80px, 11vw, 130px) 22px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 44px; }
.logo-cell { height: 112px; background: #222539; border: 4px solid var(--navy); border-radius: 12px; display: grid; place-items: center; padding: 20px; box-shadow: 0 6px 0 #0e0f19; transition: transform .06s; text-decoration: none; }
.logo-cell:hover { transform: translateY(-3px); background: #2a2d46; }
.logo-cell img { max-height: 46px; max-width: 100%; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.logo-cell.with-cap { grid-template-rows: 1fr auto; gap: 8px; }
.logo-cell.with-cap img { max-height: 34px; }
.logo-cell .cap { color: var(--ink); font: 700 13px "Pixelify Sans", sans-serif; opacity: .85; }
.logo-cell .word { color: var(--ink); font: 700 16px "Pixelify Sans", sans-serif; }

/* ---------- family ---------- */
.family { text-align: center; max-width: 1000px; margin: 0 auto; padding: 30px 22px clamp(80px, 11vw, 130px); }
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 44px; }
.people figure { margin: 0; background: var(--board); color: var(--board-text); border: 4px solid var(--navy); border-radius: 14px; padding: 20px 10px 16px; box-shadow: 0 8px 0 var(--board-edge), 0 12px 0 var(--navy); }
.people img { height: 80px; width: auto; margin: 0 auto 12px; }
.people b { display: block; font: 700 17px "Pixelify Sans", sans-serif; }
.people span { color: #6a6880; font-size: 14px; }

/* ---------- contact ---------- */
.contact { text-align: center; padding: 30px 22px clamp(90px, 12vw, 150px); }
.socials { display: flex; gap: 18px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.socials a { color: var(--ink); font: 700 15px "Pixelify Sans", sans-serif; text-decoration: none; opacity: .8; }
.socials a:hover { opacity: 1; color: var(--gold); }

/* ---------- footer ---------- */
.gfoot { background: #12131f; border-top: 4px solid var(--navy); padding: 36px 22px 28px; font-size: 13px; color: var(--muted); }
.gfoot .cols { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gfoot h4 { color: var(--gold); font: 700 14px "Pixelify Sans", sans-serif; margin: 0 0 8px; letter-spacing: .5px; }
.gfoot a { display: block; color: var(--muted); margin: 6px 0; text-decoration: none; }
.gfoot a:hover { color: var(--ink); }
.gfoot .legal { max-width: 1000px; margin: 26px auto 0; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- scroll reveal (pixel pop) ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s steps(6, end), transform .6s steps(6, end); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  #sky img, .bob, .divider img, .gate-stage .hint, .bubble .caret { animation: none !important; }
  #sky img { opacity: .5; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 900px) {
  .gnav nav { gap: 12px; }
  .gnav nav a { font-size: 12px; }
  .facts, .gif-row { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .gfoot .cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .gnav nav a:not([href="#contact"]):not([href="links.html"]) { display: none; }
  .tile { margin: 12px; }
}
