/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

/* ── Tokens ──────────────────────────────────────────── */
:root {
  --bg:   #080C10;
  --text: #EFEFEF;
}

[data-theme="light"] {
  --bg:   #F5F5F5;
  --text: #080C10;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:   #F5F5F5;
    --text: #080C10;
  }
  :root:not([data-theme="dark"]) .blood-text {
    -webkit-text-stroke: 0;
  }
}

[data-theme="light"] .blood-text {
  -webkit-text-stroke: 0;
}

/* ── Base ────────────────────────────────────────────── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: clamp(24px, 6vw, 64px);
}

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: clamp(20px, 3vw, 32px);
  left: clamp(24px, 4vw, 48px);
  z-index: 100;
}

.nav-logo {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  /* WCAG 2.5.8 – minimum 24×24px touch target */
  display: inline-block;
  padding: 4px 2px;
}

.nav-copyright {
  font-size: 0.45em;
  vertical-align: super;
  margin-right: 0.05em;
}

/* WCAG 2.4.11 – focus not obscured; 2.4.7 – visible focus indicator */
.nav-logo:focus-visible {
  outline: 0.5px solid var(--bg);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Headline ────────────────────────────────────────── */
main {
  text-align: center;
  max-width: 720px;
  width: 100%;
}

/* Relative wrapper so .blood-text can overlay h1 exactly */
.headline-wrap {
  position: relative;
}

h1,
.blood-text {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1 {
  color: var(--text);
}

/* aria-hidden overlay, clipped to a rising wave shape by JS */
.blood-text {
  position: absolute;
  inset: 0;
  color: #CC0000;
  -webkit-text-stroke: 1mm black;
  paint-order: stroke fill;
  pointer-events: none;
  user-select: none;
  will-change: clip-path;
}

/* ── Theme Toggle ────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 48px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 2.75rem;
  height: 2.75rem;
  z-index: 100;
}

.theme-toggle img {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.theme-toggle .icon-dark  { display: none; }
.theme-toggle .icon-light { filter: brightness(0) invert(1); }

[data-theme="light"] .theme-toggle .icon-light { display: none; }
[data-theme="light"] .theme-toggle .icon-dark  { display: block; filter: brightness(0); }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-light { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-dark  { display: block; filter: brightness(0); }
}

/* WCAG 2.4.11 – focus not obscured; 2.4.7 – visible focus indicator */
.theme-toggle:focus-visible {
  outline: 0.5px solid var(--bg);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  h1, .blood-text { font-size: clamp(2rem, 10vw, 2.8rem); }
  .theme-toggle { width: 2.25rem; height: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .blood-text { display: none; }
}
