:root {
  --bg: #e9dfc4;
  --bg-elevated: #f3ead4;
  --ink: #2a2418;
  --muted: #7a6f58;
  --line: rgba(42, 36, 24, 0.14);
  --accent: #6b4e16;
  --glow: rgba(210, 175, 80, 0.28);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #e9dfc4;
  --bg-elevated: #f3ead4;
  --ink: #2a2418;
  --muted: #7a6f58;
  --line: rgba(42, 36, 24, 0.14);
  --accent: #6b4e16;
  --glow: rgba(210, 175, 80, 0.28);
}

[data-theme="dark"] {
  --bg: #1c1810;
  --bg-elevated: #2a2418;
  --ink: #e9dfc4;
  --muted: #a89878;
  --line: rgba(233, 223, 196, 0.14);
  --accent: #d4b56a;
  --glow: rgba(180, 140, 50, 0.16);
}

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

html {
  color-scheme: dark light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, var(--glow), transparent 60%),
    radial-gradient(ellipse 45% 35% at 90% 75%, rgba(190, 150, 60, 0.12), transparent 55%),
    linear-gradient(180deg, transparent 0%, var(--bg) 100%);
  animation: drift 18s var(--ease) infinite alternate;
}

@keyframes drift {
  from { opacity: 0.85; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-12px); }
}

.page {
  position: relative;
  z-index: 1;
  width: min(42rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.masthead {
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}

.mark {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--muted);
}

.name {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.identity {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.thesis {
  margin: 1.4rem auto 0;
  max-width: 28rem;
  font-size: 1.15rem;
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  color: var(--ink);
}

.nav {
  display: grid;
  gap: 0.65rem;
  margin: 3rem 0 0;
  animation: rise 0.9s var(--ease) 0.12s both;
}

.nav-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.nav-item:last-child {
  border-bottom: 1px solid var(--line);
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--accent);
  padding-left: 0.35rem;
  outline: none;
}

.nav-label {
  font-size: 1.2rem;
  font-weight: 500;
}

.nav-desc {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.feature {
  margin: 3.25rem 0 0;
  text-align: center;
  animation: rise 1s var(--ease) 0.22s both;
}

.feature-label {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.feature-body {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
}

.feature-source {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.feature-gloss {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  animation: rise 1s var(--ease) 0.3s both;
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.colophon-right {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.colophon a,
#theme-toggle {
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.colophon a:hover,
#theme-toggle:hover {
  color: var(--ink);
}

/* Inner pages */
.page-head {
  margin-bottom: 2.5rem;
  animation: rise 0.7s var(--ease) both;
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
}

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

.page-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-lede {
  margin: 0.85rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.content {
  animation: rise 0.85s var(--ease) 0.1s both;
}

.empty {
  margin: 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.quote-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quote-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.quote-item:last-child {
  border-bottom: 1px solid var(--line);
}

.quote-body {
  margin: 0;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.45;
}

.quote-source {
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.quote-gloss {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.quote-source cite {
  font-style: normal;
}

.prose {
  font-size: 1.08rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-list li {
  border-top: 1px solid var(--line);
}

.entry-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.entry-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 0;
  text-decoration: none;
  color: inherit;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.entry-link:hover,
.entry-link:focus-visible {
  color: var(--accent);
  padding-left: 0.35rem;
  outline: none;
}

.entry-title {
  font-size: 1.2rem;
  font-weight: 500;
}

.entry-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.page-article {
  width: min(40rem, calc(100% - 2.5rem));
}

.article-kicker {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.article {
  font-size: 1.08rem;
  line-height: 1.7;
}

.article p {
  margin: 0 0 1.15rem;
}

.article h2 {
  margin: 2.4rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.article-figure {
  margin: 0 0 2rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.article-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.article-figure cite {
  font-style: italic;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .masthead,
  .nav,
  .feature,
  .footer,
  .page-head,
  .content {
    animation: none;
  }

  .nav-item {
    transition: none;
  }
}
