/* ============================================================
   CoupleSpark — warm, tactile relationship app
   Palette: blush / coral / cream, soft rounded cards
   Type: Fraunces (display serif) + Outfit (clean sans)
   ============================================================ */

:root {
  /* Core palette */
  --cream: #FDF6F0;
  --cream-deep: #F8EAE0;
  --blush: #F7D9D2;
  --blush-soft: #FBE7E2;
  --coral: #C84C36;
  --coral-deep: #A83A28;
  --coral-soft: #F2A491;
  --plum: #6E3B4E;
  --plum-soft: #805164;
  --gold: #E8B04B;
  --sage: #5F795B;
  --ink: #3B2A2F;
  --ink-soft: #6E5A5F;
  --line: #EAD7CD;
  --white: #FFFFFF;

  /* Shadows — soft, warm, layered */
  --shadow-sm: 0 1px 2px rgba(110, 59, 78, 0.04), 0 2px 6px rgba(232, 117, 91, 0.06);
  --shadow-md: 0 4px 10px rgba(110, 59, 78, 0.06), 0 12px 28px rgba(232, 117, 91, 0.10);
  --shadow-lg: 0 10px 24px rgba(110, 59, 78, 0.08), 0 28px 60px rgba(232, 117, 91, 0.16);
  --shadow-coral: 0 8px 20px rgba(232, 117, 91, 0.35);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

.skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 500;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--white);
  background: var(--plum);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(247, 217, 210, 0.55), transparent 38%),
    radial-gradient(circle at 88% 4%, rgba(232, 176, 75, 0.18), transparent 34%),
    radial-gradient(circle at 78% 92%, rgba(232, 117, 91, 0.12), transparent 42%);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--plum);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.serif { font-family: var(--font-display); }

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}

/* ============================================================
   Layout shell
   ============================================================ */
.shell { position: relative; z-index: 1; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Top nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(253, 246, 240, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--plum);
}
.brand .spark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--coral), var(--coral-deep));
  box-shadow: var(--shadow-coral);
  color: #fff;
  flex: none;
}
.brand .spark svg { width: 21px; height: 21px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.93rem;
  color: var(--ink-soft);
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { color: var(--plum); background: var(--blush-soft); }
.nav-link-settings { display: none; background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-link.active {
  color: #fff;
  background: linear-gradient(145deg, var(--coral), var(--coral-deep));
  box-shadow: var(--shadow-sm);
}

.nav-couple {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
  background: none;
  border-top: none; border-right: none; border-bottom: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border-radius: 0 12px 12px 0;
  transition: background 0.2s;
}
.nav-couple:hover { background: var(--blush-soft); }
.nav-gear { color: var(--ink-soft); display: grid; place-items: center; transition: color 0.2s, transform 0.3s; }
.nav-gear svg { width: 17px; height: 17px; }
.nav-couple:hover .nav-gear { color: var(--coral-deep); transform: rotate(40deg); }
.avatar-pair { display: flex; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  border: 2.5px solid var(--cream);
}
.avatar.a { background: linear-gradient(145deg, var(--coral), var(--coral-deep)); }
.avatar.b { background: linear-gradient(145deg, var(--plum-soft), var(--plum)); margin-left: -10px; }
.nav-couple small { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.2; }
.nav-couple strong { display: block; font-size: 0.88rem; color: var(--plum); }

/* Mobile menu toggle */
.nav-toggle { display: none; background: none; border: none; color: var(--plum); }
.nav-toggle { min-width: 44px; min-height: 44px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.96rem;
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(145deg, var(--coral), var(--coral-deep));
  color: #fff;
  box-shadow: var(--shadow-coral);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(232, 117, 91, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--white);
  color: var(--plum);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--coral-soft); }
.btn-soft {
  background: var(--blush-soft);
  color: var(--coral-deep);
}
.btn-soft:hover { background: var(--blush); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: 26px;
}
.card-soft {
  background: linear-gradient(160deg, var(--white), var(--blush-soft));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
.eyebrow svg { width: 14px; height: 14px; }

.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 8px 0 6px; }
.section-sub { color: var(--ink-soft); font-size: 1.02rem; max-width: 56ch; }
.ai-note {
  max-width: 72ch;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.55;
}

/* ============================================================
   Page header (inner pages)
   ============================================================ */
.page { padding: 40px 0 90px; }
.page-head { margin-bottom: 34px; }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onb-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}
.onb-card {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  padding: 44px;
  position: relative;
  overflow: hidden;
}
.onb-card::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 117, 91, 0.16), transparent 70%);
}
.onb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}
.onb-step { animation: fadeUp 0.5s var(--ease) both; }
.onb-card h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 10px; }
.onb-card p.lead { color: var(--ink-soft); font-size: 1.06rem; margin-bottom: 28px; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--plum);
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--coral);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(232, 117, 91, 0.13);
}
.field textarea { resize: vertical; min-height: 110px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.heart-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--coral-soft);
  margin: 4px 0 20px;
}
.heart-divider::before, .heart-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ============================================================
   HOME / DASHBOARD
   ============================================================ */
