:root {
  color-scheme: light dark;
  --paper: #f1e8d8;
  --paper-strong: #f8f1e5;
  --paper-muted: #e4d8c5;
  --ink: #2b211c;
  --ink-muted: #6f6258;
  --wood: #2d211c;
  --wood-line: #5b463b;
  --line: #a99a87;
  --vermilion: #a94735;
  --patina: #42766f;
  --focus: #126c87;
  font-family: Inter, "Noto Sans", "Noto Sans JP", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--wood);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper-muted);
  background-image: url('/patterns/seigaiha-day.svg');
  line-height: 1.65;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

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

.skip-link {
  position: fixed;
  z-index: 10;
  inset: 8px auto auto 8px;
  padding: 8px 12px;
  color: var(--paper-strong);
  background: var(--wood);
  transform: translateY(-180%);
}

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

.about-page {
  width: min(960px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  border-inline: 1px solid var(--wood-line);
  background: var(--paper);
  box-shadow: 8px 0 0 rgb(43 33 28 / 14%), -8px 0 0 rgb(43 33 28 / 14%);
}

.about-topbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  color: var(--paper-strong);
  background: var(--wood);
  border-bottom: 3px solid var(--vermilion);
}

.about-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  text-decoration: none;
}

.about-brand:hover {
  color: var(--paper-strong);
  background: #3a2b24;
}

.about-seal {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--vermilion);
  color: #d16c55;
  font-family: "Noto Serif JP", Georgia, serif;
  font-size: 18px;
  line-height: 1;
}

.about-wordmark {
  min-width: 0;
  display: block;
  font-family: "Noto Serif", "Noto Serif JP", Georgia, serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.language-nav {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--wood-line);
}

.language-nav a {
  min-width: 58px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border-left: 1px solid var(--wood-line);
  color: #d8cec1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.language-nav a:first-child {
  border-left: 0;
}

.language-nav a:hover,
.language-nav a[aria-current='page'] {
  color: #fff8eb;
  background: #51352b;
}

.language-nav a[aria-current='page'] {
  box-shadow: inset 0 -4px 0 var(--vermilion);
}

.about-main {
  display: block;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  border-bottom: 3px solid var(--wood);
}

.about-hero-copy {
  display: grid;
  align-content: center;
  padding: clamp(34px, 6vw, 72px) clamp(22px, 5vw, 58px);
}

.about-kicker {
  margin: 0 0 12px;
  color: var(--vermilion);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Noto Serif", "Noto Serif JP", Georgia, serif;
  text-wrap: balance;
}

h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.about-lead {
  max-width: 42rem;
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

.about-map-figure {
  min-width: 0;
  display: grid;
  align-content: center;
  margin: 0;
  padding: clamp(18px, 4vw, 36px);
  border-left: 1px solid var(--line);
  background: var(--paper-strong);
}

.about-map-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--wood);
  box-shadow: 5px 5px 0 rgb(43 33 28 / 20%);
}

.about-map-figure figcaption {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 0.66fr);
  border-bottom: 1px solid var(--line);
}

.about-section > h2 {
  margin: 0;
  padding: clamp(28px, 5vw, 46px) clamp(22px, 4vw, 36px);
  border-right: 1px solid var(--line);
  background: var(--paper-strong);
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.25;
}

.about-section-body {
  min-width: 0;
  padding: clamp(28px, 5vw, 46px) clamp(22px, 5vw, 52px);
}

.about-section-body > :first-child {
  margin-top: 0;
}

.about-section-body > :last-child {
  margin-bottom: 0;
}

.about-section-body p,
.about-section-body li {
  max-width: 66ch;
}

.stamp-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  padding: 1px;
  background: var(--line);
  list-style: none;
}

.stamp-list li {
  min-width: 0;
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 10px;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.rank-rules {
  margin: 24px 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.rank-rules li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rank-rules strong {
  color: var(--vermilion);
  font-variant-numeric: tabular-nums;
}

.about-note {
  padding: 16px 18px;
  border: 1px solid var(--patina);
  background: color-mix(in srgb, var(--patina) 7%, var(--paper));
}

.about-credits a {
  font-weight: 700;
}

.about-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: clamp(28px, 5vw, 48px);
  color: var(--paper-strong);
  background: var(--wood);
}

.about-cta p {
  max-width: 54ch;
  margin: 0;
  color: #d9cfc2;
}

.about-cta-link {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 10px 18px;
  border: 2px solid #c65c47;
  color: #fff8eb;
  background: #6f2f25;
  box-shadow: 4px 4px 0 #160f0d;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.about-cta-link:hover {
  color: #fff8eb;
  background: #85382b;
}

.about-footer {
  padding: 18px clamp(22px, 5vw, 48px);
  border-top: 1px solid var(--wood-line);
  color: #cbbfb1;
  background: #211815;
  font-size: 13px;
}

.about-footer p {
  margin: 0;
}

.error-main {
  min-height: calc(100vh - 62px);
  display: grid;
  place-items: center;
  padding: 32px;
}

.error-sheet {
  width: min(680px, 100%);
  padding: clamp(28px, 6vw, 58px);
  border: 3px solid var(--wood);
  background: var(--paper-strong);
  box-shadow: 7px 7px 0 rgb(43 33 28 / 20%);
}

.error-code {
  margin: 0 0 10px;
  color: var(--vermilion);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.error-sheet h1 {
  max-width: none;
  font-size: clamp(28px, 6vw, 44px);
}

.error-languages {
  display: grid;
  gap: 16px;
  margin: 28px 0;
  padding-block: 20px;
  border-block: 1px solid var(--line);
}

.error-languages p {
  margin: 0;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-weight: 750;
}

@media (max-width: 720px) {
  .about-topbar {
    grid-template-columns: 1fr;
  }

  .language-nav {
    border-top: 1px solid var(--wood-line);
    border-left: 0;
  }

  .language-nav a {
    min-width: 0;
    flex: 1 1 0;
  }

  .about-hero,
  .about-section {
    grid-template-columns: 1fr;
  }

  .about-map-figure,
  .about-section > h2 {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .stamp-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stamp-list li:last-child {
    grid-column: 1 / -1;
  }

  .about-cta {
    grid-template-columns: 1fr;
  }

  .about-cta-link {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .about-brand {
    padding-inline: 12px;
  }

  .about-wordmark {
    font-size: 15px;
  }

  .language-nav a {
    font-size: 12px;
  }

  .rank-rules li {
    grid-template-columns: 3.8rem minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191d22;
    --paper-strong: #22282f;
    --paper-muted: #11151a;
    --ink: #eee6da;
    --ink-muted: #b9aea0;
    --wood: #17110f;
    --wood-line: #57453c;
    --line: #4a4e51;
    --vermilion: #cf6b55;
    --patina: #6aaca3;
    --focus: #6dc4df;
  }

  body {
    background-image: url('/patterns/seigaiha-night.svg');
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
