:root {
  color-scheme: light dark;
  --ink: #1a1a1a;
  --ink-soft: #57534e;
  --ink-faint: #78716c;
  --paper: #faf9f7;
  --paper-raised: #ffffff;
  --line: #d6d3d1;
  --line-soft: #e7e5e4;
  --gold: #8a6b27;
  --gold-bright: #c9a962;
  --gold-wash: rgba(201, 169, 98, 0.12);
  --danger: #9f1239;
  --danger-wash: rgba(159, 18, 57, 0.06);
  --shadow: 0 24px 80px rgba(41, 37, 36, 0.08);
  --content-width: 72rem;
  --reading-width: 45rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #fafaf9;
    --ink-soft: #d6d3d1;
    --ink-faint: #a8a29e;
    --paper: #0c0a09;
    --paper-raised: #1c1917;
    --line: #44403c;
    --line-soft: #292524;
    --gold: #d9c477;
    --gold-bright: #c9a962;
    --gold-wash: rgba(201, 169, 98, 0.14);
    --danger: #fda4af;
    --danger-wash: rgba(251, 113, 133, 0.08);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  background:
    radial-gradient(circle at 12% 4%, var(--gold-wash), transparent 24rem),
    linear-gradient(
      90deg,
      transparent 49.95%,
      rgba(120, 113, 108, 0.05) 50%,
      transparent 50.05%
    ),
    var(--paper);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: var(--gold-bright);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

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

a:focus-visible {
  border-radius: 0.2rem;
  outline: 0.18rem solid var(--gold-bright);
  outline-offset: 0.24rem;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-200%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  width: min(calc(100% - 2rem), var(--content-width));
  min-height: 5.5rem;
  margin: 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 1rem 2rem;
}

.wordmark {
  text-decoration: none;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.035em;
  line-height: 1;
}

.wordmark span {
  color: var(--gold);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.site-nav a {
  position: relative;
  padding: 0.4rem 0;
  text-decoration: none;
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0.12rem;
  background: var(--gold-bright);
  content: "";
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: 22rem;
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 5.5rem);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  border-bottom: 1px solid var(--line);
  gap: 3rem;
  animation: reveal 560ms ease-out both;
}

.hero-copy {
  max-width: 52rem;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-break: strict;
  overflow-wrap: normal;
  word-break: normal;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  font-weight: 500;
}

p,
li {
  overflow-wrap: anywhere;
}

@supports (text-wrap: balance) {
  h1,
  h2,
  h3 {
    text-wrap: balance;
  }
}

h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero-intro {
  max-width: 44rem;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.16rem);
}

.hero-mark {
  align-self: start;
  color: transparent;
  font-family: Didot, "Bodoni 72", serif;
  font-size: clamp(5rem, 14vw, 12rem);
  line-height: 0.8;
  -webkit-text-stroke: 1px var(--line);
}

@supports (user-select: none) {
  .hero-mark {
    user-select: none;
  }
}

.date-line {
  display: flex;
  margin-top: 1.75rem;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.reading-layout {
  display: grid;
  min-width: 0;
  padding: clamp(3rem, 8vw, 7rem) 0 8rem;
  grid-template-columns: 14rem minmax(0, var(--reading-width));
  justify-content: space-between;
  gap: clamp(3rem, 9vw, 9rem);
}

.reading-layout > * {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 2rem;
  align-self: start;
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.toc-title {
  margin: 0 0 1rem;
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc :where(li + li) {
  margin-top: 0.55rem;
}

.toc a {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
  text-decoration: none;
}

.legal-document > section {
  scroll-margin-top: 2rem;
}

.legal-document > section + section {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line-soft);
}

.section-number {
  display: inline-flex;
  min-width: 2.15rem;
  height: 2.15rem;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-bright);
  border-radius: 50%;
  color: var(--gold);
  font-family: Didot, "Bodoni 72", serif;
  font-size: 0.9rem;
}

.legal-document h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.45;
}

.legal-document p {
  margin: 0;
  color: var(--ink-soft);
}

.legal-document ul,
.legal-document ol {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-step;
}

.legal-document li {
  position: relative;
  padding-left: 1.8rem;
  color: var(--ink-soft);
}

.legal-document li + li {
  margin-top: 0.8rem;
}