.hero-couple {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 0 10px;
}
.days-ring {
  position: relative;
  width: 220px; height: 220px;
  display: grid; place-items: center;
  margin-bottom: 6px;
}
.days-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.days-num {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 600;
  color: var(--coral-deep);
  line-height: 1;
}
.days-label { font-size: 0.84rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.couple-names { font-family: var(--font-display); font-size: 1.4rem; color: var(--plum); margin-top: 14px; }
.couple-names .amp { color: var(--coral); font-style: italic; }
.since-line { color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 14px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.stat-ico svg { width: 20px; height: 20px; }
.stat-ico.coral { background: var(--blush); color: var(--coral-deep); }
.stat-ico.plum { background: #EFE0E8; color: var(--plum); }
.stat-ico.gold { background: #FBEFD6; color: #B7841F; }
.stat-ico.sage { background: #E4ECE2; color: #5E7A5A; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--plum); line-height: 1; }
.stat-cap { font-size: 0.86rem; color: var(--ink-soft); margin-top: 5px; font-weight: 500; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}
.tile {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s var(--ease), box-shadow 0.24s;
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 50%, rgba(232, 117, 91, 0.05));
  opacity: 0;
  transition: opacity 0.24s;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--coral-soft); }
.tile:hover::before { opacity: 1; }
.tile-ico {
  width: 50px; height: 50px; border-radius: 15px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(145deg, var(--blush), var(--blush-soft));
  color: var(--coral-deep);
}
.tile-ico svg { width: 24px; height: 24px; }
.tile h3 { font-size: 1.28rem; margin-bottom: 6px; }
.tile p { color: var(--ink-soft); font-size: 0.95rem; }
.tile-go {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; color: var(--coral-deep); font-weight: 600; font-size: 0.9rem;
}
.tile-go svg { width: 15px; height: 15px; transition: transform 0.2s; }
.tile:hover .tile-go svg { transform: translateX(4px); }

/* ============================================================
   DAILY QUESTION
   ============================================================ */
.dq-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; align-items: start; }
.dq-card { position: relative; overflow: hidden; }
.dq-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: var(--plum);
  line-height: 1.2;
  margin: 14px 0 8px;
}
.dq-meta { display: flex; align-items: center; gap: 14px; color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 22px; }
.dq-chip {
  background: var(--blush-soft); color: var(--coral-deep);
  padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 0.8rem;
}

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.answer-box {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--cream);
  transition: border 0.2s, box-shadow 0.2s;
}
.answer-box.filled { background: var(--white); }
.answer-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.answer-head .avatar { width: 30px; height: 30px; font-size: 0.8rem; border-width: 2px; }
.answer-head strong { font-size: 0.95rem; color: var(--plum); }
.answer-text { color: var(--ink); font-size: 0.96rem; white-space: pre-wrap; }
.answer-empty { color: var(--plum-soft); font-style: italic; font-size: 0.92rem; }
.answer-box textarea {
  width: 100%; border: none; background: transparent; resize: vertical;
  min-height: 90px; font-family: inherit; font-size: 0.96rem; color: var(--ink);
}
.answer-box textarea:focus { outline: none; }

