/* =============================================================
   Women & AI — warm editorial palette
   ============================================================= */

:root {
  --ivory: #fdfaf5;
  --cream: #f6ede1;
  --paper: #fffdfa;

  --rose: #b5566c;
  --rose-deep: #8d3b50;
  --rose-soft: #f2dfe2;
  --rose-mist: #fbf1f0;

  --ink: #392c28;
  --ink-soft: #6d5c55;
  --ink-faint: #9c8b83;
  --rule: #e6d9cc;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --sans: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --shell: 41rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  background-image:
    radial-gradient(70rem 40rem at 82% -12%, var(--rose-mist), transparent 62%),
    radial-gradient(52rem 34rem at -8% 108%, var(--cream), transparent 66%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- progress ---------- */

#progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: rgba(181, 86, 108, 0.13);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
#progress.on {
  opacity: 1;
}
#progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rose), var(--rose-deep));
  transition: width 0.5s var(--ease);
}

/* ---------- layout ---------- */

#app {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 4.5rem 1.375rem 7rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen {
  animation: rise 0.5s var(--ease) both;
}
.screen.leaving {
  animation: sink 0.26s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes sink {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ---------- type ---------- */

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
  font-weight: 600;
}
.eyebrow .part {
  color: var(--rose);
}
.eyebrow .count {
  margin-left: auto;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 8.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}
h1 .lede {
  display: block;
  font-style: italic;
  color: var(--rose-deep);
  font-size: 0.62em;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.prompt {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 5.4vw, 2.05rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.help {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1.9rem;
  max-width: 34rem;
}

.intro-body p {
  font-size: 1.09rem;
  line-height: 1.72;
  color: var(--ink-soft);
  margin: 0 0 1.15rem;
  max-width: 33rem;
}
.intro-body p:first-child {
  color: var(--ink);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
  max-width: 5rem;
}

/* ---------- options ---------- */

.options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1.9rem;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.opt:hover {
  border-color: var(--rose);
  transform: translateX(3px);
}
.opt:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}
.opt[aria-pressed="true"],
.opt.on {
  background: var(--rose-mist);
  border-color: var(--rose);
  box-shadow: 0 1px 12px rgba(181, 86, 108, 0.1);
}
.opt.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.mark {
  flex: 0 0 auto;
  width: 1.18rem;
  height: 1.18rem;
  margin-top: 0.24rem;
  border: 1.5px solid var(--ink-faint);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.opt.check .mark {
  border-radius: 5px;
}
.opt[aria-pressed="true"] .mark {
  border-color: var(--rose);
  background: var(--rose);
}
.opt[aria-pressed="true"] .mark::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 0.13rem;
  width: 0.28rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(43deg);
}
.opt .label {
  flex: 1;
}
.opt .rank {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rose);
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* ---------- fields ---------- */

.field {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 0.95rem 1.1rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  resize: vertical;
}
.field::placeholder {
  color: var(--ink-faint);
}
.field:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(181, 86, 108, 0.12);
}
textarea.field {
  min-height: 9.5rem;
  line-height: 1.6;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.9rem;
}
.stack label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: -0.3rem;
  font-weight: 600;
}

.sentence-lead {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 4.4vw, 1.6rem);
  line-height: 1.35;
  color: var(--rose-deep);
  font-style: italic;
  margin: 0 0 0.75rem;
}

.other-wrap {
  margin: 0.55rem 0 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.32s var(--ease), opacity 0.32s var(--ease),
    margin 0.32s var(--ease);
}
.other-wrap.open {
  max-height: 14rem;
  opacity: 1;
  margin-top: 0.55rem;
}

/* ---------- actions ---------- */

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 2.1rem;
  background: var(--rose);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
  box-shadow: 0 2px 14px rgba(141, 59, 80, 0.18);
}
.btn:hover {
  background: var(--rose-deep);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 3px;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-quiet {
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.btn-quiet:hover {
  color: var(--rose);
  text-decoration-color: var(--rose);
}
.btn-quiet.right {
  margin-left: auto;
}

.note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 1.4rem;
}

/* ---------- back / footer ---------- */

.backbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 1.375rem calc(0.9rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ivory) 62%, transparent);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.backbar.on {
  opacity: 1;
  pointer-events: auto;
}
.backbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.backbar .hint {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
@media (max-width: 640px) {
  .backbar .hint {
    display: none;
  }
}

/* ---------- outro ---------- */

.outro h1 {
  color: var(--rose-deep);
}
.outro p {
  font-size: 1.12rem;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: 32rem;
}
.signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink);
  margin-top: 1.8rem;
}
.petal {
  width: 34px;
  height: 34px;
  margin-bottom: 1.6rem;
  color: var(--rose);
  opacity: 0.85;
}

.status {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-top: 1.2rem;
  min-height: 1.4em;
}
.status.err {
  color: var(--rose-deep);
}

/* ---------- motion / print ---------- */

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

@media (min-width: 700px) {
  #app {
    padding-top: 6rem;
  }
}
