:root {
  color-scheme: dark;
  --ink: #0c0d0b;
  --ink-soft: #171914;
  --paper: #f5efe2;
  --paper-dim: #d9ceb9;
  --gold: #c9a45a;
  --vermilion: #bb3a27;
  --moss: #3f5b44;
  --steel: #85939a;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(245, 239, 226, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(245, 239, 226, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(187, 58, 39, 0.16), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(201, 164, 90, 0.12), transparent 30rem),
    linear-gradient(135deg, #0c0d0b 0%, #151610 48%, #071011 100%);
  background-size: 52px 52px, 52px 52px, auto, auto, auto;
  color: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 47%, rgba(201, 164, 90, 0.16) 47.15% 47.45%, transparent 47.6%),
    linear-gradient(115deg, transparent 0 50.5%, rgba(245, 239, 226, 0.08) 50.7% 51%, transparent 51.2%);
}

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

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: 52vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding: clamp(40px, 7vw, 82px) 0 34px;
}

.kicker,
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 900;
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(4rem, 12vw, 9.4rem);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.tagline {
  max-width: 540px;
  margin-bottom: 30px;
  color: var(--paper-dim);
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  line-height: 1.25;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.language-switcher a {
  min-width: 42px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 239, 226, 0.18);
  border-radius: 8px;
  background: rgba(245, 239, 226, 0.045);
  color: var(--paper-dim);
  font-size: 0.78rem;
  font-weight: 900;
}

.language-switcher a[aria-current="page"],
.language-switcher a:hover,
.language-switcher a:focus-visible {
  outline: none;
  border-color: var(--gold);
  color: var(--paper);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 239, 226, 0.22);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible,
.choice-button:hover,
.choice-button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--gold);
}

.button-primary {
  background: var(--vermilion);
  color: #fff9ed;
  border-color: transparent;
}

.button-quiet {
  background: rgba(245, 239, 226, 0.06);
}

.crest-panel {
  position: relative;
  min-height: 460px;
  border: 1px solid rgba(245, 239, 226, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(245, 239, 226, 0.08), transparent 38%),
    linear-gradient(0deg, rgba(12, 13, 11, 0.6), rgba(12, 13, 11, 0.15)),
    var(--ink-soft);
  box-shadow: 0 28px 70px var(--shadow);
}

.crest-panel::before {
  position: absolute;
  inset: 26px;
  content: "";
  border: 1px solid rgba(201, 164, 90, 0.34);
}

.sun-mark {
  position: absolute;
  width: 240px;
  aspect-ratio: 1;
  top: 42px;
  right: 34px;
  border-radius: 999px;
  background: var(--vermilion);
  box-shadow: inset 0 0 0 14px rgba(12, 13, 11, 0.16);
}

.brush-kanji {
  position: absolute;
  left: 36px;
  bottom: 52px;
  color: var(--paper);
  font-family: "Noto Serif JP", serif;
  font-size: clamp(6.8rem, 18vw, 13rem);
  font-weight: 900;
  line-height: 0.86;
  writing-mode: vertical-rl;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

.blade-line {
  position: absolute;
  width: 160%;
  height: 2px;
  left: -24%;
  top: 52%;
  background: linear-gradient(90deg, transparent, var(--gold), var(--paper), transparent);
  transform: rotate(-34deg);
}

.seal {
  position: absolute;
  right: 42px;
  bottom: 40px;
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--vermilion);
  color: #fff9ed;
  font-family: "Noto Serif JP", serif;
  font-size: 2.5rem;
  font-weight: 900;
}

.deck-zone {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 540px) minmax(220px, 0.72fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  padding: 18px 0 72px;
}

.deck-heading {
  align-self: center;
}

