:root {
  --bg: #222428;
  --ink: #c2c8d8;
  --muted: #8a8f9c;
  --rule: #3a3d44;
  --accent: #d6a36b;

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

  --reading-w: 36rem;
  --frame-w: 60rem;
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
a:hover,
a:focus {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

p {
  margin: 0 0 1.2em;
}

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

hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.5em 0;
}

code, kbd, samp, pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

code {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--rule);
  padding: 1em 1.2em;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

blockquote {
  border-left: 2px solid var(--rule);
  padding: 0.2em 0 0.2em 1.2em;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
}

figcaption,
.caption,
.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.divided::after {
  content: "";
  display: block;
  width: 4rem;
  height: 1px;
  background: var(--rule);
  margin: 1.25em auto 0;
}

/* ------------------------------------------------------------------
   Masthead — large, centered, generous whitespace (Hitchens-style).
   ------------------------------------------------------------------ */
.site-header {
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
}

.site-title {
  margin: 0 0 0.3em;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 2.25rem;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.45em;
  /* tracking pushes the last letter off-center; compensate with left padding */
  padding-left: 0.45em;
}
.site-title a {
  color: var(--ink);
  text-decoration: none;
}
.site-title a:hover {
  color: var(--accent);
}

.site-tagline {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (min-width: 720px) {
  .site-header {
    padding: 6rem 2rem 5rem;
  }
  .site-title {
    font-size: 3.5rem;
  }
  .site-tagline {
    font-size: 1.875rem;
  }
}

/* ------------------------------------------------------------------
   Home — "Contents" heading + minimal post list (title left, date right).
   ------------------------------------------------------------------ */
.home {
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.content-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  text-align: center;
  margin: 0 0 2.5rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin: 0;
}

.post-list:hover .post-link,
.post-list:focus-within .post-link {
  opacity: 0.55;
}
.post-link:hover,
.post-link:focus {
  opacity: 1 !important;
  color: var(--ink);
}

.post-link {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.15rem;
  padding: 0.8rem 0;
  text-decoration: none;
  color: var(--ink);
}

.post-link__title {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.35;
}

.post-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

@media (min-width: 600px) {
  .post-link {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  .post-link__title {
    flex: 1;
  }
}

/* ------------------------------------------------------------------
   Article — centered title with divider, then date, then hero, then
   justified body with paragraph indents.
   ------------------------------------------------------------------ */
.post {
  max-width: var(--frame-w);
  margin: 0 auto;
  padding: 2rem 0 1rem;
}

.post > * {
  max-width: var(--reading-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem;
}

.post-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.25rem;
  line-height: 1.15;
  text-align: center;
  max-width: 44rem;
  padding: 2rem 1.25rem 0;
  margin: 0 auto;
}

@media (min-width: 720px) {
  .post-title {
    font-size: 3rem;
    padding-top: 3rem;
  }
}

.post-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 1.5rem auto 2rem;
}

.post-hero {
  width: 100%;
  max-width: var(--frame-w);
  max-height: 32rem;
  object-fit: cover;
  margin: 0 auto 3rem;
  padding: 0;
  border-radius: 2px;
}

.post-body {
  font-family: var(--sans);
  font-size: 1.25rem;
  line-height: 1.7;
}

.post-body p {
  text-align: justify;
  text-indent: 1.5em;
  text-justify: inter-word;
  margin: 0 0 1em;
  hyphens: auto;
}

.post-body p:first-of-type,
.post-body h2 + p,
.post-body h3 + p,
.post-body blockquote + p {
  text-indent: 0;
}

.post-body h2,
.post-body h3 {
  text-align: center;
  font-family: var(--serif);
}
.post-body h2 {
  font-size: 1.75rem;
  margin: 2.2em 0 1.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1em;
}
.post-body h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--ink);
  opacity: 0.6;
}
.post-body h3 {
  font-size: 1.15rem;
  font-style: italic;
  margin: 2em 0 0.5em;
}

.post-body img {
  margin: 2em auto;
  border-radius: 2px;
}

.post-body figcaption {
  margin-top: 0.6em;
  text-align: center;
}

.post-signoff,
.signoff {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ------------------------------------------------------------------
   Footer + skip nav.
   ------------------------------------------------------------------ */
.back-nav {
  max-width: var(--frame-w);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.15s ease;
}
.back-link:hover,
.back-link:focus {
  color: var(--accent);
}
.site-footer {
  margin-top: 5rem;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip-navigation {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-navigation:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  text-transform: uppercase;
}

/* Echo home background — OGL ink shader. Home page only.
   Canvas is fixed behind all content; pointer-events disabled so it never
   interferes with clicks. Hidden when prefers-reduced-motion is set. */
.echo-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .echo-bg { display: none; }
}

/* Article-end countdown: monospace DDDD:HH:MM:SS ticking to a shared target. */
.post-countdown {
  margin: 4em auto 0;
  padding-top: 2em;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  text-align: center;
}
.post-countdown__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-countdown__value {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Article codes — stable 5-char identifier rendered under the kicker and in
   the home listing. Muted monospace; the maintainer refers to these when
   driving the edit-post / regen-image commands. */
.post-code,
.post-list__code {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.7;
}

.post-code {
  display: block;
  text-align: center;
  margin: 0.75rem auto 0;
}

.post-list__code {
  display: inline;
  margin-left: 0.6em;
}
