:root[data-theme="light"] {
  --bg:           #FAF7F2;
  --bg-surface:   #F2EDE6;
  --bg-hover:     #EAE3D8;
  --text:         #2C2825;
  --text-muted:   #6B6259;
  --text-faint:   #75695E;
  --accent:       #5FA3A3;
  --accent-text:  #236B6B;
  --accent-soft:  #D4EBEB;
  --accent-faint: #EDF6F6;
  --border:       #E2DAD0;
  --code-bg:      #EDE8E1;
}
:root[data-theme="dark"] {
  --bg:           #1A1814;
  --bg-surface:   #222019;
  --bg-hover:     #2A2720;
  --text:         #EDE8E0;
  --text-muted:   #8A8278;
  --text-faint:   #554F48;
  --accent:       #7DBFBF;
  --accent-text:  #7DBFBF;
  --accent-soft:  #1E3333;
  --accent-faint: #162828;
  --border:       #2C2924;
  --code-bg:      #222019;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.75; transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

#progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); width: 0; z-index: 200;
  transition: width 0.08s linear; pointer-events: none;
}

.wrap { max-width: 660px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.hd {
  padding: 2.25rem 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { font-size: 0.95rem; font-weight: 500; color: var(--text); letter-spacing: 0.01em; }
.logo em { color: var(--accent-text); font-style: normal; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-size: 0.83rem; color: var(--text-muted); transition: color 0.15s; }
.nav a:hover, .nav a.on { color: var(--accent-text); }
.thm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; background: none;
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0; color: var(--text-faint);
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.thm:hover { border-color: var(--accent); color: var(--accent-text); }
.thm .icon-moon { display: none; }
:root[data-theme="dark"] .thm .icon-sun { display: none; }
:root[data-theme="dark"] .thm .icon-moon { display: block; }

main { padding: 3rem 0 5rem; }

.lbl {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 1.25rem; display: block;
}

hr.div { border: none; border-top: 1px solid var(--border); margin: 2.75rem 0; }

/* Footer */
footer {
  border-top: 1px solid var(--border); padding: 1.75rem 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
footer p { font-size: 0.78rem; color: var(--text-faint); line-height: 1.6; }
footer p a { color: var(--text-faint); border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color 0.15s; }
footer p a:hover { color: var(--accent-text); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 0.78rem; color: var(--text-faint); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent-text); }

/* Home */
.home-bio { padding: 2.5rem 0 3rem; border-bottom: 1px solid var(--border); }
.home-bio h1 { font-size: 1.35rem; font-weight: 400; line-height: 1.5; letter-spacing: -0.01em; margin-bottom: 0.9rem; }
.home-bio h1 strong { font-weight: 500; }
.home-bio p { font-size: 0.9rem; color: var(--text-muted); max-width: 460px; line-height: 1.7; }
.home-bio-links { margin-top: 1.25rem; display: flex; gap: 1.25rem; }
.home-bio-links a {
  font-size: 0.82rem; color: var(--accent-text);
  border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px;
  transition: border-color 0.15s;
}
.home-bio-links a:hover { border-color: var(--accent); }

.featured-list { list-style: none; }
.featured-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.featured-item:first-child { border-top: 1px solid var(--border); }
.fi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.fi-title { font-size: 0.96rem; font-weight: 500; color: var(--text); transition: color 0.15s; line-height: 1.4; }
.fi-title:hover { color: var(--accent-text); }
.fi-date { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }
.fi-summary { font-size: 0.865rem; color: var(--text-muted); margin-top: 0.3rem; line-height: 1.65; max-width: 56ch; }

/* Writing */
.page-header { padding: 2rem 0 2.5rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.page-header h1 { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.015em; }

.filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filt {
  font-size: 0.73rem; font-weight: 500; padding: 0.25rem 0.65rem;
  border-radius: 3px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filt:hover { border-color: var(--accent); color: var(--accent-text); }
.filt.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.writing-list { list-style: none; }
.writing-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.writing-item:first-child { border-top: 1px solid var(--border); }
.wi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.wi-title { font-size: 0.96rem; font-weight: 500; color: var(--text); transition: color 0.15s; line-height: 1.4; }
.wi-title:hover { color: var(--accent-text); }
.wi-meta { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; display: flex; gap: 0.75rem; }
.wi-type { color: var(--accent-text); }
.wi-summary { font-size: 0.855rem; color: var(--text-muted); margin-top: 0.3rem; line-height: 1.6; max-width: 56ch; }

/* Article */
.art-back { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2.5rem; transition: color 0.15s; }
.art-back:hover { color: var(--accent-text); }
.art-back svg { width: 11px; height: 11px; }
.art-hd { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.art-eye { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-faint); display: flex; gap: 1rem; align-items: center; margin-bottom: 0.9rem; flex-wrap: wrap; }
.art-eye .etag { color: var(--accent-text); }
.art-eye .grade { background: var(--accent-soft); color: var(--accent-text); padding: 0.1rem 0.4rem; border-radius: 2px; font-size: 0.66rem; }
.art-h1 { font-size: 1.6rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; color: var(--text); }
.tldr { background: var(--accent-faint); border: 1px solid var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; padding: 1rem 1.25rem; margin: 2rem 0; }
.tldr-lbl { font-family: 'DM Mono', monospace; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 0.4rem; }
.tldr p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; }
.art-body h2 { font-size: 1.05rem; font-weight: 500; margin: 2.25rem 0 0.6rem; letter-spacing: -0.01em; }
.art-body p { font-size: 0.955rem; line-height: 1.82; margin-bottom: 1.25rem; max-width: 62ch; }
.art-body blockquote { border-left: 2px solid var(--accent-soft); padding: 0.1rem 0 0.1rem 1.2rem; margin: 1.5rem 0; color: var(--text-muted); font-style: italic; }
.art-reply { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.855rem; color: var(--text-muted); }
.art-reply a { color: var(--accent-text); border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px; }

/* Now */
.now-updated { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: var(--text-faint); display: block; margin-top: 0.4rem; }
.now-body { max-width: 540px; }
.now-body h2 { font-size: 0.95rem; font-weight: 500; margin: 2rem 0 0.6rem; }
.now-body p { font-size: 0.935rem; color: var(--text-muted); line-height: 1.78; margin-bottom: 0.75rem; }
.now-body ul { margin: 0 0 1rem 1.1rem; }
.now-body li { font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 0.2rem; }

/* Start */
.start-list { list-style: none; }
.start-item { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.start-item:first-child { border-top: 1px solid var(--border); }
.start-num { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--accent-text); margin-bottom: 0.5rem; }
.start-title { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; transition: color 0.15s; display: block; }
.start-title:hover { color: var(--accent-text); }
.start-why { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; max-width: 52ch; }

/* Principles */
.principles-body { max-width: 540px; padding: 2.5rem 0; }
.principles-body h2 { font-size: 1rem; font-weight: 500; margin: 2.25rem 0 0.75rem; letter-spacing: -0.01em; }
.principles-body h2:first-of-type { margin-top: 0; }
.principles-body p { font-size: 0.935rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 1rem; max-width: 54ch; }

/* About */
.about-body { max-width: 540px; padding: 2.5rem 0; }
.about-body h1 { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 1.75rem; }
.about-body p { font-size: 0.955rem; line-height: 1.82; margin-bottom: 1.25rem; color: var(--text-muted); }
.about-body p.lead { color: var(--text); font-size: 1rem; }
.about-links { margin-top: 2.25rem; display: flex; flex-direction: column; gap: 0.65rem; }
.about-link { display: flex; align-items: baseline; gap: 0.75rem; font-size: 0.865rem; color: var(--text-muted); transition: color 0.15s; }
.about-link:hover { color: var(--accent-text); }
.about-link-k { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--text-faint); width: 56px; flex-shrink: 0; }
