/* Just Games Studio — homepage. The policy pages keep using /style.css. */

:root {
  --chalk: #f3f5fa;
  --paper: #ffffff;
  --ink: #1b1f3b;
  --slate: #5a6178;
  --rule: #dde1ec;
  --signal: #ff7a1a;
  --signal-ink: #b34a00;
  --card-edge: #ffffff;
  --shadow: 27 31 59;

  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-art: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --chalk: #14172b;
    --paper: #1c2038;
    --ink: #eef0f8;
    --slate: #a2a8c0;
    --rule: #2e3354;
    --signal-ink: #ffa25c;
    --card-edge: #2a2f50;
    --shadow: 0 0 0;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--chalk) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--signal);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}
.top nav { display: flex; gap: 28px; }
.top nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--slate);
}
.top nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */

.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(56px, 8vw, 104px); overflow-x: clip; }
.deck-box { container-type: inline-size; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7.4vw, 6.4rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.045em;
  font-variation-settings: "wdth" 85;
  text-wrap: balance;
}
.hero .lead {
  max-width: 34ch;
  margin: 28px 0 36px;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--slate);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--chalk);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
}
.btn.ghost:hover { background: var(--paper); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* The deck: one card per game, fanned like a hand of cards. */

.deck {
  --card-w: min(23cqi, 210px);
  --spread: 12deg;
  position: relative;
  height: calc(var(--card-w) * 2.15);
  margin: 0;
  padding: 0;
  list-style: none;
}
.deck:hover,
.deck:focus-within { --spread: 14deg; }

.deck li {
  --offset: calc(var(--i) - (var(--n) - 1) / 2);
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--card-w);
  margin-left: calc(var(--card-w) / -2);
  transform-origin: 50% 190%;
  transform: rotate(calc(var(--offset) * var(--spread)));
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
  animation: deal 0.7s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(0.25s + var(--i) * 0.07s);
}
.deck a {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 5px solid var(--card-edge);
  background: var(--card-edge);
  box-shadow:
    0 1px 2px rgb(var(--shadow) / 0.12),
    0 14px 30px -10px rgb(var(--shadow) / 0.35);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s ease;
}
.deck img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.deck li:hover,
.deck li:focus-within { z-index: 10; }
.deck li:hover a,
.deck a:focus-visible {
  transform: translateY(-28px) scale(1.06);
  box-shadow:
    0 2px 4px rgb(var(--shadow) / 0.12),
    0 28px 44px -14px rgb(var(--shadow) / 0.45);
}
.deck a:focus-visible { outline-offset: 4px; border-radius: 16px; }

@keyframes deal {
  from {
    transform: rotate(0deg) translateY(60px);
    opacity: 0;
  }
  40% { opacity: 1; }
}

/* ---------- games ---------- */

.games { padding: clamp(64px, 9vw, 120px) 0; background: var(--paper); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 85;
}
.section-head p {
  margin: 0;
  max-width: 40ch;
  color: var(--slate);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 80px) clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.game { scroll-margin-top: 96px; }
.game figure {
  margin: 0 0 22px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-art);
  overflow: hidden;
  background: var(--rule);
}
.game figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.game h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.game .genre { color: var(--slate); font-weight: 500; }
.game p {
  max-width: 52ch;
  margin: 10px 0 20px;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.game-actions .btn { min-height: 44px; padding: 0 18px; font-size: 0.95rem; }
.soon {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px dashed var(--rule);
  color: var(--slate);
  font-weight: 600;
  font-size: 0.95rem;
}
.game-actions .fine {
  margin-left: 6px;
  font-size: 0.9rem;
  color: var(--slate);
  text-underline-offset: 3px;
}
.game-actions .fine:hover { color: var(--ink); }

/* ---------- studio + contact ---------- */

.studio { padding: clamp(64px, 9vw, 120px) 0; }
.studio .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.studio h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 85;
  text-wrap: balance;
}
.studio p { margin: 0 0 1em; max-width: 48ch; color: var(--slate); }
.studio p:first-child { color: var(--ink); font-size: 1.2rem; }

.mail {
  display: inline-block;
  margin-top: 12px;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--signal);
  text-underline-offset: 8px;
  overflow-wrap: anywhere;
}
.mail:hover { color: var(--signal-ink); }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  color: var(--slate);
  font-size: 0.95rem;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .copy { text-align: left; }
  .deck { margin-top: -8px; }
  .game-list { grid-template-columns: 1fr; }
  .studio .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top nav { gap: 18px; }
  .deck { --spread: 10deg; }
  .deck a { border-width: 4px; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .deck li { animation: none; transition: none; }
  .deck a, .btn { transition: none; }
}
