:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #080808;
  --muted: #5f6368;
  --line: #e5e7eb;
  --accent: #9146a5;
  --accent-hover: #7f3b92;
  --accent-soft: #f4ecf7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', sans-serif;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

/* Page layout and shared cards */

.cv-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
}

.cv-hero {
  margin-bottom: 32px;
}

.cv-hero-card,
.cv-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.05);
}

.cv-hero-card {
  padding: clamp(32px, 5vw, 56px);
}

.cv-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cv-sidebar,
.cv-main {
  display: grid;
  gap: 24px;
}

.cv-block {
  padding: 28px;
}

/* Hero */

.back-link {
  width: fit-content;
  min-height: 50px;
  margin-bottom: 34px;
  padding: 13px 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(145, 70, 165, 0.2);

  font-size: 15px;
  font-weight: 650;
  text-decoration: none;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.back-link:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
  box-shadow: 0 14px 28px rgba(145, 70, 165, 0.26);
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 4vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.role-title {
  margin-bottom: 26px;
  color: var(--accent);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 650;
}

.summary {
  max-width: 1060px;
  margin-bottom: 0;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.7vw, 22px);

  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.55;
}

.summary::before,
.summary::after {
  color: var(--accent);
  font-family: 'Geist', sans-serif;
  font-size: clamp(58px, 6vw, 84px);
  font-weight: 300;
  line-height: 0.75;
}

.summary::before {
  content: " “ ";
}

.summary::after {
  content: " ” ";
}

/* Typography and section headings */

.cv-block h2 {
  margin-bottom: 20px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.cv-block h2::after {
  content: "";
  display: block;
  width: 58px;
  height: 4px;
  margin-top: 12px;
  background: var(--accent);
}

.cv-block h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.cv-block p,
.cv-block li {
  color: var(--muted);
  line-height: 1.58;
}

.cv-block article + article {
  margin-top: 20px;
}

/* Skills, lists and education */

.tag-list,
.job-header span {
  font-family: 'JetBrains Mono', monospace;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list span {
  padding: 5px 10px;
  background: var(--accent-soft);
  color: #46204f;
  border: 1px solid #ead9ef;
  border-radius: 999px;
  font-size: 12px;
}

.tag-list.mono span {
  background: #f5f5f5;
  color: var(--text);
  border-color: var(--line);
}

.simple-list {
  margin-bottom: 0;
  padding-left: 18px;
}

.simple-list li {
  margin-bottom: 7px;
}

/* Work experience */

.job {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.job:first-of-type {
  padding-top: 0;
}

.job:last-of-type {
  border-bottom: 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
}

.job-header p {
  margin-bottom: 0;
}

.job-header span {
  flex: 0 0 auto;
  padding-top: 4px;
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}

.job ul {
  margin: 0;
  padding-left: 20px;
}

.job li {
  margin-bottom: 8px;
}

/* Earlier roles */

.older-roles {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.older-roles summary {
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

.older-roles article {
  margin-top: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.older-roles article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.older-roles p {
  margin-bottom: 8px;
}

.older-role-description {
  font-size: 14px;
}

/* Responsive layout */

@media (max-width: 900px) {
  .cv-page {
    width: min(100% - 28px, 720px);
    padding: 32px 0;
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }

  .cv-hero-card,
  .cv-block {
    border-radius: 14px;
  }

  .summary {
    font-size: clamp(17px, 2.7vw, 20px);
  }

  .summary::before,
  .summary::after {
    font-size: clamp(52px, 8vw, 70px);
  }

  .job-header {
    flex-direction: column;
    gap: 6px;
  }

  .job-header span {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .cv-page {
    width: min(100% - 20px, 520px);
    padding: 20px 0;
  }

  .cv-hero-card,
  .cv-block {
    padding: 22px;
  }

  .back-link {
    min-height: 46px;
    margin-bottom: 26px;
    padding: 11px 18px;
    font-size: 14px;
  }

  .summary {
    grid-template-columns: 18px minmax(0, 1fr) 18px;
    gap: 6px;
    font-size: 17px;
    line-height: 1.5;
  }

  .summary::before,
  .summary::after {
    font-size: 44px;
  }

  .tag-list {
    gap: 7px;
  }
}

/* Print */

@media print {
  body {
    background: #ffffff;
  }

  .cv-page {
    width: 100%;
    padding: 0;
  }

  .back-link {
    display: none;
  }

  .cv-hero-card,
  .cv-block {
    box-shadow: none;
  }

  .older-roles {
    break-inside: avoid;
  }
}
