:root {
  --bg: #f3f0ea;
  --surface: #ffffff;
  --text: #1c1a21;
  --muted: #5b5765;
  --border: #d8d2c8;
  --primary: #3b38d1;
  --primary-hover: #2e2bb0;
  --on-primary: #ffffff;
  --secondary: #e9e7f2;
  --secondary-hover: #dcd9ea;
  --on-secondary: #26242e;
  --danger: #b42318;
  --success: #12663f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(20 16 30 / 0.06), 0 10px 30px rgb(20 16 30 / 0.08);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --t: 150ms;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

[tabindex='-1']:focus {
  outline: none;
}

.muted {
  color: var(--muted);
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 16px 40px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

@media (max-width: 420px) {
  .card {
    padding: 20px 16px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 40px;
  padding: 0.5em 1.1em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--t),
    color var(--t),
    box-shadow var(--t);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--on-secondary);
  border-color: #cfcbe0;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-large {
  min-height: 48px;
  padding: 0.65em 1.4em;
  font-size: 1.05rem;
}

.btn:disabled {
  background: #e4e2e8;
  color: #6c6875;
  border-color: #d3d0d9;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #e0f2ea;
  color: var(--success);
}

/* Intro */
.intro-card h1 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.intro-label {
  margin-bottom: 4px;
  font-weight: 600;
}

.observed {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.mercy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  cursor: pointer;
}

.mercy-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.noscript {
  padding: 24px;
  text-align: center;
}

/* Mercy Mode and reduced motion: transitions ≤ 100 ms, no animation. */
body.mercy *,
body.mercy *::before,
body.mercy *::after {
  transition-duration: 100ms !important;
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 100ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
