/* 帳簿紙とブルーブラック。色が付くのはリンクと、時間軸の「現在」だけ。 */

:root {
  --paper: #f3f4f1;
  --ink: #1d2533;
  --graphite: #5e6670;
  --rule: #c9ced3;
  --ledger: #2f5e8c;
  --gutter: clamp(26px, 7vw, 80px);
  --section: clamp(72px, 6.2vw, 80px);
  --heading-gap: clamp(22px, 2vw, 26px);
  --stack: clamp(16px, 2.2vw, 20px);
  --row: clamp(16px, 1.6vw, 18px);
  --bar: 76px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181e;
    --ink: #e6e8ea;
    --graphite: #9aa3ad;
    --rule: #343b45;
    --ledger: #8fb3d9;
  }
}

@font-face {
  font-family: "IBM Plex Sans JP";
  src: url("/fonts/ibm-plex-sans-jp-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans JP";
  src: url("/fonts/ibm-plex-sans-jp-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.6;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  hanging-punctuation: allow-end;
}

body {
  min-height: 100svh;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  text-spacing-trim: trim-start;
}

::selection {
  background: color-mix(in srgb, var(--ledger) 28%, var(--paper));
  color: var(--ink);
}

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

a:visited {
  color: var(--ledger);
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
.skip:focus {
  outline: 2px solid var(--ledger);
  outline-offset: 3px;
  border-radius: 2px;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.4;
}

.skip {
  position: absolute;
  left: 16px;
  top: 8px;
  z-index: 2;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sheet {
  width: min(1440px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px 32px;
  padding-block: clamp(24px, 2.4vw, 28px) clamp(16px, 1.6vw, 18px);
  font-size: 14px;
  line-height: 1.5;
  color: var(--graphite);
}

.who {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

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

.bar a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.lang {
  display: flex;
  gap: 16px;
  white-space: nowrap;
}

.lang [aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.stack {
  min-height: calc(100svh - var(--bar));
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-content: center;
  padding-bottom: 8px;
}

.id {
  grid-column: 1 / 8;
}

.topics {
  grid-column: 8 / 13;
  align-self: end;
  padding-bottom: 4px;
}

.name {
  font-weight: 500;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: 1.08;
  letter-spacing: 0.06em;
  font-feature-settings: "palt" 1;
}

.name.latin {
  font-size: clamp(40px, 4.6vw, 64px);
  letter-spacing: -0.025em;
  font-feature-settings: normal;
  line-height: 1.05;
}

.name-sub {
  margin-top: 12px;
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.4;
  color: var(--graphite);
}

.name-sub[lang="ja"] {
  letter-spacing: 0.06em;
  font-feature-settings: "palt" 1;
}

.title {
  margin-top: 26px;
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.copy,
.lead,
.ask,
.role-body,
.topic li,
.index-desc {
  word-break: normal;
  word-break: auto-phrase;
  line-break: strict;
  text-wrap: pretty;
}

.lead {
  margin-top: 18px;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.95;
  letter-spacing: 0.02em;
}

.ask {
  margin-top: 22px;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.8;
}

.ask a,
#contact .lead a {
  font-weight: 500;
  white-space: nowrap;
}

.topics h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--graphite);
  margin-bottom: 14px;
}

.topics li {
  padding-block: var(--row);
  border-top: 1px solid var(--rule);
}

.topics li:last-child {
  border-bottom: 1px solid var(--rule);
}

.topics b {
  display: block;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
}

.topics span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--graphite);
  word-break: normal;
  word-break: auto-phrase;
  line-break: strict;
}

/* 在籍年数にほぼ比例。トーマツだけ最小幅を確保している。 */
.line {
  padding-block: clamp(40px, 4.5vw, 48px);
}

.axis {
  display: grid;
  grid-template-columns: minmax(13.25rem, 2.7fr) 5.9fr 6.8fr 6.4fr;
  border-top: 1px solid var(--rule);
}

.seg {
  position: relative;
  display: block;
  height: 100%;
  padding: 14px 12px 0 0;
  color: inherit;
  text-decoration: none;
}

.seg:hover .co,
.seg:focus-visible .co {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.seg::before {
  content: "";
  position: absolute;
  left: 0;
  right: 8px;
  top: -2px;
  height: 3px;
  background: var(--ink);
  transform-origin: left center;
}

.axis li:nth-child(1) .seg { --i: 0; }
.axis li:nth-child(2) .seg { --i: 1; }
.axis li:nth-child(3) .seg { --i: 2; }
.axis li:nth-child(4) .seg { --i: 3; }

.seg.now::before {
  right: 0;
}

.seg.now::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ledger);
}

@media (prefers-reduced-motion: no-preference) {
  .seg::before {
    transform: scaleX(0);
    animation: draw-x 0.5s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * 0.38s + 0.2s);
  }

  .seg > * {
    opacity: 0;
    animation: show 0.4s ease forwards;
    animation-delay: calc(var(--i) * 0.38s + 0.45s);
  }

  .seg.now::after {
    opacity: 0;
    animation: show 0.3s ease forwards 1.9s;
  }
}

.split {
  display: none;
}

.yr,
.when,
.posts .span,
.index-meta {
  font-variant-numeric: tabular-nums;
}

.yr {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--graphite);
}