h2 {
  margin-bottom: 0;
  color: var(--paper);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.game-card {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(245, 239, 226, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(245, 239, 226, 0.11), rgba(245, 239, 226, 0.045));
  box-shadow: 0 22px 56px var(--shadow);
}

.card-topline,
.game-controls,
.hud,
.xp-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud {
  gap: 10px;
}

.hud div {
  min-height: 76px;
  flex: 1;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(245, 239, 226, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(12, 13, 11, 0.24);
}

.hud span,
.xp-label,
.prompt {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hud strong {
  color: var(--paper);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.xp-wrap {
  display: grid;
  gap: 8px;
}

.xp-label {
  color: var(--paper-dim);
  font-size: 0.76rem;
}

.xp-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 164, 90, 0.38);
  border-radius: 999px;
  background: rgba(12, 13, 11, 0.4);
}

.xp-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--vermilion), var(--gold));
  transition: width 220ms ease;
}

.challenge {
  display: grid;
  gap: 10px;
}

.card-topline {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-face {
  width: 100%;
  min-height: 230px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 239, 226, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(12, 13, 11, 0.14), rgba(12, 13, 11, 0.14)),
    var(--paper);
  color: var(--ink);
}

.kanji {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(5.4rem, 14vw, 9.2rem);
  font-weight: 900;
  line-height: 0.92;
}

.reading {
  font-weight: 900;
}

.reading {
  min-height: 1.4em;
  color: var(--vermilion);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-button {
  min-height: 66px;
  border: 1px solid rgba(245, 239, 226, 0.2);
  border-radius: 8px;
  background: rgba(245, 239, 226, 0.06);
  color: var(--paper);
  cursor: pointer;
  padding: 10px;
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.choice-button.correct {
  background: var(--moss);
  border-color: rgba(245, 239, 226, 0.42);
  color: #fff9ed;
}

.choice-button.wrong {
  background: var(--vermilion);
  border-color: rgba(245, 239, 226, 0.34);
  color: #fff9ed;
}

.choice-button:disabled {
  cursor: default;
  transform: none;
}

.game-controls {
  gap: 12px;
}

.game-controls .button {
  flex: 1;
}

.game-controls .button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.principles {
  align-self: center;
  display: grid;
  gap: 12px;
}

.principles div {
  border-left: 3px solid var(--gold);
  padding: 3px 0 4px 16px;
}

.principles span {
  color: var(--steel);
  font-size: 0.76rem;
  font-weight: 900;
}

.principles p {
  margin: 4px 0 0;
  color: var(--paper-dim);
  font-family: "Noto Serif JP", serif;
  font-size: 1.1rem;
}

.info-zone,
.faq-zone {
  border-top: 1px solid rgba(245, 239, 226, 0.14);
  padding: clamp(44px, 7vw, 76px) 0;
}

.info-zone {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.practice-zone {
  padding-top: 0;
}

.info-copy {
  max-width: 760px;
}

.info-copy p,
.faq-item p {
  color: var(--paper-dim);
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  line-height: 1.75;
}

.feature-list,
.faq-item {
  border: 1px solid rgba(245, 239, 226, 0.16);
  border-radius: 8px;
  background: rgba(245, 239, 226, 0.045);
}

.feature-list {
  padding: clamp(20px, 3vw, 30px);
}

.feature-list h3 {
  margin: 0 0 18px;
  color: var(--paper);
  font-size: 1rem;
  text-transform: uppercase;
}

.feature-list ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 22px;
  color: var(--paper-dim);
  line-height: 1.55;
}

.feature-list li::before {
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--gold);
  transform: rotate(45deg);
}

.faq-zone {
  padding-top: clamp(34px, 6vw, 62px);
}

.faq-zone > h2 {
  max-width: 820px;
  margin-bottom: 22px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 0;
}

.faq-item summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--paper);
  font-weight: 900;
}

.faq-item p {
  margin: 0;
  padding: 0 20px 20px;
}

.trust-shell {
  padding: clamp(26px, 5vw, 54px) 0 clamp(64px, 9vw, 112px);
}

.trust-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(38px, 7vw, 86px);
}

.trust-home-link,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  font-weight: 900;
}

.trust-home-link span,
.footer-logo span {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--vermilion);
  color: #fff9ed;
  font-family: "Noto Serif JP", serif;
  font-size: 1.45rem;
}

.trust-language-switcher,
.footer-language div,
.footer-link-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.trust-language-switcher a,
.footer-language a,
.footer-link-group a {
  color: var(--paper-dim);
  text-decoration: underline;
  text-decoration-color: rgba(201, 164, 90, 0.36);
  text-underline-offset: 4px;
}

