:root {
  --paper: #f7f3ea;
  --ink: #1f1b16;
  --muted: #6b6257;
  --rule: #d9d0c1;
  --accent: #7a2e24;
  --accent-soft: #efe4d6;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17140f;
    --ink: #ece4d6;
    --muted: #a99d8c;
    --rule: #3a332a;
    --accent: #d88a74;
    --accent-soft: #2a221b;
  }
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 0.9rem;
}
.site-name {
  font-size: 1.15rem; font-weight: 600; color: var(--ink); text-decoration: none;
  letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-family: var(--sans); font-size: 0.82rem; }
.site-nav a { color: var(--muted); text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1.05; margin: 0 0 0.8rem;
  font-weight: 500; letter-spacing: -0.01em;
}
.lede { font-size: 1.3rem; line-height: 1.45; margin: 0 0 1.6rem; max-width: 32rem; }
.portrait {
  width: 11rem; height: 13.5rem; border: 1px solid var(--rule); background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-family: var(--sans); font-size: 0.75rem; padding: 0.5rem;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.buttons { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.btn {
  font-family: var(--sans); font-size: 0.85rem; padding: 0.55rem 1rem; border: 1px solid var(--accent);
  color: var(--accent); text-decoration: none; border-radius: 2px;
}
.btn.primary { background: var(--accent); color: var(--paper); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

/* Facts row */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.2rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.1rem 0;
  font-family: var(--sans); font-size: 0.8rem; color: var(--muted);
}
.facts strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 0.15rem; }

/* Sections */
main section { padding: 2rem 0 0.5rem; }
h2 {
  font-size: 1.5rem; font-weight: 500; margin: 0 0 1rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.15rem; margin: 0; font-weight: 600; }
.page-title { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 500; margin: 2.5rem 0 0.4rem; }
.page-intro { color: var(--muted); margin: 0 0 1rem; }

.entry { padding: 0.9rem 0 1rem; border-bottom: 1px dotted var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.meta { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.entry p { margin: 0.35rem 0 0; }
.entry .links { font-family: var(--sans); font-size: 0.8rem; margin-top: 0.4rem; }

/* Your-words placeholders: visible on purpose so nothing ships unwritten */
.todo {
  background: #fff3b0; color: #4a3b00; padding: 0 0.25rem; border-radius: 2px;
  font-family: var(--sans); font-size: 0.82rem;
}
@media (prefers-color-scheme: dark) { .todo { background: #5a4a00; color: #fff3b0; } }

.lang-list { list-style: none; padding: 0; margin: 0; columns: 2 14rem; }
.lang-list li { margin: 0 0 0.3rem; }

.cv-frame { width: 100%; height: 80vh; border: 1px solid var(--rule); background: #fff; }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1rem; padding-bottom: 2rem; font-family: var(--sans); font-size: 0.8rem; color: var(--muted);
}
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  html { font-size: 106%; }
  .hero { padding-top: 2rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: 8rem; height: 10rem; }
  .meta { white-space: normal; }
}
