/* Codesarray site styles.
   Palette mirrors the Blockfall in-game palettes: Navy (dark) and Light.
   Single stylesheet shared by index.html and privacy-policy.html. */

:root {
  color-scheme: dark light;

  /* Blockfall Navy palette */
  --bg: #1c1f3a;
  --surface: #12142b;
  --surface-2: #262a4d;
  --text: #f2f3ff;
  --text-dim: #9da2c7;
  /* --gold tints text and icons, so it changes with the scheme to hold 4.5:1.
     --brand fills buttons and always stays the game's gold: navy on it is 10:1 either way. */
  --gold: #ffc53d;
  --brand: #ffc53d;
  --border: #2e3358;
  --on-brand: #1c1f3a;

  /* Blockfall piece colors, used for the mark and accents */
  --piece-red: #ff6b6b;
  --piece-yellow: #ffe066;
  --piece-blue: #4da3ff;
  --piece-green: #5cd68d;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.45);
  --measure: 68ch;
  --container: 1080px;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    /* Blockfall Light palette; dim text darkened to hold 4.5:1 on the page background */
    --bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #e1e4f0;
    --text: #1c1f3a;
    --text-dim: #5c6185;
    --gold: #8a5e00;
    --border: #d5d9ea;
    --shadow: 0 1px 2px rgb(28 31 58 / 0.06), 0 12px 32px -16px rgb(28 31 58 / 0.22);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", Archivo, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent);
  text-underline-offset: 3px;
  transition: color 200ms var(--ease), text-decoration-color 200ms var(--ease);
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 50;
  background: var(--brand);
  color: var(--on-brand);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 160ms var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: var(--on-brand);
}

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

.site-header {
  padding-block: 24px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
}

.wordmark:hover {
  color: var(--text);
}

.wordmark .mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

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

.hero {
  padding-block: clamp(40px, 7vw, 88px) clamp(40px, 7vw, 80px);
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  max-width: 16ch;
}

.hero .lede {
  margin-top: 20px;
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--text-dim);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease),
    color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.btn svg {
  flex: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--brand) 84%, #ffffff);
  color: var(--on-brand);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
  color: var(--text);
}

/* ---------- game section ---------- */

.section {
  padding-block: clamp(40px, 7vw, 72px);
}

.section-head h2 {
  font-size: clamp(1.625rem, 3.4vw, 2.25rem);
  font-weight: 700;
}

.section-head p {
  margin-top: 14px;
  max-width: var(--measure);
  color: var(--text-dim);
}

.game-card {
  margin-top: 36px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.game-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Let the title column shrink so the icon never strands itself on its own line. */
.game-head > div {
  min-width: 0;
}

.game-head .mark {
  width: 48px;
  height: 48px;
  flex: none;
}

.game-head h3 {
  font-size: 1.375rem;
  font-weight: 700;
}

.game-head .meta {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.features {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.features li {
  display: flex;
  gap: 12px;
}

.features svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--gold);
}

.features h4 {
  margin: 0 0 2px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.features p {
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.shots {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

.shots img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/* Two screenshots carry the idea on a phone; the third stays lazy and unfetched. */
@media (max-width: 640px) {
  .shots {
    grid-template-columns: repeat(2, 1fr);
  }
  .shots li:last-child {
    display: none;
  }
}

/* ---------- prose (privacy policy) ---------- */

.prose {
  max-width: var(--measure);
  /* Sits at the container's left edge so the policy lines up with the wordmark. */
  margin-inline: 0;
  padding-block: clamp(24px, 5vw, 48px) clamp(40px, 7vw, 72px);
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
}

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

.prose h2 {
  margin-top: 44px;
  font-size: 1.25rem;
  font-weight: 600;
}

.prose p,
.prose ul {
  margin-top: 14px;
  color: var(--text-dim);
}

.prose ul {
  padding-left: 22px;
}

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

.prose a {
  color: var(--text);
  word-break: break-word;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-dim);
  font-size: 0.9375rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--gold);
}

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

.site-footer {
  margin-top: auto;
  padding-block: 32px 48px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}

.footer-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
