/* MythCraft Games — main stylesheet
   Night archive palette for the studio; each game page may override tokens
   with data-theme on <body>. */

@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Desk at night: walnut, vellum, brass lamp, banker's-lamp green, sealing wax */
  --walnut: #1f1711;
  --walnut-2: #2b2119;
  --walnut-3: #3a2d22;
  --vellum: #ecdfc4;
  --vellum-dim: #bcaa88;
  --brass: #d2ab62;
  --verdigris: #86ad96;
  --wax: #a5362b;

  --bg: var(--walnut);
  --surface: var(--walnut-2);
  --line: var(--walnut-3);
  --text: var(--vellum);
  --text-dim: var(--vellum-dim);
  --link: var(--brass);
  --accent: var(--verdigris);

  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --body: "Alegreya Sans", "Gill Sans", "Segoe UI", sans-serif;

  /* Modular scale, ratio 1.333 (perfect fourth) from 1.125rem body */
  --s-1: 0.875rem;
  --s0: 1.125rem;
  --s1: 1.5rem;
  --s2: 2rem;
  --s3: 2.67rem;
  --s4: 3.55rem;
  --s5: clamp(2.8rem, 7.5vw, 6.3rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 34em;
  --wide: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--s0);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--vellum); color: var(--walnut); padding: 0.5rem 1rem; }
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  padding-block: 1.1rem;
}
.site-header.is-solid { position: relative; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.wordmark {
  font-family: var(--display); font-size: var(--s1); color: var(--text);
  text-decoration: none; margin-right: auto; letter-spacing: 0.01em;
}
.wordmark:hover { color: var(--link); }
.site-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; }
.lang-switch { display: flex; gap: 0.35rem; font-size: var(--s-1); }
.lang-switch a, .lang-switch span {
  padding: 0.15rem 0.45rem; border: 1px solid transparent; border-radius: 2px; text-decoration: none; color: var(--text-dim);
}
.lang-switch span[aria-current] { border-color: var(--text-dim); color: var(--text); }
.lang-switch a:hover { color: var(--link); }
@media (max-width: 40rem) {
  .site-header .wrap { gap: 0.6rem 1rem; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { gap: 1rem; }
}

/* ---------- Lantern hero (home) ---------- */
.lantern {
  --x: 76%; --y: 42%; --r: 22rem;
  position: relative; min-height: 100svh; display: grid; align-items: end;
  overflow: hidden; isolation: isolate; background: #000;
}
.lantern__dark, .lantern__lit {
  position: absolute; inset: 0; z-index: -1;
}
.lantern__dark img, .lantern__lit img { width: 100%; height: 100%; object-fit: cover; }
.lantern__dark img { filter: brightness(0.3) saturate(0.5); }
.lantern__lit {
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,0.55) 45%, transparent 100%);
  mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,0.55) 45%, transparent 100%);
}
.lantern__lit img { filter: brightness(1.7) sepia(0.45) saturate(1.3) contrast(1.05); }
.lantern::after { /* shade under the headline, and the floor the page continues from */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--walnut) 4%, transparent 38%),
    linear-gradient(to right, rgba(31,23,17,0.7) 0%, rgba(31,23,17,0.25) 45%, transparent 65%);
}
.lantern.is-idle { animation: flicker 5s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { --r: 22rem; } 30% { --r: 21rem; } 55% { --r: 23rem; } 80% { --r: 21.6rem; }
}
@property --r { syntax: "<length>"; inherits: true; initial-value: 22rem; }
@media (prefers-reduced-motion: reduce) { .lantern.is-idle { animation: none; } }

