:root {
  --paper: #fbf7ef;
  --ink: #2f2a25;
  --muted: #7a6f63;
  --forest: #2f6b4f;
  --forest-deep: #234f3b;
  --terracotta: #c2682f;
  --amber: #c98a1e;
  --plum: #8159c2;
  --leaf: #5a9e3f;
  --line: #e4dac8;
  --surface: #ffffff;
  --code-bg: #efe7d6;
  --shadow: rgba(47, 42, 37, 0.1);
  --shadow-soft: rgba(47, 42, 37, 0.04);
  /* per-page accent, overridden by body.page-* below */
  --accent: var(--terracotta);
}

/* Each section gets its own accent for a little variety */
body.page-about,
body.page-now,
body.page-past {
  --accent: var(--forest);
}

body.page-stream {
  --accent: var(--terracotta);
}

body.page-home {
  --accent: var(--amber);
}

body.page-contact {
  --accent: var(--plum);
}

body.page-garden {
  --accent: var(--leaf);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1a17;
    --ink: #ece4d6;
    --muted: #a59b8c;
    --forest: #7fc4a0;
    --forest-deep: #a7e0c0;
    --terracotta: #e08a4f;
    --amber: #e0b25a;
    --plum: #b393e8;
    --leaf: #8fce6f;
    --line: #3a352e;
    --surface: #26231e;
    --code-bg: #2e2a23;
    --shadow: rgba(0, 0, 0, 0.45);
    --shadow-soft: rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  /* subtle paper texture from layered radial dots */
  background-image: radial-gradient(var(--line) 0.5px, transparent 0.5px);
  background-size: 22px 22px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
  max-width: 52rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.2;
  color: var(--forest-deep);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.6rem;
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.7rem;
  margin-top: 2.5rem;
}

h2::before {
  content: "❧ ";
  color: var(--accent);
}

a {
  color: var(--forest);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s ease;
}

a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px dashed var(--line);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}

main {
  margin-top: 2rem;
}

/* Prose lists get little evergreen / bird markers */
main ul {
  list-style: none;
  padding-left: 1.6rem;
}

main ul li {
  position: relative;
}

main ul li::before {
  content: "🌲";
  position: absolute;
  left: -1.6rem;
  font-size: 0.85em;
}

main ul li:nth-child(3n + 2)::before {
  content: "🐦";
}

main ul li:nth-child(3n)::before {
  content: "🍂";
}

/* Stream & Garden: turn the flat list into hover-lift "pinned note" cards */
.page-stream main ul,
.page-garden main ul {
  padding-left: 0;
  display: grid;
  gap: 0.75rem;
}

.page-stream main ul li,
.page-garden main ul li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 1px 2px var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.page-stream main ul li::before,
.page-garden main ul li::before {
  content: none;
}

.page-stream main ul li:nth-child(odd),
.page-garden main ul li:nth-child(odd) {
  transform: rotate(-0.5deg);
}

.page-stream main ul li:nth-child(even),
.page-garden main ul li:nth-child(even) {
  transform: rotate(0.6deg);
}

.page-stream main ul li:hover,
.page-garden main ul li:hover {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: 0 8px 20px var(--shadow);
  border-color: var(--accent);
}

/* Garden note internals */
.garden-intro {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.75rem;
}

.garden-notes li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.65rem;
  align-items: baseline;
}

.note-stage {
  grid-row: 1 / span 2;
  font-size: 1.3rem;
  line-height: 1;
}

.garden-notes a {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
}

.note-desc {
  grid-column: 2;
  color: var(--muted);
}

.note-date {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 4rem;
  border-top: 2px dashed var(--line);
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

footer p {
  margin: 0;
}

/* --- playful touches --- */

/* terracotta text selection */
::selection {
  background: var(--accent);
  color: var(--paper);
}

/* hand-drawn squiggle under the page title */
h1 {
  position: relative;
}

h1::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: 0.15rem;
  width: 7.5rem;
  max-width: 60%;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M2 5 C 20 1, 40 9, 60 4 S 100 1, 118 5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M2 5 C 20 1, 40 9, 60 4 S 100 1, 118 5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat;
}

/* drop cap on the first paragraph — a writerly flourish */
main p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 0.8;
  float: left;
  margin: 0.1rem 0.5rem 0 0;
  color: var(--accent);
}

/* nav links give a little wiggle on hover */
nav a:hover {
  animation: wiggle 0.4s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* gentle entrance for the page content */
main {
  animation: rise-in 0.5s ease both;
}

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

/* home page hero: the name drifts through the palette */
.page-home h1 {
  font-size: 3.4rem;
  background: linear-gradient(
    100deg,
    var(--forest),
    var(--amber),
    var(--terracotta),
    var(--forest)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: drift 9s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* footer "built by hand" mark with a gently swaying leaf */
.handmade {
  font-style: italic;
}

.handmade .leaf {
  display: inline-block;
  transform-origin: bottom center;
  animation: sway 3s ease-in-out infinite;
}

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

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .page-stream main ul li:nth-child(odd),
  .page-stream main ul li:nth-child(even),
  .page-garden main ul li:nth-child(odd),
  .page-garden main ul li:nth-child(even) {
    transform: none;
  }
}
