/* Newly Here. Nearly Here's look, on purpose (sibling apps): night aubergine for the 3am hero,
   blush paper for the rest, the app's coral for actions only. Bricolage Grotesque throughout.
   Started as a copy of labour-companion/style.css; the Newly Here parts are at the end. */

:root {
  --night: #2a1826;
  --night-2: #3b2236;
  --paper: #fcf2ee;
  --paper-2: #f6e4dd;
  --ink: #2a1826;
  --muted: #7a6170;
  --coral: #e5674e;
  --coral-ink: #b8442f;
  --peach: #f7b69c;
  --line: rgba(42, 24, 38, 0.13);
  --on-night: #fbeee9;
  --on-night-dim: #cdb3bd;

  --font: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  /* Scale: 18px base, perfect fourth. */
  --s-1: 0.8125rem;
  --s0: 1.125rem;
  --s1: 1.5rem;
  --s2: 2rem;
  --s3: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --s4: clamp(2.75rem, 1.6rem + 4.6vw, 4.75rem);
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1119;
    --paper-2: #2a1824;
    --ink: #f6e9ec;
    --muted: #c0a8b3;
    --line: rgba(255, 255, 255, 0.12);
    --coral-ink: #f08a6c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--s0)/1.55 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--coral-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--font); margin: 0; text-wrap: balance; }
h2 {
  font-size: var(--s3);
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h3 { font-size: var(--s1); font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--coral); color: #fff; padding: 0.5rem 1rem; border-radius: 999px; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* ---------- masthead ---------- */

.mast { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.mast .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.home { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.mark { width: 32px; height: 32px; border-radius: 8px; }
.mast nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.mast nav a { color: inherit; text-decoration: none; font-size: 0.98rem; opacity: 0.8; }
.mast nav a:hover, .mast nav a[aria-current] { opacity: 1; text-decoration: underline; }
.mast-night { background: var(--night); color: var(--on-night); border-bottom-color: rgba(255, 255, 255, 0.08); }

/* ---------- hero: 3am ---------- */

.hero {
  background:
    radial-gradient(60rem 40rem at 78% 40%, rgba(247, 182, 156, 0.13), transparent 60%),
    var(--night);
  color: var(--on-night);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 {
  font-size: var(--s4);
  font-weight: 750;
  font-variation-settings: "wdth" 82;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--on-night);
  max-width: 13ch;
}
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--on-night-dim); max-width: 34rem; margin: 1.5rem 0 2rem; }
.acts { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.store {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--on-night); color: var(--night);
  padding: 0.6rem 1.15rem 0.6rem 0.95rem; border-radius: 14px;
  font-weight: 650; font-size: 1.15rem; line-height: 1.05;
}
.store small { display: block; font-size: 0.72rem; font-weight: 450; opacity: 0.75; }
.link-light { color: var(--on-night); }

/* The phone */
.phone-scene { position: relative; margin: 0; display: grid; justify-items: center; }
.breath {
  position: absolute; inset: 8% 4% 14%;
  background: radial-gradient(closest-side, rgba(247, 182, 156, 0.55), rgba(229, 103, 78, 0.18) 55%, transparent 75%);
  filter: blur(18px);
  animation: breathe 10s ease-in-out infinite;
}
/* In for 4, out for 6: the app's breathing guide. */
@keyframes breathe {
  0% { transform: scale(0.86); opacity: 0.55; }
  40% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(0.86); opacity: 0.55; }
}
.phone {
  position: relative;
  width: min(22rem, 100%);
  aspect-ratio: 9 / 18.6;
  border-radius: 3.1rem;
  padding: 1rem 0.8rem;
  background:
    radial-gradient(120% 70% at 50% 0%, #5a3150 0%, transparent 60%),
    linear-gradient(180deg, #33192e 0%, #1c0f1a 100%);
  border: 0.55rem solid #120910;
  box-shadow: 0 2.5rem 5rem -1.5rem rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  display: flex; flex-direction: column; align-items: center;
}
.island { width: 6.2rem; height: 1.65rem; background: #000; border-radius: 1rem; margin-top: 0.1rem; }
.ls-date { margin: 1.2rem 0 0; font-size: 0.95rem; font-weight: 550; color: rgba(255, 240, 236, 0.85); }
.ls-time {
  margin: -0.2rem 0 0.9rem; font-size: 4.6rem; line-height: 1; font-weight: 600;
  font-variation-settings: "wdth" 80; letter-spacing: -0.03em; color: rgba(255, 244, 240, 0.94);
  font-variant-numeric: tabular-nums;
}
.stack { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
.n {
  background: rgba(255, 238, 232, 0.16);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem;
  padding: 0.65rem 0.8rem 0.7rem;
  color: #fff6f2;
  font-size: 0.84rem; line-height: 1.32;
}
.n p { margin: 0; }
.n-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.2rem; }
.n-head img { width: 20px; height: 20px; border-radius: 5px; }
.n-head b { font-weight: 650; flex: 1; }
.n-head time { font-size: 0.75rem; opacity: 0.7; }
.n .from { font-weight: 600; }
.photo { margin-top: 0.5rem; border-radius: 0.7rem; overflow: hidden; aspect-ratio: 16 / 9; }
.photo svg { width: 100%; height: 100%; }
.n-acts { display: flex; gap: 0.4rem; margin-top: 0.55rem; flex-wrap: wrap; }
.n-acts span { background: rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 0.22rem 0.6rem; font-size: 0.76rem; font-weight: 550; }
.phone-scene figcaption { margin-top: 1rem; font-size: var(--s-1); color: var(--on-night-dim); }

/* The one orchestrated moment: the night's updates arrive, oldest first, each pushing the
   stack down as it lands on top. */
/* Waits until the phone is on screen (the script adds .play), so on a small screen the
   updates don't arrive before anyone has scrolled down to see them. */
@media (prefers-reduced-motion: no-preference) {
  .js .stack .n { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: -0.45rem; }
  .js .play .stack .n { opacity: 1; max-height: none; padding: 0.65rem 0.8rem 0.7rem; margin-bottom: 0; animation: arrive 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .js .play .stack .n1 { animation-delay: 0.3s; }
  .js .play .stack .n2 { animation-delay: 1.4s; }
  .js .play .stack .n3 { animation-delay: 2.7s; }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(-0.8rem) scale(0.96); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: -0.45rem; }
    to { opacity: 1; transform: none; max-height: 20rem; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .breath { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- the story: a labour, by the clock ---------- */

.story, .kit, .price, .trust, .last { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.intro { font-size: 1.2rem; color: var(--muted); max-width: 38rem; margin: 1rem 0 0; }

.timeline { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 9.5rem; top: 0.6rem; bottom: 0.6rem; width: 2px;
  background: linear-gradient(var(--peach), var(--coral));
  border-radius: 2px;
}
.timeline > li { display: grid; grid-template-columns: 8rem 1fr; gap: 3rem; padding-bottom: 2.75rem; position: relative; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: calc(9.5rem - 5px); top: 0.55rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--coral);
}
.when {
  margin: 0.15rem 0 0; text-align: right;
  font-weight: 650; font-size: 1.15rem; font-variant-numeric: tabular-nums;
  font-variation-settings: "wdth" 85; color: var(--coral-ink);
}
.what { max-width: 40rem; }
.what h3 { margin-bottom: 0.45rem; }
.what p { color: var(--muted); }
.code {
  display: inline-block; margin: 0.25rem 0 0; padding: 0.45rem 0.95rem;
  border: 1.5px dashed var(--line); border-radius: 12px;
  font-weight: 700; font-size: 1.6rem; letter-spacing: 0.06em; color: var(--ink) !important;
  font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 85;
}
.chips { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chips li {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--paper-2); border-radius: 999px; padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  font-size: 0.95rem; font-weight: 550;
}
.chips svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--coral); color: #fff; }
.love {
  display: inline-block; margin: 0.25rem 0 0; padding: 0.55rem 1rem;
  background: var(--night); color: var(--on-night) !important; border-radius: 14px;
  font-size: 0.95rem; font-weight: 550;
}

/* ---------- the timer kit ---------- */

.kit { background: var(--paper-2); }
.features { margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3.5rem; }
.features div { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.features dt { font-weight: 650; font-size: 1.15rem; margin-bottom: 0.25rem; }
.features dd { margin: 0; color: var(--muted); max-width: 32rem; }

/* ---------- price ---------- */

.table-wrap { margin-top: 2.25rem; overflow-x: auto; }
table { width: 100%; max-width: 50rem; border-collapse: collapse; font-size: 1.02rem; }
th, td { padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line); }
thead th { text-align: center; font-size: 1.15rem; font-weight: 700; vertical-align: bottom; width: 8.5rem; }
thead th:first-child { width: auto; }
.cost { display: block; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
tbody th { text-align: left; font-weight: 450; padding-left: 0; }
td { text-align: center; }
.yes { color: var(--coral-ink); font-weight: 700; font-size: 1.2rem; }
.no { color: var(--muted); }
tbody tr td:last-child { background: color-mix(in srgb, var(--coral) 7%, transparent); }
.small { font-size: 0.95rem; color: var(--muted); margin-top: 1rem; }

/* ---------- trust ---------- */

.trust { border-top: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.trust h2 { margin-bottom: 1.1rem; }
.trust p { max-width: 36rem; }
.trust-grid > div p { color: var(--muted); }
.care { background: var(--night); color: var(--on-night); border-radius: 1.5rem; padding: 1.75rem 1.75rem 0.75rem; }
.care h2 { font-size: var(--s1); font-variation-settings: "wdth" 95; }
.care p { color: var(--on-night-dim); }

/* ---------- last ---------- */

.last { padding-top: 0; }
.last p { color: var(--muted); }
.last h2 { margin-bottom: 0.75rem; }
.btn {
  display: inline-block; background: var(--coral); color: #fff; text-decoration: none;
  padding: 0.75rem 1.4rem; border-radius: 999px; font-weight: 650;
}
.btn:hover { background: var(--coral-ink); text-decoration: none; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding: 1.75rem 0 2.5rem; font-size: 0.95rem; color: var(--muted); }
footer .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer a { color: inherit; }

/* ---------- support and privacy pages ---------- */

.app-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem; }
.prose { max-width: 44rem; }
.prose h1 { font-size: var(--s4); font-weight: 750; font-variation-settings: "wdth" 82; letter-spacing: -0.03em; line-height: 1; margin-bottom: 1.5rem; }
.prose h2 { font-size: var(--s2); margin: 2.75rem 0 0.8rem; }
.prose h3 { font-size: 1.2rem; margin: 1.9rem 0 0.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.dim { color: var(--muted); }
.note { background: var(--paper-2); border-left: 4px solid var(--coral); border-radius: 0 1rem 1rem 0; padding: 1.1rem 1.3rem 0.2rem; margin: 1.5rem 0; }

/* ---------- small screens ---------- */

@media (max-width: 52rem) {
  .hero-grid, .trust-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .phone { width: min(20rem, 100%); }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 36rem) {
  .mast nav { gap: 0.9rem; }
  .mast nav a[href="#price"] { display: none; }
  .timeline::before { left: 5px; }
  .timeline > li { grid-template-columns: 1fr; gap: 0.25rem; padding-left: 1.75rem; }
  .timeline > li::before { left: 0; }
  .when { text-align: left; font-size: 1rem; }
  thead th { width: 5.5rem; }
}

/* ---------- Newly Here: the hero's Lock Screen ---------- */

/* The live feed timer (a Live Activity), started on Sarah's Watch. */
.live {
  width: 100%;
  background: rgba(20, 10, 18, 0.62);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.4rem;
  padding: 0.8rem 0.95rem 0.85rem;
  color: #fff6f2;
  font-size: 0.84rem; line-height: 1.32;
}
.live p { margin: 0; }
.live .n-head b { font-weight: 650; }
.tick {
  font-size: 2.9rem; line-height: 1.05; font-weight: 650; margin-top: 0.15rem !important;
  font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 80; letter-spacing: -0.02em;
  color: var(--peach);
}
.who { opacity: 0.72; font-size: 0.78rem; }
.switched {
  font-size: 0.78rem; font-weight: 600; color: var(--peach);
  max-height: 0; opacity: 0; overflow: hidden;
}
.live .n-acts { margin-top: 0.7rem; }
.live .n-acts span { flex: 1; text-align: center; padding: 0.4rem 0.6rem; font-size: 0.82rem; }
.live .n-acts .stop { background: var(--coral); color: #fff; }

.tiles { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.45rem; }
.tile {
  background: rgba(255, 238, 232, 0.14);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem; padding: 0.6rem 0.75rem 0.65rem;
  color: #fff6f2; line-height: 1.25;
  display: flex; flex-direction: column;
}
.tile small { font-size: 0.7rem; opacity: 0.7; }
.tile b { font-size: 1.05rem; font-weight: 650; font-variation-settings: "wdth" 88; margin: 0.1rem 0; }
.tile span { font-size: 0.74rem; opacity: 0.85; }

/* The one orchestrated moment: Tom switches side from his phone, and the card says so. */
@media (prefers-reduced-motion: no-preference) {
  .js .live, .js .tiles { opacity: 0; transform: translateY(-0.6rem) scale(0.97); }
  .js .play .live { animation: land 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both; }
  .js .play .tiles { animation: land 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 1.1s both; }
  .js .play .switched { animation: note 0.6s ease-out 3.4s both; }
  @keyframes land { to { opacity: 1; transform: none; } }
  @keyframes note { to { max-height: 2rem; opacity: 1; margin-top: 0.3rem; } }
}

/* ---------- Newly Here: from Nearly Here ---------- */

.sibling { padding: 0 0 clamp(3.5rem, 8vw, 6.5rem); }
.sibling-grid {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.75rem; align-items: start;
  background: var(--paper-2); border-radius: 1.5rem; padding: clamp(1.5rem, 4vw, 2.5rem);
}
.sib-icon { width: 72px; height: 72px; border-radius: 16px; }
.sibling h2 { font-size: var(--s2); margin-bottom: 0.6rem; }
.sibling p { color: var(--muted); max-width: 40rem; margin: 0; }
@media (max-width: 36rem) {
  .sibling-grid { gap: 1.1rem; }
  .sib-icon { width: 56px; height: 56px; border-radius: 13px; }
}