.lantern__copy { padding-block: 8rem clamp(3rem, 9vh, 6rem); }
.lantern h1 {
  font-size: var(--s5); line-height: 0.98; letter-spacing: -0.01em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.lantern h1 em { display: block; font-style: normal; padding-left: 1.2ch; }
.lantern__lede { margin-top: 1.4rem; font-size: var(--s1); line-height: 1.35; color: var(--vellum); max-width: 26em; }
.lantern__hint { margin-top: 2rem; font-size: var(--s-1); color: var(--text-dim); font-style: italic; }
@media (hover: none) { .lantern__hint { display: none; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 10vw, 7.5rem); }
.section--rule { border-top: 1px solid var(--line); }
.section h2 { font-size: var(--s3); margin-bottom: 1.2rem; }
.intro { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.intro p { font-size: var(--s1); line-height: 1.45; font-family: var(--display); }
@media (min-width: 56rem) { .intro { grid-template-columns: 1fr 2fr; align-items: start; } }

/* ---------- Catalogue of games (home) ---------- */
.catalogue { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; gap: clamp(3.5rem, 8vw, 6rem); }
.entry { display: grid; gap: 1.4rem 3rem; align-items: center; }
@media (min-width: 52rem) {
  .entry { grid-template-columns: 7fr 5fr; }
  .entry:nth-child(even) { grid-template-columns: 5fr 7fr; }
  .entry:nth-child(even) .entry__art { order: 2; }
}
.entry__art { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.entry__art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.6s ease, filter 0.6s ease; filter: saturate(0.9); }
.entry__art:hover img, .entry__art:focus-visible img { transform: scale(1.03); filter: saturate(1.05); }
@media (prefers-reduced-motion: reduce) { .entry__art img { transition: none; } }
.entry__kind { font-size: var(--s-1); color: var(--accent); margin: 0 0 0.5rem; font-weight: 500; }
.entry h3 { font-size: var(--s3); margin-bottom: 0.8rem; }
.entry h3 a { color: var(--text); text-decoration: none; }
.entry h3 a:hover { color: var(--link); }
.entry p { color: var(--text-dim); }
.entry .more { font-weight: 500; }

/* Status: a small wax seal, the only place --wax appears */
.seal {
  display: inline-flex; align-items: center; gap: 0.55rem; font-size: var(--s-1); color: var(--text);
  margin-bottom: 1rem;
}
.seal::before {
  content: ""; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d0574a, var(--wax) 55%, #6c1f18);
  box-shadow: 0 0 0 2px rgba(165,54,43,0.25);
}
.seal--out::before { background: radial-gradient(circle at 35% 30%, #b6d4c2, var(--verdigris) 55%, #4d6f5b); box-shadow: 0 0 0 2px rgba(134,173,150,0.25); }

/* ---------- Digital editions service ---------- */
.digital { background: var(--surface); }
.digital__head { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 56rem) { .digital__head { grid-template-columns: 1fr 1fr; align-items: end; } }
.digital__head h2 { font-size: var(--s4); margin: 0; }
.digital__intro { font-size: var(--s1); line-height: 1.45; margin: 0; }
.digital__steps-title { font-size: var(--s1); color: var(--accent); margin: 4rem 0 1.5rem; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 2rem 3rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 72rem) { .steps { grid-template-columns: repeat(5, 1fr); } }
.steps li { counter-increment: step; border-top: 1px solid var(--brass); padding-top: 1rem; }
.steps li::before {
  content: counter(step); display: block; font-family: var(--display); font-size: var(--s3);
  line-height: 1; color: var(--brass); margin-bottom: 0.6rem;
}
.steps h3 { font-size: var(--s1); margin-bottom: 0.5rem; }
.steps p { color: var(--text-dim); margin: 0; font-size: var(--s-1); line-height: 1.5; }
.digital__cta { margin-top: 3.5rem; font-size: var(--s1); font-family: var(--display); max-width: none; }

/* ---------- Contact block ---------- */
.contact { position: relative; isolation: isolate; overflow: hidden; }
.contact__bg { position: absolute; inset: 0; z-index: -1; }
.contact__bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.28) sepia(0.25); }
.contact .mail {
  display: inline-block; font-family: var(--display); font-size: clamp(1.5rem, 5vw, var(--s4));
  color: var(--vellum); text-decoration-color: var(--brass); word-break: break-word; margin: 0.5rem 0 1.5rem;
}
.contact .mail:hover { color: var(--brass); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: var(--s-1); color: var(--text-dim); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--link); }

/* ---------- Game page ---------- */
.game-hero { position: relative; isolation: isolate; min-height: min(88svh, 52rem); display: grid; align-items: end; overflow: hidden; }
.game-hero__art { position: absolute; inset: 0; z-index: -1; }
.game-hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 40%); }
.game-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 4%, color-mix(in srgb, var(--bg) 70%, transparent) 38%, transparent 75%); }
.game-hero__copy { padding-block: 9rem 3rem; }
.game-hero h1 { font-size: var(--s5); line-height: 1; max-width: 14ch; }
.game-hero .tagline { margin-top: 1rem; font-size: var(--s1); line-height: 1.35; max-width: 28em; }
.game-hero .kind { font-weight: 500; color: var(--accent); margin: 0 0 0.6rem; }

