:root {
  color-scheme: light;
  --canvas: #f8f7ff;
  --ink: #30264f;
  --soft: #695f7a;
  --line: #ddd5ef;
  --card: #ffffff;
  --accent: #6941d9;
  --focus: #4d2ca6;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page {
  width: min(100%, 1440px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 72px) 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.brand {
  display: inline-flex;
  width: clamp(185px, 20vw, 246px);
  color: var(--ink);
}

.brand svg { display: block; width: 100%; height: auto; }

.hero {
  align-self: center;
  width: min(100%, 980px);
  padding: clamp(48px, 8vh, 96px) 0;
}

h1, h2 {
  font-family: Outfit, ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-weight: 900;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(42px, 6.2vw, 88px);
  line-height: 0.98;
}

.lede {
  max-width: 720px;
  margin: clamp(24px, 4vh, 38px) 0 0;
  color: var(--soft);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.signup { margin-top: clamp(28px, 4vh, 42px); }

.form-row {
  display: flex;
  width: min(100%, 670px);
  gap: 10px;
}

input, button { font: inherit; }

input[type="email"] {
  min-width: 0;
  flex: 1;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  box-shadow: 0 8px 30px rgba(48, 38, 79, 0.06);
}

input::placeholder { color: #776d87; opacity: 1; }

button {
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--focus);
}

button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--focus); }
button:disabled { cursor: wait; opacity: 0.7; }

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.challenge { min-height: 66px; margin-top: 16px; }

.message {
  min-height: 28px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 16px;
}

.message[data-kind="error"] { color: #8b244a; }
.success { color: var(--ink); font-size: clamp(18px, 2vw, 22px); font-weight: 700; }

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

footer a { text-underline-offset: 3px; }

.legal-main {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: 64px 0;
  align-self: start;
}

.legal-main h1 { font-size: clamp(40px, 7vw, 68px); }
.legal-main p { color: var(--soft); font-size: 18px; line-height: 1.7; }

@media (max-width: 650px) {
  .page { padding-top: 20px; padding-bottom: 18px; }
  .brand { width: 178px; }
  .hero { padding: 28px 0 20px; }
  h1 { font-size: clamp(37px, 10.8vw, 48px); line-height: 1; }
  .lede { margin-top: 20px; font-size: 16px; line-height: 1.45; }
  .signup { margin-top: 22px; }
  .form-row { display: grid; gap: 9px; }
  input[type="email"], button { min-height: 52px; border-radius: 14px; }
  .challenge { min-height: 60px; margin-top: 11px; transform-origin: left top; }
  .message { margin-top: 9px; }
  footer { font-size: 12px; }
}

@media (max-height: 760px) and (max-width: 650px) {
  .hero { padding: 18px 0 12px; }
  h1 { font-size: 36px; }
  .lede { margin-top: 14px; font-size: 15px; }
  .signup { margin-top: 16px; }
  .challenge { min-height: 56px; margin-top: 8px; transform: scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
