/* Black Tallow — the site's one stylesheet.
   White text on black (the art's own background, #000). The text roles follow the game's style guide
   (GDD 52 UI, "Menu text"): headings, small-caps labels and body, all in Montserrat SemiBold here, since
   the game's blackletter heading face is not used on the web. Mobile first: the base rules are for
   phones, and min-width queries widen the layout. */

@font-face {
  font-family: "Montserrat";
  /* Relative to this file, so it still works when the site is served from a subfolder. */
  src: url("../fonts/montserrat/Montserrat-SemiBold-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;          /* page */
  --ink: #fff;         /* headings, links, buttons */
  --text: #e6e6e6;     /* body text: 16.6:1 on black */
  --label: #9a9a9a;    /* small-caps labels (the guide's subheading grey): 7.5:1 */
  --hint: #8a8a8a;     /* dates and captions (the guide's hint grey): 6.1:1 */
  --rule: #2e2e2e;     /* hairlines; decoration only, never text */
  --field: #0e0e0e;    /* form field fill */
  --todo: #f2b84b;     /* TODO markers: settings ones under `npm start` only; the About and privacy ones always */

  --font: "Montserrat", "Segoe UI", Arial, sans-serif;
  --gutter: 1rem;      /* 16 px side gutter on phones */
  --space: clamp(5rem, 14vw, 10rem);  /* the empty space between home sections */
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
img, picture, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* ---- base ---- */
html { background: var(--bg); color-scheme: dark; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.0625rem;  /* 17 px: Montserrat SemiBold reads large */
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
strong, b { font-weight: 600; color: var(--ink); }
code { font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }

/* Headings: spaced capitals, white. Sizes stay modest; the art is the loud thing on the page. */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.0625rem; }
h3 { font-size: 1rem; }

/* A small-caps label: the style guide's subheading role. */
.label {
  color: var(--label);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.hint { color: var(--hint); font-size: 0.875rem; }
.muted { color: var(--hint); }

/* Links are underlined everywhere, so they never depend on colour or hover to be found. */
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

/* One visible focus style for everything that takes focus. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
main:focus { outline: none; }  /* the skip link's target */

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-120%);
}
.skip-link:focus { transform: none; }

/* ---- helpers ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: 64rem; margin-inline: auto; padding-inline: var(--gutter); }
/* Narrow sections keep the page's left edge (shared with the four blocks and the footer) and only
   narrow their content to a reading measure. */
.wrap--narrow > * { max-width: 38rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; list-style: none; }

/* TODO markers: dashed amber, so nothing unfinished can pass for finished. */
.todo, .todo-text {
  color: var(--todo);
  border: 1px dashed var(--todo);
  padding: 0.1em 0.4em;
}
.todo code, .btn--todo code { color: inherit; }
.todo-text { display: block; padding: 0.75rem 1rem; }

/* ---- buttons ----
   Solid white for the main call, outlined white for the others: both read as buttons on black
   without hover. At least 48 px tall for thumbs. */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3rem;
  padding: 0.8rem 1.75rem;
  border: 2px solid var(--ink);
  font-size: 0.875rem;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: #d4d4d4; border-color: #d4d4d4; }
.btn--secondary { background: transparent; color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--bg); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn--todo { border-style: dashed; border-color: var(--todo); color: var(--todo); cursor: default; }
.btn--todo small { font-size: 0.6875rem; letter-spacing: 0.05em; text-transform: none; }

/* ---- site header (every page but home) ---- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding: 1.5rem var(--gutter);
}
.site-header__home { display: block; text-decoration: none; }
.site-header__home img { width: 10rem; }
.site-header__nav a { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.875rem; }

/* ---- home: hero ---- */
.hero {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  padding: 2.5rem var(--gutter) 0;
  text-align: center;
}
.hero__title { width: 100%; }
.hero__art {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.hero__art img {
  width: auto;
  max-width: min(100%, 30rem);
  max-height: 72vh;
  margin-inline: auto;
}
/* The one texture: a fine grain over the art. Overlay blending leaves pure black untouched, so it only
   shows on the candle's light and never on any text. */
.hero__art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.hero__tagline {
  color: var(--ink);
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
}
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  max-width: 22rem;
}

/* ---- home: pitch ---- */
.pitch {
  max-width: calc(40rem + 2 * var(--gutter));
  margin-top: var(--space);
  text-align: center;
}
.pitch p {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.6;
}
.pitch p + p { margin-top: 1.25rem; }

/* ---- home: the four blocks ----
   Text-only blocks sit in a grid (two across on wider screens). A block given an image spans the full
   width, image beside text, and alternates sides. */
.features {
  display: grid;
  gap: 3.5rem;
  margin-top: var(--space);
}
.feature { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.feature h2 { margin-bottom: 0.75rem; }
.feature p { max-width: 34rem; }
.feature__media img, .feature__media video { display: block; width: 100%; height: auto; }
.feature--media { display: grid; gap: 1.5rem; }
/* A clip and its still: the clip shows, unless the reader has asked for reduced motion. */
.feature__still { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .feature__video { display: none !important; }
  .feature__still { display: block !important; }
}

/* ---- home: devlog, signup, about ---- */
.devlog-teaser, .signup, .about { margin-top: var(--space); }
.devlog-teaser h2, .signup h2, .about h2 { margin-bottom: 1.5rem; }
.post-list { display: grid; gap: 2rem; padding: 0; list-style: none; }
.post-list__title { font-size: 1rem; letter-spacing: 0.1em; }
.post-list__date { color: var(--hint); font-size: 0.875rem; margin: 0.25rem 0 0.5rem; }
.devlog-teaser__all { margin-top: 2rem; }

.signup__form { display: grid; gap: 0.75rem; }
.signup__row { display: flex; flex-direction: column; gap: 0.75rem; }
.signup input[type="email"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  background: var(--field);
  border: 2px solid var(--hint);   /* 6.1:1 against black: well over the 3:1 a field edge needs */
  border-radius: 0;
  color: var(--ink);
}
.signup input[type="email"]:disabled { opacity: 0.5; }

/* ---- inner pages: devlog list, privacy, 404 ---- */
.page { padding-top: clamp(2rem, 6vw, 4rem); }
.page h1 { margin-bottom: 0.5rem; }
.page__sub { margin-bottom: 3rem; }
.page .post-list__title { font-size: 1.0625rem; }
.page--404 { padding-top: clamp(4rem, 14vw, 9rem); }
.page--404 p { margin-top: 1rem; }
.page--404 .btn { margin-top: 1.5rem; }
.site-header__nav a[aria-current="page"] { text-decoration-thickness: 2px; }

/* ---- a devlog post ---- */
.post { padding-top: clamp(2rem, 6vw, 4rem); }
.post__header { margin-bottom: 2.5rem; }
.post__date { margin-bottom: 0.75rem; }
/* Post titles are read, not glanced at: normal case, larger, tighter tracking than the site's labels. */
.post__title {
  font-size: clamp(1.625rem, 5vw, 2.25rem);
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0.01em;
}
.post__summary { margin-top: 1rem; color: var(--label); font-size: 1.125rem; }
.post__image { margin-bottom: 2.5rem; }
/* Pictures show at their own size up to the column's width; a small one is never stretched (and blurred). */
.post__image img { max-width: 100%; }
.post__footer { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* ---- reading text (posts and the privacy note) ----
   About 65 characters a line at 38rem; real heading levels in normal case. */
.prose > * + * { margin-top: 1.25rem; }
.prose h2, .prose h3 {
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.prose h2 { font-size: 1.375rem; margin-top: 3rem; }
.prose h3 { font-size: 1.125rem; margin-top: 2.25rem; }
.prose h2 + *, .prose h3 + * { margin-top: 0.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose img { max-width: 100%; }
.prose blockquote {
  padding-left: 1.25rem;
  border-left: 2px solid var(--label);
  color: var(--ink);
}
.prose :not(pre) > code {
  padding: 0.1em 0.35em;
  background: #1a1a1a;
  border-radius: 2px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: #111;
  border: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}
.prose pre code { font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5rem; }
.figure figcaption, .prose figcaption {
  margin-top: 0.6rem;
  color: var(--hint);
  font-size: 0.875rem;
  line-height: 1.5;
}
.prose-page .prose > .todo-text:first-child { margin-bottom: 2rem; }

/* ---- footer ---- */
.site-footer {
  margin-top: var(--space);
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--hint);
  font-size: 0.875rem;
}
.site-footer__inner { display: grid; gap: 1rem; }
.site-footer__nav a { text-transform: uppercase; letter-spacing: 0.2em; }

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

/* ---- wider screens ---- */
@media (min-width: 30rem) {
  .hero__actions { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: none; }
  .signup__row { flex-direction: row; }
  .signup__row input { flex: 1; }
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  h1 { font-size: 1.75rem; }
  .hero { padding-top: 3rem; }
  .hero__art img { max-width: min(100%, 75rem); max-height: min(68vh, 37.5rem); }
  .pitch p { font-size: 1.5rem; }
  .features { grid-template-columns: 1fr 1fr; gap: 4rem 5rem; }
  .feature--media { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
  .feature--media:nth-child(even) .feature__media { order: -1; }
}
