:root {
  --paper: #F6F3EE;
  --surface: #FFFFFF;
  --line: #E4DED4;
  --ink: #1A2230;
  --ink-soft: #5F6B7A;
  --action: #274C5B;
  --action-hover: #1B3742;
  --focus: #518297;
  --danger: #994438;
  --success: #486B5C;
  --font-ui: "Bricolage Grotesque", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.brand {
  margin: 22px 0 0;
  font: 600 26px/1 var(--font-ui);
  letter-spacing: -.02em;
  color: var(--action);
}

.pinwheel {
  width: min(56vw, 220px);
  aspect-ratio: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  border-radius: 50%;
}
.pinwheel:active { cursor: grabbing; }
.pinwheel:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus);
}
.pinwheel__svg { display: block; width: 100%; height: 100%; overflow: visible; }

.pinwheel__blade {
  fill-opacity: 0;
  stroke: var(--blade);
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    draw 1.3s var(--ease) var(--d) forwards,
    fill .9s ease-out calc(var(--d) + 1.15s) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill { to { fill-opacity: 1; stroke-opacity: 0; } }

.join { width: 100%; max-width: 360px; margin-top: 16px; }
.join__lede {
  margin: 0 auto;
  max-width: 340px;
  text-align: center;
  font: 400 18px/1.25 var(--font-display);
  letter-spacing: -.005em;
  text-wrap: balance;
}
.join__lede em { font-weight: 300; }
.areas {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 8px;
  row-gap: 4px;
  font: 600 13px/1.4 var(--font-ui);
}
.areas__item { white-space: nowrap; }
.areas__item + .areas__item::before {
  content: "·";
  color: var(--ink-soft);
  font-weight: 400;
  margin-right: 8px;
}
.areas__break { flex-basis: 100%; height: 0; }
.areas__item--saude { color: #994438; }
.areas__item--desenvolvimento { color: #3C697B; }
.areas__item--parentalidade { color: #486B5C; }
.areas__item--vida { color: #815A00; }

.join__row { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; }
.join__input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 400 15px/1 var(--font-ui);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.join__input::placeholder { color: var(--ink-soft); }
.join__input:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);
}
.join__input[aria-invalid="true"] { border-color: var(--danger); }

.join__btn {
  width: 100%;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: none;
  background: var(--action);
  color: #FFFFFF;
  font: 600 15px/1 var(--font-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms var(--ease);
}
.join__btn:hover { background: var(--action-hover); }
.join__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);
}
.join__btn:disabled { opacity: .5; cursor: default; }

.join__msg {
  margin: 12px 0 0;
  min-height: 1.5em;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.join__msg--error { color: var(--danger); }
.join__msg--ok { color: var(--success); }
.join--done .join__row,
.join--done .join__lede,
.join--done .areas { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pinwheel__blade { animation: none; fill-opacity: 1; stroke-opacity: 0; }
}

@media (min-width: 768px) {
  .pinwheel { width: 240px; }
  .brand { font-size: 30px; margin-top: 26px; }
  .join { margin-top: 18px; }
  .join__lede { font-size: 19px; max-width: 360px; }
  .join__row { margin-top: 48px; }
  .areas { width: max-content; position: relative; left: 50%; transform: translateX(-50%); }
  .areas__break { display: none; }
  .areas__break + .areas__item::before {
    content: "·";
    color: var(--ink-soft);
    font-weight: 400;
    margin-right: 8px;
  }
}
