/* The Both Halves website. One stylesheet for every page.
   Colours and lettering are the app's own "Warm cream" theme, so the site and the app look like one thing.
   Nothing here is fetched from another company: the fonts are the ones already on the visitor's device
   (on an iPhone or a Mac that is the same serif the app uses). */

:root {
  --paper: #F7F2EA;
  --paper-2: #F1E9DD;
  --surface: #FFFDF9;
  --ink: #2A2724;
  --ink-soft: #655C54;
  --line: rgba(42, 39, 36, 0.14);
  --clay: #B86B4B;
  --clay-deep: #96502F;
  --gold: #D4A24A;
  --night: #24211E;
  --on-night: #F2EFE9;
  --on-night-soft: #BDB6AC;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --edge: clamp(20px, 5vw, 56px);
  --wide: 1080px;
  --read: 42rem;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--clay-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--clay-deep); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--edge), var(--wide)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { left: 12px; top: 12px; z-index: 5; }

/* ---------- The top of every page ---------- */

.top { padding-block: 22px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }

.top nav { display: flex; gap: clamp(16px, 4vw, 30px); }
.top nav a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.top nav a:hover, .top nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--clay); }

/* ---------- Home: the opening ---------- */

.opening { padding-block: clamp(24px, 6vw, 64px) 0; overflow: hidden; }
.opening .wrap { display: grid; gap: clamp(32px, 6vw, 64px); align-items: end; }

.opening h1 { font-size: clamp(2.6rem, 7.2vw, 4.5rem); line-height: 1.02; }
.opening .lede { margin-top: 1.4rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.5; color: var(--ink-soft); max-width: 31rem; }
.opening .lede strong { color: var(--ink); font-weight: 600; }
.opening .soon { margin-top: 1.8rem; display: inline-block; font-weight: 600; padding: 12px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.opening .words { padding-bottom: clamp(24px, 6vw, 72px); }

/* The arch from the app's icon, in its two halves, with one phone in each half:
   the same world, open on both phones. */
.arch {
  position: relative;
  justify-self: center;
  width: min(100%, 520px);
  aspect-ratio: 520 / 600;
  border-radius: 260px 260px 0 0;
  background: linear-gradient(90deg, var(--night) 0 50%, var(--clay) 50% 100%);
  overflow: hidden;
}
.arch .star { position: absolute; left: 50%; top: 7%; width: 9%; transform: translateX(-50%); fill: var(--gold); }
.arch .phone { position: absolute; width: 43%; }
.arch .phone.left { left: 5.5%; top: 31%; }
.arch .phone.right { right: 5.5%; top: 20%; }

.phone {
  border-radius: 13% / 6%;
  border: 6px solid var(--night);
  background: var(--night);
  overflow: hidden;
  box-shadow: 0 30px 50px -28px rgba(20, 16, 12, 0.7);
}
.phone img { width: 100%; border-radius: 0; }
.arch .phone.left { border-color: #3A3632; }

@media (min-width: 860px) {
  .opening .wrap { grid-template-columns: 1fr minmax(0, 520px); }
}

/* ---------- Home: the chat, where everything meets ---------- */

.thread { background: var(--paper-2); padding-block: clamp(56px, 9vw, 110px); }
.thread h2 { font-size: clamp(2rem, 5vw, 3rem); max-width: 16ch; }
.thread .lead { margin-top: 1.1rem; font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); max-width: 38rem; }

/* The room on one side, the chat on the other, and the thing that joins them in between. */
.pair { display: grid; gap: 20px; margin-top: clamp(36px, 6vw, 64px); justify-items: center; }
.pair figure { margin: 0; display: grid; gap: 20px; justify-items: center; }
.pair .phone { border-radius: 40px; }
.pair .room .phone { width: min(70vw, 270px); }
.pair .chat .phone { width: min(78vw, 310px); border-color: var(--clay); background: var(--clay); }
.pair figcaption { max-width: 20rem; color: var(--ink-soft); }
.pair figcaption strong { display: block; margin-bottom: 0.3rem; color: var(--ink); font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }

.pair .sent { margin: 0; display: grid; justify-items: center; gap: 10px; color: var(--clay-deep); font-weight: 600; font-size: 0.98rem; text-align: center; }
.pair .sent::before, .pair .sent::after { content: ""; display: block; width: 0; height: 26px; border-left: 2px dashed var(--clay); }

.thread .kinds { margin-top: clamp(32px, 5vw, 56px); max-width: 44rem; color: var(--ink-soft); }
.thread .kinds strong { color: var(--ink); font-weight: 600; }

@media (min-width: 820px) {
  .pair { grid-template-columns: 1fr auto 1fr; gap: 0; align-items: start; }
  .pair .room { justify-self: end; }
  .pair .chat { justify-self: start; }
  .pair .sent { align-self: start; margin-top: 190px; grid-auto-flow: column; align-items: center; gap: 12px; padding-inline: 14px; max-width: none; white-space: nowrap; }
  .pair .sent::before, .pair .sent::after { width: clamp(18px, 3vw, 44px); height: 0; border-left: 0; border-top: 2px dashed var(--clay); }
}

/* Sections of the home page take turns between two backgrounds, so a long page has a rhythm. */
.inside.tinted { background: var(--paper-2); }
.inside .section-lead { margin-top: 1rem; font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); max-width: 36rem; }
.inside .section-note { margin-top: clamp(24px, 4vw, 40px); color: var(--ink-soft); max-width: 40rem; }

