@font-face {
  font-family: "Aileron";
  src: url("/fonts/Aileron-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Aileron", "Helvetica Neue", Arial, sans-serif;
  --size: clamp(1.25rem, 1.75vw, 1.875rem);
  --gap: 0.8em;
  --bg: #fff;
  --fg: #000;
  --accent: #0972FF;
  color-scheme: light dark;
}

/* Dark values live in two places: the system preference (no stored choice,
   or no JS) and an explicit data-theme="dark". Keep them in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a0a;
    --fg: #ededed;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #ededed;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--size);
  line-height: 1.3;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 100%; text-align: left; }

h1,
p {
  margin: 0 0 var(--gap);
  font: inherit;
  overflow-wrap: break-word;
}
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}
a:hover,
a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible { text-decoration: underline; }
a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

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

.theme-toggle {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  right: env(safe-area-inset-right, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 1rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:focus-visible { outline-offset: -6px; }

body,
.efc,
.theme-toggle {
  transition: background-color 150ms ease, color 150ms ease;
}
@media (prefers-reduced-motion: reduce) {
  body,
  .efc,
  .theme-toggle { transition: none; }
}
.theme-toggle[hidden] { display: none; }
