/* games.evasoft.pro — warm paper and Pyrenees ridges by day, pine night by dark. One font: Bricolage Grotesque (OFL). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f2ece1;
  --bg-2: #e8dfcf;
  --card: #fbf8f2;
  --ink: #1c1f1c;
  --muted: #565b53;
  --line: #d3c7b2;
  --accent: #b93d0a;
  --accent-ink: #fff8f0;
  --pine: #1f5a46;
  --sun: #f4a259;
  --haze: #d9ccb6;
  --ridge: #bcae95;
  --todo: #ffe58a;
  --shadow: 0 1px 0 rgb(28 31 28 / 4%), 0 12px 32px -18px rgb(60 40 20 / 35%);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513;
    --bg-2: #141d1a;
    --card: #1a2420;
    --ink: #ece5d8;
    --muted: #a7ac9f;
    --line: #2c3934;
    --accent: #ff8f52;
    --accent-ink: #1a0d05;
    --pine: #7fc4a6;
    --sun: #ff8f52;
    --haze: #1c2824;
    --ridge: #18221f;
    --todo: #6b5410;
    --shadow: 0 1px 0 rgb(255 255 255 / 3%), 0 16px 40px -20px rgb(0 0 0 / 70%);
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.6rem 1rem; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 1rem; }

/* Draft banner: loud on purpose, so a preview is never mistaken for the published text. */
.draft {
  position: sticky; top: 0; z-index: 10;
  padding: 0.55rem 1rem;
  background: repeating-linear-gradient(135deg, #ffd23f 0 14px, #ffc300 14px 28px);
  color: #1a1400;
  font-size: 0.95rem;
  text-align: center;
  border-bottom: 2px solid #1a1400;
}
.draft strong { text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.5em; }

/* Header and footer */
.top { padding: 1.25rem clamp(1.25rem, 5vw, 4rem) 0; position: relative; z-index: 2; }
.mark { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; }
.mark span { font-weight: 400; color: var(--muted); }
.mark .dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd9a8, var(--sun) 55%, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 25%, transparent); }

.foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 5vw, 4rem) calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--line); background: var(--bg-2);
}
.foot a { color: var(--ink); }

/* Home: hero with sun and three ridges */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(78svh, 760px);
  margin-top: -3.5rem; padding: 7.5rem clamp(1.25rem, 5vw, 4rem) 0;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero::before {
  content: ""; position: absolute; z-index: -2; inset: 0;
  /* The sun sets behind the far ridge; on phones it sits low and small, away from the text. */
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), color-mix(in srgb, var(--sun) var(--sun-a), transparent) 0 var(--sun-r), transparent calc(var(--sun-r) + 0.05rem)),
    radial-gradient(circle at var(--sun-x) var(--sun-y), color-mix(in srgb, var(--sun) 26%, transparent), transparent calc(var(--sun-r) * 3.6)),
    linear-gradient(180deg, var(--bg) 30%, color-mix(in srgb, var(--sun) 12%, var(--bg)));
}
.hero { --sun-x: 76%; --sun-y: 74%; --sun-r: 7rem; --sun-a: 72%; }
@media (max-width: 40rem) { .hero { --sun-x: 82%; --sun-y: 86%; --sun-r: 3.4rem; } }
@media (prefers-color-scheme: dark) { .hero { --sun-a: 55%; } }
.hero-text { max-width: 44rem; padding-bottom: 2rem; animation: rise 0.8s var(--ease-out) both; }
.eyebrow { margin: 0 0 1rem; color: var(--pine); font-weight: 650; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }
.hero h1, .lost h1 {
  margin: 0; font-size: clamp(2.5rem, 6.4vw, 5.25rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 780;
  font-stretch: 88%; text-wrap: balance;
}
.lead { max-width: 36rem; margin: 1.5rem 0 0; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); text-wrap: pretty; }

.ridges { position: relative; z-index: -1; display: block; width: calc(100% + 2 * clamp(1.25rem, 5vw, 4rem)); height: clamp(120px, 22vw, 300px); margin: 0 calc(-1 * clamp(1.25rem, 5vw, 4rem)); }
.ridges path { animation: ridge 1.2s var(--ease-out) both; }
.ridges .r1 { fill: var(--haze); }
.ridges .r2 { fill: var(--ridge); animation-delay: 0.12s; }
.ridges .r3 { fill: var(--bg-2); animation-delay: 0.24s; }

