:root {
  color: #20201f;
  background: #f7f6f2;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Noto Sans JP", "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.8;
  --ink: #20201f;
  --muted: #6b6963;
  --line: #dedbd2;
  --paper: #fff;
  --accent: rgb(15, 136, 108);
  --accent-dark: rgb(15, 136, 108);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f7f6f2;
  color: var(--ink);
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

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

a:focus-visible {
  outline: 3px solid rgba(15, 136, 108, 0.45);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.5rem 0.8rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 16px max(24px, calc((100vw - 1240px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  width: min(228px, 54vw);
}

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

.language-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0.2rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.language-link:hover {
  background: var(--accent);
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 820px);
  gap: clamp(32px, 5vw, 80px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 24px 96px;
  align-items: start;
}

.site-header-home {
  justify-content: flex-start;
}

.home {
  min-height: calc(100vh - 268px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 132px) 24px clamp(80px, 10vw, 128px);
}

.home-heading {
  max-width: 720px;
  margin-bottom: clamp(40px, 7vw, 72px);
}

.home-heading h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.home-heading > p:last-child {
  margin: 0;
  color: var(--muted);
}

.home-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.document-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  min-height: 190px;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.document-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgb(29 27 23 / 8%);
  transform: translateY(-3px);
}

.document-card-language {
  grid-column: 1;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.document-card-title {
  grid-column: 1;
  align-self: end;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.5;
}

.document-card-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  color: var(--accent);
  font-size: 1.4rem;
}

.not-found {
  display: grid;
  min-height: calc(100vh - 268px);
  place-items: center;
  padding: clamp(64px, 10vw, 132px) 24px;
}

.not-found-content {
  width: min(100%, 720px);
  text-align: center;
}

.not-found-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.3;
}

.not-found-content > p:not(.home-eyebrow) {
  margin: 0 auto;
  color: var(--muted);
}

.back-home-link {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 1.5rem;
  margin-top: 40px;
  padding: 0.65rem 1.25rem;
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.back-home-link:hover {
  background: #0c765e;
}

.toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding-right: 16px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.toc-title {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.toc li + li {
  margin-top: 0.65rem;
}

.toc a {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

.policy {
  min-width: 0;
  padding: clamp(28px, 5vw, 64px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 16px 50px rgb(29 27 23 / 5%);
  font-size: 0.94rem;
}

.policy h1 {
  margin: 0 0 2rem;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.policy h2 {
  scroll-margin-top: 24px;
  margin: 4rem 0 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
}

.policy h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.policy h4 {
  margin: 1.75rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.section-number {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.policy p {
  margin: 1rem 0;
}

.policy ul,
.policy ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.policy li {
  margin: 0.45rem 0;
  padding-left: 0.25rem;
}

.policy table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.policy td,
.policy th {
  padding: 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.policy th {
  background: #f1efe9;
  font-weight: 700;
}

.policy thead th {
  white-space: nowrap;
}

.policy tbody th {
  min-width: 12rem;
}

.site-footer {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #e7f2ef;
  border-top: 1px solid #c9e1db;
}

.site-footer img {
  width: min(190px, 48vw);
  height: auto;
}

@media (max-width: 860px) {
  .document-grid {
    grid-template-columns: 1fr;
  }

  .document-card {
    min-height: 140px;
  }

  .layout {
    display: block;
    padding-top: 24px;
  }

  .toc {
    position: static;
    max-height: none;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--paper);
    border: 1px solid var(--line);
  }

  .toc ol {
    columns: 2;
    column-gap: 28px;
  }

  .toc li {
    break-inside: avoid;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 72px;
    padding: 12px 16px;
  }

  .brand {
    width: 180px;
  }

  .language-link {
    min-height: 38px;
    padding-inline: 0.8rem;
  }

  .home {
    padding: 52px 16px 72px;
  }

  .not-found {
    padding: 72px 20px;
  }

  .document-card {
    min-height: 124px;
    padding: 22px;
  }

  .layout {
    padding-inline: 12px;
    padding-bottom: 56px;
  }

  .toc {
    padding: 20px;
  }

  .toc ol {
    columns: auto;
  }

  .policy {
    padding: 28px 20px 44px;
    font-size: 0.9rem;
  }

  .policy h2 {
    margin-top: 3rem;
  }

  .policy table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}

@media print {
  .site-header,
  .toc,
  .site-footer,
  .skip-link {
    display: none;
  }

  body,
  .policy {
    background: white;
  }

  .layout {
    display: block;
    padding: 0;
  }

  .policy {
    padding: 0;
    border: 0;
    box-shadow: none;
    font-size: 10pt;
  }

  .policy h2 {
    break-after: avoid;
  }

  a {
    color: inherit;
  }
}
