:root {
  --resume-bg: #181210;
  --resume-bg-soft: #241b17;
  --resume-paper: #f6efe5;
  --resume-surface: rgba(255, 251, 246, 0.82);
  --resume-surface-strong: #fffdfa;
  --resume-surface-muted: #efe4d6;
  --resume-ink: #2c211b;
  --resume-muted: #6d6054;
  --resume-line: rgba(97, 76, 59, 0.18);
  --resume-accent: #b07a3d;
  --resume-accent-strong: #8a5720;
  --resume-shadow: 0 24px 60px rgba(17, 12, 9, 0.2);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--resume-ink);
  font-family: 'Avenir Next', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

main,
section,
header {
  display: block;
}

a {
  color: var(--resume-accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #553112;
}

strong {
  color: #26180f;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
  margin-right: -10px;
}

.col,
.col-4,
.col-6 {
  position: relative;
  width: 100%;
  min-height: 1px;
  padding-left: 10px;
  padding-right: 10px;
}

@media (min-width: 576px) {
  .col-4 {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
  }

  .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col {
    flex: 1 0 0;
    max-width: 100%;
  }
}

.m-t-0 {
  margin-top: 0 !important;
}

.m-b-20 {
  margin-bottom: 20px !important;
}

.f-w-900 {
  font-weight: 900 !important;
}

.f-s-18 {
  font-size: 18px !important;
}

.p-t-0 {
  padding-top: 0 !important;
}

.p-b-0 {
  padding-bottom: 0 !important;
}

.p-t-10 {
  padding-top: 10px !important;
}

.p-b-10 {
  padding-bottom: 10px !important;
}

.bg-gray-lightest {
  background-color: transparent;
}

.boxes,
.boxes.default {
  margin: 0;
  border: 0;
  background: transparent;
}

.box {
  padding: 16px 18px;
  border: 1px solid var(--resume-line);
  border-radius: 18px;
  background: var(--resume-surface-strong);
  box-shadow: 0 8px 20px rgba(36, 27, 22, 0.05);
}

.boxes .box + .box {
  margin-top: 12px;
}

.strong-link {
  color: #4e2e13;
  font-weight: 700;
}

.resume-body {
  min-height: 100vh;
  padding: 32px 16px 64px;
  background: radial-gradient(circle at top left, rgba(176, 122, 61, 0.2), transparent 22%),
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.08), transparent 16%),
    linear-gradient(135deg, #140f0d 0%, #1b1411 48%, #120e0c 100%);
}

.resume-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.18;
  pointer-events: none;
}

.resume-page,
.page.resume-page {
  position: relative;
  width: min(1120px, 100%);
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.16)),
    var(--resume-paper);
  box-shadow: var(--resume-shadow);
  overflow: hidden;
}

.resume-page::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  border: 1px solid rgba(97, 76, 59, 0.08);
  pointer-events: none;
}

.resume-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'copy contact'
    'panel panel';
  align-items: start;
  gap: 18px;
  padding: 30px;
  border: 1px solid rgba(97, 76, 59, 0.14);
  border-radius: 28px;
  color: var(--resume-ink);
  background: radial-gradient(circle at top right, rgba(176, 122, 61, 0.22), transparent 24%),
    linear-gradient(135deg, #efdfcb 0%, #fffaf4 54%, #ecd8c2 100%);
  box-shadow: 0 24px 48px rgba(12, 9, 7, 0.22);
  overflow: hidden;
}

.hero-copy,
.hero-contact,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-copy {
  grid-area: copy;
  max-width: 820px;
}

.hero-contact {
  grid-area: contact;
  display: grid;
  justify-items: end;
  gap: 10px;
  max-width: 240px;
}

