/* ==========================================================================
   Atrophy of Humans — main.css
   ========================================================================== */

/* --- Custom properties --------------------------------------------------- */

:root {
  /* Colors — light mode */
  --color-bg: #fafaf8;
  --color-text: #1a1a1a;
  --color-muted: #8a8a80;
  --color-rule: #d4d4cc;
  --color-link: #1a1a1a;
  --color-link-hover: #555;
  --color-accent: #444;

  /* Type scale */
  --font-body: Georgia, "Times New Roman", Times, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --fs-base: 1.125rem;    /* 18px */
  --fs-small: 0.875rem;
  --fs-xs: 0.7rem;
  --fs-h1: 2rem;
  --fs-h2: 1.4rem;

  /* Spacing */
  --leading: 1.78;
  --measure: 38em;        /* ~68 chars in Georgia at 18px */
  --space-s: 0.75rem;
  --space-m: 1.5rem;
  --space-l: 3rem;
  --space-xl: 5rem;
}

/* --- Dark mode ----------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #141413;
    --color-text: #d5d5cc;
    --color-muted: #7a7a70;
    --color-rule: #333330;
    --color-link: #d5d5cc;
    --color-link-hover: #aaa;
    --color-accent: #bbb;
  }
}

/* --- Reset --------------------------------------------------------------- */

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

/* --- Base ---------------------------------------------------------------- */

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--leading);
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: var(--space-m);
}

/* --- Typography ---------------------------------------------------------- */

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-s);
}

h2 {
  font-size: var(--fs-h2);
  margin-top: var(--space-l);
  margin-bottom: var(--space-s);
}

p {
  margin-bottom: var(--space-m);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-link-hover);
}

blockquote {
  border-left: 2px solid var(--color-rule);
  padding-left: var(--space-m);
  color: var(--color-muted);
  margin-bottom: var(--space-m);
}

/* --- Layout -------------------------------------------------------------- */

main {
  max-width: var(--measure);
  margin: var(--space-xl) auto var(--space-l);
}

/* --- Site header --------------------------------------------------------- */

.site-header {
  max-width: var(--measure);
  margin: 0 auto;
}

.site-nav {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  display: flex;
  gap: var(--space-m);
  align-items: baseline;
}

.site-nav .site-name {
  font-weight: 600;
  text-decoration: none;
}

.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-text);
}

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

.site-footer {
  max-width: var(--measure);
  margin: var(--space-xl) auto var(--space-m);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--color-muted);
  text-align: center;
}

/* --- Home page ----------------------------------------------------------- */

.home-title {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-s);
}

.home-definition {
  color: var(--color-muted);
  margin-bottom: var(--space-xl);
}

.def-word {
  font-size: var(--fs-h2);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0;
}

.def-pronunciation {
  font-size: var(--fs-small);
  margin-bottom: var(--space-s);
}

.def-pos {
  font-style: italic;
  margin-bottom: 0.25rem;
}

.def-meanings {
  list-style-position: outside;
  padding-left: 1.25em;
  margin-bottom: 0;
}

.def-meanings li {
  margin-bottom: 0.25rem;
}

.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: var(--space-l);
}

.post-item a {
  text-decoration: none;
  display: block;
}

.post-item a:hover .post-item-title {
  color: var(--color-link-hover);
}

.post-item-title {
  font-size: var(--fs-h2);
  margin-bottom: 0.25rem;
}

.post-item-deck {
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 0.25rem;
}

.post-item-date {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

/* --- Article ------------------------------------------------------------- */

.article-header {
  margin-bottom: var(--space-xl);
}

.article-title {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-s);
}

.article-deck {
  font-style: italic;
  color: var(--color-muted);
  font-size: 1.15rem;
  margin-bottom: var(--space-s);
}

.article-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

.article-meta .separator {
  margin: 0 0.35em;
}

/* --- Article body -------------------------------------------------------- */

.article-body p {
  margin-bottom: var(--space-m);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: var(--space-l) 0;
}

/* Act labels: ACT ONE, ACT TWO, etc. */
.act-label {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
}

/* The first act label needs no top margin (header provides spacing) */
.article-body > .act-label:first-child {
  margin-top: 0;
}

/* --- Page layout --------------------------------------------------------- */

.page h1 {
  margin-bottom: var(--space-l);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --fs-base: 1.05rem;
    --fs-h1: 1.6rem;
    --fs-h2: 1.25rem;
    --space-xl: 3rem;
    --space-l: 2rem;
  }

  body {
    padding: var(--space-s);
  }
}
