:root {
  --color-bg: #f6f4ef;
  --color-text: #1c1b19;
  --color-muted: #5c5852;
  --color-rule: #d4d0c8;
  --color-accent: #2c4a6e;
  --color-tag-bg: #ece8e0;
  --font-body: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --font-latin: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-ui: "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-size-base: 16px;
  --line-height-body: 1.68;
  --page-max-width: 186mm;
  --section-gap: 2.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--color-bg);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  margin: 0 auto;
  max-width: var(--page-max-width);
  padding: 2rem 1.35rem 3rem;
}

header {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 1rem;
}

.header-top {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  justify-content: space-between;
}

h1 {
  font-size: 1.32em;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
}

.as-of {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  margin: 0;
}

.lead {
  font-size: 1.08em;
  line-height: 1.85;
  margin: 0.75rem 0 0;
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.16em;
}

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

.profile-urls {
  --bullet-size: 0.42em;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-latin);
  font-size: 0.9rem;
  gap: 0.35rem 1.35rem;
  list-style: none;
  margin: 0.7rem 0 0;
  overflow-wrap: anywhere;
  padding: 0;
}

.profile-urls > li {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.profile-urls > li::before {
  background: var(--color-accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  content: "";
  flex-shrink: 0;
  height: var(--bullet-size);
  width: var(--bullet-size);
}

.profile-urls a {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  text-decoration: none;
}

.profile-urls a:hover {
  color: var(--color-text);
}

.url-label {
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
}

.url-plain {
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  margin-top: 2rem;
}

/* 区切りは余白。枠の左右縦線は置かない */
section {
  background: transparent;
}

/* 見出し幅だけの下罫線。罫線色だと短い見出しで消えるので currentColor */
h2 {
  border-bottom: 1px solid currentColor;
  break-after: avoid;
  color: var(--color-accent);
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 0.65rem;
  padding-bottom: 0.38rem;
  width: fit-content;
}

h3 {
  align-items: center;
  break-after: avoid;
  display: flex;
  font-size: 1.14em;
  font-weight: 700;
  gap: 0.5rem;
  margin: 0 0 0.55em;
}

/* 行頭の右向き三角。セクションの内訳。文字の ▶ は絵文字化するため使わない */
h3::before {
  background: var(--color-muted);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
  flex-shrink: 0;
  height: 0.58em;
  width: 0.5em;
}

h4 {
  break-after: avoid;
  color: var(--color-muted);
  font-size: 1em;
  font-weight: 700;
  margin: 0.85em 0 0.28em;
}

p {
  color: var(--color-text);
  line-break: strict;
  margin: 0 0 1.05em;
  overflow-wrap: anywhere;
  word-break: auto-phrase;
}

p:last-child {
  margin-bottom: 0;
}

.h3-grid {
  display: grid;
  gap: 1.85rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.15rem;
}

.h3-block > :last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-text);
  padding: 0.35rem 0.75rem 0.35rem 0;
}

.certs th {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.certs tr:last-child td {
  border-bottom: 0;
}

.cert-when {
  color: var(--color-muted);
  white-space: nowrap;
  width: 9em;
}

.print-id {
  display: none;
}

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

@media print {
  html,
  body {
    background: #fff;
  }

  body {
    font-size: 11pt;
    max-width: none;
    padding: 0;
  }

  h2,
  h3,
  h4,
  .h3-block,
  .skill-group,
  .tags,
  tr {
    break-inside: avoid;
  }

  p {
    orphans: 2;
    widows: 2;
  }

  .print-id {
    bottom: 0;
    color: var(--color-muted);
    display: block;
    font-family: var(--font-ui);
    font-size: 9pt;
    margin: 0;
    position: fixed;
    right: 0;
  }
}
