/*
 * AfterLyfe marketing surface.
 *
 * Shares the product's palette so the site and the app feel like one thing.
 * The rules here lean on air and type scale rather than ornament: the subject
 * matter is heavy enough that decoration reads as insincerity.
 */

:root {
  color-scheme: light;
  --canvas: #fffdfa;
  --canvas-deep: #f6f1ea;
  --surface: #ffffff;
  --surface-soft: #f2f7f6;
  --surface-warm: #fff8f2;
  --ink: #073f43;
  --text: #263f40;
  --muted: #6b7776;
  --muted-soft: #8b9695;
  --border: #e4ded4;
  --border-strong: #c9d2cf;
  --teal: #075158;
  --teal-hover: #043f45;
  --amber: #c98208;
  --rose: #ce8065;
  --rose-soft: #fff0e9;
  --success: #29735e;
  --focus: #d69931;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 18px 45px rgb(7 63 67 / 7%);
  --shadow-lift: 0 28px 70px rgb(7 63 67 / 12%);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", Baskerville, "Palatino Linotype", Palatino, "Times New Roman", serif;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(4.5rem, 11vw, 9rem);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 78% -8%, var(--surface-warm) 0%, transparent 62%),
    radial-gradient(900px 520px at 6% 6%, var(--surface-soft) 0%, transparent 55%),
    var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 65%, transparent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 0.75rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- type --- */

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

h1 { font-size: clamp(2.4rem, 6.4vw, 4.15rem); line-height: 1.06; }
h2 { font-size: clamp(1.85rem, 4vw, 2.85rem); line-height: 1.14; }
h3 { font-size: clamp(1.2rem, 2vw, 1.42rem); line-height: 1.25; }

p { margin: 0; text-wrap: pretty; }
a { color: var(--teal); text-underline-offset: 3px; }

.lede {
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  line-height: 1.55;
  color: var(--text);
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.muted { color: var(--muted); }

/* Used for the single line in a section that should land hardest. */
.pull {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.3;
  color: var(--ink);
  max-width: 30rem;
}

/* -------------------------------------------------------------- layout --- */

.shell {
  width: min(70rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell-narrow { width: min(48rem, 100%); }

section { padding-block: var(--section-gap); }
section.tight { padding-block: clamp(3rem, 7vw, 5rem); }

.band {
  background: var(--surface);
  border-block: 1px solid var(--border);
}
.band-warm {
  background: linear-gradient(180deg, var(--surface-warm), var(--canvas));
  border-block: 1px solid var(--border);
}
.band-deep {
  background: var(--ink);
  color: color-mix(in srgb, #ffffff 88%, var(--surface-soft));
}
.band-deep h2, .band-deep h3 { color: #fff; }
.band-deep .muted { color: color-mix(in srgb, #ffffff 66%, transparent); }
.band-deep a { color: color-mix(in srgb, var(--amber) 78%, #fff); }

.stack > * + * { margin-top: 1.15rem; }
.stack-lg > * + * { margin-top: 2rem; }

.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }

.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head > * + * { margin-top: 1rem; }

/* -------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.site-header[data-scrolled='true'] {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--canvas) 96%, transparent);
}
.site-header .shell {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
}
.wordmark-leaf { color: var(--amber); font-size: 0.78em; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.94rem;
}
.site-nav a:hover { color: var(--teal); text-decoration: underline; }
@media (max-width: 46rem) {
  .site-nav a[data-optional] { display: none; }
}

/* -------------------------------------------------------------- button --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 26px rgb(7 81 88 / 22%);
}
.button-primary:hover { background: var(--teal-hover); }

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.button-quiet:hover { background: var(--surface); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------------------------------------------------------------- hero --- */

/* Kept deliberately shallow: the intent router below is the first real decision
   on the page and has to be reachable without scrolling on a laptop. */
.hero { padding-block: clamp(2.25rem, 5vw, 3.75rem) clamp(1.5rem, 3vw, 2.25rem); }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.4rem; max-width: 30rem; }
.hero .button-row { margin-top: 1.85rem; }

.hero-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 30rem;
}
.hero-note::before {
  content: '◇';
  color: var(--amber);
  /* Aligns to the first line rather than the centre of a wrapped block. */
  line-height: inherit;
  flex: none;
}

/* -------------------------------------------------------- intent router --- */

.router { padding-block: 0 var(--section-gap); }
.router-head { margin-bottom: 1.35rem; max-width: 34rem; }
.router-head h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }

.router-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.router-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.router-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.router-card .router-mark {
  font-size: 1.35rem;
  color: var(--amber);
  line-height: 1;
}
.router-card h3 { font-size: 1.22rem; }
.router-card p { font-size: 0.95rem; color: var(--muted); }
.router-card .router-go {
  margin-top: auto;
  padding-top: 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.router-card:hover .router-go span { transform: translateX(3px); }
.router-card .router-go span { transition: transform 180ms ease; }

/* --------------------------------------------------------- prompt card --- */

/* Deliberately object-like: a card you could hold. It is the one piece of the
   site that should feel physical, because the printed deck is a real thing. */
.prompt-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-soft);
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.prompt-card::before {
  content: '';
  position: absolute;
  inset: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}
.prompt-theme {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.prompt-question {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  line-height: 1.28;
  color: var(--ink);
}
.prompt-stem {
  margin-top: auto;
  padding: 0.95rem 1.1rem;
  background: var(--surface-warm);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--text);
}
.prompt-stem em {
  font-style: normal;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
}
.prompt-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.prompt-card[data-swapping='true'] .prompt-question,
.prompt-card[data-swapping='true'] .prompt-stem,
.prompt-card[data-swapping='true'] .prompt-theme {
  opacity: 0;
  transition: opacity 130ms ease;
}
.prompt-card .prompt-question,
.prompt-card .prompt-stem,
.prompt-card .prompt-theme {
  opacity: 1;
  transition: opacity 260ms ease;
}

/* --------------------------------------------------------------- cards --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 2.6vw, 1.9rem);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.card h3 { font-size: 1.15rem; }
.card p { font-size: 0.96rem; color: var(--muted); }
.card-mark { font-size: 1.3rem; color: var(--amber); line-height: 1; }

.band-deep .card {
  background: color-mix(in srgb, #ffffff 8%, transparent);
  border-color: color-mix(in srgb, #ffffff 16%, transparent);
  box-shadow: none;
}
.band-deep .card p { color: color-mix(in srgb, #ffffff 70%, transparent); }

/* Two-column feature row that alternates side. */
.feature {
  display: grid;
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}
.feature + .feature { margin-top: clamp(3.5rem, 8vw, 6rem); }
.feature-copy > * + * { margin-top: 1.05rem; }

/* ------------------------------------------------------------ vignette --- */

/* A quiet illustrative panel standing in for a screenshot. */
.vignette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.vignette-label {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.bubble {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.97rem;
  max-width: 88%;
}
.bubble-ask {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.bubble-answer {
  background: var(--rose-soft);
  border: 1px solid color-mix(in srgb, var(--rose) 30%, transparent);
  border-bottom-right-radius: 5px;
  align-self: flex-end;
}
.bubble-who {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.photo-plate {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--rose) 22%, transparent), transparent 58%),
    linear-gradient(30deg, color-mix(in srgb, var(--teal) 16%, transparent), transparent 55%),
    var(--canvas-deep);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted-soft);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- list --- */

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.ticks li {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.65rem;
  align-items: start;
  font-size: 0.99rem;
}
.ticks li::before {
  content: '◇';
  color: var(--amber);
  line-height: 1.6;
}
.band-deep .ticks li::before { color: var(--amber); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1.5rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--amber);
  padding-top: 0.1rem;
}
.steps h3 { font-size: 1.08rem; margin-bottom: 0.3rem; }
.steps p { font-size: 0.96rem; color: var(--muted); }

/* ------------------------------------------------------------ evidence --- */

.citation {
  border-left: 2px solid var(--border-strong);
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
}
.citation-finding { font-size: 1rem; color: var(--text); }
.citation-ref { font-size: 0.86rem; color: var(--muted); }
.citation-ref cite { font-style: italic; }
.citation-ref a { color: var(--teal); }

/* ---------------------------------------------------------------- form --- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-soft);
}

.field { display: grid; gap: 0.4rem; margin-bottom: 1.15rem; }
.field > label, .fieldset-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.field-hint { font-size: 0.85rem; color: var(--muted); }

.field input[type='text'],
.field input[type='email'],
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--canvas);
}
.field textarea { min-height: 6.5rem; resize: vertical; }

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.15rem;
}
.choice-row { display: grid; gap: 0.55rem; margin-top: 0.6rem; }
.choice {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--canvas);
  cursor: pointer;
  font-size: 0.96rem;
}
.choice:hover { border-color: var(--border-strong); }
.choice input { margin-top: 0.25rem; }
.choice strong { display: block; color: var(--ink); font-weight: 600; }
.choice span { font-size: 0.88rem; color: var(--muted); }
.choice:has(input:checked) {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
}
.form-status[hidden] { display: none; }
.form-status[data-tone='ok'] {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  color: var(--success);
}
.form-status[data-tone='error'] {
  background: var(--rose-soft);
  border: 1px solid color-mix(in srgb, var(--rose) 40%, transparent);
  color: #8d4a33;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  font-size: 0.94rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.footer-grid h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--teal); text-decoration: underline; }
.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* ------------------------------------------------------------- motion --- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 620ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- print --- */

@media print {
  @page { margin: 14mm; }

  body {
    background: #fff;
    font-size: 12pt;
  }
  .site-header, .site-footer, .no-print { display: none !important; }
  section { padding-block: 0; }
  [data-reveal] { opacity: 1; transform: none; }

  .print-deck {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
  }
  .print-card {
    break-inside: avoid;
    border: 1.2pt solid #073f43;
    border-radius: 4mm;
    padding: 8mm 7mm;
    min-height: 62mm;
    display: flex;
    flex-direction: column;
    gap: 4mm;
  }
  .print-card .prompt-theme { color: #8a5c05; font-size: 8pt; }
  .print-card .prompt-question {
    /* Large print is not a nicety here — these are read across a table by
       people who left their glasses in the other room. */
    font-size: 15pt;
    line-height: 1.3;
  }
  .print-card .prompt-stem {
    margin-top: auto;
    border: 0.8pt dashed #7d8886;
    background: transparent;
    font-size: 12pt;
  }
  .page-break { break-before: page; }
}

/* ------------------------------------------------------------- pricing --- */

/* Scoped to `.card` so it outranks `.card p`, which would otherwise render the
   figure at body size. */
.card .price,
.price {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.1rem);
  line-height: 1;
  color: var(--ink);
  margin: 0.35rem 0 0.5rem;
}
.card .price span,
.price span {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

#pricing .card { gap: 0.5rem; }
#pricing .card .button { margin-top: 0.9rem; align-self: flex-start; }