.streak-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FBEFD6, var(--blush-soft));
  border: 1px solid #F1E0C2;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.streak-flame { font-size: 1.8rem; }
.streak-banner strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--plum); }
.streak-banner small { color: var(--ink-soft); }

/* Heatmap */
.heatmap-wrap { margin-top: 8px; }
.heatmap {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 5px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--cream-deep);
  transition: transform 0.15s;
  cursor: default;
}
.hm-cell.l1 { background: #F6C9BD; }
.hm-cell.l2 { background: #EE9B83; }
.hm-cell.l3 { background: var(--coral); }
.hm-cell.l4 { background: var(--coral-deep); }
.hm-cell:hover { transform: scale(1.25); }
.hm-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 12px; font-size: 0.78rem; color: var(--ink-soft); }
.hm-legend .hm-cell { width: 13px; aspect-ratio: 1; cursor: default; }

/* ============================================================
   LOVE LANGUAGE QUIZ
   ============================================================ */
.quiz-shell { max-width: 720px; margin: 0 auto; }
.quiz-progress {
  height: 8px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; margin-bottom: 28px;
}
.quiz-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--coral-soft), var(--coral-deep)); border-radius: 999px; transform: scaleX(var(--progress, 0)); transform-origin: left; transition: transform 0.4s var(--ease); }
.quiz-qnum { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--coral-deep); font-weight: 700; }
.quiz-question { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2rem); color: var(--plum); margin: 8px 0 24px; }
.quiz-opts { display: flex; flex-direction: column; gap: 12px; }
.quiz-opt {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 1rem; color: var(--ink);
  transition: all 0.18s var(--ease);
}
.quiz-opt .dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--coral-soft); flex: none;
  display: grid; place-items: center; transition: all 0.18s;
}
.quiz-opt:hover { border-color: var(--coral); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.quiz-opt.sel { border-color: var(--coral); background: var(--blush-soft); }
.quiz-opt.sel .dot { background: var(--coral); border-color: var(--coral); }
.quiz-opt.sel .dot::after { content: ""; width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 28px; }

/* Quiz result */
.result-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; align-items: center; }
.result-headline { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 6px 0 10px; }
.result-headline em { font-style: italic; color: var(--coral-deep); }
.ll-bars { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.ll-bar-row { }
.ll-bar-top { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 5px; font-weight: 600; color: var(--plum); }
.ll-bar-top .pct { color: var(--ink-soft); font-weight: 500; }
.ll-bar-track { height: 12px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.ll-bar-fill { height: 100%; border-radius: 999px; transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease); }

/* ============================================================
   DATE IDEAS
   ============================================================ */
.di-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 8px; }
.opt-group .glabel { display: block; font-weight: 600; font-size: 0.84rem; color: var(--plum); margin-bottom: 9px; }
.opt-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--white); font-size: 0.9rem; font-weight: 500; color: var(--ink-soft);
  transition: all 0.16s var(--ease); display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { border-color: var(--coral-soft); color: var(--plum); }
.pill.sel { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: var(--shadow-sm); }

.di-results { margin-top: 30px; }
.di-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.di-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  animation: fadeUp 0.5s var(--ease) both;
  transition: transform 0.22s var(--ease), box-shadow 0.22s;
}
.di-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.di-emoji { font-size: 2rem; margin-bottom: 12px; }
.di-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.di-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 14px; }
.di-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.di-tag { font-size: 0.74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--blush-soft); color: var(--coral-deep); }
.di-cost { position: absolute; top: 22px; right: 22px; font-family: var(--font-display); font-weight: 600; color: var(--sage); }

/* Thinking loader */
.thinking {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 50px 0; gap: 18px; text-align: center;
}
.think-dots { display: flex; gap: 8px; }
.think-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--coral); animation: thinkPulse 1.2s infinite ease-out;
}
.think-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--coral-soft); }
.think-dots span:nth-child(3) { animation-delay: 0.3s; background: var(--gold); }
.thinking p { color: var(--plum); font-family: var(--font-display); font-size: 1.2rem; }
@keyframes thinkPulse { 0%, 70%, 100% { transform: scale(.72); opacity: .55; } 35% { transform: scale(1); opacity: 1; } }