.legal-document ul li::before {
  position: absolute;
  top: 0.88rem;
  left: 0.12rem;
  width: 0.65rem;
  height: 1px;
  background: var(--gold-bright);
  content: "";
}

.legal-document ol li {
  min-height: 2rem;
  padding-left: 3rem;
  counter-increment: legal-step;
}

.legal-document ol li::before {
  position: absolute;
  top: 0.05rem;
  left: 0;
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  content: counter(legal-step, decimal-leading-zero);
  font-family: Didot, "Bodoni 72", serif;
  font-size: 0.72rem;
}

.callout {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-left: 0.2rem solid var(--gold-bright);
  background: var(--gold-wash);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.callout-danger {
  margin: 0 0 3.5rem;
  border-color: color-mix(in srgb, var(--danger) 42%, transparent);
  border-left-color: var(--danger);
  background: var(--danger-wash);
  color: var(--danger);
}

.contact-panel {
  display: grid;
  margin-top: 5.5rem;
  padding: clamp(1.5rem, 5vw, 2.75rem);
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  gap: 2rem;
}

.contact-panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.contact-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.contact-link {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.65rem 1.2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.contact-link:hover {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--paper);
}

.language-block {
  border-top-style: dashed !important;
}

.language-label {
  margin: 0 0 1rem !important;
  color: var(--gold) !important;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.document-cards {
  display: grid;
  padding: clamp(3rem, 8vw, 7rem) 0 8rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.document-card {
  display: flex;
  min-height: 19rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  flex-direction: column;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-raised) 88%, transparent);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.document-card:hover {
  transform: translateY(-0.3rem);
  border-color: var(--gold-bright);
  box-shadow: var(--shadow);
}

.card-index {
  color: var(--gold);
  font-family: Didot, "Bodoni 72", serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.document-card h2 {
  margin: auto 0 1rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-break: strict;
  word-break: keep-all;
}

.document-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* 詳細度 (0,1,2) のため、同じ p を対象にする (0,1,1) の規則より後に置く。 */
.legal-document p + p {
  margin-top: 1rem;
}

.card-arrow {
  display: block;
  margin-top: 2rem;
  color: var(--gold);
  font-size: 1.25rem;
}

.site-footer {
  display: grid;
  width: min(calc(100% - 2rem), var(--content-width));
  min-height: 9rem;
  margin: 0 auto;
  padding: 2rem 0;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.75rem;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@keyframes reveal {
  from {
    transform: translateY(0.75rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 52rem) {
  .site-header {
    min-height: 4.75rem;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-mark {
    display: none;
  }

  .reading-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    padding: 0 0 1.5rem;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .toc ol {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    gap: 0.65rem;
  }

  @supports (scrollbar-width: thin) {
    .toc ol {
      scrollbar-width: thin;
    }
  }

  .toc :where(li + li) {
    margin-top: 0;
  }

  .toc a {
    width: max-content;
    max-width: 14rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line);
  }

  .document-cards {
    grid-template-columns: 1fr;
  }

  .document-card {
    min-height: 14rem;
  }
}

@media (max-width: 36rem) {
  body {
    line-height: 1.82;
  }

  .site-header,
  .page-shell,
  .site-footer {
    width: min(calc(100% - 1.25rem), var(--content-width));
  }

  .site-nav {
    justify-content: flex-start;
    gap: 0.75rem;
    font-size: 0.68rem;
  }

  .contact-panel,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .contact-link {
    width: 100%;
  }
}

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

  .hero {
    animation: none;
  }

  .document-card {
    transition: none;
  }
}

@media print {
  :root {
    color-scheme: light;
    --ink: #000000;
    --ink-soft: #222222;
    --paper: #ffffff;
    --paper-raised: #ffffff;
    --line: #cccccc;
    --line-soft: #dddddd;
  }

  body {
    background: #ffffff;
    font-size: 10pt;
  }

  .site-header,
  .toc,
  .contact-panel,
  .site-footer,
  .hero-mark {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 1.5cm 0 1cm;
  }

  .page-shell {
    width: 100%;
  }

  .reading-layout {
    display: block;
    padding: 1cm 0;
  }

  .legal-document > section {
    break-inside: avoid;
  }
}
