/* PP Kyoto — free for personal use (Pangram Pangram).
   Download the free font, then drop the file(s) into the fonts/ folder.
   Rename your file to match below, or update the path. */
@font-face {
  font-family: "PP Kyoto";
  src: url("fonts/PPKyoto-Medium.woff2") format("woff2"),
       url("fonts/PPKyoto-Medium.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4eede;
  --text: #2b2b2b;
  --muted: #777;
  --accent: #2f6f4e;
  --accent-soft: rgba(47, 111, 78, 0.3);
  --name: #234f38;
  --line: #e7e3dc;
}

/* Dark palette: applied when the system prefers dark and no manual
   choice has been made... */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1e20;
    --text: #e7e4dd;
    --muted: #9b988f;
    --accent: #a6dcc4;
    --accent-soft: rgba(166, 220, 196, 0.32);
    --name: #c6ecd9;
    --line: #34352f;
  }
}

/* ...or when the user explicitly toggles dark mode. */
:root[data-theme="dark"] {
  --bg: #1d1e20;
  --text: #e7e4dd;
  --muted: #9b988f;
  --accent: #a6dcc4;
  --accent-soft: rgba(166, 220, 196, 0.32);
  --name: #c6ecd9;
  --line: #34352f;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.wrap.wide {
  max-width: 900px;
}

nav {
  display: flex;
  gap: 22px;
  margin-bottom: 56px;
  font-size: 16px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a.active {
  color: var(--text);
}

.theme-toggle {
  margin-left: auto;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 12px;
  cursor: pointer;
  line-height: 1.5;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

a:hover {
  border-bottom-color: var(--accent);
}

h1 {
  font-family: "PP Kyoto", Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  color: var(--name);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

h2 {
  font-family: "PP Kyoto", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  margin: 40px 0 8px;
}

h3 {
  font-family: "PP Kyoto", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  margin: 32px 0 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 17px;
  margin: 0 0 28px;
}

.headshot {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 28px;
  display: block;
}

p {
  margin: 0 0 18px;
}

.socials {
  margin: 28px 0 0;
}

.socials .label {
  color: var(--muted);
  margin-right: 4px;
}

.muted {
  color: var(--muted);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.post-list li {
  margin-bottom: 22px;
}

.post-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: none;
}

.post-card .thumb {
  flex: none;
  width: 120px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-card .post-title {
  font-size: 19px;
  border-bottom: 1px solid var(--accent-soft);
}

.post-card:hover .post-title {
  border-bottom-color: var(--accent);
}

.post hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

.post hr + h2 {
  margin-top: 0;
}

.post ul {
  padding-left: 22px;
  margin: 0 0 18px;
}

.post ul ul {
  margin: 4px 0 8px;
}

.post li {
  margin-bottom: 4px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--line);
  padding: 1px 6px;
  border-radius: 5px;
}

.charts {
  margin: 28px 0;
}

.charts img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.chart-wide {
  width: 90%;
  margin: 0 auto 16px;
}

.chart-row {
  display: flex;
  gap: 16px;
  width: 90%;
  margin: 0 auto;
}

.chart-row figure {
  flex: 1;
  min-width: 0;
  margin: 0;
}

figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

.post-video {
  width: 100%;
  margin: 16px 0 28px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000;
  display: block;
}

.back-link {
  margin-top: 36px;
}

footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
