:root {
  color-scheme: light;

  /* Brand tokens — see /home/deployer/org/context/brand-system.md §3 */
  --ink: #1b2238;
  --parchment: #f0e7d7;
  --terracotta: #b85c38;
  --sage: #6b7553;

  /* Application tokens composed from brand */
  --bg: var(--parchment);
  --fg: var(--ink);
  --muted: rgba(27, 34, 56, 0.66);
  --soft: rgba(27, 34, 56, 0.5);
  --rule: rgba(27, 34, 56, 0.18);
  --accent: var(--terracotta);

  /* Type stack — see brand-system.md §4. No external font load: real-platform
     fallbacks render directly — Baskerville (Apple) → Baskerville Old Face
     (Windows) → Georgia (Linux/Android and older browsers). */
  --serif: Baskerville, "Baskerville Old Face", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-feature-settings: "kern", "liga", "onum";
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 9vh, 6rem) 1.5rem;
}

main.prose {
  max-width: 40rem;
}

/* ── Masthead (hero teaser) ─────────────────────────────────────── */

.masthead {
  margin-bottom: clamp(2.25rem, 6vh, 3.5rem);
  text-align: center;
}

.masthead .arc {
  display: block;
  width: 100%;
  max-width: 28rem;
  height: auto;
  margin: 0 auto 1.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

/* ── Brand link (masthead identifier on prose pages) ─────────────── */

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 2.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand .lettermark {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1;
  color: var(--ink);
  display: inline-block;
}
.brand .brand-name {
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 120ms ease;
}
.brand:hover .brand-name {
  color: var(--terracotta);
}

/* ── Headings & teaser body ─────────────────────────────────────── */

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  letter-spacing: -0.005em;
  line-height: 1.22;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

main:not(.prose) h1 {
  font-style: italic;
  text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--ink);
  opacity: 0.92;
  max-width: 32rem;
  margin: 0 auto 2rem;
}

.lede {
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--ink);
  opacity: 0.85;
  margin: 0 0 1.75rem;
  line-height: 1.5;
  text-align: center;
}

.beat {
  margin: 0 0 2.25rem;
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 1.65;
  text-align: center;
}

.next {
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
  margin-top: 2.75rem;
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}
.next strong {
  color: var(--ink);
  font-style: normal;
  font-weight: 400;
}

footer {
  margin-top: 4rem;
  font-size: 0.85rem;
  color: var(--soft);
  letter-spacing: 0.04em;
  font-style: italic;
  text-align: center;
}

/* ── Long-form prose ────────────────────────────────────────────── */

.prose .article-meta {
  margin: 0 0 2rem;
  font-size: 0.9rem;
  color: var(--soft);
  letter-spacing: 0.04em;
  font-style: italic;
}
.prose .article-meta time {
  color: var(--muted);
}

.prose h1 {
  margin-bottom: 1.75rem;
  font-size: clamp(1.85rem, 4.2vw, 2.5rem);
  line-height: 1.22;
  font-style: normal;
  text-align: left;
  letter-spacing: -0.005em;
  max-width: none;
}

.prose .lede-prose {
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  color: var(--ink);
  opacity: 0.92;
  margin: 0 0 2.5rem;
  line-height: 1.5;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.55rem);
  line-height: 1.32;
  margin: 3rem 0 1rem;
  color: var(--ink);
  letter-spacing: -0.003em;
}

.prose h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 2.25rem 0 0.7rem;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.4rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
  font-style: normal;
}

.prose em {
  font-style: italic;
  color: inherit;
}

.prose a:not(.brand) {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--terracotta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-thickness 120ms ease;
}
.prose a:not(.brand):hover {
  text-decoration-thickness: 2px;
}

.prose blockquote {
  margin: 1.75rem 0 2rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}
.prose blockquote p {
  margin: 0 0 0.75rem;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1.6rem;
  padding-left: 1.4rem;
}
.prose li {
  margin: 0 0 0.65rem;
  line-height: 1.65;
  font-size: 1.05rem;
}
.prose li:last-child {
  margin-bottom: 0;
}
.prose ul li::marker {
  color: var(--terracotta);
}

/* End-mark divider: the marked point on a thin rule */
.prose hr {
  border: 0;
  height: 0;
  margin: 3rem 0;
  position: relative;
  text-align: center;
  overflow: visible;
}
.prose hr::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--rule);
}
.prose hr::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  margin: -3.5px auto 0;
  position: relative;
}

.prose .article-coda {
  margin-top: 2.5rem;
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.6;
}

/* ── More-from module ───────────────────────────────────────────── */

.more-from {
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
  margin-top: 3.5rem;
}
.more-from h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--soft);
  margin: 0 0 1rem;
}
.more-from ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.more-from li {
  margin: 0 0 0.65rem;
  line-height: 1.5;
}
.more-from a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 120ms ease;
}
.more-from a:hover {
  border-bottom-color: var(--terracotta);
}

/* ── Early-access capture (MON-11) ──────────────────────────────── */

.ea {
  margin-top: 1.5rem;
}
.ea-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}
.ea-input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-style: italic;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.ea-input::placeholder {
  color: var(--soft);
  font-style: italic;
}
.ea-input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.18);
}
.ea-button {
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.ea-button:hover:not(:disabled) {
  background: #a04f30;
  border-color: #a04f30;
}
.ea-button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.ea-pot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ea-status {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  font-style: italic;
}
.ea-status[data-tone="ok"] {
  color: var(--terracotta);
}
.ea-status[data-tone="err"] {
  color: #8a3a1f;
}

/* ── Small-screen tightening ────────────────────────────────────── */

@media (max-width: 480px) {
  main {
    padding: 2.25rem 1.25rem 3rem;
  }
  .masthead {
    margin-bottom: 2rem;
  }
  .brand {
    margin-bottom: 2rem;
  }
}