.hero-contact-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(97, 76, 59, 0.18);
  background: linear-gradient(135deg, #2c1d14 0%, #4a2c18 100%);
  color: #fffaf4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(31, 23, 18, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-download-button:hover,
.hero-download-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(31, 23, 18, 0.2);
  background: linear-gradient(135deg, #3a2619 0%, #5c361d 100%);
  color: #fffaf4;
  text-decoration: none;
  outline: none;
}

.hero-contact-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(97, 76, 59, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.78);
  color: #4d392a;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(31, 23, 18, 0.08);
  backdrop-filter: blur(8px);
}

.hero-kicker {
  margin-bottom: 18px;
  color: var(--resume-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.hero-title {
  color: #241711;
  font-size: 68px;
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'Noto Serif SC', serif;
}

.hero-role {
  margin-top: 16px;
  color: #724215;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
}

.hero-description {
  margin-top: 18px;
  max-width: 620px;
  color: #4b3f35;
  font-size: 17px;
  line-height: 1.8;
}

.hero-panel {
  grid-area: panel;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-metric {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 104px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(135deg, #1c1511 0%, #291d16 100%);
  box-shadow: inset 0 1px 0 rgba(255, 246, 236, 0.08);
}

.metric-value {
  color: #f7d4a2;
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-label {
  color: rgba(247, 239, 230, 0.94);
  font-size: 14px;
  line-height: 1.5;
}

.resume-section {
  position: relative;
  margin-bottom: 20px;
  padding: 24px 26px 26px;
  border-radius: 24px;
  border: 1px solid var(--resume-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18)),
    var(--resume-surface);
  box-shadow: 0 12px 28px rgba(31, 23, 18, 0.08);
}

.section-title {
  margin-bottom: 18px !important;
  color: var(--resume-ink);
  font-size: 28px !important;
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-weight: 700 !important;
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'Noto Serif SC', serif;
}

.section-title::after {
  content: '';
  display: block;
  width: 78px;
  height: 3px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--resume-accent), rgba(176, 122, 61, 0));
}

.section-summary .box,
.section-profile .box:nth-child(2),
.section-strengths .box {
  background: linear-gradient(180deg, rgba(176, 122, 61, 0.08), rgba(255, 255, 255, 0.96));
}

.section-summary .boxes > .box,
.section-strengths .boxes > .box {
  position: relative;
  padding-left: 22px;
}

.section-summary .boxes > .box::before,
.section-strengths .boxes > .box::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--resume-accent), rgba(176, 122, 61, 0.2));
}

.section-contact .boxes > .box:first-child,
.section-profile .boxes > .box:first-child,
.section-profile .boxes > .box:nth-child(3) {
  background: var(--resume-surface-muted);
}

.section-contact {
  padding: 18px 22px 20px;
}

.section-contact .section-title {
  margin-bottom: 12px !important;
}

.section-contact .section-title::after {
  margin-top: 8px;
  width: 56px;
}

.section-contact .box {
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 16px;
}

.section-contact .p-t-10 {
  padding-top: 6px !important;
}

.section-contact .p-b-10 {
  padding-bottom: 6px !important;
}

.section-contact .col-4,
.section-profile .col-4,
.section-profile .col-6 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--resume-ink);
}

.border {
  position: relative;
}

.border::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(97, 76, 59, 0),
    rgba(97, 76, 59, 0.22),
    rgba(97, 76, 59, 0)
  );
}

.section-strengths .boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.section-strengths .boxes .box + .box {
  margin-top: 0;
}

.section-open-source .box {
  display: grid;
  gap: 8px;
}

.section-experience .boxes {
  position: relative;
  padding-left: 28px;
}

.section-experience .boxes::before {
  content: '';
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 9px;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(176, 122, 61, 0),
    var(--resume-accent),
    rgba(176, 122, 61, 0)
  );
}

.section-experience .boxes > .box:first-child {
  position: relative;
  border-color: transparent;
  background: linear-gradient(135deg, #211812 0%, #2f2118 100%);
  color: #f6ede4;
  box-shadow: 0 16px 28px rgba(22, 15, 11, 0.12);
}

.section-experience .boxes > .box:first-child::before {
  content: '';
  position: absolute;
  top: 22px;
  left: -25px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--resume-accent);
  box-shadow: 0 0 0 6px rgba(176, 122, 61, 0.18);
}

