/* ============================================================
   AMORE — Global Design System
   "Every soul deserves to feel it."
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --midnight:   #0f0a14;
  --plum:       #1e1020;
  --rose:       #e8a0b0;
  --dark-rose:  #d4537e;
  --blush:      #f5e6ea;
  --muted-rose: #c9849a;
  --dim-rose:   #8a5a6a;
  --border:     #2a1a24;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Inter', system-ui, sans-serif;

  --radius-card: 12px;
  --radius-pill: 999px;
  --transition:  0.22s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--midnight);
  color: var(--blush);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-ui); border: none; background: none; }

/* ── Scrollbar — hidden on all devices ──────────────────────── */
* { -ms-overflow-style: none; scrollbar-width: none; }
::-webkit-scrollbar { width: 0; display: none; }

/* ── Page system ────────────────────────────────────────────── */
.page { display: none; min-height: 100vh; padding-bottom: 110px; animation: fadeIn 0.35s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom nav ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--plum);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 max(12px, env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--dim-rose);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: color var(--transition);
  padding: 4px 8px; border-radius: var(--radius-pill);
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 20px; height: 20px; stroke-width: 1.5; }
.nav-item.active, .nav-item:hover { color: var(--rose); }
.nav-logo {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 400;
  letter-spacing: 0.14em; color: var(--rose);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.top-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}
.logo {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: 0.14em;
  color: var(--rose); font-weight: 400;
}

/* ── Typography ─────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 300; line-height: 1.25; color: var(--blush);
}
.display em { font-style: italic; color: var(--rose); }
.subtitle { font-size: 13px; color: var(--muted-rose); letter-spacing: 0.03em; line-height: 1.6; }
.section-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dim-rose); margin-bottom: 14px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.06em;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary { background: var(--rose); color: #4B1528; }
.btn-primary:hover { background: var(--dark-rose); color: #fff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--muted-rose); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--plum);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--dim-rose); }

/* ── Inputs ──────────────────────────────────────────────────── */
.input, .textarea {
  width: 100%; background: var(--plum);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 13px 16px; color: var(--blush);
  font-family: var(--font-ui); font-size: 16px;
  transition: border-color var(--transition); outline: none;
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--dim-rose); }
.input:focus, .textarea:focus { border-color: var(--muted-rose); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted-rose); letter-spacing: 0.06em; margin-bottom: 7px;
}
.form-group { margin-bottom: 18px; }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-wrap { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 18px 0; }
.progress-bar { height: 100%; background: var(--rose); border-radius: 2px; transition: width 0.5s ease; }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; color: var(--rose); flex-shrink: 0;
}

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 11px;
  font-weight: 500; letter-spacing: 0.05em;
  border: 1px solid var(--border); color: var(--muted-rose);
}

/* ── Spacing helpers ─────────────────────────────────────────── */
.container { padding: 0 20px; }
.section { margin-top: 32px; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up        { animation: fadeUp 0.55s ease both; }
.fade-up-delay  { animation: fadeUp 0.55s 0.15s ease both; }
.fade-up-delay2 { animation: fadeUp 0.55s 0.3s ease both; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.18); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.10); }
}
.heartbeat { animation: heartbeat 1.6s ease infinite; display: inline-block; }

.dots::after { content: ''; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots {
  0%   { content: ''; }   25%  { content: '.'; }
  50%  { content: '..'; } 75%  { content: '...'; }
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--plum); border: 1px solid var(--rose);
  color: var(--rose); padding: 11px 22px;
  border-radius: var(--radius-pill); font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease; z-index: 200; white-space: nowrap;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── HOME ───────────────────────────────────────────────────── */
.hero { padding: 28px 20px 0; }
.hero-greeting {
  font-size: 12px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--dim-rose); margin-bottom: 10px;
}

.daily-prompt {
  background: linear-gradient(135deg, #1a0e22 0%, #221228 100%);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 22px; position: relative; overflow: hidden;
}
.daily-prompt::before {
  content: '❝'; position: absolute; top: 10px; right: 16px;
  font-size: 40px; color: var(--border);
  font-family: var(--font-display); line-height: 1;
}
.prompt-label {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dark-rose); margin-bottom: 10px;
}
.prompt-text {
  font-family: var(--font-display); font-size: 18px;
  font-style: italic; font-weight: 300;
  color: var(--blush); line-height: 1.5;
}

