/* Bitbit Games: shared styles. Black and white. */

:root {
  --black: #000;
  --ink: #0b0b0b;
  --panel: #111;
  --line: #2a2a2a;
  --grey: #8a8a8a;
  --soft: #bdbdbd;
  --white: #fff;
  --display: "Space Mono", ui-monospace, Consolas, monospace;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 1200px;
  --pad: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--white); color: var(--black); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-family: var(--display);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 18px;
}

.brand svg { width: 28px; height: 28px; }

.nav { display: flex; gap: 28px; }

.nav a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--white); border-color: var(--white); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--white);
  background: var(--white);
  color: var(--black);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.btn:hover { background: var(--black); color: var(--white); }
.btn:active { transform: translateY(1px); }

.btn.ghost { background: transparent; color: var(--white); }
.btn.ghost:hover { background: var(--white); color: var(--black); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Hero with the tiled pattern ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url("../BitbitTile.svg") repeat;
  background-size: 108px 108px;
  opacity: 0.55;
  animation: drift 25s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 75% 45%, #000 0%, transparent 75%);
}

@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 216px 216px; } /* whole tiles, so the loop has no jump */
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  html { scroll-behavior: auto; }
}

.hero .wrap {
  position: relative;
  min-height: min(86vh, 760px);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 48px;
  padding-top: 80px;
  padding-bottom: 80px;
}

.hero h1 {
  font-family: var(--display);
  margin: 18px 0 22px;
  font-size: clamp(44px, 7.5vw, 96px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--white);
}

.hero p.lede {
  max-width: 540px;
  margin: 0 0 34px;
  font-size: clamp(18px, 2vw, 21px);
  color: var(--soft);
}

/* ---------- Sections ---------- */

section { scroll-margin-top: 68px; padding: clamp(72px, 10vw, 128px) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--white);
}

.section-head h2 {
  font-family: var(--display);
  margin: 6px 0 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head .count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--grey);
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
}

.big-text {
  font-family: var(--display);
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose p { margin: 0 0 18px; color: var(--soft); }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Principles (studio) ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.principle {
  padding: 36px 30px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principle .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--grey);
}

.principle h3 {
  margin: 18px 0 10px;
  font-size: 23px;
  font-weight: 700;
}

.principle p { margin: 0; color: var(--soft); font-size: 16px; }

/* ---------- Game card (studio page) ---------- */

.game-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  border: 2px solid var(--white);
  text-decoration: none;
  transition: border-color 0.2s;
}

.game-card:hover .arrow-link { text-decoration: underline; text-underline-offset: 6px; }

.game-card .art {
  position: relative;
  min-height: 380px;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.game-card .art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.game-card:hover .art img { transform: scale(1.04); }

.game-card .info {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.game-card h3 { font-family: var(--display); margin: 0; font-size: 40px; line-height: 1; font-weight: 700; }
.game-card p { margin: 0; color: var(--soft); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--line);
  color: var(--soft);
}

.arrow-link {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Privacy policy ---------- */

.policy { max-width: 760px; }
.policy h3 {
  font-family: var(--display);
  font-size: 26px;
  margin: 56px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.policy h4 { font-size: 17px; margin: 30px 0 8px; }
.policy p, .policy li { color: var(--soft); font-size: 15px; }
.policy p { margin: 0 0 14px; }
.policy ul, .policy ol { margin: 0 0 14px; padding-left: 22px; }
.policy li { margin-bottom: 6px; }
.policy strong { color: var(--white); }
.policy a { color: var(--white); text-underline-offset: 3px; }

/* ---------- Contact ---------- */

.contact {
  text-align: center;
  border-top: 1px solid var(--line);
}

.contact h2 {
  font-family: var(--display);
  margin: 14px 0 26px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact .btn-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grey);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* equal outer columns keep the copyright centred */
  align-items: center;
  gap: 20px;
}
.site-footer .wrap > :first-child { justify-self: start; }
.site-footer .wrap > :last-child { justify-self: end; }

.site-footer .brand { font-family: var(--display); font-size: 15px; color: var(--white); }
.site-footer .brand svg { width: 22px; height: 22px; }
.site-footer a { color: var(--soft); text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* ================= Cat Mania page ================= */

.cm-hero .wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.cm-hero::before {
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 80%);
          mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 0%, transparent 80%);
}

/* Test: a game screenshot behind the Cat Mania hero instead of the tile.
   Remove the "world" class in cat-mania/index.html to go back to the tile. */
.cm-hero.world::before {
  inset: 0;
  background: url("../img/cat-mania-world.jpg") center bottom / cover no-repeat; /* the sun is cropped out of the image */
  opacity: 1;
  animation: none;
  -webkit-mask-image: none;
          mask-image: none;
}
.cm-hero.world::after { /* darkens it so the text reads, and fades into the page */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.5) 55%, #000 100%);
}
.cm-hero.world .wrap { z-index: 1; }
.cm-hero.world .label,
.cm-hero.world p.lede { color: var(--white); text-shadow: 0 1px 12px rgba(0,0,0,0.7); }

.cm-title {
  margin: 8px 0 6px;
  line-height: 0;
}

.cm-title img {
  width: min(440px, 76vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.8));
}

.cm-hero p.lede { margin-left: auto; margin-right: auto; }
.cm-hero .btn-row { justify-content: center; }

/* About the game (store text) */

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.about-block {
  padding: 34px 32px 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-block h3 { margin: 0 0 12px; font-family: var(--display); font-size: 24px; font-weight: 700; }
.about-block p { margin: 0; color: var(--soft); }
.about-block strong { color: var(--white); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .split { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .game-card { grid-template-columns: 1fr; }
  .game-card .art { min-height: 0; aspect-ratio: 1 / 1; } /* the art is square: show all of it */
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav { gap: 16px; }
  .nav a { font-size: 11px; }
  .brand span { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .site-footer .wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer .wrap > * { justify-self: center !important; }
}

/* draft placeholders in the terms ([to decide]) */
.policy mark.todo { background: none; color: #9a9a9a; border-bottom: 1px dashed #9a9a9a; }
