:root {
  --bg: #fafafa;
  --text: #1c1d20;
  --muted: #6a6c72;
  --border: #dddee1;
  --accent: #9c6b16;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1d21;
    --text: #e6e6e8;
    --muted: #8c8e94;
    --border: #34363c;
    --accent: #e2b23f;
  }
}

html[data-theme="light"] {
  --bg: #fafafa;
  --text: #1c1d20;
  --muted: #6a6c72;
  --border: #dddee1;
  --accent: #9c6b16;
}

html[data-theme="dark"] {
  --bg: #1b1d21;
  --text: #e6e6e8;
  --muted: #8c8e94;
  --border: #34363c;
  --accent: #e2b23f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.65; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 880px; margin: 0 auto; padding: 0 24px; }

header.site { border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-weight: 600; font-size: 15px; }
nav.links { display: flex; align-items: center; gap: 22px; }
nav.links a { font-size: 13px; color: var(--muted); }
nav.links a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  background: none;
  color: var(--accent);
}
.theme-toggle svg { display: block; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .icon-sun { display: none; }
}
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .icon-moon { display: none; }
}

main { padding: 64px 0 96px; }

.kicker { font-size: 13px; color: var(--accent); letter-spacing: 0.04em; margin-bottom: 16px; }
h1 { font-size: 32px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 a:hover { opacity: 1; }
.meta { font-size: 12px; color: var(--muted); margin-bottom: 28px; }

.lede, .post-body p { font-size: 15px; line-height: 1.85; margin: 0 0 18px; max-width: 620px; }
.post-body p { opacity: 0.92; }

.continue { display: inline-block; font-size: 14px; color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 2px; margin-top: 8px; }

footer.site { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links { display: flex; gap: 18px; }

.page-head { margin-bottom: 40px; }
.page-head p { color: var(--muted); font-size: 14px; max-width: 500px; margin: 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.card { border: 1px solid var(--border); padding: 22px; }
.card h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.card .tags { font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.card a { font-size: 13px; color: var(--accent); }

.post-list { display: flex; flex-direction: column; gap: 30px; }
.post-item .meta-row { display: flex; gap: 14px; align-items: baseline; }
.post-item .date { font-size: 12px; color: var(--accent); width: 90px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.post-item h2 { font-size: 17px; font-weight: 600; margin: 0; }
.post-item .excerpt { font-size: 14px; color: var(--muted); margin: 6px 0 0 104px; line-height: 1.6; }

.back-link { font-size: 13px; color: var(--muted); margin-bottom: 28px; display: inline-block; }

.skills { font-size: 13px; color: var(--muted); line-height: 1.9; }

.converter { max-width: 520px; }
.cv-select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.cv-row { display: flex; align-items: stretch; gap: 12px; }
.cv-field { flex: 1; min-width: 0; }
.cv-inputwrap { position: relative; }
.cv-input {
  width: 100%;
  height: 46px;
  font: inherit;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 14px;
}
.cv-output {
  display: flex;
  align-items: center;
  padding-right: 60px;
  color: var(--accent);
  overflow-x: auto;
  white-space: nowrap;
}
.cv-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  padding: 4px 8px;
  cursor: pointer;
}
.cv-btn:hover { opacity: 0.65; }
.cv-arrow { align-self: center; color: var(--muted); }

@media (max-width: 640px) {
  main { padding: 44px 0 72px; }
  h1 { font-size: 25px; }
  .post-item .excerpt { margin-left: 0; }
  .header-inner { padding: 18px; }
  .cv-row { flex-direction: column; }
  .cv-arrow { align-self: center; transform: rotate(90deg); padding: 4px 0; }
}
