:root {
  --paper: #FFFFFF;
  --paper-alt: #F6F7FB;
  --ink: #1B2559;
  --ink-muted: #5B6386;
  --rule: rgba(27, 37, 89, 0.14);
  --accent: #E8264F;
  --accent-2: #3B3BE8;
  --accent-wash: #FFE8EC;
  --on-accent: #FFFFFF;
  --rule-on-accent: rgba(255, 255, 255, 0.24);
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

html { scrollbar-color: var(--accent) var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.on-band :focus-visible,
.on-accent-scope :focus-visible {
  outline-color: var(--on-accent);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- shared utilities ---------- */
.measure { max-width: 68ch; }
.column { max-width: 720px; }
.breakout { max-width: 1040px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.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;
}
hr.rule { border: 0; border-top: 1px solid var(--rule); }

.band-label {
  display: block;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.on-band .band-label { color: var(--on-accent); }

.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
}

.chip-band {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
}

mark {
  background: var(--accent-wash);
  color: var(--ink);
  padding: 0 3px;
  margin: -1px 0;
  font-weight: inherit;
  font-style: inherit;
}

.link-accent {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: opacity 160ms ease;
}
.link-accent:hover { opacity: 0.7; }

.link-plain { color: var(--ink); transition: color 160ms ease; }
.link-plain:hover { color: var(--accent); }

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: opacity 150ms ease;
}
.btn-accent:hover { opacity: 0.9; }

.screen { min-height: 100vh; background: var(--paper); }

/* ---------- on-accent scope (blue header / footer) ---------- */
.on-accent-scope {
  background: var(--accent-2);
  color: var(--on-accent);
  border-color: var(--rule-on-accent);
}
.on-accent-scope .link-plain,
.on-accent-scope a,
.on-accent-scope button { color: var(--on-accent); }
.on-accent-scope .link-plain:hover {
  color: var(--on-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--rule-on-accent);
}
.site-header .bar {
  height: 72px;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1; letter-spacing: -0.02em; }
.nav-desktop { display: none; align-items: center; gap: 28px; font-size: 14px; }
.site-header [data-logout] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; padding: 0; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: -6px; padding: 0; background: none; border: 0; color: var(--on-accent); cursor: pointer; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-bars { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-active { padding-bottom: 4px; border-bottom: 3px solid var(--on-accent); }
.nav-inactive { padding-bottom: 4px; border-bottom: 3px solid transparent; }
.nav-mobile { border-top: 1px solid var(--rule-on-accent); background: var(--accent-2); }
.nav-mobile .inner { display: flex; flex-direction: column; padding: 8px 20px; }
.nav-mobile a, .nav-mobile button {
  padding: 12px 0; font-size: 15px; text-align: left;
  border: 0; border-bottom: 1px solid var(--rule-on-accent); background: none; color: var(--on-accent); cursor: pointer;
}

@media (min-width: 768px) {
  .site-header .bar { padding: 0 32px; }
  .nav-desktop { display: flex; }
  .nav-toggle, .nav-mobile { display: none; }
}

/* ---------- home bands ---------- */
.home-main { display: flex; flex-direction: column; }
.band { width: 100%; padding: 64px 20px; }
.band > .inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 96px; }
.band-paper { background: var(--paper); color: var(--ink); }
.band-paper-alt { background: var(--paper-alt); color: var(--ink); }
.band-accent { background: var(--accent); color: var(--on-accent); }
.band-accent-2 { background: var(--accent-2); color: var(--on-accent); }
@media (min-width: 768px) { .band { padding: 112px 32px; } }

section[id] { scroll-margin-top: 80px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 80vh;
  padding: 80px 20px;
  background: var(--paper-alt);
  overflow: hidden;
}
@media (min-width: 768px) { .hero { min-height: 92vh; padding: 80px 32px; } }
.hero-orb { position: absolute; border-radius: 999px; pointer-events: none; }
.hero .content { position: relative; z-index: 1; margin: 0 auto; width: 100%; max-width: 820px; text-align: center; }
.hero .wordmark { font-size: 36px; }
.hero h1 { margin-top: 40px; font-size: 56px; line-height: 1.02; letter-spacing: -0.03em; }
@media (min-width: 768px) { .hero h1 { font-size: 88px; } }
.hero .standfirst { margin: 24px auto 0; font-size: 20px; line-height: 1.55; color: var(--ink-muted); max-width: 54ch; }
.hero .entry { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 24px; font-size: 15px; }
.hero .entry .btn-accent { padding: 18px 28px; }
@media (min-width: 640px) { .hero .entry { flex-direction: row; justify-content: center; align-items: flex-start; } }
.hero .image-slot { margin-top: 56px; }

/* ---------- image slots ---------- */
.image-slot {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent-wash);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
}
.image-slot img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.image-slot.has-image { border: 0; }
.image-slot.has-image .slot-label { display: none; }
.hero-slot { aspect-ratio: 16 / 9; }
.slot-label { font-size: 12px; font-weight: 500; color: var(--accent); }

.image-band { width: 100%; overflow: hidden; }
.band-slot { aspect-ratio: 5 / 2; border-radius: 0; border-left: 0; border-right: 0; }

/* ---------- sections ---------- */
.section-title { margin-top: 20px; font-size: 32px; }
@media (min-width: 768px) { .section-title { font-size: 44px; } }
.section-p { margin-top: 24px; font-size: 17px; }
.band-accent .section-p, .band-accent-2 .section-p { color: var(--on-accent); }
.section-p.muted { color: var(--ink-muted); }

/* trade-off cards */
.parts { margin-top: 48px; display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 640px) { .parts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .parts { grid-template-columns: repeat(3, 1fr); } }
.part { border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); padding: 32px; }
.part .glyph {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-wash); color: var(--accent);
}
.part .glyph svg { width: 24px; height: 24px; }
.part h3 { margin-top: 24px; font-size: 18px; font-weight: 600; }
.part p { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }

