/* ============================================================================
   Architecting the Writing Room - writingroom.efrederick.net

   Dark by design, not by toggle. Light text on a dark ground is the whole
   brief, so there is no prefers-color-scheme branch: this site looks the same
   everywhere on purpose.

   Two deliberate departures from literally inverting black and white:

   1. The ground is #0e0f11, not #000, and body text is #e4e1dc, not #fff. At
      maximum contrast the glyph edges bloom into the background and the text
      smears on a long read. Backing both ends off a few percent still reads
      as black-and-white but survives 4,000 words.
   2. Body copy is a serif. These are long technical essays, and a serif holds
      the eye across a 68ch measure better than a UI sans does.

   Accent is brass, NOT the red of the fiction site. Two different rooms.
   ========================================================================= */

:root {
  --bg:            #0e0f11;
  --bg-raised:     #16181c;
  --bg-code:       #131519;

  --text:          #e4e1dc;   /* body copy - warm off-white, not #fff */
  --text-head:     #f4f2ef;   /* headings sit a touch brighter */
  --text-dim:      #b3aea7;   /* secondary prose, theses, ledes */
  --text-mute:     #8b9096;   /* meta, dates, captions */

  --accent:        #d8a657;   /* brass */
  --accent-bright: #f0bd72;
  --accent-dim:    #8a6c3a;

  --border:        #24272c;
  --border-strong: #33373e;

  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, Cambria,
           "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
           sans-serif;
  --mono:  ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas,
           "Liberation Mono", Menlo, monospace;

  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 2rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- nav ---- */

nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 64px;
  flex-wrap: wrap;
}

.nav-name {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-head);
  white-space: nowrap;
}
.nav-name:hover { color: var(--accent-bright); }

nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
nav ul li a { color: var(--text-mute); }
nav ul li a:hover,
nav ul li a.active { color: var(--accent-bright); }

/* --------------------------------------------------------------- hero ---- */

.page-hero { padding: 5rem 0 2.5rem; border-bottom: 1px solid var(--border); }

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text-head);
  margin: 0 0 1.2rem;
}

.page-hero p.lede {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: var(--measure);
  margin: 0;
}

/* -------------------------------------------------------------- index ---- */

.series-note {
  padding: 2.5rem 0 0;
  max-width: var(--measure);
  color: var(--text-dim);
  font-size: 0.98rem;
}
.series-note strong { color: var(--text); font-weight: 600; }

.entry-list { padding: 1.5rem 0 5rem; list-style: none; margin: 0; }

.entry {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 2rem;
  align-items: start;
}
.entry:last-child { border-bottom: 1px solid var(--border); }

.entry-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  line-height: 1.9;
  padding-top: 0.45rem;
}
.entry-no { display: block; color: var(--accent-dim); font-size: 0.8rem; }

.entry-body { min-width: 0; max-width: var(--measure); }

.entry h2 {
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.7rem;
}
.entry h2 a { color: var(--text-head); }
.entry h2 a:hover { color: var(--accent-bright); }

.entry .thesis { margin: 0; color: var(--text-dim); font-size: 1rem; line-height: 1.7; }

.entry .entry-foot {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-top: 0.85rem;
  text-transform: uppercase;
}

/* ------------------------------------------------------------ article ---- */

.article-header { padding: 3.5rem 0 0; }

.article-header .kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.article-header h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-head);
  margin: 0 0 0.7rem;
  max-width: min(22ch, 100%);
}

.article-header .subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 0 0 1.4rem;
  max-width: var(--measure);
}

.article-header .byline {
  font-family: var(--sans);
  font-size: 0.73rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.article-header-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
  margin-top: 2rem;
  border: 1px solid var(--border);
}

.article-content { padding: 3rem 0 2rem; max-width: var(--measure); }

.article-content > p { margin: 0 0 1.55rem; }

.article-content h2 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-head);
  margin: 3rem 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 2.2rem 0 0.8rem;
}

.article-content blockquote {
  margin: 0 0 1.55rem;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-dim);
  font-style: italic;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

.article-content ul,
.article-content ol { margin: 0 0 1.55rem; padding-left: 1.4rem; }
.article-content li { margin-bottom: 0.55rem; }

.article-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.75rem 0;
}

.article-content strong { color: var(--text-head); font-weight: 600; }

/* Dates a position rather than a fact, so a reader years out knows whether it
   still holds. Sits under a heading, above the statement it stamps. */
.article-content p.dateline {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: -0.4rem 0 1.3rem;
}

/* Code. These essays carry docker-compose, SQL and schema blocks, so this is
   load-bearing rather than decorative. Blocks scroll inside themselves so the
   page body never scrolls sideways. */
.article-content code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.12em 0.36em;
  color: var(--accent-bright);
}

.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.55rem;
  font-size: 0.86rem;
  line-height: 1.6;
}
.article-content pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 1em;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.55rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  display: block;
  overflow-x: auto;
}
.article-content th,
.article-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.article-content th { color: var(--text-head); background: var(--bg-raised); font-weight: 600; }

.article-content img { border: 1px solid var(--border); display: block; margin: 0 0 1.55rem; }

/* ----------------------------------------------------------- article foot */

.article-foot {
  border-top: 1px solid var(--border);
  padding: 2rem 0 5rem;
  max-width: var(--measure);
}

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.5;
}
.prevnext .slot { max-width: 20rem; }
.prevnext .slot.next { text-align: right; margin-left: auto; }
.prevnext .lbl {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 0.3rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.15rem;
}
.back-link:hover { color: var(--accent-bright); border-color: var(--accent-dim); }

/* --------------------------------------------------------- disclosure ---- */

/* Mirrors VoT-Site's .ai-disclosure rule exactly, with one substitution: the
   accent there is --red-light, which is the fiction's colour. Brass is the
   equivalent role here. */
.ai-disclosure {
  font-size: 0.78rem;
  color: var(--accent);
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------- footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3.5rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--text-mute);
}
footer .container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.footer-name { letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-mute); }
.footer-links a:hover { color: var(--accent-bright); }

/* -------------------------------------------------------------- small ---- */

@media (max-width: 720px) {
  .container { padding: 0 1.25rem; }
  .page-hero { padding: 3rem 0 2rem; }
  .entry { grid-template-columns: 1fr; gap: 0.6rem; }
  .entry-meta { padding-top: 0; }
  .entry-no { display: inline; margin-right: 0.6rem; }
  nav .container { min-height: 0; padding-top: 0.75rem; padding-bottom: 0.75rem; }
  nav ul { gap: 1.1rem; }
  .prevnext .slot.next { text-align: left; margin-left: 0; }
}