/* ============================================================
   MEMORIES TIMELINE
   ============================================================ */
.mem-layout { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--coral-soft), var(--line));
}
.mem-item { position: relative; margin-bottom: 22px; animation: fadeUp 0.5s var(--ease) both; }
.mem-item::before {
  content: ""; position: absolute; left: -30px; top: 22px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--coral); border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--coral-soft);
}
.mem-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.mem-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.mem-date { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral-deep); font-weight: 700; }
.mem-card h3 { font-size: 1.25rem; margin: 5px 0 6px; }
.mem-card p { color: var(--ink-soft); font-size: 0.95rem; }
.mem-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; }
.mem-edit, .mem-del { background: none; border: none; color: var(--plum-soft); transition: color 0.2s; cursor: pointer; padding: 4px; line-height: 0; border-radius: 8px; }
.mem-edit, .mem-del { width: 40px; height: 40px; display: inline-grid; place-items: center; }
.mem-card:hover .mem-edit, .mem-card:hover .mem-del { color: var(--coral-soft); }
.mem-edit:hover { color: var(--plum); background: var(--blush-soft); }
.mem-del:hover { color: var(--coral-deep); background: var(--blush-soft); }
.mem-edit svg, .mem-del svg { width: 16px; height: 16px; }

/* ============================================================
   Misc: empty states, toasts, modal
   ============================================================ */
.empty {
  text-align: center; padding: 50px 24px; color: var(--ink-soft);
}
.empty .ico { font-size: 2.6rem; margin-bottom: 12px; }
.empty h3 { color: var(--plum); margin-bottom: 6px; }

#toast-stack { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--plum); color: #fff; padding: 13px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 500; font-size: 0.94rem;
  display: flex; align-items: center; gap: 9px;
  animation: toastIn 0.35s var(--ease);
  max-width: min(92vw, 640px);
  white-space: normal;
}
.toast svg { width: 17px; height: 17px; color: var(--coral-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-overlay {
  position: fixed; inset: 0; z-index: 150; display: none;
  background: rgba(59, 42, 47, 0.45); backdrop-filter: blur(4px);
  place-items: center; padding: 20px;
}
.modal-overlay.open { display: grid; animation: fadeIn 0.25s ease; }
.modal {
  background: var(--white); border-radius: var(--radius-xl); padding: 34px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.dialog-open { overflow: hidden; }
.modal h2 { font-size: 1.6rem; margin-bottom: 6px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Confetti */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* Stagger helper */
.stagger > * { animation: fadeUp 0.55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .dq-grid, .result-grid, .mem-layout { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .di-controls { grid-template-columns: 1fr; }
  .di-cards { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 6px; padding: 16px 24px 22px; background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .nav-link-settings { display: inline-flex; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: grid; place-items: center; margin-left: auto; }
  .nav-couple { display: none; }
  .answers { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .onb-card { padding: 30px 24px; }
  .field-row { grid-template-columns: 1fr; }
  .heatmap { grid-template-columns: repeat(13, 1fr); }
  .container { padding: 0 18px; }
}

/* ============================================================
   Language switcher (pill group) — added for i18n
   ============================================================ */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--cream-deep);
  border: 1px solid var(--line);
}
.lang-pill {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body, inherit);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--plum-soft);
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1;
  min-height: 36px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.lang-pill:hover { color: var(--plum); }
.lang-pill.active {
  color: #fff;
  background: linear-gradient(145deg, var(--coral), var(--coral-deep));
  box-shadow: 0 2px 8px rgba(212, 90, 65, .28);
}
/* nav variant sits left of the couple chip */
.nav-lang { margin-left: auto; }
/* onboarding variant: centered above the card content */
.onb-lang { margin: 0 auto 18px; }
@media (max-width: 720px) {
  .nav-lang { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  #confetti-canvas { display: none !important; }
}

@media (forced-colors: active) {
  .btn, .pill, .quiz-opt, .lang-pill, .hm-cell { border: 1px solid ButtonText; }
  .pill.sel, .quiz-opt.sel, .lang-pill.active { outline: 2px solid Highlight; }
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--plum) !important;
  outline-offset: 3px !important;
}
