/* WonderDays public-document styles (terms / privacy / support / thanks).
   The layout follows the approved compact card mockups while keeping fonts,
   scripts, payment URLs, and translated content under repository control. */

:root {
  color-scheme: light;

  --wd-brand: #d6336c;
  --wd-brand-hover: #b02455;
  --wd-brand-soft: #fdf2f7;
  --wd-brand-line: #eddde7;
  --wd-ink: #241f3f;
  --wd-body: #3f3b5c;
  --wd-muted: #6e6a85;
  --wd-line: #ece9f5;
  --wd-panel: #f8f7fc;
  --wd-ground: #edeaf5;
  --wd-hero-end: #f4f2fb;
  --wd-shadow: 0 0.375rem 1.375rem rgba(36, 31, 63, .1);
  --wd-shell-shadow: 0 0.125rem 0.875rem rgba(36, 31, 63, .06);

  font-family: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans JP", "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--wd-body);
  background: var(--wd-ground);
}

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

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--wd-ground);
  color: var(--wd-body);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a {
  color: var(--wd-brand);
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--wd-brand-hover); }
a:focus-visible,
summary:focus-visible {
  outline: 0.1875rem solid var(--wd-brand);
  outline-offset: 0.15rem;
  border-radius: 0.375rem;
}

.page-shell {
  width: min(100%, 38rem);
  min-height: 100vh;
  margin-inline: auto;
  background: #fff;
}
.page-terms,
.page-privacy,
.page-thanks { width: min(100%, 30rem); }

.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.375rem 0;
  background: var(--wd-brand-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--wd-brand);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand::before {
  content: "";
  inline-size: 0.5625rem;
  block-size: 0.5625rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--wd-brand);
}

.language-picker { position: relative; }
.language-picker summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--wd-brand-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #4a4666;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  list-style: none;
}
.language-picker summary::after {
  content: "▾";
  color: #9a95b0;
  font-size: 0.65rem;
  transition: transform .15s ease;
}
.language-picker[open] summary::after { transform: rotate(180deg); }
.language-picker summary::-webkit-details-marker { display: none; }

.language-list {
  position: absolute;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-end: 0;
  z-index: 5;
  display: grid;
  gap: 0.125rem;
  width: min(12rem, calc(100vw - 2.75rem));
  max-height: 17rem;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  border: 1px solid var(--wd-line);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgba(36, 31, 63, .14);
  list-style: none;
}
.language-list a {
  display: block;
  padding: 0.45rem 0.625rem;
  border-radius: 0.5rem;
  color: #4a4666;
  font-size: 0.75rem;
  line-height: 1.4;
  text-decoration: none;
}
.language-list a:hover { background: var(--wd-panel); }
.language-list a[aria-current="page"] {
  background: var(--wd-brand-soft);
  color: var(--wd-brand);
  font-weight: 700;
}

main {
  display: flow-root;
  background: #fff;
}
main:focus { outline: none; }

.page-hero {
  padding: 2.125rem 1.375rem 2.875rem;
  background: linear-gradient(165deg, var(--wd-brand-soft) 0%, var(--wd-hero-end) 100%);
}
.page-hero h1 {
  margin: 0;
  color: var(--wd-ink);
  font-size: clamp(1.625rem, 7vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.5;
  text-wrap: balance;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.45rem;
  margin: 0.75rem 0 0;
  color: var(--wd-muted);
  font-size: 0.71875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.meta span + span::before {
  content: "·";
  margin-inline-end: 0.45rem;
}

.summary,
.lead {
  margin: 1.125rem 0 0;
  color: #4a4666;
  font-size: 0.84375rem;
  font-weight: 400;
  line-height: 2;
}

.contents-card {
  position: relative;
  z-index: 2;
  margin: -1.625rem 1rem 0;
  padding: 1.125rem 1.25rem 1.25rem;
  border: 1px solid var(--wd-line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--wd-shadow);
}
.contents-title {
  margin: 0 0 0.875rem;
  color: var(--wd-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}
.contents-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contents-list a {
  display: flex;
  gap: 0.4rem;
  color: #4a4666;
  font-size: 0.71875rem;
  line-height: 1.55;
  text-decoration: none;
}
.contents-list a:hover { color: var(--wd-brand); }
.contents-number,
.section-number {
  flex: 0 0 auto;
  color: var(--wd-brand);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
}
.contents-number { font-size: 0.625rem; line-height: 1.8; }

.legal-sections,
.support-content {
  padding: 2rem 1.375rem 0;
}
.legal-section { scroll-margin-top: 1rem; }
.legal-section + .legal-section {
  margin-top: 1.625rem;
  padding-top: 1.625rem;
  border-top: 1px solid var(--wd-line);
}
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 0.5625rem;
  margin-bottom: 0.75rem;
}
.section-number { font-size: 0.6875rem; line-height: 1.5; }
h2 {
  margin: 0;
  color: var(--wd-ink);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: balance;
}
.legal-section p,
.legal-section li,
.support-use p,
.support-details p {
  font-size: 0.78125rem;
  line-height: 1.95;
}
.legal-section p { margin: 0; }
.legal-section p + p { margin-top: 0.6875rem; }
.legal-section ul {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-section li {
  position: relative;
  padding-inline-start: 0.9375rem;
}
.legal-section li::before,
.support-details p::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.72rem;
  inline-size: 0.3125rem;
  block-size: 0.3125rem;
  border-radius: 999px;
  background: #ee87b0;
}

.support-hero { padding-bottom: 3rem; }
.support-intro {
  margin: 1.125rem 0 0;
  padding: 0;
  border: 0;
}
.support-intro p {
  margin: 0;
  color: var(--wd-muted);
  font-size: 0.8125rem;
  line-height: 1.95;
}
.support-intro p + p { margin-top: 0.625rem; }
.support-intro .support-intro-primary {
  color: #4a4666;
  font-size: 0.875rem;
  line-height: 2;
}

.support-action-card,
.thanks-card {
  position: relative;
  z-index: 2;
  margin: -1.625rem 1rem 0;
  padding: 1.25rem;
  border: 1px solid var(--wd-line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--wd-shadow);
}
.support-action { margin: 0; }
.support-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.90625rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.support-button {
  background: var(--wd-brand);
  color: #fff;
  box-shadow: 0 0.375rem 1rem rgba(214, 51, 108, .16);
}
.support-button:hover {
  background: var(--wd-brand-hover);
  color: #fff;
}
.support-legal-links {
  margin: 0.75rem 0 0;
  color: var(--wd-muted);
  font-size: 0.71875rem;
  line-height: 1.65;
  text-align: center;
}

.support-content { padding-top: 2.25rem; }
.support-use h2 {
  margin-bottom: 0.875rem;
  color: var(--wd-brand);
}
.support-use p { margin: 0; }
.support-use .support-note {
  margin-top: 0.875rem;
  padding: 1rem 1.125rem;
  border-radius: 0.75rem;
  background: var(--wd-panel);
  color: var(--wd-muted);
  font-size: 0.75rem;
}
.support-details {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--wd-line);
}
.support-details p {
  position: relative;
  margin: 0;
  padding-inline-start: 0.9375rem;
}
.support-details p + p { margin-top: 0.75rem; }

.thanks-hero { padding-bottom: 3rem; }
.success-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.375rem;
  height: 3.375rem;
  margin-bottom: 1.25rem;
  border-radius: 999px;
  background: var(--wd-brand);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}
