/* ============================================
   alpharecursion.com — Kolja Wawrowsky
   Typography-first. Let it breathe.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  --bg: #faf9f6;
  --bg-warm: #f5f3ee;
  --text: #2c2c2c;
  --text-secondary: #4a4540;
  --text-tertiary: #9e9891;
  --accent: #8b4513;
  --accent-light: #a0522d;
  --rule: #e0dcd5;
  --rule-light: #eceae5;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif; /* alias — use for headings */
  --font-body: 'Crimson Pro', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  --content-width: 720px;
  --page-padding: 2rem;
}

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

html {
  font-size: 21px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Navigation ---- */

.site-nav {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 3rem var(--page-padding) 0;
}

.site-nav__inner {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  padding-bottom: 1.5rem;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  margin-right: 2.5rem;
}

.site-name:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  flex: 1;
  list-style: none;
  align-items: baseline;
}

.nav-links li + li::before {
  content: "·";
  margin: 0 1rem;
  color: var(--text-tertiary);
}


.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.site-tagline {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  margin: 1.25rem 0 0;
  text-wrap: balance;
}

@media (max-width: 600px) {
  .site-tagline {
    font-size: 0.95rem;
  }
}

.nav-links a.nav-author {
  color: var(--text-tertiary);
}

.nav-links a.nav-author:hover,
.nav-links a.nav-author.active {
  color: var(--text);
}

/* ---- Main Content ---- */

main {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--page-padding);
  flex: 1;
}

.list-header {
  padding: 2.5rem 0 1rem;
}

.list-header h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---- Essay List (editorial, single-column) ---- */

.essay-grid {
  padding: 0.5rem 0 6rem;
}

.essay-tile {
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule-light);
}


.essay-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.essay-category {
  color: var(--accent);
}

.essay-tile h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.essay-tile h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.essay-tile h2 a:hover {
  color: var(--accent);
}

.essay-excerpt {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.85;
  flex: 1;
}

.read-more {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: var(--text);
}

/* ---- Single Essay ---- */

.essay-header {
  padding: 2.5rem 0 1.5rem;
}

.essay-header .essay-date {
  margin-bottom: 1.25rem;
}

.essay-header h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.essay-header .essay-subtitle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
}

.essay-body {
  padding-bottom: 0;
}

.essay-body p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.85;
}

.essay-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.essay-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.essay-body blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--rule);
  font-style: italic;
  font-weight: 300;
  color: var(--text-secondary);
}

.essay-body code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-warm);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.essay-body pre {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-warm);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.essay-body pre code {
  background: none;
  padding: 0;
}

.essay-body ul,
.essay-body ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.essay-body li {
  margin-bottom: 0.5rem;
}

.essay-body hr {
  border: none;
  border-top: 1px solid var(--rule-light);
  margin: 3rem 0;
}

.essay-body img {
  max-width: 100%;
  margin: 2rem 0;
}

.essay-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.3s ease;
}

.essay-body a:hover {
  border-color: var(--accent);
}

/* ---- Post response invitation ---- */

.essay-response {
  margin-top: 3rem;
  padding-top: 2rem;
  padding-bottom: 6rem;
  border-top: 1px solid var(--rule-light);
}

.essay-response p {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.85;
}

.essay-response a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.essay-response a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Page content (about, publications) ---- */

.page-header {
  padding: 2.5rem 0 1.5rem;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.page-body {
  padding-bottom: 6rem;
}

.page-body p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.85;
}

.page-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.page-body > h2:first-child,
.page-body > :first-child h2 {
  margin-top: 0;
}

.page-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-body ul,
.page-body ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.page-body li {
  margin-bottom: 0.5rem;
  line-height: 1.85;
}

.page-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.3s ease;
}

.page-body a:hover {
  border-color: var(--accent);
}

.credentials {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 2;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ---- Footer ---- */

.site-footer {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--page-padding) 3rem;
}

.site-footer__inner {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.footer-text a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

@media (max-width: 720px) {
  html {
    font-size: 18px;
  }

  .site-nav {
    padding-top: 2rem;
  }

  .site-nav__inner {
    flex-direction: column;
    gap: 1rem;
  }

  .site-tagline {
    margin-top: 1rem;
    font-size: 1rem;
  }

  .essay-tile h2 {
    font-size: 1.4rem;
  }

  .essay-header {
    padding: 3.5rem 0 2rem;
  }

  .essay-header h1 {
    font-size: 1.9rem;
  }

  .nav-links {
    gap: 1.5rem;
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #1a1917;
    --bg-warm:        #211f1c;
    --text:           #e8e4de;
    --text-secondary: #b8b0a6;
    --text-tertiary:  #6e6860;
    --accent:         #c87941;
    --accent-light:   #d4895a;
    --rule:           #2e2b27;
    --rule-light:     #252320;
  }
}