.features-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-top: 14px;
}
.feature-card {
  background: var(--plum); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 18px 14px;
  cursor: pointer; transition: all var(--transition); text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 120px;
}
.feature-card:hover { border-color: var(--dim-rose); transform: translateY(-2px); }
.feature-card:active { transform: scale(0.98); }
.feature-icon { font-size: 20px; margin-bottom: 10px; display: block; }
.feature-name { font-size: 13px; font-weight: 500; color: var(--blush); margin-bottom: 4px; }
.feature-desc {
  font-size: 11px; color: var(--dim-rose);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ─── QUIZ ───────────────────────────────────────────────────── */
.quiz-step { font-size: 11px; color: var(--dim-rose); letter-spacing: 0.1em; }
.quiz-question {
  font-family: var(--font-display); font-size: 20px;
  font-weight: 300; color: var(--blush);
  line-height: 1.4; padding: 20px 20px 0;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.quiz-option {
  background: var(--plum); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px 18px;
  text-align: left; color: var(--blush); font-size: 14px;
  line-height: 1.45; transition: all var(--transition);
  cursor: pointer; width: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.quiz-option:active { transform: scale(0.99); }
.quiz-option:hover { border-color: var(--muted-rose); color: var(--rose); }
.quiz-option.selected { border-color: var(--rose); background: #2a1228; color: var(--rose); }

.result-screen { text-align: center; padding: 32px 24px; }
.result-icon { font-size: 52px; margin-bottom: 16px; }
.result-type {
  font-family: var(--font-display); font-size: 28px;
  color: var(--rose); font-style: italic; margin-bottom: 8px;
}
.result-desc {
  font-size: 14px; color: var(--muted-rose);
  line-height: 1.7; max-width: 320px;
  margin: 0 auto 28px;
}
.result-traits {
  display: flex; gap: 8px;
  justify-content: center; flex-wrap: wrap; margin-bottom: 32px;
}

/* ─── LETTER ─────────────────────────────────────────────────── */
.style-selector { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.style-btn {
  padding: 8px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); font-size: 12px;
  color: var(--muted-rose); background: var(--plum);
  cursor: pointer; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.style-btn.active { border-color: var(--rose); color: var(--rose); background: #2a1228; }

.letter-output {
  background: var(--plum); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px;
  margin: 0 20px 20px; display: none; animation: fadeIn 0.6s ease;
}
.letter-output.visible { display: block; }
.letter-output-text {
  font-family: var(--font-display); font-size: 17px;
  font-weight: 300; line-height: 1.8;
  color: var(--blush); white-space: pre-wrap;
}
.letter-actions { display: flex; gap: 10px; margin-top: 16px; }
.generating {
  display: none; text-align: center; padding: 32px;
  color: var(--muted-rose); font-family: var(--font-display);
  font-style: italic; font-size: 16px;
}
.generating.visible { display: block; }

/* ─── MATCH ──────────────────────────────────────────────────── */
.match-list { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.match-card {
  background: var(--plum); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.match-card:hover { border-color: var(--muted-rose); transform: translateX(3px); }
.match-card:active { transform: scale(0.99); }
.match-info { flex: 1; min-width: 0; }
.match-name {
  font-size: 15px; font-weight: 500;
  color: var(--blush); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-desc {
  font-size: 12px; color: var(--dim-rose); margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-bar-wrap { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.match-bar {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--muted-rose), var(--rose));
  width: 0; transition: width 1.2s cubic-bezier(0.22,1,0.36,1);
}
.match-pct {
  font-size: 22px; font-family: var(--font-display);
  color: var(--rose); font-weight: 300;
  min-width: 52px; text-align: right; flex-shrink: 0;
}

/* ─── STORIES ────────────────────────────────────────────────── */
.stories-list { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.story-card {
  background: var(--plum); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px;
  transition: border-color var(--transition);
}
.story-card:hover { border-color: var(--dim-rose); }
.story-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.story-couple { flex: 1; min-width: 0; }
.story-names {
  font-size: 14px; font-weight: 500; color: var(--blush);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.story-duration { font-size: 11px; color: var(--dim-rose); margin-top: 2px; }
.story-text {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 300; font-style: italic;
  color: var(--muted-rose); line-height: 1.7; margin-bottom: 16px;
}
.story-footer { display: flex; align-items: center; justify-content: flex-end; }
.like-btn {
  display: flex; align-items: center; gap: 6px;
  color: var(--dim-rose); font-size: 13px;
  transition: color var(--transition);
  padding: 8px 12px; border-radius: var(--radius-pill);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.like-btn:hover, .like-btn.liked { color: var(--rose); }
.like-btn svg { width: 16px; height: 16px; }
.like-btn.liked svg { fill: var(--rose); stroke: var(--rose); }

/* ─── Mobile specific ────────────────────────────────────────── */
@media (max-width: 380px) {
  .display { font-size: clamp(22px, 6vw, 30px); }
  .features-grid { gap: 8px; }
  .feature-card { padding: 14px 12px; min-height: 110px; }
  .feature-name { font-size: 12px; }
  .nav-item { font-size: 9px; padding: 4px 6px; }
  .quiz-question { font-size: 18px; }
}

/* ─── Responsive desktop ─────────────────────────────────────── */
@media (min-width: 500px) {
  .hero, .quiz-question, .quiz-options,
  .letter-form, .letter-output, .match-list, .stories-list,
  .container { max-width: 500px; margin-left: auto; margin-right: auto; }
  .top-bar {
    max-width: 500px; margin-left: auto;
    margin-right: auto; padding-left: 0; padding-right: 0;
  }
  .feature-desc { -webkit-line-clamp: 3; }
}

@media (min-width: 768px) {
  .nav { max-width: 500px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
  .page { padding-bottom: 120px; }
}