:root {
  --ink: #1c2b46;
  --ink-70: rgba(28, 43, 70, .72);
  --ink-45: rgba(28, 43, 70, .5);
  --paper: #f6f4ee;
  --paper-alt: #efece1;
  --rubric: #7c2e2b;
  --rubric-soft: #a8564c;
  --line: #cdc5ab;
  --gold: #9c7a3c;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper-alt);
}

body {
  margin: 0;
  padding: 56px 20px 80px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(28, 43, 70, .06), 0 12px 40px rgba(28, 43, 70, .08);
  padding: 56px 56px 48px;
  border: 1px solid var(--line);
}

/* Header */

header {
  margin-bottom: 28px;
}

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 2.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}

.subtitle {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--rubric-soft);
  margin: 0 0 12px;
}

.contact {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-70);
  margin: 0;
}

.contact span {
  margin-right: 14px;
  display: inline-block;
}

.contact span:last-child {
  margin-right: 0;
}

.portrait {
  width: 96px;
  height: 118px;
  object-fit: cover;
  border: 1px solid var(--line);
  filter: grayscale(15%);
  flex-shrink: 0;
}

/* staff-line divider — a quiet nod to ten years of violin */
.staff {
  margin: 26px 0 4px;
  height: 22px;
}

.staff svg {
  width: 100%;
  height: 100%;
  display: block;
}

.staff line {
  stroke: var(--line);
  stroke-width: 1;
}

/* Sections */

section {
  margin-top: 40px;
}

h2 {
  margin: 0 0 4px;
  font-weight: 400;
}

h2 .rest {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 20px;
}

/* Entries */

.entry {
  margin-bottom: 20px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 2px;
  color: var(--ink);
}

.entry-subtitle {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-70);
  margin: 0 0 2px;
}

.entry-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}

.entry-bullets {
  margin: 0;
  padding-left: 18px;
}

.entry-bullets li {
  margin-bottom: 3px;
  font-size: 0.94rem;
}

.entry-bullets li::marker {
  color: var(--rubric-soft);
}

/* Competenze tables */

.comp-table {
  width: 100%;
  border-collapse: collapse;
}

.comp-table tr {
  border-bottom: 1px solid var(--paper-alt);
}

.comp-table tr:last-child {
  border-bottom: none;
}

.comp-table td {
  padding: 10px 0;
  vertical-align: top;
  font-size: 0.94rem;
}

.comp-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-45);
  width: 130px;
  padding-top: 12px;
  white-space: nowrap;
}

/* Footer */

footer {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ink-45);
  text-align: center;
}

/* Responsive */

@media (max-width: 640px) {
  body {
    padding: 24px 0 60px;
  }

  .sheet {
    padding: 32px 24px;
    border-left: none;
    border-right: none;
  }

  h1 {
    font-size: 2rem;
  }

  .head-row {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .portrait {
    width: 84px;
    height: 104px;
  }

  .comp-table td:first-child {
    width: 100px;
  }
}

/* Print */

@media print {

  html,
  body {
    background: #fff;
  }

  body {
    padding: 0;
    font-size: 12.5px;
  }

  .sheet {
    box-shadow: none;
    border: none;
    max-width: 100%;
    padding: 0 8mm;
  }

  section {
    margin-top: 26px;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}