/* tend — workshop-site shared stylesheet
 *
 * Canonical tokens from TendKit/Sources/TendPalette.swift, mirrored by the
 * Design System brief (Tend.zip Ed. 2026.04). Ivory, never white;
 * one glowing accent; no gradients. Radii whitelist: 6/10/14/20.
 *
 * Light mode is the site default — matches email clients and the brief's
 * "warm eggshell, never sterile white" stance for marketing surfaces.
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:ital,wght@0,500;0,700;1,800&display=swap');

:root {
  /* Palette — canonical */
  --bg:            #F6F1EA;   /* warm eggshell */
  --bg-alt:        #EFE9DF;   /* hover surface */
  --card:          #FDFBF7;   /* ivory card */
  --ink:           #1A1815;   /* charcoal */
  --text:          #1A1815;
  --text-muted:    #5A544B;
  --text-subtle:   #8A8275;
  --border:        #E6DFD1;
  --border-strong: #D4CBB8;
  --accent:        #B5542A;   /* burnt sienna — light-mode accent */
  --accent-hover:  #9A4620;
  --amber:         #E8A33D;   /* for decorative accents only */
  --sage:          #5F7F62;   /* semantic: stable / close */
  --terracotta:    #B94A3A;   /* semantic: warning / cooling */

  /* Type stacks */
  --serif:   "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --rounded: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wordmark: "Bricolage Grotesque", ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;

  /* Radii whitelist */
  --r-6:  6px;
  --r-10: 10px;
  --r-14: 14px;
  --r-20: 20px;

  /* Motion budget */
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  color: var(--text);
  font-family: var(--rounded);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.detail-page {
  background:
    radial-gradient(circle at 78% 16%, rgba(232, 163, 61, 0.16), transparent 24%),
    radial-gradient(circle at 28% 10%, rgba(181, 84, 42, 0.08), transparent 20%),
    var(--bg);
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
a:hover { color: var(--accent); }

.page {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

.detail-main,
.detail-page .page {
  width: min(1160px, calc(100% - 40px));
}

.detail-hero {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

/* Inside a centered .detail-hero, the .sub and .hero-note paragraphs have
   their own max-widths but were missing horizontal auto margins, so the
   text was centered while the block anchored left. Center the block too. */
.detail-hero .sub,
.detail-hero .hero-note {
  margin-left: auto;
  margin-right: auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 18px;
}

.detail-grid--stacked {
  grid-template-columns: 1fr;
}

.detail-card,
.viz-card {
  margin: 0;
}

.detail-card h2,
.viz-card h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.detail-card p,
.viz-card p {
  color: var(--text-muted);
}

.signal-bars {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.signal-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 108px;
  gap: 12px;
  align-items: center;
}

.signal-row span,
.signal-row strong {
  font-size: 13px;
}

.signal-row span {
  color: var(--text-muted);
}

.signal-row strong {
  color: var(--ink);
  text-align: right;
  font-weight: 600;
}

.signal-bar {
  height: 10px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}

.signal-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
}

.signal-bar--thin span {
  background: linear-gradient(90deg, rgba(181, 84, 42, 0.7), rgba(232, 163, 61, 0.75));
}

.signal-bar--zero {
  border: 1px dashed var(--border-strong);
  background: transparent;
}

.flow-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  align-items: stretch;
}

.flow-node {
  position: relative;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-14);
  background: color-mix(in srgb, var(--card) 94%, transparent);
}

.flow-node--middle::before,
.flow-node--middle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--border-strong);
}

.flow-node--middle::before {
  left: -18px;
}

.flow-node--middle::after {
  right: -18px;
}

.flow-node__label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flow-node strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
}

.flow-node small {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Site chrome — shared header + footer ----------------------------------- */

.home-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid rgba(230, 223, 209, 0.72);
}

.home-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 12px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--wordmark);
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--accent);
  transition: color 140ms var(--ease);
}
.home-brand:hover { color: var(--accent-hover); }

.home-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 140ms var(--ease);
}

.home-nav a:hover,
.home-nav a.active {
  color: var(--accent);
}

/* Canonical global nav (index-derived) ------------------------------------ */