/* Two screens side by side, each with a few words under it. */
.duo { display: grid; gap: 40px; margin-top: clamp(48px, 8vw, 96px); justify-items: center; }
.duo figure { margin: 0; display: grid; gap: 18px; justify-items: center; }
.duo .phone { width: min(64vw, 240px); border-radius: 34px; }
.duo figcaption { max-width: 17rem; color: var(--ink-soft); }
.duo figcaption strong { display: block; margin-bottom: 0.25rem; color: var(--ink); font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }

@media (min-width: 700px) {
  .duo { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* A shelf of small screens. On a phone it scrolls sideways; on a wide screen it wraps into rows. */
.shelf {
  list-style: none;
  margin: clamp(36px, 6vw, 64px) calc(-1 * var(--edge)) 0;
  padding: 4px var(--edge) 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(46vw, 180px);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
}
.shelf li { scroll-snap-align: start; margin: 0; }
.shelf figure { margin: 0; }
.shelf .phone { border-width: 5px; border-radius: 24px; box-shadow: 0 18px 30px -20px rgba(20, 16, 12, 0.6); }
.shelf figcaption { margin-top: 12px; font-size: 0.95rem; line-height: 1.4; color: var(--ink-soft); }
.shelf figcaption strong { display: block; color: var(--ink); font-weight: 600; }

@media (min-width: 900px) {
  .shelf { margin-inline: 0; padding-inline: 0; grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); gap: 36px 26px; overflow: visible; }
}

/* ---------- Home: the rest of what's inside, in a few words each ---------- */

.also { padding-block: clamp(56px, 10vw, 120px); }
.also h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); max-width: 20ch; }
.also dl { margin: clamp(28px, 5vw, 48px) 0 0; display: grid; gap: 26px 48px; }
.also dt { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }
.also dd { margin: 0.25rem 0 0; color: var(--ink-soft); }

