/* Layout: a dating-app profile in one narrow column. The first card is the match card
   (photo, verdict, address, every action); the profile scrolls under it; a bottom bar
   keeps "share location" and "call" in reach once that card has scrolled away.
   Palette from Charlotte herself: seal-point ink, ice-blue eyes, a ginger tortie fleck. */
:root {
  --paper: #f3f1ef;
  --surface: #ffffff;
  --ink: #241b17;
  --ink-2: #5f544e;
  --line: #e3dcd6;
  --eye: #2d6cab;
  --eye-wash: #e4edf7;
  --on-eye: #ffffff;
  --ginger: #a4581d;
  --seal: #241b17;
  --on-seal: #f3ece6;
  --alarm: #bf3529;
  --alarm-wash: #fbeae7;
  --ok: #2e7d4f;
  --shade: rgba(36, 27, 23, 0.08);

  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15110f;
    --surface: #211b18;
    --ink: #f2ece7;
    --ink-2: #b7aca4;
    --line: #3b322d;
    --eye: #8fbde9;
    --eye-wash: #1d2a37;
    --on-eye: #0e1620;
    --ginger: #e8a265;
    --seal: #0b0908;
    --on-seal: #f2ece7;
    --alarm: #ff8c7e;
    --alarm-wash: #3a1d19;
    --ok: #7fd3a0;
    --shade: rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15110f;
  --surface: #211b18;
  --ink: #f2ece7;
  --ink-2: #b7aca4;
  --line: #3b322d;
  --eye: #8fbde9;
  --eye-wash: #1d2a37;
  --on-eye: #0e1620;
  --ginger: #e8a265;
  --seal: #0b0908;
  --on-seal: #f2ece7;
  --alarm: #ff8c7e;
  --alarm-wash: #3a1d19;
  --ok: #7fd3a0;
  --shade: rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font-body);
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding-block: max(12px, env(safe-area-inset-top, 0px)) calc(110px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--eye); }
:focus-visible { outline: 3px solid var(--eye); outline-offset: 2px; }

.small { font-size: 0.9375rem; color: var(--ink-2); }

/* Lost mode swaps calm copy for the urgent version */
.only-lost { display: none; }
html.lost .only-lost { display: revert; }
html.lost .only-calm { display: none; }

/* ---------- The match card ---------- */
.match {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px var(--shade), 0 10px 30px var(--shade);
}
.match-photo { position: relative; }
.match-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 46svh;
  min-height: 260px;
  object-fit: cover;
  object-position: 50% 72%;
}
.match-photo figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 64px 18px 16px;
  color: #fff;
  background: linear-gradient(to top, rgba(20, 13, 10, 0.8), rgba(20, 13, 10, 0));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.match-photo h1 { font-size: 2.6rem; line-height: 0.95; font-weight: 800; }
.match-photo h1 span { font-weight: 500; opacity: 0.85; }
.distance { font-size: 0.9375rem; margin-top: 6px; opacity: 0.95; }
.verified {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 0.8125rem/1 var(--font-body);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #241b17;
}
.verified svg { width: 14px; height: 14px; color: #2d6cab; }

.match-body { padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 14px; }

.verdict h2 { font-size: 2.1rem; line-height: 1.02; font-weight: 800; }
.verdict h2 em { font-style: normal; color: var(--eye); }
html.lost .verdict h2 em { color: var(--alarm); }
.verdict p { margin-top: 8px; }
.home-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 10px; }
.home-line strong { font-weight: 700; }
.home-line a { font-weight: 700; text-decoration: none; white-space: nowrap; }

html.lost .match { outline: 3px solid var(--alarm); }
.lost-flag {
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--alarm);
  background: var(--alarm-wash);
  padding: 7px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--eye);
  background: transparent;
  color: var(--eye);
  font: 700 1.0625rem/1.15 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: default; }
.btn-main { background: var(--eye); color: var(--on-eye); width: 100%; font-size: 1.125rem; min-height: 56px; }
html.lost .btn-main { background: var(--alarm); border-color: var(--alarm); }
.btn-main.sent { background: var(--ok); border-color: var(--ok); }

.locate-note { text-align: center; margin-top: -6px; }
.status { font-weight: 700; text-align: center; }
.status:empty { display: none; }
.status.ok { color: var(--ok); }
.status.err { color: var(--alarm); }

/* The two people */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px; min-width: 0; }
.person h3 { font-size: 1.3rem; font-weight: 700; }
.person-number { color: var(--ink-2); font-size: 0.9375rem; margin: 2px 0 10px; user-select: all; }
.person-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.person-actions .btn { min-height: 44px; padding: 8px; font-size: 0.9375rem; }
.person-actions .btn-call { background: var(--eye); color: var(--on-eye); }
html.lost .person-actions .btn-call { background: var(--alarm); border-color: var(--alarm); }
html.lost .person-actions .btn { border-color: var(--alarm); }
html.lost .person-actions .btn:not(.btn-call) { color: var(--alarm); }

/* Note */
.note { border-top: 1.5px dashed var(--line); padding-top: 12px; }
.note summary { cursor: pointer; font-weight: 700; color: var(--eye); list-style: none; display: flex; align-items: center; gap: 8px; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: '+'; font-size: 1.3rem; line-height: 1; margin-left: auto; }
.note[open] summary::after { content: '–'; }
.note form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.note textarea, .note input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.note textarea { resize: vertical; min-height: 88px; }
.note-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- The profile ---------- */
.section-label {
  font: 700 0.8125rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 14px 4px -2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 1.5px; background: var(--line); }

.prompt { background: var(--surface); border-radius: var(--radius); padding: 18px 18px 20px; }
.prompt-label {
  font: 700 0.8125rem/1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ginger);
  margin-bottom: 8px;
}
.prompt-answer { font: 700 1.5rem/1.22 var(--font-display); letter-spacing: -0.01em; text-wrap: pretty; }
.prompt-seal { background: var(--seal); color: var(--on-seal); }
.prompt-seal .prompt-label { color: var(--eye); }
:root:not([data-theme="dark"]) .prompt-seal .prompt-label { color: #9cc6ef; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 0.9375rem; font-weight: 700; }

.shot { margin: 0; }
.shot img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius); }
.shot figcaption { font: 600 1.15rem/1.3 var(--font-display); padding: 10px 4px 0; }

.truths { margin: 0; padding-left: 1.4em; font: 700 1.25rem/1.3 var(--font-display); display: flex; flex-direction: column; gap: 6px; }
.reveal { margin-top: 12px; }
.reveal summary { cursor: pointer; color: var(--eye); font-weight: 700; }
.reveal p { margin-top: 6px; }

.footer { text-align: center; color: var(--ink-2); font-size: 0.875rem; padding: 12px 8px 0; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Bottom bar ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding-top: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface);
  border-top: 1.5px solid var(--line);
  box-shadow: 0 -6px 20px var(--shade);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}
.bar.show { transform: none; }
.bar-inner { max-width: 34rem; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; }
.bar .btn { min-height: 48px; padding: 8px 10px; font-size: 0.9375rem; }
.bar .btn-main { font-size: 0.9375rem; min-height: 48px; }

@media (max-width: 370px) {
  .people, .note-row { grid-template-columns: 1fr; }
  .match-photo h1 { font-size: 2.2rem; }
  .verdict h2 { font-size: 1.85rem; }
  .bar-inner { grid-template-columns: 1fr 1fr; }
  .bar .bar-shaun { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bar { transition: none; }
}
