/* Jackal Games. Tokens first; components use the tokens, never raw colours. */
@font-face { font-family: "Special Elite"; src: url("../assets/fonts/SpecialElite-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../assets/fonts/CourierPrime-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../assets/fonts/CourierPrime-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --line: #34322d;
  --ink: #ece7da;
  --dim: #a8a396;
  --amber: #d9a441;
  --on-amber: #14110a;
  --head: "Special Elite", "Courier New", monospace;
  --body: "Courier Prime", "Courier New", monospace;
  --wrap: 72rem;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --gap: clamp(3.5rem, 9vw, 7rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--amber); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 7vw, 4.75rem); letter-spacing: 0.04em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h3 { font-size: 1.25rem; color: var(--amber); }
p { margin: 0; max-width: 62ch; }
.wrap { width: min(100% - 2 * var(--pad), var(--wrap)); margin-inline: auto; }
.stack > * + * { margin-top: 1.25rem; }
.dim { color: var(--dim); }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--amber); color: var(--on-amber); padding: 0.75rem 1rem; z-index: 20; }
.skip:focus { top: 1rem; }

/* Header */
.top { position: fixed; inset: 0 0 auto 0; z-index: 10; background: rgba(10, 10, 11, 0.88); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); transition: background-color 0.25s ease, border-color 0.25s ease; }
/* Over the hero the bar is clear; the script adds .solid once the page scrolls. Without the script it stays solid. */
.js .top:not(.solid) { background: linear-gradient(180deg, rgba(10, 10, 11, 0.7), rgba(10, 10, 11, 0)); backdrop-filter: none; border-bottom-color: transparent; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { font-family: var(--head); font-size: 1.15rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 0.75rem 0; }
.brand span { color: var(--amber); }
.brand { white-space: nowrap; }
@media (max-width: 30rem) {
  .brand { font-size: 1rem; letter-spacing: 0.12em; }
  .nav a { padding: 0 0.6rem; font-size: 0.85rem; letter-spacing: 0.08em; }
}
.nav { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.9rem; font-family: var(--head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.9rem; color: var(--dim); text-decoration: none; border-bottom: 2px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }

/* Hero */
.hero { position: relative; isolation: isolate; display: grid; align-items: end; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.hero > picture img { animation: drift 28s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
/* Film grain over the picture, under the words. */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.16; mix-blend-mode: overlay; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero > picture, .hero > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 10, 11, 0.35) 0%, rgba(10, 10, 11, 0.15) 35%, rgba(10, 10, 11, 0.92) 82%, var(--bg) 100%); }
.hero .wrap { padding-block: clamp(3rem, 8vw, 6rem); }
.eyebrow { font-family: var(--head); letter-spacing: 0.28em; text-transform: uppercase; font-size: 0.85rem; color: var(--amber); }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.35rem); max-width: 46ch; }
.hero-logo { width: min(24rem, 62vw); filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.8)); }

/* Buttons and tags */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem; background: var(--amber); color: var(--on-amber); font-family: var(--head); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--amber); cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.btn:hover { background: transparent; color: var(--amber); }
.tag { display: inline-flex; align-items: center; gap: 0.6em; min-height: 2.5rem; font-family: var(--head); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.9rem; color: var(--ink); }
.tag::before { content: "["; color: var(--amber); }
.tag::after { content: "]"; color: var(--amber); }
.tag.lit { color: var(--amber); }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Sections */
.section { padding-block: var(--gap); }
.section + .section { border-top: 1px solid var(--line); }
.numeral { max-width: none; display: flex; align-items: center; gap: 1rem; font-family: var(--head); color: var(--amber); letter-spacing: 0.3em; font-size: 0.9rem; margin-bottom: 1.25rem; }
.numeral::after { content: ""; flex: 1; height: 5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } .split.flip > :first-child { order: 2; } }
.frame { border: 1px solid var(--line); padding: 6px; background: var(--surface); }
.frame img { width: 100%; }

/* Featured game card */
.card { display: grid; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color 0.2s ease; }
.card:hover { border-color: var(--amber); color: inherit; }
.card > img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: clamp(1.25rem, 3vw, 2.25rem); }
@media (min-width: 56rem) { .card { grid-template-columns: 3fr 2fr; align-items: center; } }
.card img.logo { width: min(18rem, 70%); }

/* Rules and features */
.rules { display: grid; gap: 1rem; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (min-width: 40rem) { .rules { grid-template-columns: repeat(3, 1fr); } }
.rules li { border: 1px solid var(--line); padding: 1.25rem; background: var(--surface); }
.rules strong { display: block; font-family: var(--head); font-weight: 400; font-size: 1.2rem; color: var(--amber); margin-bottom: 0.4rem; }
.features { display: grid; gap: 1.5rem 2.5rem; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (min-width: 48rem) { .features { grid-template-columns: 1fr 1fr; } }
.features li { padding-left: 1.25rem; border-left: 2px solid var(--amber); }
.features p { color: var(--dim); margin-top: 0.35rem; }

/* Gallery */
.gallery { display: grid; gap: 0.75rem; list-style: none; padding: 0; margin: 2rem 0 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--surface); cursor: zoom-in; transition: border-color 0.2s ease; }
.gallery button:hover { border-color: var(--amber); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
dialog.light { width: min(96vw, 110rem); max-width: none; padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
dialog.light::backdrop { background: rgba(0, 0, 0, 0.88); }
dialog.light img { width: 100%; }
dialog.light .bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0.75rem; }
dialog.light .bar p { font-size: 0.95rem; color: var(--dim); }
dialog.light button { min-height: 2.75rem; padding: 0 1rem; background: transparent; color: var(--ink); border: 1px solid var(--line); font: 400 0.9rem var(--head); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
dialog.light button:hover { border-color: var(--amber); color: var(--amber); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--dim); font-size: 0.95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }

/* Reveal: content is visible without JavaScript; the script opts in. */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease-out, transform 0.4s ease-out; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero > picture img { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