.thanks-card p {
  margin: 0 0 1rem;
  font-size: 0.78125rem;
  line-height: 1.95;
}
.secondary-button {
  border: 1px solid #ebb9ce;
  background: #fff;
  color: var(--wd-brand);
}
.secondary-button:hover {
  border-color: var(--wd-brand);
  background: var(--wd-brand-soft);
}

.draft-notice {
  margin: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #f2dda6;
  border-radius: 0.75rem;
  background: #fff9ea;
  color: #6b4a00;
  font-size: 0.75rem;
  line-height: 1.6;
}
.draft-notice strong { margin-inline-end: 0.4rem; }

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 1.375rem 1.625rem;
  border-top: 1px solid var(--wd-line);
  background: var(--wd-panel);
  color: var(--wd-muted);
  font-size: 0.75rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.site-footer nav a {
  color: #4a4666;
  text-decoration: none;
}
.site-footer nav a:hover { color: var(--wd-brand); }
.site-footer p { margin: 0.875rem 0 0; }
.footer-meta { font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed;
  inset-inline-start: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--wd-shadow);
  color: var(--wd-ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.isolate { direction: ltr; unicode-bidi: isolate; }

body > .site-header,
body > main,
body > .site-footer {
  width: min(100%, 38rem);
  margin-inline: auto;
}
body > .site-header { padding-bottom: 1.25rem; }
.not-found {
  min-height: calc(100vh - 5rem);
  padding: 3rem 1.375rem;
  text-align: center;
}
.not-found-code {
  margin: 0 0 0.5rem;
  color: var(--wd-brand);
  font-size: clamp(4rem, 16vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}
.not-found h1 {
  margin: 0 0 1.25rem;
  color: var(--wd-ink);
  font-size: 1.625rem;
}
.not-found-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--wd-line);
}

@media (min-width: 40rem) {
  .page-shell {
    min-height: calc(100vh - 4rem);
    margin-block: 2rem;
    overflow: clip;
    border: 1px solid var(--wd-line);
    border-radius: 1.25rem;
    box-shadow: var(--wd-shell-shadow);
  }
  .site-header { padding: 1.75rem 2.5rem 0; }
  .page-hero { padding: 2.75rem 2.5rem 3.25rem; }
  .page-hero h1 { font-size: 2.125rem; }
  .contents-card,
  .support-action-card,
  .thanks-card { margin-inline: 2rem; padding: 1.5rem; }
  .legal-sections,
  .support-content { padding: 2.5rem 2.5rem 0; }
  .site-footer { padding: 1.75rem 2.5rem 2rem; }
}

@media (max-width: 23rem) {
  .contents-list { grid-template-columns: 1fr; }
  .site-header,
  .page-hero,
  .legal-sections,
  .support-content,
  .site-footer { padding-inline: 1rem; }
  .contents-card,
  .support-action-card,
  .thanks-card { margin-inline: 0.75rem; padding: 1rem; }
}

@media print {
  :root { background: #fff; font-size: 10.5pt; }
  body { background: #fff; }
  .page-shell { width: auto; min-height: 0; margin: 0; border: 0; box-shadow: none; }
  .site-header,
  .contents-card,
  .support-action-card,
  .thanks-card,
  .site-footer nav,
  .skip-link { display: none; }
  .page-hero,
  .legal-sections,
  .support-content,
  .site-footer { padding-inline: 0; background: #fff; }
  .page-hero { padding-block: 0 1.5rem; }
  .legal-sections,
  .support-content { padding-top: 0; }
  .legal-section { break-inside: avoid; }
  .site-footer { margin-top: 1.5rem; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
