:root {
  color-scheme: light dark;
  --bg: #fbf7f3;
  --card: #ffffff;
  --text: #2a2320;
  --muted: #6f665f;
  --line: #ded4ca;
  --brand: #c44a2c;
  --brand-strong: #8d2d17;
  --brand-soft: #fceae3;
  --action-text: #ffffff;
  --max: 940px;
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1714;
    --card: #251f1b;
    --text: #f2ebe4;
    --muted: #c1b5ab;
    --line: #4a4038;
    --brand: #f2825f;
    --brand-strong: #ff9b80;
    --brand-soft: #3a2a22;
    --action-text: #1c1714;
  }
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(100%, var(--max));
  max-width: none;
  padding: clamp(1rem, 5vw, 4rem) clamp(1rem, 4vw, 2.4rem) 5rem;
}

.card {
  padding: clamp(1.4rem, 5vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(77, 48, 37, 0.1);
}

h1,
h2 {
  color: var(--text);
  font-weight: 760;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 18ch;
  margin-top: 1.6rem;
  font-size: clamp(2.15rem, 6vw, 4rem);
  line-height: 1.08;
  text-wrap: balance;
}

h2 {
  margin-top: 2.5rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  border-left: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.2;
}

p,
li {
  color: var(--text);
}

.muted {
  color: var(--muted);
}

a {
  color: var(--brand);
  text-underline-offset: 0.22em;
}

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

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin: 0 0 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  color: transparent;
  font-size: 0.9rem;
  font-weight: 700;
}

.top-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
}

.top-links a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.badge {
  border-color: var(--line);
  background: var(--brand-soft);
  color: var(--brand);
}

.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-strong);
  border-radius: 14px;
  background: var(--brand-soft);
}

.notice p:first-child {
  margin-top: 0;
}

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

.action-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  border: 2px solid var(--brand-strong);
  border-radius: 999px;
  background: var(--brand-strong);
  color: var(--action-text);
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.action-link:hover {
  filter: brightness(1.06);
  text-decoration: underline;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-spacing: 0;
}

th,
td {
  min-width: 150px;
  border-color: var(--line);
}

th {
  background: var(--brand-soft);
  color: var(--text);
}

code {
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .card {
    border-radius: 22px;
  }

  ul,
  ol {
    padding-left: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