@keyframes ridge { from { transform: translateY(40px); opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

/* Games catalog: cards grow from data/games.json */
.games { background: var(--bg-2); padding: 1rem clamp(1.25rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem); }
.games h2 { margin: 0 0 1.5rem; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.02em; font-weight: 750; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.game {
  display: flex; gap: 1.25rem; align-items: flex-start;
  padding: 1.25rem; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.game .icon { flex: none; width: 96px; height: 96px; border-radius: 22%; box-shadow: 0 6px 18px -8px rgb(20 10 60 / 55%); transition: transform 0.35s var(--ease-out); }
.game h3 { margin: 0.15rem 0 0.35rem; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 750; }
.game p { margin: 0; }
.game-body > p + p { margin-top: 0.5rem; }
.game .status {
  display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.game .status-live { background: color-mix(in srgb, var(--pine) 16%, transparent); color: var(--pine); }
.game .platforms { color: var(--muted); font-size: 0.95rem; }
.game .legal, .game .stores { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.95rem; }
.game .legal a { color: var(--muted); }
.game .legal a:hover { color: var(--accent); }
@media (hover: hover) {
  .game:hover { transform: translateY(-4px); box-shadow: var(--shadow), 0 22px 40px -24px rgb(60 40 20 / 45%); }
  .game:hover .icon { transform: rotate(-4deg) scale(1.04); }
}
@media (max-width: 30rem) {
  .game { flex-direction: column; }
  .game .icon { width: 80px; height: 80px; }
}

/* Documents: privacy policy, terms */
.page-doc main { padding: 1.5rem clamp(1.25rem, 5vw, 4rem) 4rem; }
.doc { max-width: 44rem; margin: 0 auto; }
.crumb { margin: 1rem 0 0.75rem; color: var(--muted); font-size: 0.95rem; }
.doc h1 { margin: 0 0 0.5rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 780; font-stretch: 90%; text-wrap: balance; }
.doc .meta { color: var(--muted); margin: 0 0 1.5rem; }
.doc h2 { margin: 2.75rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 720; scroll-margin-top: 4rem; }
.doc h3 { margin: 1.75rem 0 0.5rem; font-size: 1.15rem; font-weight: 700; scroll-margin-top: 4rem; }
.doc p, .doc li { text-wrap: pretty; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li + li { margin-top: 0.35rem; }
.doc a { overflow-wrap: anywhere; }
.doc .table { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.doc th, .doc td { padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font-weight: 700; background: var(--bg-2); }
.toc { margin: 0 0 2rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { margin: 0.75rem 0 0.25rem; padding-left: 1.4rem; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin: 0 0 0.3rem; }
mark.todo { background: var(--todo); color: inherit; padding: 0 0.2em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* 404 */
.page-404 main { display: grid; place-items: center; padding: 3rem clamp(1.25rem, 5vw, 4rem) 5rem; }
.lost { max-width: 40rem; animation: rise 0.6s var(--ease-out) both; }
.lost .eyebrow { font-size: 1.1rem; }
.button {
  display: inline-block; margin-top: 1.75rem; padding: 0.8rem 1.4rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.button:hover { color: var(--accent-ink); transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(0.98); }

button.button { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
button.button:disabled { opacity: 0.6; cursor: progress; transform: none; }

/* /my-data */
.mydata { padding-top: 0.5rem; }
.mydata h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 780; font-stretch: 90%; text-wrap: balance; }
.mydata .lead { margin-top: 0; }
.idcard { margin: 1.75rem 0 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.idcard dt { color: var(--muted); font-size: 0.9rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.idcard dd { margin: 0.3rem 0 0; }
.idcard code { font: 500 1rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.status-line { min-height: 1.6em; margin: 1rem 0 0; }
.status-line[data-tone="ok"] { color: var(--pine); font-weight: 600; }
.status-line[data-tone="warn"] { color: var(--accent); font-weight: 600; }
.hint { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
