/* ── Reset ──────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  min-height: 100%;
}

/* ══════════════════════════════════════════════════════
   AUTUMN THEME — DARK (default)
   ══════════════════════════════════════════════════════ */
:root {
  --accent: #d37d70;
  --accent-dim: rgba(211, 125, 112, 0.32);
  --accent-hover: rgba(211, 125, 112, 0.65);
  --cream: #d1a453;
  --cream-muted: rgba(184, 145, 110, 0.88);
  --text-sub: rgba(184, 145, 110, 0.82);
  --btn-bg: rgba(7, 7, 7, 0.35);
  --btn-bg-h: rgba(65, 41, 28, 0.45);

  --ink: rgba(209, 164, 83, 0.92);
  --ink-muted: rgba(184, 145, 110, 0.75);
  --ink-faint: rgba(184, 145, 110, 0.42);
  --page-bg: #211f01;
  --nav-bg: #2c2e1ce0;
  --pale-sky: #afd2e6;
  --rule: #d37d7033;

  --font-display: "Comfortaa", cursive;
  --font-serif: "Alegreya Sans", sans-serif;
  --font-sans: "Mulish", sans-serif;

  --measure: 68ch;
  --nav-h: 56px;

  /* Theme toggle icon */
  --toggle-icon: "☀";
}

/* ══════════════════════════════════════════════════════
   AUTUMN THEME — LIGHT
   ══════════════════════════════════════════════════════ */
[data-theme="light"] {
  --accent: #b45049;
  --accent-dim: rgba(180, 80, 73, 0.28);
  --accent-hover: rgba(211, 125, 112, 0.7);
  --cream: #2c2e1c;
  --cream-muted: rgba(44, 46, 28, 0.88);
  --text-sub: rgba(65, 41, 28, 0.82);
  --btn-bg: rgba(184, 145, 110, 0.15);
  --btn-bg-h: rgba(184, 145, 110, 0.3);

  --ink: #211f01;
  --ink-muted: #41291c;
  --ink-faint: rgba(65, 41, 28, 0.55);
  --page-bg: #f5ede0;
  --nav-bg: var(--pale-sky);
  --rule: rgba(180, 80, 73, 0.22);

  --toggle-icon: "☽";
}

/* Smooth transition when switching themes */
body,
.site__header,
.post__body,
.post__header,
.site__footer,
.site__main {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* ── Body ───────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Site wrapper ───────────────────────────────────── */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Site nav ───────────────────────────────────────── */
.site__header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 0.5px solid var(--rule);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site__nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site__nav-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

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

.site__nav-links {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  align-items: center;
}

.site__nav-links a {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site__nav-links a:hover,
.site__nav-links a[aria-current="page"] {
  color: var(--accent);
}

/* ── Theme toggle button ────────────────────────────── */
.theme-toggle {
  background: none;
  border: 0.5px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.3rem 0.55rem;
  transition:
    border-color 0.2s,
    color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Site main ──────────────────────────────────────── */
.site__main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ── Site footer ────────────────────────────────────── */
.site__footer {
  border-top: 0.5px solid var(--rule);
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Page headings ──────────────────────────────────── */
.page__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--cream);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.page__lead {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 0.5px solid var(--rule);
}

/* ── Post list (Scribble index) ─────────────────────── */
.post-list {
  list-style: none;
}

.post-list__item {
  padding: 1.6rem 0;
  border-bottom: 0.5px solid var(--rule);
}

.post-list__item:first-child {
  border-top: 0.5px solid var(--rule);
}

.post-list__meta {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.45rem;
}

.post-list__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.post-list__title a {
  color: var(--cream-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.post-list__title a:hover {
  color: var(--accent);
}

.post-list__excerpt {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* ── Post article ───────────────────────────────────── */
.post__header {
  padding: 3rem 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 0.5px solid var(--rule);
  margin-bottom: 2.5rem;
}

.post__meta {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.post__category {
  color: var(--accent);
}

.post__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--cream);
  margin-bottom: 0.6rem;
}

.post__subtitle {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.post__body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.7rem;
  color: var(--ink);
}

.post__body p {
  margin-bottom: 1.4rem;
}

.post__body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  margin: 2.5rem 0 0.8rem;
}

.post__body h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--cream-muted);
  margin: 2rem 0 0.6rem;
}

.post__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__body img {
  width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
}

.post__body blockquote {
  border-left: 2px solid var(--accent-dim);
  padding-left: 1.2rem;
  margin: 1.8rem 0;
  color: var(--ink-muted);
  font-style: italic;
}

/* ── Post footer ────────────────────────────────────── */
.post__footer {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 2rem 1.5rem 0;
  border-top: 0.5px solid var(--rule);
}

.post__back {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .site__nav {
    height: auto;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.5rem;
    gap: 0.5rem;
  }

  .site__nav-links {
    gap: 1.1rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .site__nav-links a {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }

  .post__header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .post__body {
    max-width: 90vw;
    margin: 0 auto;
    padding: 0 0rem;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--ink);
  }
}
