/* ---------- Tokens ---------- */
:root {
  --ink: #1c2029;
  --muted: #586070;
  --rule: #dde0e6;
  --page: #eceef1;
  --paper: #ffffff;
  --ruby: #a3172f;
  --ruby-tint: #f7e9ec;
  --code-bg: #f1f2f5;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: var(--ruby);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ruby);
}

a:focus-visible {
  outline: 2px solid var(--ruby);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Page sheet ---------- */
.sheet {
  max-width: 920px;
  margin: 40px auto;
  padding: 56px 64px 64px;
  background: var(--paper);
  border-top: 6px solid var(--ruby);
  box-shadow: 0 1px 3px rgba(20, 24, 36, 0.08);
}

/* ---------- Masthead ---------- */
.masthead {
  padding-bottom: 28px;
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.role {
  margin: 8px 0 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ruby);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.94rem;
}

.contact li + li {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
}

/* ---------- Sections ---------- */
.block {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0 32px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}

.block h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ruby);
}

.content > :first-child {
  margin-top: 0;
}

.content > :last-child {
  margin-bottom: 0;
}

.content p {
  margin: 0;
  max-width: 68ch;
}

/* ---------- Skills ---------- */
.skills {
  margin: 0;
}

.skills > div {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0 20px;
  padding: 7px 0;
}

.skills > div + div {
  border-top: 1px dashed var(--rule);
}

.skills dt {
  font-weight: 600;
}

.skills dd {
  margin: 0;
}

/* ---------- Projects & education ---------- */
.project + .project {
  margin-top: 30px;
}

.project h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
}

.meta {
  margin: 3px 0 0 !important;
  color: var(--muted);
  font-size: 0.9rem;
}

.note {
  margin-top: 8px !important;
  font-style: italic;
}

.project ul {
  margin: 12px 0 0;
  padding-left: 1.15rem;
  max-width: 68ch;
}

.project li {
  margin-bottom: 6px;
  padding-left: 2px;
}

.project li::marker {
  color: var(--ruby);
}

.project li:last-child {
  margin-bottom: 0;
}

/* ---------- Inline code ---------- */
code {
  padding: 1px 5px;
  background: var(--code-bg);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.86em;
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 820px) {
  .sheet {
    margin: 0;
    padding: 36px 28px 44px;
    box-shadow: none;
  }

  .masthead h1 {
    font-size: 2.4rem;
  }

  .block {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .sheet {
    padding: 28px 20px 36px;
  }

  .masthead h1 {
    font-size: 2rem;
  }

  .contact {
    flex-direction: column;
    gap: 4px;
  }

  .contact li + li {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .skills > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------- Print / Save as PDF ---------- */
@page {
  size: A4;
  margin: 14mm;
}

@media print {
  body {
    background: #fff;
    font-size: 10.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border-top-width: 4px;
    box-shadow: none;
  }

  .masthead {
    padding-top: 18px;
  }

  .masthead h1 {
    font-size: 2.3rem;
  }

  .block {
    padding: 16px 0;
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .project {
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
