:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #172033;
  --text-strong: #0d1526;
  --muted: #5d687c;
  --faint: #7a8597;
  --line: #d9dee7;
  --line-strong: #bbc4d2;
  --accent: #1d4ed8;
  --accent-soft: #e8efff;
  --focus: #b45309;
  --font-sans: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-wrap: anywhere;
  background:
    linear-gradient(90deg, transparent calc(50% - 361px), var(--line) calc(50% - 360px), transparent calc(50% - 359px)) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.975rem;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

header,
main {
  width: min(720px, calc(100% - 64px));
  margin-inline: auto;
}

.hero {
  padding-block: 112px 96px;
}

.hero__rule {
  width: 48px;
  height: 4px;
  margin-bottom: 32px;
  background: var(--accent);
}

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

h1,
h2,
h3 {
  color: var(--text-strong);
  font-weight: 680;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 640px;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.24;
  text-wrap: balance;
}

.hero__meta {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.875rem;
}

.hero__meta p + p {
  display: flex;
  gap: 24px;
  align-items: center;
}

.hero__meta p + p::before {
  width: 32px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.hero__lead {
  max-width: 664px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.9;
}

main {
  padding-bottom: 112px;
}

main > section + section {
  margin-top: 96px;
}

.section-heading {
  display: flex;
  gap: 24px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.45;
}

.section-heading > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.works,
.tags {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work {
  border-top: 1px solid var(--line-strong);
  padding-block: 40px 48px;
}

.work:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.work h3 {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  font-size: 1.25rem;
  line-height: 1.55;
}

.work__number {
  padding-top: 0.31em;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.work__details {
  display: grid;
  gap: 24px;
  margin-top: 32px;
  padding-left: 56px;
}

.work__details > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

dd {
  min-width: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-left: 56px;
}

.tags li {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 9px 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.015em;
  line-height: 1.6;
}

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

.skill-list > div {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 24px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}

.skill-list dt {
  padding-top: 0.2em;
}

.closing {
  position: relative;
  padding: 40px 40px 40px 56px;
  border-block: 1px solid var(--line-strong);
  background: var(--surface);
}

.closing::before {
  position: absolute;
  inset: 40px auto 40px 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.closing .section-heading {
  margin-bottom: 16px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1118;
    --surface: #151a24;
    --text: #d9dfeb;
    --text-strong: #f3f6fb;
    --muted: #aeb8c8;
    --faint: #8d98aa;
    --line: #2a3241;
    --line-strong: #465166;
    --accent: #7aa7ff;
    --accent-soft: #17284d;
    --focus: #fbbf24;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
    font-size: 0.9375rem;
  }

  header,
  main {
    width: min(100% - 40px, 720px);
  }

  .hero {
    padding-block: 72px 72px;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .hero__meta {
    gap: 16px;
    margin-top: 24px;
  }

  .hero__meta p + p {
    gap: 16px;
  }

  .hero__meta p + p::before {
    width: 16px;
  }

  .hero__lead {
    margin-top: 32px;
    font-size: 1rem;
  }

  main {
    padding-bottom: 72px;
  }

  main > section + section {
    margin-top: 72px;
  }

  .work {
    padding-block: 32px 40px;
  }

  .work h3 {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    font-size: 1.125rem;
  }

  .work__details,
  .tags {
    padding-left: 40px;
  }

  .work__details > div,
  .skill-list > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .closing {
    padding: 32px 24px 32px 32px;
  }

  .closing::before {
    inset-block: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@page {
  size: A4;
  margin: 16mm 18mm;
}

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #202020;
    --text-strong: #000000;
    --muted: #444444;
    --faint: #666666;
    --line: #cccccc;
    --line-strong: #999999;
    --accent: #1f4e79;
  }

  html {
    font-size: 10.5pt;
  }

  body {
    background: #ffffff;
    color: #202020;
  }

  header,
  main {
    width: 100%;
  }

  .hero {
    padding-block: 0 18mm;
  }

  h1 {
    font-size: 27pt;
  }

  .hero__lead {
    max-width: none;
  }

  main {
    padding-bottom: 0;
  }

  main > section + section {
    margin-top: 18mm;
  }

  .work {
    break-inside: avoid;
    padding-block: 7mm;
  }

  .work__details {
    gap: 3.5mm;
    margin-top: 5mm;
  }

  .tags {
    margin-top: 5mm;
  }

  .closing,
  .skill-list > div {
    break-inside: avoid;
  }

  .closing {
    background: #ffffff;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}
