:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --panel: #eef2f7;
  --text: #1c1f24;
  --muted: #5d6470;
  --accent: #1a4f8b;
  --accent-soft: #dfe9f5;
  --rule: #e1e5ea;
  --tag-bg: #ffffff;
  --tag-border: #d3dbe5;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161a20;
    --panel: #1b2129;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --accent: #8ab8ee;
    --accent-soft: #1f2d3f;
    --rule: #262d36;
    --tag-bg: #161a20;
    --tag-border: #303946;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.page {
  max-width: 72rem;
  margin: 2.5rem auto;
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "id main" "side main";
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Identity block and sidebar share the tinted left column */
.id, aside { background: var(--panel); padding: 2rem 1.75rem; }
.id { grid-area: id; padding-bottom: 0.5rem; }
aside { grid-area: side; padding-top: 0.5rem; }
main { grid-area: main; padding: 2.25rem 2.75rem 2.75rem; }

.lang-switch { display: flex; gap: 0.25rem; margin-bottom: 1.25rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; }
.lang-switch a, .lang-switch span { padding: 0.2rem 0.55rem; border-radius: 999px; text-decoration: none; }
.lang-switch span { background: var(--accent); color: var(--surface); }
.lang-switch a { color: var(--muted); border: 1px solid var(--tag-border); }
.lang-switch a:hover { color: var(--accent); border-color: var(--accent); }

h1 { margin: 0; font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.02em; }
.headline { margin: 0.35rem 0 1.25rem; color: var(--accent); font-weight: 600; font-size: 1.05rem; }

.contact { list-style: none; margin: 0 0 1.4rem; padding: 0; font-size: 0.92rem; color: var(--muted); }
.contact li { display: flex; align-items: center; gap: 0.55rem; margin: 0.4rem 0; overflow-wrap: anywhere; }
.contact svg { color: var(--accent); }

.download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.download:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26, 79, 139, 0.25); }

h2 {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
main section + section { margin-top: 3rem; }
aside section { margin-top: 1.75rem; }

.lead { margin: 0; max-width: 64ch; font-size: 1.04rem; line-height: 1.75; }
.lead + .lead { margin-top: 1rem; }
main section:first-child .lead:first-of-type { font-size: 1.2rem; line-height: 1.55; font-weight: 500; }

/* Experience timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.job { position: relative; padding: 0 0 2.4rem 1.6rem; border-left: 2px solid var(--rule); }
.job:last-child { padding-bottom: 0.25rem; border-left-color: transparent; }
.job::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.job:first-child::before { background: var(--accent); }
.job-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.at { color: var(--accent); font-weight: 600; }
.when { margin: 0.15rem 0 0.7rem; color: var(--muted); font-size: 0.88rem; }
.summary { margin: 0 0 0.7rem; max-width: 68ch; color: var(--muted); }
.highlights { margin: 0; padding-left: 1.1rem; max-width: 68ch; }
.highlights li { margin: 0.5rem 0; padding-left: 0.2rem; line-height: 1.6; }
.highlights li::marker { color: var(--accent); }

/* Book card */
.book {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--accent-soft);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.book:hover { border-color: var(--accent); transform: translateY(-1px); }
.book-icon { width: 2rem; height: 2rem; color: var(--accent); margin-top: 0.15rem; }
.book-body { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.book-summary { margin-top: 0.3rem; }
.arrow { color: var(--accent); font-size: 1.25rem; align-self: center; }

.muted { color: var(--muted); font-size: 0.88rem; }

/* Sidebar content */
.tag-group { margin: 0.9rem 0 0.4rem; font-size: 0.85rem; font-weight: 600; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.tag {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  background: var(--tag-bg);
  font-size: 0.8rem;
}
.edu { display: flex; flex-direction: column; margin-bottom: 0.9rem; font-size: 0.92rem; line-height: 1.45; }
.pair { display: flex; justify-content: space-between; gap: 1rem; margin: 0.3rem 0; font-size: 0.92rem; }

@media (max-width: 52rem) {
  .page {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "id" "main" "side";
  }
  .id { padding: 1.75rem 16px 1.5rem; }
  main { padding: 2rem 16px; }
  aside { padding: 0.5rem 16px 2.5rem; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --panel: #fff; --text: #000; --muted: #444; --accent: #1a4f8b; --accent-soft: #fff; }
  body { font-size: 11pt; }
  .page { margin: 0; box-shadow: none; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "id" "main" "side"; }
  .lang-switch, .download { display: none; }
  .id, aside, main { padding: 0 0 1rem; }
  .job, .book, .edu { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
