:root {
  --bg: #fbfaf7;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #e6e2d9;
  --soft: #f2efe8;
  --accent: #b4441c;
  --accent-hover: #8f3414;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161513;
    --text: #ece8e1;
    --muted: #a39e94;
    --line: #2e2c28;
    --soft: #201f1c;
    --accent: #f0875e;
    --accent-hover: #ffa784;
  }
}
:root[data-theme="dark"] {
  --bg: #161513;
  --text: #ece8e1;
  --muted: #a39e94;
  --line: #2e2c28;
  --soft: #201f1c;
  --accent: #f0875e;
  --accent-hover: #ffa784;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-family: var(--sans); font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.site-nav a { font-family: var(--sans); font-size: 15px; color: var(--muted); text-decoration: none; margin-left: 22px; }
.site-nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 36px 0 48px; font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 1.6; }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--muted); }

/* home */
.intro { padding: 72px 0 40px; }
.intro h1 { font-family: var(--sans); font-size: clamp(38px, 7vw, 60px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; margin: 0 0 20px; }
.intro p { font-size: 22px; color: var(--muted); margin: 0; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-top: 1px solid var(--line); padding: 40px 0; }
.post-item .meta { margin-bottom: 10px; }
.post-item h2 { font-family: var(--sans); font-size: clamp(28px, 4.6vw, 38px); line-height: 1.15; letter-spacing: -.025em; font-weight: 750; margin: 0 0 14px; }
.post-item h2 a { color: var(--text); text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { margin: 0 0 14px; color: var(--muted); }
.read-more { font-family: var(--sans); font-size: 16px; font-weight: 600; text-decoration: none; }

.meta { font-family: var(--sans); font-size: 14px; color: var(--muted); letter-spacing: .01em; }
.meta .tag { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; }

/* article */
.article-head { padding: 64px 0 28px; }
.article-head h1 { font-family: var(--sans); font-size: clamp(36px, 6.6vw, 58px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; margin: 14px 0 22px; }
.article-head .lede { font-size: 24px; line-height: 1.55; color: var(--muted); margin: 0; }

.article { padding-bottom: 8px; }
.article h2 { font-family: var(--sans); font-size: clamp(27px, 4.4vw, 36px); line-height: 1.2; letter-spacing: -.025em; font-weight: 750; margin: 64px 0 18px; }
.article h3 { font-family: var(--sans); font-size: 23px; line-height: 1.3; letter-spacing: -.015em; font-weight: 700; margin: 40px 0 10px; }
.article p { margin: 0 0 24px; }
.article ul, .article ol { margin: 0 0 26px; padding-left: 26px; }
.article li { margin-bottom: 10px; }
.article li::marker { color: var(--accent); }
.article strong { font-weight: 650; }
.article blockquote { margin: 36px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent); font-size: 25px; line-height: 1.5; font-style: italic; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0; }

.table-scroll { overflow-x: auto; margin: 8px 0 14px; -webkit-overflow-scrolling: touch; }
.article table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 16px; line-height: 1.45; min-width: 520px; }
.article th, .article td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.article tr.hl td { background: var(--soft); font-weight: 650; }
.note { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 0 0 24px; }

.deal-box { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; margin: 44px 0; }
.deal-box h3 { margin: 0 0 10px; }
.deal-box p { margin: 0 0 20px; }
.btn { display: inline-block; font-family: var(--sans); font-size: 17px; font-weight: 700; color: #fff; background: var(--accent); padding: 14px 26px; border-radius: 10px; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--accent-hover); color: #fff; }
:root[data-theme="dark"] .btn, :root[data-theme="dark"] .btn:hover { color: #1a1210; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) .btn:hover { color: #1a1210; }
}

.more { border-top: 1px solid var(--line); margin-top: 72px; padding-top: 36px; }
.more .meta { margin-bottom: 8px; }
.more a.title { font-family: var(--sans); font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; color: var(--text); text-decoration: none; }
.more a.title:hover { color: var(--accent); }

/* reading progress */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 10; }

/* 404 */
.notfound { padding: 120px 0 40px; }
.notfound h1 { font-family: var(--sans); font-size: clamp(40px, 7vw, 60px); letter-spacing: -.035em; margin: 0 0 16px; }

@media (max-width: 600px) {
  body { font-size: 19px; }
  .article-head .lede { font-size: 21px; }
  .article blockquote { font-size: 22px; }
  .deal-box { padding: 24px 20px; }
  .site-nav a { margin-left: 16px; }
}
