:root {
  color-scheme: light;
  --canvas: #f3f6f4;
  --surface: #fff;
  --ink: #1e2a27;
  --muted: #687872;
  --line: #e2e9e5;
  --accent: #187a5b;
  --accent-hover: #126649;
  --accent-soft: #e5f3ed;
  --body-copy: #52615c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101714;
  --surface: #18211d;
  --ink: #e5ede8;
  --muted: #9eada4;
  --line: #304138;
  --accent: #42b883;
  --accent-hover: #58ca96;
  --accent-soft: #1d3b2e;
  --body-copy: #becbc3;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
}

a:focus-visible {
  border-radius: 3px;
  outline: 3px solid rgb(65 167 127 / 45%);
  outline-offset: 3px;
}

.page-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.theme-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ffca70;
}

.theme-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  filter: drop-shadow(0 0 5px rgb(255 197 97 / 48%));
}

.theme-icon .theme-moon {
  display: none;
}

:root[data-theme="light"] .theme-icon {
  color: #a178e8;
}

:root[data-theme="light"] .theme-icon svg {
  filter: drop-shadow(0 0 5px rgb(161 120 232 / 35%));
}

:root[data-theme="light"] .theme-icon .theme-sun {
  display: none;
}

:root[data-theme="light"] .theme-icon .theme-moon {
  display: block;
}

.theme-toggle:hover {
  background: var(--accent-soft);
}

:root[data-theme="dark"] .theme-toggle {
  border-color: #554b68;
  background: linear-gradient(135deg, #27243a, #263344 55%, #28392f);
  color: #f0e9ff;
}

:root[data-theme="dark"] .theme-toggle:hover {
  border-color: #8270a5;
  background: linear-gradient(135deg, #342c4b, #2c4051 55%, #304838);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgb(65 167 127 / 45%);
  outline-offset: 2px;
}

.theme-status {
  max-width: 180px;
  color: #a34238;
  font-size: 11px;
}

:root[data-theme="dark"] .theme-status {
  color: #ff9b90;
}

.brand {
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand span {
  display: block;
  max-width: 330px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.3;
}

.home-link {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.page-main {
  width: min(820px, calc(100% - 36px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 76px) 0 64px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.intro {
  max-width: 650px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.page-content {
  display: grid;
  gap: 20px;
}

.page-content section,
.page-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.page-content h2,
.page-card h2 {
  margin: 0 0 9px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.page-content h3 {
  margin: 18px 0 7px;
  font-size: 15px;
}

.page-content p,
.page-content li,
.page-card p {
  color: var(--body-copy);
  font-size: 14px;
  line-height: 1.7;
}

.page-content p:last-child,
.page-card p:last-child {
  margin-bottom: 0;
}

.page-content ul,
.page-content ol {
  margin: 10px 0;
  padding-left: 22px;
}

.page-content li + li {
  margin-top: 6px;
}

.page-callout {
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
}

.page-callout p {
  margin: 0;
}

.link-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.link-button:hover {
  background: var(--accent-hover);
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.page-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.page-footer a {
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

.not-found {
  display: grid;
  min-height: 55vh;
  align-content: center;
  justify-items: start;
}

.not-found-code {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: clamp(64px, 14vw, 112px);
  font-weight: 800;
  letter-spacing: -0.09em;
  line-height: 0.9;
}

:root[data-theme="dark"] .page-callout {
  color: var(--ink);
}

@media (max-width: 600px) {
  .page-header {
    min-height: 66px;
    gap: 12px;
  }

  .page-header-actions {
    gap: 9px;
  }

  .theme-toggle {
    width: 36px;
    justify-content: center;
    padding: 6px;
  }

  .theme-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .page-main {
    min-height: calc(100vh - 180px);
  }

  .page-content section,
  .page-card {
    padding: 18px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
