:root {
  color-scheme: light;
  --bg: #fcfbf7;
  --text: #1c1a17;
  --muted: #6a6257;
  --line: #d8d0c3;
  --link: #1c1a17;
  --button-bg: rgba(252, 251, 247, 0.88);
  --button-hover: rgba(216, 208, 195, 0.45);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161311;
  --text: #f3ede3;
  --muted: #b7ab9c;
  --line: #3a332c;
  --link: #f3ede3;
  --button-bg: rgba(22, 19, 17, 0.88);
  --button-hover: rgba(58, 51, 44, 0.8);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  width: min(680px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

a {
  color: var(--link);
}

.home-page h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 400;
  line-height: 1.05;
}

.intro {
  margin: 0 0 56px;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.label {
  margin: 0 0 16px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.article-list > li {
  border-bottom: 1px solid var(--line);
}

.article-list article {
  padding: 18px 0 20px;
}

.article-list article a {
  text-decoration: none;
}

.article-list article a:hover h2,
.article-list article a:focus h2 {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.article-list h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 400;
}

.summary {
  margin: 8px 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

time {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: var(--button-hover);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-page { line-height: 1.75; }

.back {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover,
.back:focus {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.article-page time { margin-bottom: 12px; }

.article-page h1 {
  margin: 0 0 28px;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.08;
}

.article-page p {
  margin: 0 0 20px;
  font-size: 1.08rem;
}

.article-page hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Prose additions for future Markdown articles; listing styles stay scoped. */
.article-page h2,
.article-page h3 { font-weight: 400; line-height: 1.25; }
.article-page img { max-width: 100%; height: auto; }
.article-page pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); }
.article-page blockquote { margin-left: 0; padding-left: 20px; border-left: 2px solid var(--line); }
.article-page .draft-notice { color: var(--muted); font-size: 0.95rem; }

.theme-toggle [data-theme-icon="light"] { display: none; }
:root[data-theme="dark"] .theme-toggle [data-theme-icon="light"] { display: block; }
:root[data-theme="dark"] .theme-toggle [data-theme-icon="dark"] { display: none; }
