/* oivu — reset + global layout + shared components */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

/* persistent top bar: brand + always-reachable crisis affordance */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(env(safe-area-inset-top), 12px) 18px 12px;
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
}
.brand { font-size: var(--fs-md); font-weight: 600; color: var(--accent-strong); letter-spacing: .3px; }
.crisis-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  color: var(--care); border: 1.5px solid var(--care);
  background: color-mix(in srgb, var(--care) 12%, transparent);
}

main {
  flex: 1 1 auto;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: var(--sp-3) 20px var(--sp-4);
  display: flex; flex-direction: column;
}

.microbar {
  text-align: center; font-size: var(--fs-xs); color: var(--text-faint);
  padding: 12px 16px max(env(safe-area-inset-bottom), 14px);
}
.microbar a { color: var(--care); }

/* typography */
h1 { font-size: var(--fs-xl); line-height: 1.25; font-weight: 600; margin: 0 0 var(--sp-2); }
h2 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--sp-2); }
p { margin: 0 0 var(--sp-2); color: var(--text-soft); font-size: var(--fs-md); }
.lead { color: var(--text); }
.faint { color: var(--text-faint); font-size: var(--fs-sm); }

/* buttons */
.btn, .btn-secondary, .btn-ghost {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; min-height: var(--tap); padding: 14px 18px; margin-top: var(--sp-2);
  border-radius: var(--r); font-size: var(--fs-md); font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: filter var(--dur), background var(--dur);
}
.btn { background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--text-soft); min-height: 48px; font-weight: 500; }
.btn-help { background: var(--care); color: var(--care-ink); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the big help button on home */
.help-now {
  min-height: 120px; font-size: var(--fs-xl); border-radius: 28px;
  margin-top: var(--sp-4);
}

/* spacer pushes primary actions toward the thumb */
.spacer { flex: 1 1 auto; min-height: var(--sp-3); }

.stack > * + * { margin-top: var(--sp-2); }
.center { text-align: center; }

details.why { margin-top: var(--sp-2); color: var(--text-soft); font-size: var(--fs-sm); }
details.why summary { cursor: pointer; color: var(--accent); }
details.why p { font-size: var(--fs-sm); margin-top: var(--sp-1); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
