/* Codeator Arcade — games.codeator.ai
   Palette and shapes are lifted from the app itself: the four icon shapes are
   the four games, and each keeps its own hue everywhere it appears. */

:root {
  --ground:   #0E1330;
  --ground-2: #161C42;
  --panel:    #1B2350;
  --line:     #2A3468;
  --ink:      #EDEFFA;
  --muted:    #8E96C4;

  --memory: #A78BFA;  /* purple diamond  — Memory Match */
  --snake:  #5CC97A;  /* green circle    — Snake */
  --runner: #F89B5C;  /* orange triangle — Endless Runner */
  --turret: #5B96F7;  /* blue hexagon    — Turret Defence */
  --next:   #4DD6C4;  /* the slot that is not filled yet */

  --shell: min(1120px, 100% - 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Almarai, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Reem Kufi', Almarai, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  letter-spacing: 0;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--next);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell { width: var(--shell); margin-inline: auto; }

/* Latin words inside Arabic text keep the utility face and stay LTR. */
.mono {
  font-family: 'Space Mono', ui-monospace, monospace;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.82em;
  letter-spacing: 0.02em;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
}

.top .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1.12rem;
}

.brand img { width: 2rem; height: 2rem; border-radius: 0.55rem; display: block; }

.top nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.94rem;
  color: var(--muted);
}

.top nav a { text-decoration: none; transition: color 0.18s; }
.top nav a:hover { color: var(--ink); }

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

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--ground-2) 0%, transparent 62%),
    var(--ground);
  overflow: hidden;
}

.hero .shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  font-weight: 700;
  margin-block-end: 1.1rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--next);
}

.hero p {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  max-width: 34ch;
  margin: 0 0 0.9rem;
}

.pitch {
  color: var(--ink);
  font-family: 'Reem Kufi', sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  border-inline-start: 3px solid var(--next);
  padding-inline-start: 1rem;
  margin-block: 1.6rem 2.2rem;
  line-height: 1.6;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 0.85rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.cta-main {
  background: var(--next);
  color: #06231F;
  box-shadow: 0 8px 26px -12px var(--next);
}

.cta-main:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px var(--next); }

.cta-ghost {
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

/* ---------- the mark: four shapes, one per game ---------- */

.mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.9rem, 2vw, 1.6rem);
  aspect-ratio: 1;
  width: min(100%, 24rem);
  margin-inline: auto;
  padding: clamp(1rem, 2.5vw, 1.8rem);
  border-radius: 1.75rem;
  background: linear-gradient(150deg, var(--ground-2), var(--ground));
  border: 1px solid var(--line);
}

.mark svg { width: 100%; height: 100%; display: block; }

.mark .cell {
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.75);
  animation: pop 0.62s cubic-bezier(0.2, 0.9, 0.25, 1.1) forwards;
}

.mark .cell:nth-child(1) { animation-delay: 0.08s; }
.mark .cell:nth-child(2) { animation-delay: 0.20s; }
.mark .cell:nth-child(3) { animation-delay: 0.32s; }
.mark .cell:nth-child(4) { animation-delay: 0.44s; }

@keyframes pop {
  to { opacity: 1; transform: scale(1); }
}

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

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

.section-head { margin-block-end: 2.5rem; }

.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  direction: ltr;
  display: block;
  margin-block-end: 0.6rem;
}

.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }

.games { display: grid; gap: 1.1rem; }

.game {
  --hue: var(--muted);
  display: grid;
  grid-template-columns: 4.5rem 1fr 8.5rem;
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  padding: 1.4rem clamp(1.2rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}

.game:hover { border-color: var(--hue); transform: translateY(-2px); }

.game-shape { width: 3.4rem; height: 3.4rem; }
.game-shape svg { width: 100%; height: 100%; display: block; }

.game h3 { font-size: 1.35rem; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.game h3 .mono { color: var(--hue); }
.game p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.7; }

/* The Unity "Development Build" stamp sits in the bottom corner of every
   capture, so the frame is shorter than the source and anchored to the top. */
.shot {
  aspect-ratio: 9 / 17;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ground);
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.game-memory { --hue: var(--memory); }
.game-snake  { --hue: var(--snake); }
.game-runner { --hue: var(--runner); }
.game-turret { --hue: var(--turret); }

/* ---------- the fifth slot ---------- */

.slot {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  padding: 1.6rem clamp(1.2rem, 3vw, 2rem);
  margin-block-start: 1.1rem;
  border: 1px dashed color-mix(in srgb, var(--next) 55%, transparent);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--next) 6%, transparent);
}

.slot-shape { width: 3.4rem; height: 3.4rem; }
.slot-shape svg { width: 100%; height: 100%; display: block; }
.slot h3 { font-size: 1.35rem; color: var(--next); }
.slot p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- facts ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.fact {
  padding: 1.6rem;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: var(--ground-2);
}

.fact h3 { font-size: 1.16rem; margin-block-end: 0.5rem; }
.fact p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- article pages ---------- */

.doc { padding-block: clamp(3rem, 7vw, 5rem); }
.doc .shell { max-width: 44rem; }
.doc h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-block-end: 0.6rem; }
.doc h2 { font-size: 1.3rem; margin-block: 2.4rem 0.7rem; }
.doc p, .doc li { color: var(--muted); }
.doc ul { padding-inline-start: 1.2rem; }
.doc li { margin-block: 0.35rem; }
.doc a { color: var(--next); }
.doc .updated { font-family: 'Space Mono', monospace; font-size: 0.82rem; direction: ltr; }

.doc-en {
  direction: ltr;
  text-align: left;
  margin-block-start: 4rem;
  padding-block-start: 2.5rem;
  border-block-start: 1px solid var(--line);
  font-family: system-ui, sans-serif;
}

.doc-en ul { padding-inline-start: 1.2rem; }

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

.foot {
  border-block-start: 1px solid var(--line);
  padding-block: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.foot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
  justify-content: space-between;
}

.foot nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero .shell { grid-template-columns: 1fr; }
  .mark { order: -1; width: min(100%, 17rem); }
  .hero p, .pitch { max-width: none; }
  .game, .slot { grid-template-columns: 3.2rem 1fr; }
  .game-shape { width: 2.7rem; height: 2.7rem; }
  .shot { grid-column: 1 / -1; aspect-ratio: 3 / 4; width: min(100%, 13rem); margin-inline: auto; }

  .facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .mark .cell { animation: none; opacity: 1; transform: none; }
  .cta, .game { transition: none; }
  .cta-main:hover, .game:hover { transform: none; }
}
