/* Shared editorial layout for static content pages (/rules, /techniques/*).
   Kept separate from the SPA bundle so these pages stand alone for crawlers. */

:root {
  --c-paper: #f4efe6;
  --c-paper-2: #ece3d2;
  --c-paper-3: #e2d6bd;
  --c-ink: #14110d;
  --c-ink-2: #6b6356;
  --c-rule: #2a2520;
  --c-accent: #9a2a2a;
  --c-accent-tint: #ecd7d2;
  --font-display: "Fraunces", "IM Fell English", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-paper: #0e0c0a;
    --c-paper-2: #1a1612;
    --c-paper-3: #241f18;
    --c-ink: #ede5d3;
    --c-ink-2: #a39a8a;
    --c-rule: #6b6356;
    --c-accent: #d49c4a;
    --c-accent-tint: #2a1f12;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "calt";
  font-variation-settings: "SOFT" 50, "WONK" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

.masthead-bar {
  border-bottom: 1px solid var(--c-ink);
}
.masthead-bar > div {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}
.masthead {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.025em;
  font-feature-settings: "lnum", "ss01", "calt";
  font-size: 1.5rem;
  margin: 0;
  text-decoration: none;
  color: var(--c-ink);
}
.masthead-nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}
.masthead-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--c-ink-2);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.masthead-nav a:hover { color: var(--c-ink); border-bottom-color: var(--c-ink); }

article {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.kicker {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--c-accent);
  margin: 0 0 0.5rem;
}
article h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 80, "WONK" 1, "opsz" 144;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
}
.byline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--c-ink-2);
  margin: 0 0 2rem;
  font-size: 1rem;
}
article p, article ul, article ol {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.1rem;
}
article ul, article ol { padding-left: 1.5em; }
article li { margin-bottom: 0.35rem; }
article h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 36;
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}
article h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}
article a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
article a:hover { text-decoration-thickness: 2px; }

.lede::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  font-size: 3.6em;
  float: left;
  line-height: 0.85;
  padding: 0.1em 0.12em 0 0;
  color: var(--c-ink);
}

.hr {
  border: 0;
  border-top: 1px solid var(--c-rule);
  opacity: 0.4;
  margin: 2.5rem 0;
}

/* Mini Sudoku board diagram — same 3-tier rule treatment as the app. */
.diagram {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  margin: 1.5rem auto;
  max-width: 360px;
  border: 3px solid var(--c-ink);
  background: var(--c-paper);
  font-family: var(--font-display);
  font-feature-settings: "lnum", "tnum";
  font-variant-numeric: lining-nums tabular-nums;
  aspect-ratio: 1 / 1;
}
.diagram .c {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.7rem, 2.5vw, 0.95rem);
  font-weight: 600;
  color: var(--c-ink);
  position: relative;
  background: transparent;
}
.diagram .c.t::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--c-paper-2) 55%, transparent);
  z-index: 0;
}
.diagram .c > span { position: relative; z-index: 1; }
/* Cell-internal hairlines */
.diagram .c { border-top: 1px solid color-mix(in srgb, var(--c-rule) 25%, transparent); border-left: 1px solid color-mix(in srgb, var(--c-rule) 25%, transparent); }
/* Box dividers — every 3rd column/row gets a thicker top/left */
.diagram .c.box-top { border-top: 2px solid var(--c-ink); }
.diagram .c.box-left { border-left: 2px solid var(--c-ink); }
/* First row/col have no top/left because of the outer 3px frame on .diagram */
.diagram .c.first-row { border-top: 0; }
.diagram .c.first-col { border-left: 0; }
/* Highlight a single cell — used in technique illustrations */
.diagram .c.hi {
  background: var(--c-accent-tint);
  color: var(--c-accent);
  font-style: italic;
}
.diagram .c.hi::before { background: transparent; }
.diagram .c.dim { color: var(--c-ink-2); }
.diagram .c.note {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--c-ink-2);
  line-height: 1;
  letter-spacing: -0.04em;
  padding: 0.1em;
  text-align: center;
}
.diagram-caption {
  text-align: center;
  font-style: italic;
  color: var(--c-ink-2);
  font-size: 0.95rem;
  margin: -0.5rem 0 2rem;
}

.cta {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--c-rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.cta p { margin: 0; font-size: 0.95rem; }
.cta a.button {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  color: var(--c-paper);
  background: var(--c-accent);
  border: 1px solid var(--c-accent);
  text-decoration: none;
  white-space: nowrap;
}
.cta a.button:hover { filter: brightness(0.9); }

footer.site {
  border-top: 1px solid color-mix(in srgb, var(--c-rule) 40%, transparent);
  margin-top: 2rem;
}
footer.site > div {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}
footer.site .small {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--c-ink-2);
}
footer.site em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--c-ink-2);
  font-size: 0.95rem;
}

::selection { background: var(--c-accent); color: var(--c-paper); }
