:root {
  --bg-color: #fdfaf6;
  --text-color: #2a1f16;
  --link-color: #44515c;
  --heading-color: #2a1f16;
  --max-width: 700px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1b1712;
    --text-color: #f4e8c1;
    --link-color: #e0b574;
    --heading-color: #f4e8c1;
  }
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'EB Garamond', serif;
  max-width: var(--max-width);
  margin: 4rem auto;
  padding: 2rem;
  line-height: 1.7;
}

header h1 {
  margin: 0;
  text-align: center;
}

header h1 a {
  color: var(--heading-color);
  text-decoration: none;
}

main h2 {
  text-align: center;
  margin-top: 1.5em;
  color: var(--heading-color);
}

article {
  margin-top: 1.5em;
}

nav.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

nav.post-nav a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
}

nav.post-nav a:hover {
  text-decoration: underline;
}

/* links in content */
a {
  color: var(--link-color);
  text-decoration: underline;
}

a:hover {
  color: var(--link-color);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  text-decoration: none;
}

/* Lute icon animation */
.lute-link {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  opacity: 0.9;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 999;
}

.lute-link:hover {
  transform: rotate(-6deg) scale(1.15);
  opacity: 1;
}

.lute {
  width: 64px;
  height: 64px;
  display: block;
  animation: sway 4s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(5deg); }
}

/* Mobile tweaks + safe-area */
@media (max-width: 640px) {
  body {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  .lute { width: 48px; height: 48px; }
  .lute-link {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lute, .lute-link {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
