:root {
  --ink: #111318;
  --text: #3d4350;
  --muted: #6b7280;
  --faint: #9aa0aa;
  --line: #e4e6ea;
  --sidebar: #f3f4f6;
  --chip: #e8eaee;
  --card: #f4f5f7;
  --page: #ffffff;
  --ground: #e9eaec;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 32px 16px;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.resume {
  display: grid;
  grid-template-columns: 340px 1fr;
  max-width: 1040px;
  margin: 0 auto;
  background: var(--page);
  box-shadow: 0 10px 40px rgba(17, 19, 24, 0.08);
}

.sidebar {
  background: var(--sidebar);
  padding: 36px 30px 40px 36px;
}

.content {
  padding: 36px 36px 28px 36px;
  display: flex;
  flex-direction: column;
}

/* ---------- Shared ---------- */
.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}

.section-title {
  margin-top: 44px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

/* ---------- Sidebar ---------- */
.avatar {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  height: auto;
}

.name {
  margin-top: 26px;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.role {
  margin-top: 8px;
  font-size: 20px;
  color: var(--muted);
}

.about {
  margin-top: 26px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--muted);
}

.contact { display: grid; gap: 18px; }
.contact li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: 15px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.contact svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--ink);
}
.contact small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.sidebar .label { margin-bottom: 16px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
}
.chips li {
  background: var(--chip);
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 13px;
  color: var(--text);
}

.languages { display: grid; gap: 10px; }
.languages div { display: flex; justify-content: space-between; }
.languages dt { color: var(--ink); font-size: 17px; }
.languages dd { color: var(--muted); font-size: 16px; }

.sidebar p.muted { font-size: 16px; line-height: 1.55; }

/* ---------- Main ---------- */
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.headline {
  margin-top: 12px;
  font-size: 42px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.motto {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.25;
  color: var(--muted);
  padding-right: 4px;
}
.motto span { transition: color 0.3s ease; }
.motto span.is-active { color: var(--ink); }
.motto .dash { margin-top: 2px; }

.summary {
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.job + .job {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.job h3,
.edu h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.date { font-size: 15px; color: var(--text); white-space: nowrap; }
.duration { font-size: 14px; color: var(--faint); white-space: nowrap; }
.org { margin-top: 2px; font-size: 16px; color: var(--text); }
.place { margin-top: 2px; font-size: 15px; color: var(--muted); }

.bullets {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}
.bullets li {
  position: relative;
  padding-left: 21px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.certs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.certs li {
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px 12px;
}
.certs li:has(.cert-link) {
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.cert-link {
  display: block;
  height: 100%;
  padding: 10px 16px 12px;
  border-radius: inherit;
}
.cert-link:hover { text-decoration: none; }
.certs li:has(.cert-link:hover),
.certs li:has(.cert-link:focus-visible) {
  background: #eceef2;
  border-color: #d5d8de;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 19, 24, 0.08);
}
.cert-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.certs strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.certs span {
  display: block;
  margin-top: 2px;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--muted);
}

.projects { display: grid; gap: 8px; }
.project {
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  gap: 22px;
  align-items: start;
  margin: 0 -14px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
}
a.project {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
a.project:hover,
a.project:focus-visible {
  text-decoration: none;
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 6px 16px rgba(17, 19, 24, 0.06);
  transform: translateY(-2px);
}
a.project:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a.project:hover h3,
a.project:focus-visible h3 { text-decoration: underline; text-underline-offset: 3px; }
.proj-icon { width: 34px; height: 34px; color: var(--ink); margin-top: 2px; }
.projects h3 { font-size: 17px; font-weight: 600; color: var(--ink); }
.projects p { font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 520px; }
.proj-arrow {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  color: var(--ink);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
a.project:hover .proj-arrow,
a.project:focus-visible .proj-arrow { opacity: 1; transform: none; }
/* Touch screens have no hover, so always show the arrow there. */
@media (hover: none) {
  .proj-arrow { opacity: 0.6; transform: none; }
}

.footer {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  color: var(--text);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .resume { grid-template-columns: 1fr; }
  .sidebar { padding: 28px 24px; }
  .avatar { max-width: 280px; }
  .content { padding: 28px 24px; }
  .certs { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 560px) {
  body { padding: 0; }
  .name { font-size: 36px; }
  .headline { font-size: 32px; }
  .motto { display: none; }
  .row { flex-wrap: wrap; row-gap: 0; }
  .project { grid-template-columns: 28px 1fr 20px; gap: 14px; }
  .proj-icon { width: 28px; height: 28px; }
  .footer { flex-direction: column; gap: 4px; }
}

/* ---------- Print ---------- */
@page { size: A4; margin: 0; }

@media print {
  body { background: #fff; padding: 0; font-size: 13px; }
  .proj-arrow { display: none; }
  .resume { box-shadow: none; max-width: none; }
  .motto span.is-active { color: var(--muted); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .certs li:has(.cert-link),
  a.project,
  .proj-arrow { transition: none; }
  .certs li:has(.cert-link:hover),
  a.project:hover,
  a.project:focus-visible,
  .proj-arrow { transform: none; }
}
