/* ============================================
   rarepepe.cloud — editorial archive
   ============================================ */

:root {
  /* Palette */
  --paper:      #F2EBE0;
  --paper-deep: #E8DFD0;
  --ink:        #1F1A14;
  --ink-soft:   #4A4339;
  --ink-faint:  #6B6358;
  --rule:       #D8CFC0;
  --accent:     #15803D;
  --hot:        #9A3412;
  --mark:       #FDE68A;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Crimson Pro', 'Iowan Old Style', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* Scale */
  --measure: 38rem;
  --pad-x: clamp(1.25rem, 5vw, 2rem);
  --pad-y: clamp(2rem, 6vw, 4rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  font-feature-settings: 'liga' 1, 'kern' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Site header / nav
   ============================================ */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 50;
}

.site-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-name::before {
  content: '◆ ';
  color: var(--accent);
}

.site-nav {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 120ms ease;
  position: relative;
}

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

.site-nav a.current { color: var(--ink); }

.site-nav a.current::after {
  content: '';
  position: absolute;
  bottom: -0.4rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* ============================================
   Main layout
   ============================================ */

main { padding: var(--pad-y) var(--pad-x); }

.wrap {
  max-width: 64rem;
  margin: 0 auto;
}

/* ============================================
   Homepage hero
   ============================================ */

.home-hero {
  padding: 1rem 0 var(--pad-y);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--pad-y);
}

.home-hero .kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.home-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-variation-settings: 'opsz' 144;
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 1.75rem;
  color: var(--ink);
  max-width: 18ch;
}

.home-hero h1 em {
  font-style: italic;
  color: var(--hot);
  font-variation-settings: 'opsz' 144;
}

.home-hero .lede {
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.home-hero .cta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: color 120ms ease, border-color 120ms ease;
}

.home-hero .cta:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.home-hero .cta::after {
  content: ' →';
  color: var(--accent);
}

.home-hero .cta:hover::after { color: var(--hot); }

/* ============================================
   Section heading
   ============================================ */

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.home-section { margin-bottom: 4rem; }

/* ============================================
   Featured article (homepage)
   ============================================ */

.featured {
  display: grid;
  gap: 1rem;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--rule);
}

.featured .featured-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.featured .featured-meta::before {
  content: '◆ Featured ';
  color: var(--accent);
  margin-right: 0.5rem;
}

.featured h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-variation-settings: 'opsz' 144;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

.featured h3 a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(to bottom, transparent 60%, var(--mark) 60%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 200ms ease, color 120ms ease;
}

.featured h3 a:hover {
  background-size: 100% 100%;
  color: var(--hot);
}

.featured .featured-dek {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: var(--measure);
}

.featured .read-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  margin-top: 0.5rem;
  display: inline-block;
}

.featured .read-link::after { content: ' →'; color: var(--accent); }

.featured .read-link:hover { color: var(--hot); }

/* ============================================
   Article list
   ============================================ */

.archive { display: grid; gap: 0; }

.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry:last-child { border-bottom: none; }

.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.entry-meta .pending {
  color: var(--ink-faint);
  background: var(--paper-deep);
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  border-radius: 2px;
  font-size: 0.7rem;
}

.entry h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

.entry h3 a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(to bottom, transparent 60%, var(--mark) 60%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 200ms ease;
}

.entry h3 a:hover {
  background-size: 100% 100%;
  color: var(--hot);
}

.entry h3 .pending-title { color: var(--ink-faint); }

.entry-dek {
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0.25rem 0 0;
  max-width: var(--measure);
}

@media (min-width: 720px) {
  .entry {
    grid-template-columns: 9rem 1fr;
    gap: 2rem;
    align-items: baseline;
  }
}

/* ============================================
   View-all link
   ============================================ */

.view-all {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.view-all a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.view-all a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.view-all a::after { content: ' →'; color: var(--accent); }
.view-all a:hover::after { color: var(--hot); }

/* ============================================
   About teaser (homepage)
   ============================================ */

.about-teaser p {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 1.5rem;
}

/* ============================================
   Page header (articles index, about)
   ============================================ */

.page-header {
  padding: 1rem 0 var(--pad-y);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--pad-y);
}

.page-header .kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-variation-settings: 'opsz' 144;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.page-header .lede {
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================
   About page body
   ============================================ */

.about-body {
  max-width: var(--measure);
  margin: 0 auto;
}

.about-body p {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  line-height: 1.65;
}

.about-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.about-body h2::before {
  content: '§ ';
  color: var(--accent);
  font-weight: 400;
}

.about-body a {
  color: var(--hot);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ============================================
   Article page
   ============================================ */

.article-header {
  max-width: var(--measure);
  margin: 0 auto 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.crumbs {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}

.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--hot); }

.article-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-variation-settings: 'opsz' 144;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-meta span::before { content: '◆ '; color: var(--accent); }

.article-body {
  max-width: var(--measure);
  margin: 0 auto;
}

.article-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 0.85;
  float: left;
  margin: 0.35rem 0.5rem -0.25rem 0;
  color: var(--hot);
}

.article-body p { margin: 0 0 1.25rem; }

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
}

.article-body h2::before {
  content: '§ ';
  color: var(--accent);
  font-weight: 400;
}

.article-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

.article-body a {
  color: var(--hot);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body a:hover { background: var(--mark); }

.article-body ul {
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.article-body li::marker {
  color: var(--accent);
  font-family: var(--font-mono);
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.article-body em { font-style: italic; }
.article-body strong { font-weight: 600; }

.pull {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

/* ============================================
   Sources, related
   ============================================ */

.sources, .related {
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.sources h2, .related h2 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  margin: 0 0 1.25rem;
}

.sources ol {
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.sources li {
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.sources li::marker {
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

.sources a {
  color: var(--hot);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-word;
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.related a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25rem;
  transition: color 120ms ease, border-color 120ms ease;
}

.related a:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

/* ============================================
   Site footer
   ============================================ */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem var(--pad-x);
  margin-top: 5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer .footer-name { color: var(--ink); }

.site-footer .footer-name::before {
  content: '◆ ';
  color: var(--accent);
}

.site-footer nav { display: flex; gap: 1.5rem; }

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer a:hover { color: var(--hot); }

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus { top: 0; }
