/* Pere Games hub */

:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #efedf7;
  --text: #1b1830;
  --muted: #605b78;
  --border: #dedbea;
  --accent: #6a4bff;
  --accent-text: #ffffff;
  --accent-soft: #ebe6ff;
  --highlight: #d99a00;
  --live: #1f8a4c;
  --beta: #b26a00;
  --dev: #5b5f74;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 16 40 / 6%), 0 8px 24px rgb(20 16 40 / 6%);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e1c;
    --surface: #1a1729;
    --surface-2: #231f37;
    --text: #ecebf5;
    --muted: #a39fbd;
    --border: #2f2a47;
    --accent: #8f78ff;
    --accent-text: #100e1c;
    --accent-soft: #2a2350;
    --highlight: #ffd166;
    --live: #5ad08c;
    --beta: #ffb547;
    --dev: #a3a7bd;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

code { font-family: var(--mono); font-size: 0.88em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 40px; padding-bottom: 64px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.muted { color: var(--muted); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; margin: 0 0 1.5rem; }
.eyebrow { margin: 0 0 0.75rem; font-size: 0.95rem; }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }

/* Header / footer */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; padding-bottom: 24px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }

/* Buttons, chips, tags */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }

.game-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.8rem; font-weight: 500; text-decoration: none;
}
a.tag:hover { color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dev); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--live); }
.status-beta, .status-early-access { color: var(--beta); }

.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 0.95rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.version { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* Sections */

.hero { padding: 32px 0 48px; }
/* Home hero: the animated logo canvas is larger than the settled logo (room
   for the splash), so it overflows a box sized to the final logo. */
.hero-home { text-align: center; padding-top: clamp(72px, 14vw, 150px); overflow-x: clip; }
.hero-home .lede { margin-left: auto; margin-right: auto; }
.hero-home .game-actions { justify-content: center; }
.hero-logo { position: relative; width: min(520px, 78%); aspect-ratio: 1688 / 824; margin: 0 auto 32px; }
.hero-logo-img { position: absolute; max-width: none; width: 145.97%; height: auto; left: -25.59%; top: -64.93%; }
@media (prefers-reduced-motion: reduce) {
  .hero-logo-img { width: 100%; left: 0; top: 0; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero h1:not(.hero-logo) { font-size: clamp(2.5rem, 8vw, 4.5rem); background: linear-gradient(90deg, var(--accent), var(--highlight)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; }

section + section, section + .ad-slot, .ad-slot + .split, .ad-slot + section { margin-top: 48px; }

.split > section { margin-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 48px; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* Game cards */

.game-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.game-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-cover { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); text-decoration: none; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-cover-fallback { display: grid; place-items: center; height: 100%; font-size: 4rem; font-weight: 700; color: var(--accent); }
.game-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.game-body h3 { margin: 0; }
.game-body h3 a { color: var(--text); text-decoration: none; }
.game-body p { margin: 0 0 8px; color: var(--muted); flex: 1; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.game-hero { display: grid; gap: 32px; align-items: center; padding-bottom: 16px; }
.game-hero .game-meta { margin-bottom: 20px; }
.game-hero-cover { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 860px) { .game-hero:has(.game-hero-cover) { grid-template-columns: 1fr 1fr; } }

/* Changelog */

.changelog { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.changelog-item { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.changelog-item[hidden] { display: none; }
.changelog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.changelog-item h3 { margin: 0 0 4px; }
.changelog-item h3 a { color: var(--text); text-decoration: none; }
.changelog-item h3 a:hover { color: var(--accent); }
.changelog-body { color: var(--muted); }
.changelog-body > :last-child { margin-bottom: 0; }
.changelog-body ul { padding-left: 1.2em; }

/* Blog */

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.post-list li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.post-list time { color: var(--muted); font-size: 0.9rem; padding-top: 2px; }
.post-list a { font-weight: 500; }
.post-list p { margin: 4px 0 0; }
.post-list-lg a { font-size: 1.15rem; }
@media (max-width: 520px) { .post-list li { grid-template-columns: 1fr; gap: 2px; } }

.prose { max-width: 68ch; }
.prose img { border-radius: 10px; }
.prose pre { overflow-x: auto; padding: 14px; border-radius: 10px; background: var(--surface-2); }
.byline { color: var(--muted); margin-top: -0.25rem; }

/* Ad slot */

.ad-slot { position: relative; margin-top: 48px; }
.ad-label { position: absolute; top: 8px; right: 12px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ad-house {
  display: flex; flex-direction: column; gap: 4px; padding: 24px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.ad-house span { color: var(--muted); }
.ad-house:hover { border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
  .game-card:hover { transform: none; }
}

.game-card[hidden] { display: none; }
.tag-more { background: transparent; border: 1px dashed var(--border); }