/* proximity map figure */
figure.map-figure { margin: 48px auto; max-width: 1040px; }
@media (min-width: 768px) { figure.map-figure { margin: 64px auto; } }
figure.map-figure img { display: block; width: 100%; height: auto; opacity: 0.6; }

/* interest mosaic */
.mosaic { margin-top: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 481px) { .mosaic { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .mosaic { margin-top: 56px; } }
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
}
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.tile .subject {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px; text-align: center; font-size: 11px; color: var(--ink-muted);
}
.tile.faded { opacity: 0.7; filter: saturate(0.35); }
.tile.shared { border: 3px solid var(--accent); }
.tile.shared .dot {
  position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px; border-radius: 999px; background: var(--accent);
}

/* visibility controls */
.controls { margin-top: 40px; border-top: 1px solid var(--rule); }
.controls li {
  padding: 20px 0 20px 20px;
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 8px;
}
.controls .label { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.controls .label svg { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
.controls .label span { font-size: 15px; font-weight: 500; }
.controls .desc { font-size: 15px; color: var(--ink-muted); }
@media (min-width: 768px) {
  .controls li { flex-direction: row; align-items: center; gap: 24px; }
  .controls .label { width: 224px; }
}

/* safety principles (rose band) */
.principles { margin-top: 40px; border-top: 1px solid var(--rule-on-accent); }
.principles li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid var(--rule-on-accent);
  font-size: 15px; color: var(--on-accent);
}
.principles svg { width: 12px; height: 12px; margin-top: 8px; flex-shrink: 0; color: var(--on-accent); }

/* faq */
.faq dl { margin-top: 32px; display: flex; flex-direction: column; gap: 2px; }
.faq dt { border-radius: 12px; background: var(--accent-wash); padding: 16px 20px; font-size: 16px; font-weight: 500; }
.faq dd { padding: 12px 20px 20px; font-size: 15px; color: var(--ink-muted); max-width: 68ch; }

/* closing */
.closing-links { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; font-size: 16px; }
@media (min-width: 768px) { .closing-links { flex-direction: row; gap: 40px; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule-on-accent); }
.site-footer .inner {
  padding: 40px 20px; display: flex; flex-direction: column; gap: 16px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; }
.site-footer .wm { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.site-footer .note { font-size: 13px; color: var(--on-accent); }
@media (min-width: 768px) {
  .site-footer .inner { padding: 40px 32px; flex-direction: row; align-items: baseline; justify-content: space-between; }
}

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.auth main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 64px 20px; }
.auth .box { width: 100%; max-width: 380px; }
.auth .wordmark { color: var(--ink); }
.auth h1 { margin-top: 40px; font-size: 32px; }
.auth .lead { margin-top: 8px; font-size: 15px; color: var(--ink-muted); }
.auth form { margin-top: 32px; display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--ink-muted); }
.field input {
  height: 40px; width: 100%; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none;
  transition: border-color 150ms ease; border-radius: 0;
}
.field input:focus { border-bottom-color: var(--accent); }
.consent { display: flex; align-items: flex-start; gap: 12px; }
.consent input {
  margin-top: 3px; height: 16px; width: 16px; flex-shrink: 0;
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); cursor: pointer;
}
.consent input:checked { border-color: var(--accent); background: var(--accent); }
.consent label { font-size: 13px; color: var(--ink-muted); }
.auth .btn-accent { width: 100%; padding: 18px 0; }
@media (min-width: 768px) { .auth .btn-accent { width: 280px; } }
.auth .fine { margin-top: 16px; font-size: 12px; color: var(--ink-muted); }
.auth .alt { margin-top: 24px; font-size: 13px; color: var(--ink-muted); }