@media (min-width: 620px) { .also dl { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .also dl { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Home: what's inside ---------- */

.inside { padding-block: clamp(56px, 10vw, 120px); }
.inside > .wrap > h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); max-width: 22ch; }

.half-row { display: grid; gap: 28px; align-items: center; margin-top: clamp(48px, 8vw, 96px); }
.half-row .phone { width: min(64vw, 260px); justify-self: center; border-radius: 36px; }
.half-row h3 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
.half-row p { margin-top: 0.9rem; color: var(--ink-soft); max-width: 30rem; }

@media (min-width: 760px) {
  .half-row { grid-template-columns: 1fr 1fr; gap: 0; }
  .half-row .text { padding-inline: clamp(24px, 5vw, 72px); }
  .half-row.flip .phone { order: 2; }
}

/* ---------- Home: the promise, on the dark half ---------- */

.promise { background: var(--night); color: var(--on-night); padding-block: clamp(56px, 9vw, 110px); }
.promise h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); max-width: 18ch; }
.promise .lead { margin-top: 1.1rem; color: var(--on-night-soft); max-width: 36rem; font-size: 1.15rem; }
.promise ul { list-style: none; padding: 0; margin: clamp(36px, 6vw, 64px) 0 0; display: grid; gap: 36px; }
.promise li h3 { font-size: 1.3rem; color: var(--on-night); }
.promise li p { margin-top: 0.6rem; color: var(--on-night-soft); }
.promise .more { margin-top: clamp(36px, 6vw, 56px); }
.promise a { color: #E9B99F; }
.promise a:hover { color: var(--on-night); }
.promise :focus-visible { outline-color: #E9B99F; }

@media (min-width: 760px) {
  .promise ul { grid-template-columns: repeat(2, 1fr); gap: 48px 64px; }
}

/* ---------- The foot of every page ---------- */

.foot { padding-block: 40px 56px; font-size: 0.95rem; color: var(--ink-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--ink); }

/* ---------- Reading pages: Privacy, Support, Join ---------- */

.reading { padding-block: clamp(24px, 5vw, 56px) clamp(56px, 9vw, 110px); }
.reading .wrap { max-width: var(--read); }
.reading h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); }
.reading .intro { margin-top: 1.2rem; font-size: 1.2rem; line-height: 1.5; color: var(--ink-soft); }
.reading .dated { margin-top: 0.8rem; font-size: 0.95rem; color: var(--ink-soft); }
.reading h2 { font-size: clamp(1.45rem, 3.4vw, 1.8rem); margin-top: 3.2rem; }
.reading h3 { font-size: 1.15rem; margin-top: 1.8rem; font-family: var(--sans); letter-spacing: 0; line-height: 1.35; }
.reading p, .reading ul, .reading ol { margin-top: 1rem; }
.reading ul, .reading ol { padding-left: 1.25rem; }
.reading li { margin-top: 0.5rem; }
.reading li::marker { color: var(--clay-deep); }
.reading strong { font-weight: 600; }

/* "What we can't see" beside "What we can": the two halves of the truth. */
.two-halves { display: grid; margin-top: 2rem; border-radius: 22px; overflow: hidden; }
.two-halves > div { padding: 26px 26px 30px; }
.two-halves .cannot { background: var(--night); color: var(--on-night); }
.two-halves .can { background: var(--paper-2); }
.two-halves h2 { margin-top: 0; font-size: 1.35rem; }
.two-halves ul { margin-top: 1rem; padding-left: 1.1rem; }
.two-halves .cannot li::marker { color: var(--gold); }
.two-halves .cannot :focus-visible { outline-color: #E9B99F; }

@media (min-width: 700px) {
  .two-halves { grid-template-columns: 1fr 1fr; }
}

/* A question and its answer on the Support page. */
.asked { margin-top: 2.2rem; }
.asked h3 { margin-top: 0; font-family: var(--serif); font-size: 1.3rem; letter-spacing: -0.01em; }

.where { font-weight: 600; white-space: nowrap; }

/* ---------- Join: the invitation ---------- */

.invitation { margin-top: 2rem; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.invitation .label { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.invitation .code {
  margin-top: 0.6rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.05rem, 3.6vw, 1.35rem);
  line-height: 1.5;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.button {
  margin-top: 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
}
.button:hover { background: #000; }
.quiet { color: var(--ink-soft); font-size: 0.98rem; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
