:root,
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #9198a1;
  --accent: #f0883e;
  --accent-text: #0d1117;
  --link: #58a6ff;
  --line: #30363d;
  --icon-sun: none;
  --icon-moon: inline;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #59636e;
  --accent: #bc4c00;
  --accent-text: #ffffff;
  --link: #0969da;
  --line: #d0d7de;
  --icon-sun: inline;
  --icon-moon: none;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --text: #1f2328;
    --muted: #59636e;
    --accent: #bc4c00;
    --accent-text: #ffffff;
    --link: #0969da;
    --line: #d0d7de;
    --icon-sun: inline;
    --icon-moon: none;
    color-scheme: light;
  }
}

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

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

#theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

#theme-toggle:hover { color: var(--accent); }

#theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

#theme-toggle .icon-sun { display: var(--icon-sun); }
#theme-toggle .icon-moon { display: var(--icon-moon); }

main, footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px;
}

body > main:first-child { padding-top: 2rem; }

h1 {
  font-size: clamp(1.4rem, 7.4vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

.hero h1 { text-align: center; }

h1 .accent { color: var(--accent); }

.hero img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 1.25rem 0 2rem;
}

.actions .btn {
  flex: 1 1 14rem;
  max-width: 20rem;
  min-height: 44px;
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn.secondary {
  color: var(--accent);
  background: transparent;
}

.btn:hover { filter: brightness(1.1); }

section {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

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

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

footer p { margin: 0 0 0.5rem; }

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
