/* Nunito is self-hosted (latin subset, SIL OFL; see fonts/) so the page loads
   nothing from other sites. One variable file covers every weight. It sets the
   headings and the wordmark; body text uses the system font. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(fonts/nunito-latin.woff2) format("woff2");
}

:root {
  --bg: #f7f4ee;
  --text: #16213b;
  --muted: #5d6579;
  --line: rgba(22, 33, 59, 0.14);
  --glow-a: rgba(47, 125, 225, 0.16);
  --glow-b: rgba(255, 159, 28, 0.14);
  --accent: #1f63c4;
  --button-bg: #16213b;
  --button-text: #f7f4ee;
  /* The Ragnaruff card keeps the game's own blues in both themes. */
  --game-a: #2f7de1;
  --game-b: #1b4fa8;
  --display: "Nunito", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --text: #eef1f7;
    --muted: #9aa2b6;
    --line: rgba(238, 241, 247, 0.16);
    --glow-a: rgba(47, 125, 225, 0.22);
    --glow-b: rgba(255, 159, 28, 0.10);
    --accent: #7db1f5;
    --button-bg: #eef1f7;
    --button-text: #0d1220;
    --game-a: #2a6fca;
    --game-b: #173f87;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Short pages (404) still fill the screen, so the glows aren't cut off. */
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(60vmax 60vmax at 15% 0, var(--glow-a), transparent 60%),
    radial-gradient(55vmax 55vmax at 95% 40vmax, var(--glow-b), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: 16px; }

/* ---------- Header ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  margin-left: 0.5em;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

nav {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}

nav a {
  padding: 8px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(56px, 12vw, 136px);
  padding-bottom: clamp(56px, 10vw, 112px);
  animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

h1 {
  max-width: 13ch;
  font-family: var(--display);
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.lead {
  max-width: 36em;
  margin-top: 28px;
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.5;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 40px;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease;
}

.button:hover { transform: translateY(-2px); }

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Sections ---------- */

.section {
  padding-top: clamp(48px, 8vw, 88px);
  padding-bottom: clamp(48px, 8vw, 88px);
}

.label {
  margin-bottom: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.num {
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--accent);
}

.service h3 {
  margin: 10px 0 8px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.service p:last-child { color: var(--muted); }

/* ---------- Work ---------- */

.game {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--game-a), var(--game-b));
  color: #fff;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.game:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(20, 42, 92, 0.28);
}

.game:focus-visible { border-radius: 28px; }

.game img {
  flex: none;
  width: clamp(88px, 14vw, 120px);
  height: auto;
  border-radius: 22.5%;
  box-shadow: 0 8px 24px rgba(10, 24, 60, 0.35);
}

.game-body {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.game-kind {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}

.game-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.game-pitch {
  max-width: 34em;
  opacity: 0.92;
}

.game-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffc93c;
  animation: pulse 2.4s ease-in-out infinite;
}

.arrow {
  flex: none;
  transition: transform 200ms ease;
}

.game:hover .arrow { transform: translateX(4px); }

/* ---------- About and contact ---------- */

.statement {
  max-width: 24em;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.aside {
  max-width: 36em;
  margin-top: 20px;
  color: var(--muted);
}

.email {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--display);
  font-size: clamp(1.5rem, 5.6vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
  transition: text-decoration-color 150ms ease;
}

.email:hover { text-decoration-color: currentColor; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(24px, 5vw, 56px);
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.site-footer a { text-underline-offset: 3px; }

.site-footer a:hover { color: var(--text); }

/* ---------- Documents (legal notice, privacy policies) ---------- */

.doc {
  max-width: 760px;
  padding-top: clamp(40px, 8vw, 88px);
  padding-bottom: clamp(48px, 8vw, 88px);
}

.doc h1 {
  max-width: none;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.08;
}

.updated {
  margin-top: 16px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.doc section {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.doc h2 {
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.doc h3 {
  margin-top: 28px;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 800;
}

.doc p,
.doc ul,
.doc address,
.doc dl { margin: 14px 0 0; }

.doc ul { padding-left: 1.25em; }

.doc li + li { margin-top: 8px; }

.doc address { font-style: normal; }

.doc dl div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.doc dt {
  flex: 0 0 12em;
  color: var(--muted);
}

.doc dd { margin: 0; }

.doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.nowrap { white-space: nowrap; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .services {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .wordmark span { display: none; }

  .game {
    flex-direction: column;
    align-items: flex-start;
  }

  .arrow { display: none; }
}

/* ---------- Motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.5); opacity: 1; }
  50% { box-shadow: 0 0 0 7px transparent; opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero, .dot { animation: none; }
  .button, .game, .arrow { transition: none; }
}