.home-topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid rgba(230, 223, 209, 0.72);
}

.home-topbar__inner {
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0 12px;
}

.home-topbar .home-brand {
  display: inline-flex;
  align-items: center;
}

.home-topbar .home-brand img {
  display: block;
  height: 26px;
  width: auto;
}

.home-topbar__links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.home-topbar__links a:not(.apply-pill) {
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--rounded);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 140ms var(--ease);
}

.home-topbar__links a:not(.apply-pill):hover,
.home-topbar__links a.active {
  color: var(--accent);
}

.home-topbar .apply-pill,
.home-nav .apply-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--r-14);
  background: var(--accent);
  color: var(--card);
  text-decoration: none;
  font-family: var(--rounded);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 140ms var(--ease), transform 140ms var(--ease), color 140ms var(--ease);
}

.home-topbar .apply-pill:hover,
.home-topbar .apply-pill.active,
.home-nav .apply-pill:hover,
.home-nav .apply-pill.active {
  background: var(--accent-hover);
  color: var(--card);
  transform: translateY(-1px);
}

/* Hero -------------------------------------------------------------------- */

.hero { margin-bottom: 40px; }
.eyebrow {
  font-family: var(--rounded);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-subtle); font-weight: 600;
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 16px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .sub {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 52ch;
}

.hero-note {
  margin: -4px 0 0;
  max-width: 54ch;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.55;
}

/* Rhythm chart ------------------------------------------------------------ */

.rhythm {
  margin: 40px 0;
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-20);
}
.rhythm__label {
  font-family: var(--rounded);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-subtle); font-weight: 600;
  margin-bottom: 18px;
}
.rhythm__bar {
  display: flex;
  height: 14px;
  width: 100%;
  border-radius: var(--r-6);
  overflow: hidden;
  background: var(--bg-alt);
}
.rhythm__seg {
  height: 100%;
  transition: filter 140ms var(--ease);
}
.rhythm__seg:hover { filter: brightness(1.08); }
.rhythm__seg.is-close       { background: var(--sage);       }
.rhythm__seg.is-connected   { background: var(--accent);     }
.rhythm__seg.is-cooling     { background: var(--amber);      }
.rhythm__seg.is-missing     { background: var(--terracotta); opacity: 0.8; }
.rhythm__seg.is-lost        { background: var(--text-subtle); }
.rhythm__legend {
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  margin-top: 16px;
  font-family: var(--rounded);
  font-size: 12px;
  color: var(--text-muted);
}
.rhythm__legend-item { display: inline-flex; align-items: center; gap: 7px; }
.rhythm__swatch {
  width: 10px; height: 10px; border-radius: var(--r-6);
  display: inline-block;
}
.rhythm__swatch.is-close     { background: var(--sage); }
.rhythm__swatch.is-connected { background: var(--accent); }
.rhythm__swatch.is-cooling   { background: var(--amber); }
.rhythm__swatch.is-missing   { background: var(--terracotta); opacity: 0.8; }
.rhythm__swatch.is-lost      { background: var(--text-subtle); }
.rhythm__legend-count { color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.rhythm__caption {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* Why now · loneliness infographic ---------------------------------------- */

.whynow {
  margin: 56px 0 40px;
  padding: 44px 0;
  position: relative;
}
.whynow__eyebrow {
  font-family: var(--rounded);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-subtle); font-weight: 600;
  margin: 0 0 10px;
}
.whynow__title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 28px;
}
.whynow__title em { font-style: italic; color: var(--accent); }

.whynow__hero-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-20);
  padding: 32px 30px;
  margin-bottom: 20px;
}
.whynow__timeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}
.whynow__year {
  font-family: var(--rounded);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-subtle); font-weight: 600;
  margin-bottom: 6px;
}
.whynow__big {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 4.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.whynow__big.is-now { color: var(--accent); }
.whynow__arrow {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-subtle);
  padding: 0 8px;
  font-style: italic;
}
.whynow__hero-caption {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  max-width: 58ch;
}
.whynow__hero-caption strong { color: var(--ink); font-weight: 600; }

