:root {
  --bg: #f3f5f8;
  --paper: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --soft: #e5eaf1;
  --line: #d8dee8;
  --blue: #1d6fd8;
  --blue-deep: #155bb3;
  --blue-soft: #eaf3ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.68;
  letter-spacing: 0;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
}

.page-shell {
  width: 100%;
  padding: 42px 20px;
}

.resume-paper {
  position: relative;
  width: min(100%, 900px);
  min-height: 1272px;
  margin: 0 auto;
  padding: 54px 60px 62px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.document-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 18px;
}

.document-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.print-button:hover {
  background: var(--blue-deep);
}

.print-button:focus-visible {
  outline: 3px solid rgba(29, 111, 216, 0.25);
  outline-offset: 3px;
}

.resume-header {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 250px;
  gap: 28px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--ink);
}

.profile-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f9fbff 0, #f9fbff 24%, transparent 25%),
    linear-gradient(135deg, var(--blue-soft), #f7f9fc);
}

.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.profile-photo.is-placeholder img {
  display: none;
}

.profile-initials {
  color: var(--blue-deep);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.resume-label {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-main h1 {
  color: #111827;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.08;
}

.desired-role {
  margin-top: 10px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.contact-list {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-style: normal;
  font-size: 13px;
  line-height: 1.35;
}

.contact-list a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.contact-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.resume-section {
  margin-top: 34px;
}

.section-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.section-title::before {
  content: "";
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px var(--blue-soft);
}

.intro-copy {
  display: grid;
  gap: 12px;
  color: #334155;
}

.intro-highlight {
  color: var(--blue-deep);
  font-weight: 800;
}

.military-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 24px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #334155;
}

.military-line strong {
  color: var(--blue-deep);
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.summary-item {
  padding-left: 16px;
  border-left: 3px solid var(--blue);
}

.period {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-item h3,
.credential-item h3,
.experience-list h3,
.project-item h3 {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.summary-item p:not(.period),
.experience-list p,
.project-item li {
  color: #475569;
}

.summary-item ul {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-left: 17px;
}

.summary-item li::marker,
.project-item li::marker {
  color: var(--blue);
}

.credential-list {
  border-top: 1px solid var(--line);
}

.credential-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.credential-label {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.credential-item p:not(.credential-label) {
  color: #475569;
}

.experience-list {
  display: grid;
  gap: 15px;
  list-style: none;
  counter-reset: experience;
}

.experience-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 14px;
  counter-increment: experience;
}

.experience-list li::before {
  content: counter(experience, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.experience-list h3,
.experience-list p {
  grid-column: 2;
}

.experience-list p {
  margin-top: 2px;
}

.skill-table {
  border-top: 1px solid var(--line);
}

.skill-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.skill-row strong {
  color: var(--blue-deep);
  font-size: 13px;
}

.skill-row p {
  color: #334155;
}

.project-list {
  display: grid;
  gap: 18px;
}

.project-item {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.project-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.project-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 7px;
}

.project-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.project-item ul {
  display: grid;
  gap: 4px;
  padding-left: 17px;
}

@media (max-width: 820px) {
  .page-shell {
    padding: 20px 12px;
  }

  .resume-paper {
    min-height: auto;
    padding: 34px 28px 42px;
  }

  .document-actions {
    align-items: flex-start;
    justify-content: space-between;
  }

  .resume-header {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 20px;
  }

  .profile-photo {
    width: 88px;
    height: 88px;
  }

  .profile-main h1 {
    font-size: 34px;
  }

  .desired-role {
    font-size: 16px;
  }

  .contact-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    padding-top: 2px;
  }

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

  .credential-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-heading {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .project-heading p {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .page-shell {
    padding: 0;
  }

  .resume-paper {
    width: 100%;
    padding: 26px 18px 34px;
    border-right: 0;
    border-left: 0;
    box-shadow: none;
  }

  .document-actions {
    gap: 10px;
  }

  .document-note {
    max-width: 120px;
    line-height: 1.35;
  }

  .print-button {
    min-width: 82px;
  }

  .resume-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-photo {
    justify-self: center;
  }

  .profile-main h1 {
    font-size: 30px;
  }

  .contact-list {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .contact-list a {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .resume-section {
    margin-top: 28px;
  }

  .military-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .experience-list li {
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 10px;
  }

  .experience-list li::before {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .credential-item {
    padding: 12px 0;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  html,
  body {
    min-height: auto;
    background: #ffffff;
  }

  body {
    color: #111827;
    font-size: 11.5pt;
    line-height: 1.5;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

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

  .page-shell {
    padding: 0;
  }

  .resume-paper {
    width: 100%;
    max-width: none;
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .document-actions {
    min-height: auto;
    margin-bottom: 10mm;
  }

  .print-button {
    display: none;
  }

  .document-note {
    font-size: 9pt;
  }

  .resume-header {
    grid-template-columns: 26mm 1fr 58mm;
    gap: 8mm;
    padding-bottom: 8mm;
  }

  .profile-photo {
    width: 26mm;
    height: 26mm;
  }

  .profile-main h1 {
    font-size: 27pt;
  }

  .desired-role {
    font-size: 12pt;
  }

  .contact-list {
    font-size: 9pt;
  }

  .resume-section {
    margin-top: 8mm;
    break-inside: avoid;
  }

  .section-title {
    margin-bottom: 3mm;
    font-size: 13pt;
  }

  .summary-grid {
    gap: 7mm;
  }

  .credential-item,
  .project-item,
  .experience-list li {
    break-inside: avoid;
  }
}
