:root {
  /* Light (default) */
  --bg: #f6f1e6;
  --ink: #2b241c;
  --muted: rgba(43, 36, 28, 0.6);
  --muted2: rgba(43, 36, 28, 0.45);
  --badge: rgba(43, 36, 28, 0.08);
  --subhead: rgba(43, 36, 28, 0.75);
  --icon: rgba(43, 36, 28, 0.75);
  --iconHover: rgba(43, 36, 28, 0.95);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh; /* fallback */
  min-height: 100svh; /* iOS stable viewport */
  min-height: 100dvh; /* modern dynamic viewport */

  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

main.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

/* Logo */
.logo {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 0 48px 0;
}

.logo--dark {
  display: none;
}
html[data-theme="dark"] .logo--light {
  display: none;
}
html[data-theme="dark"] .logo--dark {
  display: block;
}

/* Type */
h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 12px 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 28px 0 10px 0;
  color: var(--subhead);
  font-weight: 700;
}

p {
  max-width: 620px;
  margin: 0 0 18px 0;
  line-height: 1.6;
  color: var(--muted);
  font-size: 16px;
}

.lede {
  color: var(--muted);
  max-width: 620px;
}

/* Links / CTAs */
.cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  width: fit-content;
  margin-bottom: 14px;
}

.learn-more {
  display: inline-block;
  margin-top: 18px;
  margin-bottom: 36px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.learn-more:hover {
  text-decoration: underline;
}

.textlink {
  display: inline-block;
  margin: 0 0 26px 0;
  color: var(--ink);
  opacity: 0.85;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.textlink:hover {
  opacity: 1;
  text-decoration: underline;
}

.rule {
  height: 1px;
  background: rgba(43, 36, 28, 0.12);
  border: 0;
  margin: 26px 0;
}

/* Footer */
footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--muted2);
  flex-wrap: wrap;
}

.footerlink {
  color: var(--icon);
  text-decoration: none;
  font-weight: 600;
}
.footerlink:hover {
  color: var(--iconHover);
  text-decoration: underline;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.iconlink {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--badge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon);
  text-decoration: none;
}
.iconlink:hover {
  color: var(--iconHover);
}
.iconlink svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Floating theme toggle */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;

  border: 0;
  background: var(--badge);
  color: var(--iconHover);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 480px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
  }
}

/* ---- Manual Dark Theme (solid, readable) ---- */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1213;
  --ink: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.74);
  --muted2: rgba(255, 255, 255, 0.56);
  --badge: rgba(255, 255, 255, 0.08);
  --subhead: rgba(255, 255, 255, 0.78);
  --icon: rgba(255, 255, 255, 0.72);
  --iconHover: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .rule {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .cta {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
