/* Atoms · shared values and element rules. */
:root {
  --ink:#241d22;
  --bg:#fbfafb;
  --behind: color-mix(in srgb, var(--bg), black 0%);
  --oblivion: color-mix(in srgb, var(--behind), black 80%);
  --link:#790b78;
  --link-hover:var(--red);
  --image-shadow:0 4px 20px hsl(0 0% 0% / 0.12);
  --red:#b3132b;
  --rule: color-mix(in srgb, var(--ink), transparent 78%);
  --col: 1120px;
  --interface: "Oswald", "Arial Narrow", sans-serif;
  --mono: 'Courier New', Courier, monospace;
  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --reading: "Alegreya", Georgia, serif;

  /* Base reading size and heading scale. */
  --base-font: clamp(1.3rem, 3vw, 2rem);
  --h1-size: clamp(3.2rem, 10vw, 8rem);
  --h4-size: clamp(1.25rem, 2.75vw, 1.875rem);
  --h5-size: clamp(1.125rem, 2.25vw, 1.5rem);
  --h6-size: clamp(1rem, 1.75vw, 1.25rem);
}

@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/imfell-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/imfell-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1edef;
    --bg: #1b1c20;
    --behind: #1b1c20;
    --link: #e15bd7;
    --link-hover: #ff7888;
    --image-shadow: none;
    --red: #ff4057;
    --rule: color-mix(in srgb, var(--ink), transparent 80%);
  }
}

*{ box-sizing: border-box;
}

/* ATOMS · base elements; browser defaults remain unless the reading system needs a change. */
html { background: var(--behind); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--behind);
  font-family: var(--reading);
  font-size: var(--base-font);
  line-height: 1.8;
  overflow-wrap: break-word;
}
p { line-height: 1.65; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  clear: both;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -.025em;
}
h1 { font-size: clamp(3rem, 7.4vw, 6.25rem); line-height: .94; }
h2 { padding-top: 3rem; font-size: clamp(2rem, 5vw, 4.5rem); line-height: .98; }
h3 { font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.05; }
h4 { font-size: var(--h4-size); line-height: 1.4; font-weight: 600; }
h5 { font-size: var(--h5-size); line-height: 1.5; font-weight: 500; }
h6 { font-size: var(--h6-size); line-height: 1.5; font-weight: 500; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: .2em; }
strong { color: var(--red); font-weight: 700; }
b { display: block; margin: 0; color: var(--link); font: 700 .68rem/1.3 var(--interface); letter-spacing: .1em; text-transform: uppercase; }
@media (min-width: 721px) {
  h2 { padding-top: clamp(2.5rem, 6vw, 5rem); }
}
blockquote {
  margin: 2rem 0;
  padding: .25rem .25rem .25rem 1rem;
  border-left: 2px solid var(--red);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-style: italic;
  line-height: 1.35;
}
blockquote cite { display: block; margin-top: 1rem; opacity: .55; text-align: right; font-size: .72em; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 1.5rem 0; }
/* picture stays transparent except when an image participates in a grid. */
picture { display: contents; }
pre, code { background: var(--bg); padding: .2em .4em; border-radius: 4px; }
pre { max-width: 100%; overflow-x: auto; border-left: 2px solid var(--red); padding: 1rem; }
code { font-size: .82em; }
