/* Perpolita: porcelain, ink, horn. The mark is drawn; the site stays quiet
   around it. Fraunces is the brand face (decisions.md 20.23); the variable
   axes are set per role rather than loading multiple families. */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* The brand constants. These never change; only the roles below do. */
  --porcelain: #f4f2ec;
  --mist: #e5e1d6;
  --ink: #101014;
  --shade: #5b574d;
  --horn: #7b5a28;        /* link/accent, AA on porcelain */
  --horn-soft: #b08a4c;   /* decorative only */

  /* Roles. Every rule below paints with these, never with a colour name, so
     dark mode is a token swap rather than a second stylesheet. */
  --bg: var(--porcelain);
  --surface: #fbfaf6;
  --fg: var(--ink);
  --muted: var(--shade);
  --line: var(--mist);
  --accent: var(--horn);
  --accent-soft: var(--horn-soft);
  --btn-bg: var(--ink);
  --btn-fg: var(--porcelain);
  --code-bg: var(--mist);
  --flag: #a33;
  --mark-filter: none;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --measure: 66ch;
}

/* Porcelain after dark: a warm near-black ground rather than a neutral one, so
   the horn accent still reads as horn. Horn itself opens up to #cba25c, and the
   light-mode value is tuned for AA on porcelain and fails on ink. Every pair
   here is AA or better (fg 14.5:1, muted 7:1, accent 8:1).

   FOLLOWS THE OS SETTING, WITH NO TOGGLE, ON PURPOSE. A switch has to remember
   its position, and web/README.md and semblature.com/privacy.html both promise
   this site stores nothing. That promise is worth more than the switch. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131218;
    --surface: #1b1a21;
    --fg: #ece9e1;
    --muted: #a8a094;
    --line: #2c2a34;
    --accent: #cba25c;
    --accent-soft: #8a6c38;
    --btn-bg: #ece9e1;
    --btn-fg: #131218;
    --code-bg: #1b1a21;
    --flag: #e07a7a;
    /* the mark and the wordmark are one-tone #101014 on transparency, so an
       invert lands them within a shade of porcelain, so no second asset is needed */
    --mark-filter: invert(1);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-variation-settings: 'opsz' 18, 'wght' 400, 'SOFT' 0, 'WONK' 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-variation-settings: 'opsz' 144, 'wght' 600, 'SOFT' 0, 'WONK' 0;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
h1 { font-size: 2.1rem; margin: 0 0 0.6em; }
h2 { font-size: 1.45rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.4em; }

.measure { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 4rem; }

.eyebrow, .entry-date, .entry-meta, .game-facts {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow { margin: 3rem 0 0.75rem; }

/* Header / footer */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 62rem; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--fg);
  font-variation-settings: 'opsz' 144, 'wght' 600;
  font-size: 1.15rem; letter-spacing: 0.09em; text-transform: uppercase;
}
.site-head nav { display: flex; gap: 1.4rem; }
.site-head nav a {
  text-decoration: none; color: var(--muted);
  font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.site-head nav a:hover { color: var(--fg); }

.site-foot {
  border-top: 1px solid var(--line);
  max-width: 62rem; margin: 0 auto; padding: 2rem 1.25rem 3rem;
  color: var(--muted); font-size: 0.9rem;
}
.site-foot img { display: block; margin-bottom: 0.75rem; opacity: 0.8; }
.site-foot p { margin: 0.3em 0; }

/* Hero */
.hero {
  display: flex; align-items: center; gap: 3rem;
  max-width: 62rem; margin: 2.5rem auto 1rem; padding: 0 1.25rem;
}
.hero-mark { flex: 0 0 auto; position: relative; }
.hero-mark img { display: block; width: min(300px, 38vw); height: auto; }
.hero-word .wordmark { width: min(420px, 80vw); height: auto; display: block; }
.hero-line {
  font-variation-settings: 'opsz' 60, 'wght' 500;
  font-size: 1.35rem; margin: 1.2rem 0 0.2rem;
  /* one sentence now, so balance the wrap rather than orphaning the tail */
  text-wrap: balance;
}

@media (max-width: 44rem) {
  .hero { flex-direction: column; gap: 1.5rem; text-align: center; margin-top: 1.5rem; }
  .hero-mark img { width: 42vw; }
  .hero-word .wordmark { margin: 0 auto; }
  .site-head { flex-direction: column; gap: 0.8rem; }
}

/* Game card */
.game-card {
  display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem;
  border: 1px solid var(--line); background: var(--surface);
  padding: 1.25rem; border-radius: 4px;
}
.game-art img { display: block; width: 100%; height: auto; border-radius: 3px; }
.game-copy h2 { margin-top: 0.2rem; }
.game-copy h2 span { font-variation-settings: 'opsz' 60, 'wght' 400; color: var(--muted); }
.game-facts { margin: 0.8rem 0; }
.game-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 0.55rem 1.1rem;
  background: var(--btn-bg); color: var(--btn-fg);
  text-decoration: none; border-radius: 3px;
  font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.btn:hover { background: var(--accent); color: var(--btn-fg); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--fg); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 44rem) {
  .game-card { grid-template-columns: 1fr; }
}

/* Entry lists (devlog) */
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list li { margin: 0 0 1.6rem; }
.entry-list .entry-date { display: block; margin-bottom: 0.15rem; }
.entry-list a {
  font-variation-settings: 'opsz' 90, 'wght' 600;
  font-size: 1.2rem; text-decoration: none; color: var(--fg);
}
.entry-list a:hover { color: var(--accent); }
.entry-desc { margin: 0.25rem 0 0; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
.lede { color: var(--muted); }
.more { margin-top: 1.5rem; }
.feed-link { margin-top: 2rem; }

.entry-meta { margin-bottom: 0.4rem; }
.entry-back { margin-top: 3rem; }

.draft-tag {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--flag);
  border: 1px solid var(--flag); border-radius: 3px; padding: 0.05em 0.4em;
  vertical-align: middle;
}
.draft-banner {
  background: #a33; color: #fff; text-align: center;
  font-family: var(--mono); font-size: 0.8rem; padding: 0.5rem;
}

/* Article body */
.page img, .entry img { max-width: 100%; height: auto; }
blockquote {
  margin: 1.2em 0; padding: 0.2em 1.2em;
  border-left: 3px solid var(--accent-soft); color: var(--muted);
}
pre {
  background: var(--code-bg); padding: 1rem; border-radius: 4px;
  overflow-x: auto; font-size: 0.85rem;
}
code { font-family: var(--mono); font-size: 0.9em; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* The mark, the footer mark and the wordmark are all single-tone #101014 art on
   transparency, so one filter carries them both ways. */
.hero-mark img, .brand img, .site-foot img, .wordmark { filter: var(--mark-filter); }