/* ---------- app header (plain, 56px) ---------- */
.app-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.app-header .bar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.app-header .wordmark { color: var(--ink); }
.back { color: var(--ink); }
.back svg { width: 20px; height: 20px; display: block; }

/* ---------- discover ---------- */
.discover main { max-width: 1040px; margin: 0 auto; padding: 40px 20px; }
.discover h1 { font-size: 28px; }
.discover .lead { margin-top: 8px; font-size: 15px; color: var(--ink-muted); }
.people-list { margin-top: 32px; display: grid; grid-template-columns: 1fr; column-gap: 64px; }
@media (min-width: 900px) { .people-list { grid-template-columns: repeat(2, 1fr); } }
.people-list li { border-top: 1px solid var(--rule); }
.person-row { display: flex; align-items: flex-start; gap: 20px; padding: 32px 0; }
.person-row .monogram { width: 80px; height: 80px; font-size: 44px; }
.person-row .name { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.25; color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 4px; }
.person-row:hover .name { text-decoration: underline; text-decoration-thickness: 1px; }
.person-row .interests { margin-top: 4px; display: block; font-size: 15px; color: var(--ink-muted); }
.person-row .chip-band { margin-top: 8px; }

.monogram {
  position: relative;
  display: flex; flex-shrink: 0; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display);
  line-height: 1;
}
.monogram[data-avatar] img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- profile ---------- */
.profile main { max-width: 560px; margin: 0 auto; padding: 40px 20px; }
.profile .monogram { width: 112px; height: 112px; font-size: 64px; }
.profile h1 { margin-top: 16px; font-size: 34px; }
.profile .chip-band { margin-top: 8px; }
.profile hr { margin: 32px 0; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); }
.tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.profile .note { margin-top: 12px; font-size: 16px; line-height: 1.7; }
.profile .btn-accent { width: 100%; height: 44px; font-size: 15px; }
@media (min-width: 768px) { .profile .btn-accent { width: 240px; } }
.profile .guidelines { margin-top: 16px; font-size: 13px; color: var(--ink-muted); }

