/* ============================================================
   Peekiva Couple Quiz — editorial, soft, playful, romantic.
   Mobile-first. Palette: warm white / dusty blush / powder pink
   / muted brown / soft charcoal. No neon, no gradients-as-crutch.
   ============================================================ */
:root {
  --paper: #faf6f1;
  --paper-deep: #f3ece3;
  --blush: #e9c8c2;
  --blush-soft: #f5e2dc;
  --blush-deep: #d9a9a1;
  --brown: #8a6f5c;
  --brown-deep: #6b5443;
  --ink: #2e2a26;
  --ink-soft: #5c554e;
  --line: #e7d9cc;
  --card: #fffdf9;
  --sage: #b9c4b1;
  --danger: #a44a3f;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(107, 84, 67, 0.12);
  --shadow-sm: 0 4px 14px rgba(107, 84, 67, 0.1);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* faint paper grain, no heavy decoration */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(138, 111, 92, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  z-index: 0;
}

main { flex: 1; position: relative; z-index: 1; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 20px 64px; }
.wrap-wide { max-width: 720px; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 720px; margin: 0 auto; padding: 18px 20px 6px;
  position: relative; z-index: 1;
}
.brand {
  font-family: var(--serif); font-size: 26px; font-weight: 600;
  letter-spacing: 0.02em; color: var(--ink); text-decoration: none;
}
.brand em { font-style: italic; color: var(--brown-deep); }
.header-link {
  font-size: 14px; color: var(--brown-deep); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  background: var(--card); min-height: 44px; display: inline-flex; align-items: center;
}
.header-link:active { transform: scale(0.97); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 8.5vw, 52px); letter-spacing: -0.01em; }
h1 em, h2 em { font-style: italic; color: var(--brown-deep); }
h2 { font-size: clamp(26px, 6.5vw, 36px); }
h3 { font-size: 22px; }
.sub { color: var(--ink-soft); font-size: 17px; margin: 0 0 24px; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brown-deep); background: var(--blush-soft);
  border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.center { text-align: center; }
.note { font-size: 14px; color: var(--ink-soft); }
.tiny { font-size: 13px; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { padding: 36px 0 8px; }
.hero .sub { font-size: 18px; }
.free-line {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 18px 0 30px; font-size: 14px; color: var(--brown-deep);
}
.free-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

/* steps: Create → Send → Answer → Discover */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin: 8px 0 34px; padding: 0; list-style: none;
}
.steps li {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 6px; text-align: center; font-size: 12.5px; color: var(--brown-deep);
}
.steps b { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); }
.steps .arrow { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 28px; border-radius: 999px;
  font-size: 16.5px; font-weight: 600; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--blush-deep); outline-offset: 2px;
}
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #453e37; }
.btn-blush { background: var(--blush); color: var(--ink); }
.btn-blush:hover { background: var(--blush-deep); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brown); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #e3bdb6; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.btn-row { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
@media (min-width: 480px) { .btn-row.split { flex-direction: row; } .btn-row.split .btn { width: auto; flex: 1; } }