.game-body { display: grid; gap: 3rem; }
@media (min-width: 56rem) { .game-body { grid-template-columns: 3fr 2fr; gap: 5rem; } }
.game-body .prose p:first-child { font-size: var(--s1); line-height: 1.45; }
.facts { border-top: 1px solid var(--line); margin: 0; }
.facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding-block: 0.75rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.6rem; }
@media (min-width: 40rem) { .features { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2rem 3rem; } }
.features h3 { font-size: var(--s1); margin-bottom: 0.4rem; }
.features p { color: var(--text-dim); margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.button {
  display: inline-block; padding: 0.8rem 1.4rem; font-weight: 700; text-decoration: none;
  background: var(--brass); color: var(--walnut); border-radius: 3px; border: 1px solid var(--brass);
}
.button:hover { background: transparent; color: var(--brass); }
.button--ghost { background: transparent; color: var(--text); border-color: var(--text-dim); }
.button--ghost:hover { color: var(--link); border-color: var(--link); }

.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); margin-top: 2rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); }
.gallery figcaption { font-size: var(--s-1); color: var(--text-dim); margin-top: 0.4rem; }
.pending {
  border: 1px dashed var(--text-dim); padding: 1.5rem; color: var(--text-dim); font-style: italic;
  aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center;
}

/* ---------- Press kit ---------- */
.press-head { padding-block: clamp(4rem, 10vw, 7rem) 2rem; }
.press-head h1 { font-size: var(--s4); margin-bottom: 1rem; }
.press-grid { display: grid; gap: 3rem; }
@media (min-width: 56rem) { .press-grid { grid-template-columns: 1fr 2fr; gap: 5rem; } }
.press-games { list-style: none; padding: 0; margin: 0; display: grid; gap: 2.5rem; }
.press-games > li { display: grid; gap: 1.2rem; grid-template-columns: 1fr; border-top: 1px solid var(--line); padding-top: 1.5rem; }
@media (min-width: 40rem) { .press-games > li { grid-template-columns: 12rem 1fr; } }
.press-games img { width: 100%; aspect-ratio: 616 / 353; object-fit: cover; }
.press-games h3 { font-size: var(--s2); margin-bottom: 0.4rem; }
.downloads { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }

/* ---------- Meadow theme: Arroyo Manso is the sunlit page in the archive ---------- */
body[data-theme="meadow"] {
  --bg: #e7eed6;
  --surface: #f5f2e4;
  --line: #c7d1ad;
  --text: #2a3420;
  --text-dim: #56603f;
  --link: #8a4b14;
  --accent: #4f7a35;
  --brass: #8a4b14;
}
body[data-theme="meadow"] .site-header.is-solid { background: var(--surface); }
body[data-theme="meadow"] .wordmark { color: var(--text); }
body[data-theme="meadow"] .game-hero h1 { text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
body[data-theme="meadow"] .button { color: #fff8ea; }
body[data-theme="meadow"] .button:hover { color: var(--link); }
body[data-theme="meadow"] .site-footer { background: var(--surface); }
body[data-theme="meadow"] .seal::before { background: radial-gradient(circle at 35% 30%, #f6d36d, #d9a21c 55%, #93680a); box-shadow: 0 0 0 2px rgba(217,162,28,0.3); }
body[data-theme="meadow"] :focus-visible { outline-color: var(--link); }

/* ---------- Studio emblem in the header: the octopus, tinted by the current accent ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark__mark {
  width: 1.55rem; height: 2.2rem; flex: none; background: var(--brass);
  -webkit-mask: url("../img/mythcraft-octopus.svg") center / contain no-repeat;
  mask: url("../img/mythcraft-octopus.svg") center / contain no-repeat;
}
.press-logo { width: min(100%, 26rem); margin: 0.5rem 0 1.2rem; }

/* Store capsules on cards keep their own proportions (616 x 353) */
.entry__art--capsule img { aspect-ratio: 616 / 353; }
