:root {
  --canvas: #ede8de;
  --beige: #c9c5bd;
  --surface: #f6f1e8;
  --ink: #262624;
  --muted: rgba(38, 38, 36, 0.68);
  --line: rgba(38, 38, 36, 0.13);
  --coral: #ff726c;
  --teal: #62a7a9;
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  font-weight: 850;
}

.topbar {
  background: rgba(201, 197, 189, 0.92);
  border-bottom: 1px solid rgba(38, 38, 36, 0.08);
}

.topbar-inner {
  width: min(1180px, 100%);
  min-height: 72px;
  margin: 0 auto;
  padding: calc(10px + var(--safe-top)) clamp(18px, 4vw, 42px) 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.brand {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  text-decoration: none;
}

.brand img {
  width: clamp(190px, 26vw, 340px);
  height: auto;
  display: block;
}

.nav,
.language {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav {
  grid-column: 3;
  justify-self: end;
}

.language {
  grid-column: 1;
  justify-self: start;
}

.nav a,
.language a {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(38, 38, 36, 0.68);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.language a:hover,
.language a:focus-visible {
  color: var(--ink);
  background: rgba(237, 232, 222, 0.55);
  outline: none;
}

.language a[aria-current="true"] {
  color: var(--surface);
  background: var(--ink);
}

.page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(52px, 8vw, 88px) clamp(18px, 4vw, 42px) calc(34px + var(--safe-bottom));
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) auto;
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  padding-bottom: clamp(34px, 6vw, 64px);
}

.page-icon {
  width: clamp(104px, 14vw, 168px);
  filter: drop-shadow(0 16px 26px rgba(38, 38, 36, 0.2));
}

h1,
h2,
h3,
p {
  margin-top: 0;
  word-break: keep-all;
}

html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] p,
html[lang="ja"] li {
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: break-all;
  word-wrap: break-word;
}

html[lang="ja"] .page,
html[lang="ja"] .legal-card,
html[lang="ja"] .legal-card * {
  max-width: 100%;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

html[lang="ja"] h1 {
  max-width: 620px;
  font-size: clamp(2.4rem, 6vw, 4.55rem);
}

.lead,
.updated,
p,
li {
  color: rgba(38, 38, 36, 0.82);
  font-weight: 620;
}

.lead,
.updated {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  font-weight: 700;
}

.legal-card {
  border-top: 1px solid var(--line);
  padding-top: clamp(28px, 5vw, 46px);
}

h2 {
  margin: 34px 0 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

h3 {
  margin: 26px 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

ul {
  padding-left: 1.2rem;
}

.notice,
.contact {
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(246, 241, 232, 0.54);
  border: 1px solid var(--line);
}

.notice {
  border-left: 5px solid var(--coral);
}

.contact {
  border-left: 5px solid var(--teal);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.links a {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  background: rgba(201, 197, 189, 0.38);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(42px, 7vw, 72px);
  padding-top: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  color: rgba(38, 38, 36, 0.58);
  font-size: 0.88rem;
  font-weight: 650;
}

.footer-logo img {
  width: 148px;
  margin-bottom: 12px;
  display: block;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px 24px;
}

.footer-links a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .topbar-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }

  .brand,
  .nav,
  .language {
    grid-column: auto;
    justify-self: center;
  }

  .brand {
    order: 1;
  }

  .nav {
    order: 2;
    flex-wrap: wrap;
    justify-content: center;
  }

  .language {
    order: 3;
  }

  .brand img {
    width: 230px;
  }

  .page-hero {
    grid-template-columns: 1fr;
  }

  html[lang="ja"] h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 12vw, 3.15rem);
  }

  html[lang="ja"] .page {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-icon {
    order: -1;
  }

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

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

}