.whynow__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.whynow__stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-14);
  padding: 22px 20px;
}
.whynow__stat-num {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.whynow__stat-text {
  font-family: var(--rounded);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}
.whynow__source {
  margin: 24px 0 0;
  font-family: var(--rounded);
  font-size: 12px;
  color: var(--text-subtle);
}
.whynow__source a { color: var(--text-subtle); text-underline-offset: 2px; }
.whynow__source a:hover { color: var(--ink); }

/* Parallax fade-up — elements with .reveal translate in as they enter view.
   JS toggles .is-visible via IntersectionObserver. Respect reduced-motion. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* How it works + privacy + inline survey ---------------------------------- */

.howit {
  margin: 48px 0 40px;
}
.howit__privacy {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-10);
}
.howit__privacy p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0;
  max-width: 62ch;
}
.howit__privacy p em { font-style: normal; color: var(--accent); font-weight: 600; }

.survey {
  margin: 40px 0;
}
.survey__intro {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  max-width: 58ch;
}

/* Block sections ---------------------------------------------------------- */

.block { margin: 48px 0; }
.block h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 16px;
}
.block h2 em { font-style: italic; color: var(--accent); }
.block p {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 16px;
  max-width: 62ch;
}
.block p.fine {
  font-family: var(--rounded);
  font-size: 13px;
  color: var(--text-subtle);
}

/* CTAs -------------------------------------------------------------------- */

.cta-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 28px 0 8px;
}
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--card);
  padding: 13px 22px; border-radius: var(--r-14);
  font-family: var(--rounded);
  font-weight: 600; font-size: 15px; border: none; cursor: pointer;
  text-decoration: none;
  transition: background 140ms var(--ease), transform 140ms var(--ease);
}
.cta:hover { background: var(--accent-hover); transform: translateY(-1px); color: var(--card); }
.cta.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--border-strong);
}
.cta.ghost:hover { background: var(--bg-alt); color: var(--ink); transform: translateY(-1px); }

/* Cards ------------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-20);
  padding: 24px 26px;
  margin: 20px 0;
}

/* Tiles grid -------------------------------------------------------------- */

.grid-2, .grid-3 {
  display: grid; gap: 14px;
  margin: 20px 0;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-14);
  padding: 18px 20px;
}
.tile .th {
  font-family: var(--rounded);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.tile .td {
  font-family: var(--rounded);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Form (used on /beta/) --------------------------------------------------- */

.field {
  margin: 0 0 20px;
  min-inline-size: 0;
}

fieldset.field {
  padding: 0;
  border: 0;
}

.field legend,
.field label,
.field .fl {
  display: block;
  font-family: var(--rounded);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  padding: 0;
}

.field-hint {
  margin: 0 0 12px;
  color: var(--text-subtle);
  font-family: var(--rounded);
  font-size: 13px;
  line-height: 1.45;
}

.field-optional {
  color: var(--text-subtle);
  font-weight: 400;
}

.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-10);
  background: var(--bg);
  font: inherit;
  font-family: var(--rounded);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.choices label {
  display: inline-flex; align-items: center;
  padding: 9px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-6);
  font-size: 14px; font-weight: 500;
  color: var(--ink); cursor: pointer; margin: 0;
}
.choices label:hover { border-color: var(--accent); }
.choices input[type="radio"]:checked + label {
  background: var(--accent);
  color: var(--card);
  border-color: var(--accent);
}
.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--rounded);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 10px;
}
.consent-row input[type="checkbox"] { margin-top: 3px; }
.consent-row:last-of-type { margin-bottom: 0; }
.status {
  min-height: 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.status[data-kind="error"] { color: var(--terracotta); }
.status[data-kind="success"] { color: var(--accent); }

@media (max-width: 860px) {
  .home-shell {
    width: min(100%, calc(100% - 32px));
  }
  .home-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-nav {
    justify-content: flex-start;
  }
  .detail-grid,
  .flow-chart,
  .signal-row {
    grid-template-columns: 1fr;
  }
  .signal-row strong {
    text-align: left;
  }
  .flow-node--middle::before,
  .flow-node--middle::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-nav {
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .home-topbar__links {
    gap: 9px 12px;
  }
}
