:root {
  --bg: #EDE7DA;
  --paper: #F8F4EC;
  --ink: #1A1A1A;
  --muted: #777;
  --line: rgba(26, 26, 26, 0.12);
  --accent: #8B2E1F;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 820px;
  margin: 2.5rem auto;
  padding: 3.5rem 3.5rem 4rem;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 40px rgba(0, 0, 0, 0.08);
}

a { color: inherit; transition: color 0.15s; }
a:hover { color: var(--accent); }

/* top bar */
.topbar {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: #666;
  margin-bottom: 2rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.topbar a { color: #666; text-decoration: none; margin-right: 15px; }
.topbar a.active { color: var(--ink); font-weight: 500; border-bottom: 2px solid var(--accent); }

/* header */
.me { padding-bottom: 0.5rem; }
.me-label {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem;
}
.me-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 900; line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
}
.me-title { font-size: 1.05rem; font-weight: 300; color: #555; margin-bottom: 1.2rem; }
.me-title::after {
  content: ""; display: block; width: 48px; height: 3px;
  background: var(--accent); margin-top: 1.1rem;
}
.me-contacts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.85rem; color: #444; }
.me-contacts a { text-decoration: none; border-bottom: 1px solid var(--line); }
.me-contacts a:hover { border-color: var(--accent); }

.dl-btn {
  margin-top: 1.4rem; padding: 0.65rem 1.5rem; border: none; border-radius: 2px;
  background: var(--ink); color: var(--paper);
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.dl-btn:hover { background: var(--accent); transform: translateY(-1px); }

/* section headings */
.section-header { display: flex; align-items: center; gap: 0.9rem; margin: 3rem 0 1.3rem; }
.section-header::before {
  content: ""; width: 8px; height: 8px; background: var(--accent); flex-shrink: 0;
}
.section-title {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.01em; white-space: nowrap;
}
.section-line {
  flex: 1; height: 1px;
  background: linear-gradient(to right, rgba(26,26,26,0.35), rgba(26,26,26,0));
}

/* summary */
.summary-text { font-size: 0.96rem; line-height: 1.8; color: #333; max-width: 660px; }
.summary-text p { margin: 0 0 0.75rem; }
.summary-text p:last-child { margin-bottom: 0; }
.summary-text a, .edu-paper a, .act-desc a { text-decoration: underline; }

/* experience */
.exp-item { display: grid; grid-template-columns: 130px 1fr; gap: 0 1.5rem; padding: 0 0 1.6rem; }
.exp-item + .exp-item { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.exp-period { font-size: 0.78rem; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; line-height: 1.5; padding-top: 0.2rem; white-space: pre-line; }
.exp-company { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.25rem; }
.exp-role { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.exp-desc { font-size: 0.9rem; line-height: 1.7; color: #444; }

/* education */
.edu-item { padding: 0 0 1.4rem; }
.edu-item + .edu-item { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.edu-year { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.25rem; }
.edu-school { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.edu-detail { font-size: 0.88rem; color: #555; line-height: 1.6; margin-top: 0.15rem; }
.edu-gpa {
  display: inline-block; margin-top: 0.5rem; padding: 0.15rem 0.7rem;
  border-radius: 999px; background: var(--accent); color: var(--paper);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em;
}
.edu-papers { margin-top: 0.7rem; padding-left: 1rem; border-left: 2px solid var(--accent); }
.edu-paper { font-size: 0.84rem; color: #555; font-style: italic; margin-bottom: 0.3rem; }

/* skills */
.skills-grid { display: grid; grid-template-columns: 165px 1fr; gap: 0.9rem 1.5rem; align-items: start; }
.skill-cat { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500; padding-top: 0.15rem; }
.skill-val { font-size: 0.9rem; color: #333; line-height: 1.75; }

/* languages */
.lang-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.lang-name { font-size: 0.9rem; font-weight: 500; width: 110px; }
.lang-bar-bg { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lang-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.lang-level { font-size: 0.78rem; color: var(--muted); width: 130px; text-align: right; }

/* activities */
.activity-row { display: flex; gap: 1rem; margin-bottom: 0.8rem; font-size: 0.9rem; }
.act-year { color: var(--accent); font-size: 0.8rem; font-weight: 500; width: 80px; flex-shrink: 0; padding-top: 0.1rem; }
.act-desc { color: #333; line-height: 1.6; }

/* interests */
.interests { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.interest-tag {
  padding: 0.35rem 0.95rem; border-radius: 999px;
  background: rgba(26,26,26,0.05); border: 1px solid var(--line);
  font-size: 0.82rem; color: #555;
}

/* footer */
footer { margin-top: 3.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: #aaa; font-size: 0.8rem; text-align: center; }

/* ── responsive: must stay AFTER the base rules ── */
@media (max-width: 640px) {
  .page { margin: 0; padding: 1.5rem 1.25rem 3rem; border-radius: 0; box-shadow: none; }
  .exp-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .skills-grid { grid-template-columns: 1fr; gap: 0.2rem; }
  .lang-name { width: 80px; }
  .lang-level { width: 100px; }
}

/* ── print ── */
@media print {
  body { background: #fff; }
  .page { max-width: 100%; margin: 0; padding: 0; background: none; border-radius: 0; box-shadow: none; }
  .no-print { display: none !important; }
  .exp-item, .edu-item, .activity-row { break-inside: avoid; }
  .section-header { break-after: avoid; }
  .section-header::before, .me-title::after, .edu-gpa, .lang-bar-bg, .lang-bar-fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}