/* carstenwolfram.de – one stylesheet, no build step */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #E3E9E1;
  --ink: #1E2A24;
  --body: #36443B;
  --muted: #4B5A50;
  --btn: #23443A;
  --btn-text: #FFFFFF;
  --chip: rgba(255, 255, 255, 0.6);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #141A17;
  --ink: #E6ECE5;
  --body: #C3CEC6;
  --muted: #98A69D;
  --btn: #A9C4AE;
  --btn-text: #141A17;
  --chip: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #141A17;
    --ink: #E6ECE5;
    --body: #C3CEC6;
    --muted: #98A69D;
    --btn: #A9C4AE;
    --btn-text: #141A17;
    --chip: rgba(255, 255, 255, 0.09);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 19px;
  line-height: 1.7;
  transition: background-color 0.3s, color 0.3s;
}

a { color: inherit; }
a:hover { opacity: 0.85; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--btn);
  outline-offset: 3px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 680px; }

/* Headings: Fraunces (soft serif), body stays Figtree */
.hero h1, section.block h2, .legal h1, .notfound h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Hero */
.hero {
  padding: 140px 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero img { width: 280px; height: 280px; }
.hero h1 {
  margin: 48px 0 20px;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero p { margin: 0 0 12px; max-width: 600px; font-size: 21px; }
.hero p.muted { color: var(--muted); margin-bottom: 40px; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  background: var(--chip);
  color: var(--ink);
}
.btn.primary { background: var(--btn); color: var(--btn-text); font-weight: 700; }

/* Sections */
section.block { padding: 0 0 160px; }
section.block h2 {
  margin: 0 0 56px;
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.grid { display: flex; flex-wrap: wrap; gap: 48px 72px; }
.grid > div { flex: 1 1 380px; }
.grid h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; }
.grid p { margin: 0; color: var(--body); }

/* Legal pages */
.legal { padding: 120px 0 120px; }
.legal h1 { margin: 0 0 40px; font-size: clamp(34px, 4vw, 46px); line-height: 1.15; letter-spacing: -0.02em; }
.legal h2 { margin: 48px 0 12px; font-size: 23px; }
.legal p, .legal li { color: var(--body); }
.legal ul { padding-left: 1.2em; }
.back { display: inline-block; margin-bottom: 48px; color: var(--muted); text-decoration: none; }

/* 404 */
.notfound { padding: 200px 0; text-align: center; }
.notfound h1 { font-size: clamp(40px, 5vw, 60px); margin: 0 0 16px; letter-spacing: -0.02em; }
.notfound p { color: var(--muted); margin: 0 0 40px; font-size: 21px; }

/* Footer */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 0 24px 56px;
  font-size: 15px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