.trust-language-switcher a[aria-current="page"],
.footer-language a[aria-current="page"],
.trust-language-switcher a:hover,
.footer-language a:hover,
.footer-link-group a:hover {
  color: var(--paper);
  text-decoration-color: var(--gold);
}

.trust-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(28px, 6vw, 86px);
  align-items: end;
  padding-bottom: clamp(40px, 7vw, 78px);
  border-bottom: 1px solid rgba(245, 239, 226, 0.14);
}

.trust-hero h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 9vw, 7rem);
  line-height: 0.88;
}

.trust-lead {
  max-width: 780px;
  color: var(--paper-dim);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.trust-meta-panel,
.trust-sidecard {
  border: 1px solid rgba(245, 239, 226, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(245, 239, 226, 0.11), rgba(245, 239, 226, 0.035)),
    rgba(12, 13, 11, 0.2);
  box-shadow: 0 22px 56px var(--shadow);
}

.trust-meta-panel {
  padding: clamp(20px, 3vw, 30px);
}

.trust-meta-kicker,
.footer-link-group > span,
.footer-language > span {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trust-meta-panel strong {
  display: block;
  margin-bottom: 18px;
  color: var(--paper);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.trust-meta-panel ul,
.trust-section ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-meta-panel li,
.trust-section li {
  position: relative;
  padding-left: 22px;
  color: var(--paper-dim);
  line-height: 1.55;
}

.trust-meta-panel li::before,
.trust-section li::before {
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--gold);
  transform: rotate(45deg);
}

.trust-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: start;
  padding-top: clamp(46px, 7vw, 82px);
}

.trust-article {
  display: grid;
  gap: clamp(34px, 5vw, 56px);
}

.trust-section {
  max-width: 820px;
}

.trust-section h2,
.trust-sidecard h2 {
  margin: 0 0 18px;
  color: var(--paper);
  font-size: clamp(1.7rem, 3.5vw, 3rem);
  line-height: 1;
}

.trust-section p {
  color: var(--paper-dim);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.8;
}

.trust-section p:last-child {
  margin-bottom: 0;
}

.trust-sidecard {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 22px;
  padding: clamp(20px, 3vw, 30px);
}

.trust-sidecard nav {
  display: grid;
  gap: 12px;
}

.trust-sidecard nav a {
  color: var(--paper-dim);
  font-weight: 800;
}

.trust-sidecard nav a:hover {
  color: var(--paper);
}

.site-footer {
  margin-top: clamp(24px, 5vw, 64px);
  padding: clamp(30px, 5vw, 54px) clamp(18px, 4vw, 44px);
  border-top: 1px solid rgba(245, 239, 226, 0.12);
  background:
    linear-gradient(90deg, rgba(201, 164, 90, 0.1), transparent 38%),
    rgba(12, 13, 11, 0.9);
  color: var(--paper-dim);
  font-size: 0.86rem;
  font-weight: 700;
}

.footer-inner {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 0.9fr) minmax(140px, 0.55fr) minmax(150px, 0.55fr);
  gap: clamp(22px, 4vw, 46px);
  margin: 0 auto;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 10px;
}

.footer-brand p {
  max-width: 420px;
  margin: 0;
  line-height: 1.55;
}

.site-footer a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

@media (max-width: 920px) {
  .hero,
  .deck-zone,
  .info-zone,
  .trust-hero,
  .trust-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .crest-panel {
    min-height: 360px;
  }

  .deck-heading,
  .principles {
    max-width: 560px;
  }

  .trust-sidecard {
    position: static;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: clamp(3.15rem, 18vw, 5.4rem);
  }

  .hero-actions {
    width: 100%;
  }

  .button {
    flex: 1 1 140px;
  }

  .crest-panel {
    min-height: 320px;
  }

  .sun-mark {
    width: 168px;
  }

  .brush-kanji {
    left: 24px;
    bottom: 38px;
  }

  .game-card {
    min-height: auto;
  }

  .hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .deck-zone {
    padding-bottom: 72px;
  }

  .trust-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    font-size: 0.78rem;
  }
}
