/* =========================================================
   Theoretical Genetics — shared minimal-academic stylesheet
   (mirrors theoretical-physics with engraving-style flourishes)
   ========================================================= */

:root {
  --bg:        #fbfaf6;
  --bg-tint:   #f3efe3;
  --surface:   #ffffff;
  --ink:       #1f2024;
  --muted:     #6b6b72;
  --rule:      #d9d4c2;
  --accent:    #4a6a35;          /* moss green — genetics accent */
  --accent-2:  #6b2e2e;
  --gold:      #a07f3a;
  --content-width: 42rem;
  --wide-width: 56rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

html { font-size: 18px; }
body {
  color: var(--ink);
  font-family: "EB Garamond", "Source Serif Pro", "Iowan Old Style",
               Georgia, "Times New Roman", serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 24%, rgba(74, 106, 53, 0.05) 0, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(107, 46, 46, 0.05) 0, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(160, 127, 58, 0.025) 0, transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: "Source Sans 3", "Inter", -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 2.2rem 0 0.8rem;
}
h1 { font-size: 2.1rem; letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.1rem;  color: var(--muted); text-transform: uppercase;
     letter-spacing: 0.12em; font-weight: 500; }
h4 { font-size: 1rem; }

p  { margin: 0 0 1.1rem; }
em { font-style: italic; }
strong { color: var(--ink); font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 106, 53, 0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: var(--accent); }

blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }

.site {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 1rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--rule);
}

.site-title {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
.site-title a { color: var(--ink); border-bottom: none; }
.site-tagline {
  display: block;
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.site-nav a {
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 2px;
}
.site-nav a:hover, .site-nav a.is-active {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.hero { margin: 2rem auto 2.5rem; max-width: var(--wide-width); }
.hero svg,
.hero img { width: 100%; height: auto; display: block; }

.hero--dark {
  border-radius: 6px;
  overflow: hidden;
  background: #080809;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 12px 36px -12px rgba(20, 30, 12, 0.45),
    0 2px 4px rgba(0,0,0,0.15);
  border: 1px solid #1a1f1a;
}

.spectrum-bar {
  height: 3px;
  width: 100%;
  margin-bottom: 1.4rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #ff1d1d 8%,
    #ff8a00 22%,
    #ffe600 38%,
    #27e36a 55%,
    #22b8ff 72%,
    #3a47ff 88%,
    transparent 100%
  );
  opacity: 0.85;
  border-radius: 2px;
  filter: drop-shadow(0 0 6px rgba(180, 220, 100, 0.25));
}

.content { max-width: var(--content-width); }
.content--wide { max-width: var(--wide-width); }

.lede {
  font-size: 1.18rem;
  color: var(--muted);
  margin: -0.2rem 0 2rem;
  line-height: 1.6;
  font-style: italic;
}

.ornament {
  display: flex; align-items: center; justify-content: center;
  margin: 3rem 0 2rem;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.4rem;
  font-family: "EB Garamond", Georgia, serif;
}
.ornament::before, .ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule), transparent);
  margin: 0 1.2rem;
}
.ornament span {
  display: inline-block;
  transform: translateY(-1px);
  letter-spacing: 0.6rem;
  color: var(--accent);
  opacity: 0.85;
}

.article-list {
  list-style: none; margin: 0; padding: 0; counter-reset: post;
}
.article-list > li {
  position: relative;
  padding: 1.8rem 0 1.8rem 4.5rem;
  border-top: 1px solid var(--rule);
  counter-increment: post;
}
.article-list > li:last-child { border-bottom: 1px solid var(--rule); }
.article-list > li::before {
  content: counter(post, upper-roman) ".";
  position: absolute;
  left: 0; top: 1.5rem;
  font-family: "EB Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
}
.article-list h2 {
  margin: 0 0 0.3rem;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0;
}
.article-list h2 a { color: var(--ink); border-bottom: none; }
.article-list h2 a:hover { color: var(--accent); }
.article-meta {
  display: block;
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.article-excerpt { color: var(--ink); margin: 0; }

.post-header { margin: 0 0 2rem; text-align: center; }
.post-title {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}
.post-meta {
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.post-header::after {
  content: "✦";
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 1rem;
  opacity: 0.7;
}

.post-body p:first-of-type::first-letter {
  font-size: 5rem;
  float: left;
  line-height: 0.82;
  padding: 0.45rem 0.55rem 0 0.1rem;
  margin-right: 0.05rem;
  font-family: "EB Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(160, 127, 58, 0.18);
}

.post-nav {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.9rem;
  text-align: center;
}

.topics {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 1.2rem;
}
.topics li {
  font-family: "EB Garamond", Georgia, serif;
  padding: 0.5rem 0 0.5rem 1.2rem;
  border-bottom: 1px dotted var(--rule);
  color: var(--ink);
  position: relative;
  font-size: 1.05rem;
}
.topics li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0.45rem;
  color: var(--accent);
  font-size: 0.7rem;
  opacity: 0.7;
}

.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: "Source Sans 3", "Inter", sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  position: relative;
}
.site-footer::before {
  content: "❋";
  display: block;
  color: var(--accent);
  font-size: 1.4rem;
  margin: -2.5rem auto 1rem;
  width: 2.2rem;
  height: 2.2rem;
  line-height: 2.2rem;
  background: var(--bg);
  border-radius: 50%;
  opacity: 0.9;
}
.site-footer a { color: var(--muted); border-bottom: none; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 640px) {
  html { font-size: 17px; }
  .site { padding: 1rem 1.1rem 3rem; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .site-nav ul { gap: 1.1rem; flex-wrap: wrap; }
  .post-title { font-size: 1.9rem; }
  .post-body p:first-of-type::first-letter { font-size: 3.6rem; }
  .article-list > li { padding-left: 3rem; }
  .article-list > li::before { font-size: 1.7rem; top: 1.3rem; }
  .hero { margin: 1.2rem 0 2rem; }
}
