:root {
  --page-bg: #f7f6f3;
  --page-bg-strong: #f2f1ee;
  --paper: #ffffff;
  --surface: #fbfbfa;
  --surface-muted: #f7f7f5;
  --ink: #2f3437;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --tag-bg: #f5f5f4;
  --tag-border: #e7e5e4;
  --link: #2563eb;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  --mono:
    "SFMono-Regular",
    "SF Mono",
    "Roboto Mono",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-strong) 100%);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
  line-height: 1.7;
  letter-spacing: -0.01em;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

p,
ul,
ol,
dl,
blockquote,
table {
  margin: 0;
}

ul {
  padding-left: 1.15rem;
}

li::marker {
  color: #9ca3af;
}

strong {
  font-weight: 700;
}

.document {
  width: 194mm;
  max-width: calc(100vw - 40px);
  min-height: 281mm;
  margin: 28px auto 48px;
  padding: 12mm 13mm 14mm;
  background: var(--paper);
  border: 1px solid rgba(47, 52, 55, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.break-avoid,
.panel,
.topic-block,
.skill-card,
.detail-table {
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.hero {
  padding-bottom: 8mm;
  border-bottom: 1px solid var(--line);
}

.hero-top {
  display: grid;
  grid-template-columns: 34mm minmax(0, 1fr);
  gap: 7mm;
  align-items: start;
}

.profile-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.profile-figure img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.hero-copy {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: 2.15rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.identity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
}

.identity-list li {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.89rem;
  line-height: 1.55;
  white-space: nowrap;
}

.hero-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.15rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.hero-contact-list li {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: nowrap;
}

.summary {
  margin-top: 6mm;
  padding: 0.25rem 0 0.25rem 1rem;
  border: none;
  border-left: 3px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.summary p {
  color: #3f3f46;
  font-size: 0.99rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4mm;
  margin-top: 7mm;
}

.intro-grid > :only-child {
  grid-column: 1 / -1;
}

.panel {
  padding: 4.5mm 4.8mm;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.intro-grid + .panel {
  margin-top: 4mm;
}

.panel > h2 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 3mm;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.info-list {
  display: grid;
  gap: 0.55rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3.2mm;
}

.skill-card {
  padding: 3.7mm 4mm;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.skill-card h3 {
  margin-bottom: 2.2mm;
  font-size: 0.86rem;
  font-weight: 700;
  color: #52525b;
  letter-spacing: 0.01em;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 2mm;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.58rem;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  background: var(--tag-bg);
  color: #44403c;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: nowrap;
}

.section {
  margin-top: 9mm;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 4mm;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.record {
  display: grid;
  grid-template-columns: minmax(24mm, 31mm) minmax(0, 1fr);
  gap: 5mm;
  margin-bottom: 4mm;
  padding: 4.8mm;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  break-inside: auto;
  page-break-inside: auto;
}

.record::after {
  display: none;
}

.record-figure {
  width: auto;
  margin: 0;
  float: none;
  align-self: start;
}

.logo-figure,
.evidence-figure {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.logo-figure {
  padding: 2.2mm;
}

.evidence-figure {
  padding: 1.2mm;
}

.logo-figure img,
.evidence-figure img {
  border-radius: 10px;
}

.portrait-figure {
  width: auto;
}

.record-body {
  min-width: 0;
}

.record-heading {
  margin-bottom: 0;
}

.record-title-group {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.6mm;
  align-items: start;
  margin-bottom: 2.6mm;
}

.record-mark {
  margin-top: 0.1rem;
  font-size: 0.96rem;
  line-height: 1;
}

.record-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.record-role,
.record-period {
  color: var(--muted);
}

.record-role {
  margin-top: 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.record-period {
  margin-top: 0.14rem;
  font-size: 0.79rem;
  font-family: var(--mono);
}

blockquote {
  margin-bottom: 3mm;
  padding: 3mm 3.5mm;
  border: none;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 12px 12px 0;
  background: var(--surface-muted);
  color: #3f3f46;
}

.topic-block {
  padding-top: 2.7mm;
  border-top: 1px solid #f0eeeb;
}

.topic-block + .topic-block {
  margin-top: 0;
}

.topic-block h4 {
  margin-bottom: 1.7mm;
  font-size: 0.91rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topic-block ul,
.record-body > ul,
.sub-list {
  display: grid;
  gap: 1.2mm;
}

.stack-box {
  margin-top: 3mm;
  padding: 3mm 3.4mm;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fcfcfb;
}

.stack-label {
  margin-bottom: 1.8mm;
  color: #78716c;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-table {
  width: 100%;
  margin-top: 2.4mm;
  margin-bottom: 3mm;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  font-size: 0.92rem;
}

.detail-table th,
.detail-table td {
  padding: 2.4mm 2.8mm;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.detail-table thead th {
  background: var(--surface-muted);
  color: #52525b;
  font-weight: 700;
}

.detail-table thead th:first-child,
.detail-table tbody td:first-child {
  width: 26%;
}

.detail-table tbody td:first-child {
  background: #fafaf9;
  color: #57534e;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-table th + th,
.detail-table td + td {
  border-left: 1px solid #f0eeeb;
}

.detail-table tbody tr:last-child td {
  border-bottom: none;
}

.detail-list {
  display: grid;
  gap: 1.2mm;
  margin-top: 2.2mm;
  margin-bottom: 3mm;
}

.detail-list div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.18rem;
  min-width: 0;
}

.detail-list dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.79rem;
  font-weight: 700;
}

.detail-list dt::after {
  content: "|";
  margin-left: 0.18rem;
  color: #a8a29e;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
}

.sub-list {
  margin-top: 2.4mm;
  padding-top: 2.4mm;
  border-top: 1px dashed var(--line);
}

.sub-list li {
  list-style: disc;
}

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

  @bottom-center {
    content: counter(page);
    font-family: "SF Mono", "Roboto Mono", Consolas, Menlo, monospace;
    font-size: 9pt;
    color: #78716c;
  }
}

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

  .document {
    width: auto;
    max-width: none;
    min-height: auto;
    margin: 0;
    padding: 10mm 11mm 12mm;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .hero,
  .panel,
  .record,
  .skill-card,
  .logo-figure,
  .evidence-figure,
  blockquote,
  .stack-box {
    box-shadow: none;
  }

  .section-title {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .section-title + * {
    break-before: avoid-page;
    page-break-before: avoid;
  }

  p,
  li,
  blockquote {
    orphans: 3;
    widows: 3;
  }

  a {
    color: inherit;
  }
}

@media screen and (max-width: 960px) {
  .document {
    width: calc(100vw - 24px);
    max-width: none;
    min-height: auto;
    margin: 12px auto 24px;
    padding: 18px;
    border-radius: 16px;
  }

  .hero-top,
  .intro-grid,
  .skill-grid,
  .record {
    grid-template-columns: 1fr;
  }

  .identity-list {
    gap: 0.3rem 0.8rem;
  }

  .hero-contact-list {
    gap: 0.3rem 0.8rem;
  }

  .profile-figure,
  .record-figure {
    width: min(100%, 180px);
  }

  .section {
    margin-top: 28px;
  }

  .section-title {
    margin-bottom: 16px;
  }
}