.co {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

.role-line,
.fact {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  text-wrap: pretty;
}

.role-line {
  color: var(--graphite);
}

.fact {
  margin-top: 8px;
  color: var(--ink);
}

@keyframes draw-x {
  to { transform: scaleX(1); }
}

@keyframes draw-y {
  to { transform: scaleY(1); }
}

@keyframes show {
  to { opacity: 1; }
}

.block {
  padding-top: var(--section);
  padding-bottom: clamp(12px, 1.6vw, 16px);
  scroll-margin-top: 24px;
}

.block h2 {
  font-size: 21px;
  font-weight: 400;
  color: var(--graphite);
  line-height: 1.4;
  margin-bottom: var(--heading-gap);
}

.topic {
  max-width: 38em;
  padding-block: clamp(24px, 2.8vw, 28px);
  border-top: 1px solid var(--rule);
}

.topic:last-child {
  border-bottom: 1px solid var(--rule);
}

.topic h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.topic ul {
  margin-top: 12px;
}

.topic li {
  padding-block: clamp(6px, 0.8vw, 8px);
  font-size: 16px;
  line-height: 1.9;
}

.role {
  display: grid;
  grid-template-columns: 11rem minmax(0, 38em);
  column-gap: clamp(24px, 3vw, 32px);
  align-items: start;
  padding-block: clamp(28px, 3vw, 32px);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 24px;
}

.role:last-of-type {
  border-bottom: 1px solid var(--rule);
}

.when {
  position: sticky;
  top: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--graphite);
}

.role h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.place {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--graphite);
}

.role-body {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.9;
}

.posts {
  margin-top: 16px;
}

.posts li {
  padding-block: var(--stack);
  border-top: 1px solid var(--rule);
}

.posts .span {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--graphite);
}

.posts li p:last-child {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.9;
  word-break: normal;
  word-break: auto-phrase;
  line-break: strict;
}

.note {
  max-width: 38em;
  margin: -6px 0 18px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}

.ledger-wrap {
  width: 100%;
}

.ledger {
  width: 100%;
  max-width: 880px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.ledger th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--graphite);
  padding: 0 20px 8px 0;
  border-bottom: 1px solid var(--rule);
}

.ledger td {
  padding: var(--row) 20px var(--row) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.ledger td:first-child {
  color: var(--graphite);
  white-space: nowrap;
}

.ledger td:last-child {
  color: var(--graphite);
  white-space: nowrap;
}

.ledger td:nth-child(2) {
  color: var(--ink);
}

.index {
  max-width: 40em;
}

.index li {
  padding-block: var(--stack);
  border-top: 1px solid var(--rule);
}

.index li:last-child {
  border-bottom: 1px solid var(--rule);
}

.index-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--graphite);
}