/* ---------- conversations ---------- */
.conversations main { max-width: 720px; margin: 0 auto; padding: 0 20px 64px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 96px 0; text-align: center; }
.empty-state svg { width: 32px; height: 32px; color: var(--ink-muted); }
.list-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); }
.conv-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; transition: background-color 150ms ease; }
.conv-row:hover { background: var(--accent-wash); }
.conv-row .monogram { width: 36px; height: 36px; font-size: 15px; border-radius: 999px; }
.conv-row .name { display: block; font-size: 15px; font-weight: 500; }
.conv-row .sub { display: block; font-size: 14px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row .time { flex-shrink: 0; font-size: 11px; color: var(--ink-muted); }
.conv-row .chip-band { flex-shrink: 0; }
.conv-list li { border-bottom: 1px solid var(--rule); }

/* ---------- thread ---------- */
.thread { display: flex; min-height: 100vh; flex-direction: column; background: var(--paper); }
.thread .app-header .bar { max-width: 720px; margin: 0 auto; }
.thread-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thread-person .monogram { width: 36px; height: 36px; font-size: 18px; }
.thread-person .identity { min-width: 0; }
.thread-person .name { display: block; font-size: 15px; font-weight: 500; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.thread-person .area { display: block; font-size: 13px; line-height: 1.25; color: var(--ink-muted); }
.thread main { width: 100%; max-width: 720px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 24px 20px 112px; }
.thread .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.thread .empty .monogram { width: 64px; height: 64px; font-size: 28px; border-radius: 999px; }
.thread .empty .nm { font-family: var(--font-display); font-size: 20px; }
.thread .disclaimer { text-align: center; font-size: 12px; color: var(--ink-muted); }
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 78%; align-self: flex-end; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--paper); padding: 8px 16px; font-size: 15px; line-height: 1.5;
}
.bubble-time { align-self: flex-end; font-size: 11px; color: var(--ink-muted); }
.composer { position: fixed; inset-inline: 0; bottom: 0; border-top: 1px solid var(--rule); background: var(--paper); }
.composer .inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.composer input { height: 40px; flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.composer input::placeholder { color: var(--ink-muted); }
.composer button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.composer svg { width: 24px; height: 24px; display: block; }

/* ---------- legal ---------- */
.legal { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.legal main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 48px 20px 40px; }
@media (min-width: 768px) { .legal main { padding: 64px 32px 40px; } }
.legal h1 { font-size: 40px; line-height: 1.2; letter-spacing: -0.01em; }
.legal .updated { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }
.legal main > hr { margin-top: 32px; }
.legal h2 { font-size: 24px; line-height: 1.35; margin-top: 48px; }
.legal p.t { margin-top: 16px; font-size: 16px; line-height: 1.7; }
.legal ul.t { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; padding-left: 20px; font-size: 16px; line-height: 1.7; list-style: disc; }
.legal ul.t li::marker { color: var(--ink-muted); }
.legal .cross { margin-top: 64px; font-size: 14px; }

/* ---------- support pages (about / guidelines / help) ---------- */
.support { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.support main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 48px 20px 40px; }
@media (min-width: 768px) { .support main { padding: 64px 32px 40px; } }
.support h1 { margin-top: 32px; font-size: 40px; line-height: 1.2; letter-spacing: -0.01em; }
.support .standfirst { margin-top: 24px; max-width: 66ch; font-size: 17px; line-height: 1.7; color: var(--ink-muted); }
.support section { margin-top: 96px; }
.support h2 { margin-top: 32px; font-size: 24px; }
.support p.t { margin-top: 24px; max-width: 66ch; font-size: 17px; line-height: 1.7; }
.support .related { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; }

/* ---------- not found ---------- */
.notfound { min-height: 100vh; background: var(--paper); display: flex; align-items: center; }
.notfound .inner { margin: 0 auto; max-width: 720px; padding: 0 20px; }
.notfound h1 { margin-top: 16px; font-size: 40px; }

/* visibility driven by the session state on <body> */
[hidden] { display: none !important; }
body:not(.signed-in) .signed-in-only { display: none; }
body.signed-in .signed-out-only { display: none; }