/* option buttons (answers) */
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 58px; padding: 14px 16px; margin: 0 0 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 16px; color: var(--ink); cursor: pointer; text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.opt:hover { border-color: var(--blush-deep); background: #fff8f4; }
.opt:active { transform: scale(0.99); }
.opt .key {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: var(--blush-soft); color: var(--brown-deep);
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.opt.picked { border-color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }

/* ---------- cards & forms ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; margin: 0 0 16px; box-shadow: var(--shadow-sm);
}
.card.blush { background: linear-gradient(180deg, #fdf3ee, var(--card)); }
label.f-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--brown-deep); margin: 18px 0 8px; letter-spacing: 0.02em; }
input[type="text"], textarea, select {
  width: 100%; font-size: 16px; font-family: var(--sans); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 16px; min-height: 52px;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b3a696; }
.char-count { font-size: 12.5px; color: var(--ink-soft); text-align: right; margin-top: 4px; }

.q-card { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px 16px; margin-bottom: 14px; }
.q-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.q-num { font-family: var(--serif); font-size: 19px; font-style: italic; color: var(--brown-deep); }
.q-tools { display: flex; gap: 6px; }
.icon-btn {
  min-width: 40px; min-height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--brown-deep); font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 10px;
}
.icon-btn:active { transform: scale(0.95); }
.opt-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-edit .key {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--blush-soft);
  color: var(--brown-deep); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.opt-edit input { min-height: 48px; }
.link-btn { background: none; border: none; color: var(--brown-deep); font-size: 14.5px; cursor: pointer; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }
.add-btn {
  width: 100%; min-height: 52px; border: 1.5px dashed var(--blush-deep); border-radius: var(--radius);
  background: transparent; color: var(--brown-deep); font-size: 15.5px; font-weight: 600; cursor: pointer;
}

/* template grid */
.tpl-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 20px 0; }
@media (min-width: 480px) { .tpl-grid { grid-template-columns: 1fr 1fr; } }
.tpl {
  text-align: left; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px; cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease;
  font-family: var(--sans);
}
.tpl:hover { border-color: var(--blush-deep); }
.tpl:active { transform: scale(0.98); }
.tpl b { display: block; font-family: var(--serif); font-size: 20px; margin-bottom: 4px; color: var(--ink); }
.tpl span { font-size: 13.5px; color: var(--ink-soft); }
.tpl .count { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--brown-deep); background: var(--blush-soft); border-radius: 999px; padding: 3px 10px; }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
.progress i { display: block; height: 100%; background: var(--brown); border-radius: 999px; transition: width 0.3s ease; }
.q-count { font-size: 13.5px; color: var(--ink-soft); letter-spacing: 0.06em; text-transform: uppercase; }
.q-text { font-family: var(--serif); font-size: clamp(24px, 6vw, 32px); margin: 10px 0 22px; }
.fade-in { animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } * { transition: none !important; } }

/* ---------- share box ---------- */
.share-box {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 24px 20px; margin: 20px 0; word-break: break-all;
}
.share-box .link { font-size: 16px; font-weight: 600; color: #fff; }
.save-warning {
  border: 1.5px solid var(--blush-deep); background: #fdf1ec; border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0; font-size: 14.5px; color: var(--brown-deep);
}

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 22px; }
.stat span { font-size: 12px; color: var(--ink-soft); }
.answer-card { border-left: 4px solid var(--blush); }
.answer-card .who { font-size: 13px; color: var(--brown-deep); font-weight: 600; margin-bottom: 2px; }
.answer-card .ans { font-size: 16.5px; margin: 6px 0; }
.answer-card .time { display: inline-block; font-size: 12.5px; background: var(--paper-deep); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft); }
.slow-list { list-style: none; margin: 0; padding: 0; }
.slow-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.slow-list li:last-child { border-bottom: none; }
.slow-list .t { white-space: nowrap; color: var(--brown-deep); font-weight: 600; }
.resp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; text-decoration: none; color: var(--ink);
}
.resp-row:active { transform: scale(0.99); }
.resp-row b { display: block; font-size: 16px; }
.resp-row span { font-size: 13px; color: var(--ink-soft); }
.resp-row .go { color: var(--brown-deep); font-size: 20px; }

/* ---------- toast / error ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 13px 22px; border-radius: 999px;
  font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.alert { background: #fbeae7; border: 1px solid #e3bdb6; color: var(--danger); border-radius: 14px; padding: 14px 16px; margin: 16px 0; font-size: 14.5px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 20px 40px;
  text-align: center; position: relative; z-index: 1;
}
.site-footer p { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0; }
.site-footer a { color: var(--brown-deep); }
.peekiva-cta {
  display: inline-block; margin-top: 12px; padding: 12px 26px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink);
}

/* desktop breathing room */
@media (min-width: 768px) {
  .wrap { padding-bottom: 90px; }
  .hero { padding-top: 56px; }
  .card, .q-card, .share-box { padding-left: 26px; padding-right: 26px; }
}
