:root {
  --bg: #fdfaf5;
  --surface: #ffffff;
  --ink: #1d1a2b;
  --muted: #6d6a7c;
  --line: #ece4d6;

  --coral: #ff6b57;
  --sun: #f5a300;
  --mint: #1fb5a5;
  --sky: #3d8fe0;
  --violet: #8b5cf6;
  --pink: #ec5fa8;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15131f;
    --surface: #1d1a2b;
    --ink: #f4efe6;
    --muted: #a39fb5;
    --line: #2d2940;
    --coral: #ff8473;
    --sun: #ffbe3d;
    --mint: #3fd0c0;
    --sky: #6aaeff;
    --violet: #a78bfa;
    --pink: #ff82c0;
  }
}
:root[data-theme="dark"] {
  --bg: #15131f;
  --surface: #1d1a2b;
  --ink: #f4efe6;
  --muted: #a39fb5;
  --line: #2d2940;
  --coral: #ff8473;
  --sun: #ffbe3d;
  --mint: #3fd0c0;
  --sky: #6aaeff;
  --violet: #a78bfa;
  --pink: #ff82c0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  border-top: 6px solid var(--accent, var(--coral));
}
a { color: inherit; }
::selection { background: var(--accent, var(--coral)); color: #fff; }

/* header */
.site-header, main, .site-footer {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand .dot {
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: conic-gradient(var(--coral), var(--sun), var(--mint), var(--sky), var(--violet), var(--pink), var(--coral));
}
.site-header nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
#theme {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1;
}
#theme:hover { color: var(--ink); border-color: var(--ink); }

/* home */
.hero { padding-block: 3rem 2rem; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.post-list { list-style: none; margin: 0; padding: 0 0 3rem; }
.post-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.25rem 0 1.25rem 1rem;
  border-top: 1px solid var(--line);
  border-left: 4px solid transparent;
  text-decoration: none;
  transition: border-color 0.15s, padding-left 0.15s;
}
.post-list li:last-child .post-row { border-bottom: 1px solid var(--line); }
.post-row:hover { border-left-color: var(--accent); padding-left: 1.25rem; }
.post-date { font-size: 0.9rem; font-weight: 600; color: var(--accent); line-height: 1.3; }
.post-date small { display: block; color: var(--muted); font-weight: 400; }
.post-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.25; }
.post-summary { display: block; color: var(--muted); font-size: 0.97rem; margin-top: 0.25rem; }
.post-mood { font-size: 1.4rem; }
.empty { color: var(--muted); padding: 2rem 0; }

/* post */
.post { padding-block: 2rem 1rem; }
.post .meta { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin: 0 0 0.75rem; }
.post h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 6.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
  text-wrap: balance;
}
.prose { font-size: 1.125rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.25em; }
.prose h2, .prose h3 { font-family: var(--serif); line-height: 1.25; margin-top: 2em; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { background: var(--accent); color: #fff; }
.prose blockquote {
  margin-inline: 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--muted);
}
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose hr { border: 0; text-align: center; }
.prose hr::before { content: "• • •"; letter-spacing: 0.6em; color: var(--accent); }
.prose code { background: var(--surface); border: 1px solid var(--line); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.9em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 1rem; border-radius: 12px; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li::marker { color: var(--accent); }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-block: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.post-nav a { text-decoration: none; font-family: var(--serif); font-weight: 700; line-height: 1.3; }
.post-nav a:hover { color: var(--accent); }
.post-nav small { display: block; font-family: var(--sans); font-weight: 500; color: var(--muted); margin-bottom: 0.2rem; }
.post-nav .right { text-align: right; }

/* footer */
.site-footer { padding-block: 2rem 3rem; color: var(--muted); font-size: 0.9rem; }
.swatches { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.swatches i { width: 1.4rem; height: 0.4rem; border-radius: 99px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 30rem) {
  .post-row { grid-template-columns: 3.5rem 1fr; }
  .post-mood { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
