/* Closer — candlelit dusk. Two warm accents (amber = warmth/attention,
   rose = bond), sage = in good standing. Fraunces display, Hanken Grotesk body. */
:root {
  --bg: #14121c;
  --bg-2: #191622;
  --surface: #201c2c;
  --surface-2: #2a2539;
  --line: #342e44;
  --ink: #ede7f2;
  --muted: #9a93ad;
  --faint: #6b6480;
  --amber: #f2b880;
  --amber-deep: #e8955a;
  --rose: #e58aa0;
  --rose-deep: #d96e8c;
  --sage: #8fb7a2;
  --danger: #e57b7b;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.75);
  --tab-h: 66px;
  --maxw: 620px;
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
/* the ambient candle glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 42% at 30% 8%, rgba(242, 184, 128, 0.10), transparent 70%),
    radial-gradient(55% 40% at 82% 22%, rgba(229, 138, 160, 0.10), transparent 70%),
    radial-gradient(90% 60% at 50% 108%, rgba(20, 18, 28, 0.6), transparent);
  pointer-events: none;
  z-index: 0;
}

button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amber); }

.display { font-family: "Fraunces", Georgia, serif; }

/* --- App shell ----------------------------------------------------------- */
#app {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 18px calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 2px 10px;
}
.wordmark {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 45%, var(--amber), transparent 62%),
    radial-gradient(circle at 62% 55%, var(--rose), transparent 62%);
  box-shadow: 0 0 22px -4px rgba(242, 184, 128, 0.55);
}
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 17px;
  transition: background 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

/* --- Views --------------------------------------------------------------- */
.view { display: none; animation: fade 0.28s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  margin: 22px 2px 10px;
}
h1.page { font-family: "Fraunces", serif; font-weight: 600; font-size: 30px; margin: 4px 2px 2px; letter-spacing: -0.015em; }
.lede { color: var(--muted); margin: 0 2px 8px; font-size: 15px; }

/* --- Contact field (signature) ------------------------------------------ */
.field-wrap {
  position: relative;
  margin: 8px -18px 6px;
  height: 300px;
  overflow: hidden;
  border-radius: 0;
  -webkit-mask-image: radial-gradient(120% 120% at 50% 40%, #000 62%, transparent);
          mask-image: radial-gradient(120% 120% at 50% 40%, #000 62%, transparent);
}
#field { width: 100%; height: 100%; display: block; }
.field-hint {
  position: absolute; left: 0; right: 0; bottom: 8px; text-align: center;
  color: var(--faint); font-size: 12px; letter-spacing: 0.04em;
}

/* --- Cards --------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

.nudge {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-top: 10px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r-md);
}
.nudge.birthday { border-left-color: var(--rose); }
.nudge .glyph {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(242, 184, 128, 0.12);
}
.nudge.birthday .glyph { background: rgba(229, 138, 160, 0.14); }
.nudge .body { flex: 1; min-width: 0; }
.nudge .who { font-weight: 600; }
.nudge .why { color: var(--muted); font-size: 13.5px; }
.nudge .go {
  flex: none; padding: 8px 13px; border-radius: 999px;
  background: var(--ink); color: #221c2a; font-weight: 600; font-size: 13px;
  border: none;
}
.nudge .go:active { transform: scale(0.96); }

/* --- Calibration meter --------------------------------------------------- */
.meter { margin-top: 10px; }
.meter .track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter .fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--rose));
  transition: width 0.5s ease;
}
.meter .cap { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 13px; }

.empty {
  text-align: center; color: var(--muted); padding: 40px 16px;
}
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* --- People list --------------------------------------------------------- */
.person-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 4px; border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: none; }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-family: "Fraunces", serif;
  font-weight: 600; font-size: 18px; color: #241d2b;
}
.person-row .info { flex: 1; min-width: 0; }
.person-row .nm { font-weight: 600; }
.person-row .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.pip { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* --- Compare ------------------------------------------------------------- */
.compare-q { text-align: center; color: var(--muted); margin: 10px 0 4px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.choice {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 14px; text-align: center; transition: transform 0.1s, border-color 0.15s;
}
.choice:hover { border-color: var(--amber); }
.choice:active { transform: scale(0.97); }
.choice .avatar { width: 62px; height: 62px; font-size: 26px; margin: 0 auto 12px; }
.choice .nm { font-weight: 600; font-size: 17px; }
.choice .cat { color: var(--muted); font-size: 12.5px; }
.compare-mid { text-align: center; margin: 14px 0; }
.eqbtn {
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600;
}
.eqbtn:hover { border-color: var(--sage); }
.skip { display: block; margin: 20px auto 0; background: none; border: none; color: var(--faint); font-size: 13px; }

/* --- Check-in (post-comparison contact update) --------------------------- */
.checkin .chan { margin-top: 14px; }
.checkin .chan-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.checkin .chan-head .lbl { font-weight: 600; }
.checkin .chan-head .ago { color: var(--faint); font-size: 12.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 7px; }
.quick button {
  padding: 7px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.quick button.on { background: var(--amber); border-color: var(--amber); color: #241d2b; font-weight: 600; }
.quick input[type="date"] { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }

/* --- Forms --------------------------------------------------------------- */
label.f { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--amber); }
textarea.input { min-height: 74px; resize: vertical; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 11px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
}
.seg button.on { border-color: var(--amber); color: var(--ink); background: var(--surface); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: var(--r-md); border: none;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: #2a1f16; font-weight: 700; font-size: 15px; margin-top: 20px;
}
.btn:active { transform: scale(0.99); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: none; border: 1px solid var(--danger); color: var(--danger); }

/* --- Modal / sheet ------------------------------------------------------- */
.scrim {
  position: fixed; inset: 0; background: rgba(8, 6, 14, 0.6); backdrop-filter: blur(3px);
  z-index: 40; display: none; align-items: flex-end; justify-content: center;
}
.scrim.open { display: flex; }
.sheet {
  width: 100%; max-width: var(--maxw); max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(30px + env(safe-area-inset-bottom));
  animation: up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.sheet h2 { font-family: "Fraunces", serif; font-weight: 600; margin: 4px 0 2px; }
.sheet .grip { width: 42px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }

/* detail sheet contact lines */
.detail-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-line .glyph { width: 36px; text-align: center; font-size: 18px; }
.detail-line .txt { flex: 1; }
.detail-line .set { font-size: 13px; color: var(--amber); background: none; border: none; }

/* --- Tab bar ------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(21, 18, 28, 0.86);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
}
.tabbar .inner { max-width: var(--maxw); margin: 0 auto; width: 100%; display: flex; }
.tab {
  flex: 1; background: none; border: none; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; padding-top: 8px;
}
.tab .ic { font-size: 20px; line-height: 1; }
.tab.on { color: var(--ink); }
.tab.on .ic { filter: drop-shadow(0 0 10px rgba(242, 184, 128, 0.5)); }

/* the big center compare button */
.tab.compare-tab .ic {
  width: 46px; height: 46px; margin-top: -18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; color: #241d2b;
  background: radial-gradient(circle at 38% 40%, var(--amber), var(--amber-deep));
  box-shadow: 0 8px 22px -6px rgba(242, 184, 128, 0.6);
}
.tab.compare-tab { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.muted-note { color: var(--faint); font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { margin-top: 12px; }

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