.section-experience .boxes > .box:not(:first-child) {
  margin-left: 18px;
}

.section-experience p + p {
  margin-top: 10px;
}

.section-experience .m-t-0 strong {
  color: var(--resume-ink);
  font-size: 18px;
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Songti SC', 'Noto Serif SC', serif;
}

.section-experience .boxes > .box:first-child strong,
.section-experience .boxes > .box:first-child {
  color: #f6ede4;
}

#print-btn {
  position: fixed;
  font-size: 16px;
  cursor: pointer;
  display: none;
}

#ericsson-work,
#education-section {
  display: none;
}

@media (max-width: 900px) {
  .resume-body {
    padding: 18px 12px 40px;
  }

  .resume-page,
  .page.resume-page {
    padding: 16px;
    border-radius: 24px;
  }

  .resume-hero {
    padding: 22px;
  }

  .hero-title {
    font-size: 52px;
  }

  .hero-role {
    font-size: 21px;
  }

  .hero-panel,
  .section-strengths .boxes {
    grid-template-columns: 1fr;
  }

  .resume-section {
    padding: 20px;
  }
}

@media (max-width: 575px) {
  .resume-page,
  .page.resume-page {
    padding: 12px;
  }

  .resume-page::before {
    inset: 10px;
  }

  .resume-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      'copy'
      'contact'
      'panel';
    padding: 18px;
    border-radius: 22px;
  }

  .hero-kicker {
    letter-spacing: 0.2em;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-contact {
    position: static;
    max-width: none;
    justify-items: start;
    margin-top: -2px;
    margin-bottom: 6px;
  }

  .hero-contact-meta {
    justify-content: flex-start;
  }

  .hero-download-button {
    min-height: 36px;
    padding: 0 14px;
  }

  .hero-contact-item {
    min-height: 32px;
    padding: 6px 11px;
  }

  .hero-role {
    font-size: 18px;
  }

  .hero-description {
    font-size: 15px;
  }

  .resume-section {
    padding: 18px;
    border-radius: 20px;
  }

  .section-title {
    font-size: 24px !important;
  }

  .section-contact .col-4,
  .section-profile .col-4,
  .section-profile .col-6 {
    font-size: 14px;
  }

  .section-contact {
    padding: 16px 18px 18px;
  }

  .border::before {
    display: none;
  }

  .section-experience .boxes {
    padding-left: 16px;
  }

  .section-experience .boxes::before {
    left: 2px;
  }

  .section-experience .boxes > .box:first-child::before {
    left: -18px;
  }

  .section-experience .boxes > .box:not(:first-child) {
    margin-left: 8px;
  }
}

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body {
    font-size: 10.8px;
    line-height: 1.38;
    background: #fff !important;
    color: #222 !important;
  }

  .resume-body {
    padding: 0;
    background: #fff !important;
  }

  .resume-body::before,
  .resume-page::before {
    display: none !important;
  }

  .resume-page,
  .page.resume-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible;
  }

  .resume-hero,
  .resume-section,
  .box,
  .boxes > .box {
    color: #222 !important;
    background: #fff !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .resume-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      'copy'
      'contact'
      'panel';
    gap: 8px;
    margin-bottom: 8px !important;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .hero-kicker {
    margin-bottom: 5px;
    font-size: 9px;
  }

  .hero-title {
    color: #1f1712;
    font-size: 27px;
    line-height: 1;
  }

  .hero-role {
    margin-top: 5px;
    color: #403024;
    font-size: 14px;
    line-height: 1.3;
  }

  .hero-description {
    margin-top: 6px;
    max-width: none;
    color: #51473e;
    font-size: 10.2px;
    line-height: 1.45;
  }

  .hero-contact {
    position: static;
    max-width: none;
    justify-items: start;
    gap: 5px;
    margin-bottom: 4px;
  }

  .hero-contact-meta {
    justify-content: flex-start;
    gap: 5px;
  }

  .hero-download-button {
    display: none;
  }

  .hero-contact-item {
    min-height: auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #403024;
    font-size: 10px;
    box-shadow: none;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .hero-metric {
    min-height: auto;
    padding: 8px 9px 7px;
    border: 1px solid #cfc5bb;
    border-radius: 8px;
    background: linear-gradient(180deg, #faf6f1 0%, #f2ebe2 100%) !important;
  }

  .metric-value {
    color: #241711;
    font-size: 21px;
  }

  .metric-label {
    font-size: 9px;
    line-height: 1.25;
    color: #4b4138 !important;
  }

  .resume-section {
    margin-bottom: 6px !important;
    padding: 8px 10px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-title {
    margin-bottom: 8px !important;
    font-size: 15px !important;
  }

  .section-title::after {
    width: 36px;
    height: 2px;
    margin-top: 4px;
    background: #8a5720;
  }

  .box {
    padding: 7px 8px;
    border: 1px solid #e3e3e3;
    border-radius: 7px;
    margin-top: 0;
  }

  .boxes .box + .box {
    margin-top: 4px;
  }

  .row {
    margin-left: -6px;
    margin-right: -6px;
  }

  .col,
  .col-4,
  .col-6 {
    padding-left: 6px;
    padding-right: 6px;
  }

  .section-contact .col-4,
  .section-profile .col-4,
  .section-profile .col-6 {
    font-size: 10px;
    font-weight: 600;
  }

  .section-contact {
    padding: 6px 9px 8px;
  }

  .section-contact .section-title {
    margin-bottom: 6px !important;
  }

  .section-contact .section-title::after {
    width: 28px;
    margin-top: 3px;
  }

  .section-contact .box {
    padding-left: 6px;
    padding-right: 6px;
    border-radius: 6px;
  }

  .section-contact .p-t-10 {
    padding-top: 3px !important;
  }

  .section-contact .p-b-10 {
    padding-bottom: 3px !important;
  }

  .section-summary .boxes,
  .section-open-source .boxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .section-summary .boxes .box + .box,
  .section-open-source .boxes .box + .box {
    margin-top: 0;
  }

  .section-summary .boxes > .box,
  .section-strengths .boxes > .box {
    padding-left: 12px;
  }

  .section-summary .boxes > .box::before,
  .section-strengths .boxes > .box::before {
    top: 7px;
    bottom: 7px;
    width: 2px;
  }

  .section-strengths .boxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .section-open-source .box {
    gap: 2px;
  }

  .section-education {
    padding-bottom: 8px;
  }

  .section-education .boxes {
    display: grid;
    grid-template-columns: 0.95fr 1.25fr;
    gap: 4px;
    align-items: stretch;
  }

  .section-education .boxes .box + .box {
    margin-top: 0;
  }

  .section-experience {
    break-inside: auto;
    page-break-inside: auto;
  }

  .section-experience .boxes {
    padding-left: 14px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-experience .boxes::before {
    left: 4px;
    top: 10px;
    bottom: 10px;
  }

  .section-experience .boxes > .box:first-child {
    padding: 7px 8px;
    border: 1px solid #d9d9d9;
    color: #222 !important;
  }

  .section-experience .boxes > .box:first-child::before {
    left: -13px;
    top: 13px;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px rgba(138, 87, 32, 0.15);
  }

  .section-experience .boxes > .box:not(:first-child) {
    margin-left: 6px;
  }

  .section-experience .m-t-0 strong {
    font-size: 12px;
  }

  .section-experience p,
  .section-summary .box,
  .section-profile .box,
  .section-strengths .box,
  .section-open-source .box,
  .section-education .box {
    font-size: 10px;
    line-height: 1.38;
  }

  .section-experience p + p {
    margin-top: 4px;
  }

  a,
  .strong-link {
    color: #222 !important;
    text-decoration: none;
  }

  #ericsson-work,
  #education-section {
    display: block;
  }
}