.index-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
}

.index-title a {
  font-weight: 500;
}

.index-desc {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--graphite);
}

#contact .lead {
  margin-top: 0;
}

.also {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: clamp(32px, 4vw, 40px);
  font-size: 15px;
}

.foot {
  padding-block: clamp(64px, 8vw, 80px) clamp(40px, 5vw, 48px);
  color: var(--graphite);
  font-size: 13px;
}

@media (min-width: 901px) {
  .split { display: block; }
}

@media (max-width: 960px) {
  .id,
  .topics {
    grid-column: 1 / -1;
  }

  .topics {
    margin-top: clamp(48px, 8vw, 64px);
    align-self: start;
    max-width: 38em;
  }
}

@media (max-width: 900px) {
  .axis {
    grid-template-columns: 1fr;
    border-top: 0;
    border-left: 1px solid var(--rule);
    margin-left: 4px;
  }

  .axis li:nth-child(1) { order: 4; }
  .axis li:nth-child(2) { order: 3; }
  .axis li:nth-child(3) { order: 2; }
  .axis li:nth-child(4) { order: 1; }

  .seg {
    padding: 0 0 clamp(28px, 5vw, 36px) 22px;
  }

  .seg::before {
    left: -2px;
    right: auto;
    top: 0;
    bottom: 8px;
    width: 3px;
    height: auto;
    transform-origin: top center;
  }

  .seg.now::before {
    bottom: 0;
  }

  .seg.now::after {
    right: auto;
    left: -6.5px;
    top: -4px;
  }
}

@media (max-width: 720px) {
  :root {
    --bar: 60px;
  }

  .bar nav {
    display: none;
  }

  .stack {
    min-height: 0;
  }

  .hero {
    align-content: start;
    padding-top: clamp(40px, 8vw, 56px);
  }

  .name {
    letter-spacing: 0.04em;
  }

  .lead,
  .role-body,
  .topic li,
  .posts li p:last-child,
  .note {
    font-size: 16px;
  }

  .block h2 {
    font-size: 16px;
  }

  .topic h3,
  .role h3 {
    font-size: 16px;
  }

  .role {
    grid-template-columns: 1fr;
    row-gap: clamp(10px, 2vw, 14px);
  }

  .when {
    position: static;
  }

  .ledger thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .ledger,
  .ledger tbody,
  .ledger tr,
  .ledger td {
    display: block;
    width: 100%;
  }

  .ledger tr {
    padding-block: clamp(18px, 3vw, 22px);
    border-bottom: 1px solid var(--rule);
  }

  .ledger td {
    border: 0;
    padding: 0;
    white-space: normal;
  }

  .ledger td:nth-child(1) {
    font-size: 12px;
  }

  .ledger td:nth-child(2) {
    margin-block: 4px;
    font-weight: 500;
  }

  .ledger td:nth-child(3) {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
  .seg::before {
    transform: scaleY(0);
    animation-name: draw-y;
  }
}

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

@media print {
  :root {
    --paper: #fff;
    --ink: #1d2533;
    --graphite: #3c4450;
    --rule: #b7bdc4;
    --ledger: #1e4e7a;
  }

  .skip,
  .bar nav,
  .lang {
    display: none;
  }

  .stack,
  .first {
    min-height: 0;
  }

  .seg::before,
  .seg > *,
  .seg.now::after {
    animation: none;
    transform: none;
    opacity: 1;
  }

  .when {
    position: static;
  }

  a {
    text-decoration: underline;
  }

  #contact a[href]::after {
    content: " (" attr(href) ")";
    font-weight: 400;
    font-size: 11px;
    word-break: break-all;
  }

  .sr {
    display: none;
  }

  .role,
  .topic,
  .index li,
  .ledger tr {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }
}
