/* ============================================================
   Nearly Departed — promo
   Cinematic dusk editorial. Brand-matched to the iOS app.
   ============================================================ */

/* ---- Clash Display (self-hosted, identical to the app) ---- */
@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* warm-tinted near-black + bone white — never pure #000/#fff */
  --bg: oklch(0.14 0.005 70);
  --bg-deep: oklch(0.1 0.004 70);
  --ink: oklch(0.97 0.006 85);
  --ink-muted: oklch(0.75 0.008 80);
  --ink-faint: oklch(0.56 0.009 80);
  --ember: oklch(0.81 0.13 70); /* candlelight — used at ~10% */
  --hairline: oklch(0.97 0.006 85 / 0.14);
  --hairline-soft: oklch(0.97 0.006 85 / 0.08);

  --font-display: "Clash Display", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;

  /* 4pt scale */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);

  --shell: min(1200px, 92vw);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain — fixed, non-interactive, GPU-cheap */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  padding: clamp(20px, 4vw, 40px);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* the app's exact gradient stops + a left wash for text legibility */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to right,
      oklch(0.1 0.004 70 / 0.72) 0%,
      oklch(0.1 0.004 70 / 0.1) 52%,
      transparent 72%
    ),
    linear-gradient(
      to bottom,
      oklch(0.1 0.004 70 / 0.5) 0%,
      transparent 16%,
      transparent 40%,
      oklch(0.1 0.004 70 / 0.42) 60%,
      oklch(0.1 0.004 70 / 0.9) 82%,
      var(--bg) 100%
    );
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.topbar__meta {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- hero content, bottom-left ---- */
.hero__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-bottom: clamp(8px, 3vh, 40px);
}

/* content-anchored scrim — guarantees text legibility no matter where the
   bottom-anchored content lands over the photo (the mid-zone is the brightest
   part on tall mobile crops). Transparent at the top so the wordmark stays
   crisp; full-bleed so it reads as atmosphere, not a band. */
.hero__body::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  inset-block: 0 -140px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    oklch(0.1 0.004 70 / 0.5) 10%,
    oklch(0.1 0.004 70 / 0.78) 32%,
    oklch(0.1 0.004 70 / 0.9) 64%,
    var(--bg) 100%
  );
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: oklch(0.97 0.006 85 / 0.04);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 var(--ember);
  animation: pulse 2.6s var(--ease-out-expo) infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 oklch(0.81 0.13 70 / 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px oklch(0.81 0.13 70 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 oklch(0.81 0.13 70 / 0);
  }
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 13vw, 9rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-shadow: 0 2px 40px oklch(0.1 0.004 70 / 0.55);
}

.tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink);
  max-width: 30ch;
  text-wrap: balance;
  text-shadow: 0 1px 18px oklch(0.1 0.004 70 / 0.7);
}

.sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 52ch;
}

/* ---- CTA row ---- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.5s var(--ease-fluid),
    background 0.4s var(--ease-fluid),
    border-color 0.4s var(--ease-fluid);
  will-change: transform;
}
.btn:active {
  transform: scale(0.975);
}

/* primary — white pill, dark text, button-in-button arrow */
.btn--primary {
  padding: 13px 13px 13px 26px;
  background: var(--ink);
  color: oklch(0.16 0.006 70);
}
.btn--primary:hover {
  background: oklch(1 0 0);
}
.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: oklch(0.16 0.006 70 / 0.09);
  transition: transform 0.5s var(--ease-fluid);
}
.btn--primary:hover .btn__icon {
  transform: translate(2px, -2px) scale(1.05);
}
.btn__icon svg {
  width: 16px;
  height: 16px;
}

/* secondary — translucent outline */
.btn--ghost {
  padding: 13px 24px;
  color: var(--ink);
  background: oklch(0.97 0.006 85 / 0.06);
  border-color: var(--hairline);
}
.btn--ghost:hover {
  background: oklch(0.97 0.006 85 / 0.12);
  border-color: oklch(0.97 0.006 85 / 0.28);
}

/* ---- footer ---- */
.hero__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  width: 100%;
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline-soft);
  font-size: 13px;
  color: var(--ink-faint);
}
.hero__footer a {
  color: var(--ink-muted);
  transition: color 0.3s var(--ease-out-expo);
}
.hero__footer a:hover {
  color: var(--ink);
}
.hero__footer .spacer {
  margin-left: auto;
}

/* ============================================================
   Load stagger
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  animation: rise 0.9s var(--ease-out-expo) forwards;
}
.reveal[data-d="1"] {
  animation-delay: 0.05s;
}
.reveal[data-d="2"] {
  animation-delay: 0.16s;
}
.reveal[data-d="3"] {
  animation-delay: 0.28s;
}
.reveal[data-d="4"] {
  animation-delay: 0.4s;
}
.reveal[data-d="5"] {
  animation-delay: 0.54s;
}
.reveal[data-d="6"] {
  animation-delay: 0.68s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .dot {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Legal / support (privacy.html, terms.html, support.html)
   ============================================================ */
.doc {
  max-width: 72ch;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 32px) var(--space-4xl);
}
.doc__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: var(--space-2xl);
  transition: color 0.3s var(--ease-out-expo);
}
.doc__back:hover {
  color: var(--ink);
}
.doc h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}
.doc .meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: var(--space-2xl);
}
.doc h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: var(--space-2xl) 0 var(--space-sm);
}
.doc h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: var(--space-lg) 0 var(--space-2xs);
}
.doc p,
.doc li {
  color: var(--ink-muted);
  margin-bottom: var(--space-sm);
}
.doc ul {
  padding-left: 1.2em;
  margin-bottom: var(--space-md);
}
.doc li::marker {
  color: var(--ink-faint);
}
.doc strong {
  color: var(--ink);
  font-weight: 600;
}
.doc a:not(.doc__back) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}
.doc a:not(.doc__back):hover {
  text-decoration-color: var(--ember);
}

@media (max-width: 768px) {
  .hero__body {
    gap: var(--space-md);
  }
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
  }
  .btn--primary {
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .topbar__meta {
    display: none;
  }
}

/* ============================================================
   B — promo sections
   ============================================================ */

/* scroll cue — bottom-right of hero, out of the content's way */
.scrollcue {
  position: absolute;
  right: clamp(20px, 4vw, 40px);
  bottom: clamp(18px, 4vw, 36px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.3s var(--ease-out-expo);
}
.scrollcue:hover {
  color: var(--ink);
}
.scrollcue svg {
  width: 16px;
  height: 16px;
  animation: nudge 2.4s var(--ease-out-expo) infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* shared section scaffolding */
.section-head {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: var(--space-md);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 18ch;
  text-wrap: balance;
}

/* ---- how it works ---- */
.how {
  padding: clamp(72px, 12vh, 150px) 0 clamp(32px, 6vh, 64px);
}
.step {
  display: flex;
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(36px, 7vh, 80px) clamp(20px, 5vw, 40px);
}
.step--rev {
  flex-direction: row-reverse;
}
.step__text {
  flex: 1;
}
.step__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-faint);
  margin-bottom: var(--space-md);
}
.step h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-md);
}
.step p {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 44ch;
}

/* ---- phone frame (double-bezel) ---- */
.phone {
  flex-shrink: 0;
  width: clamp(228px, 30vw, 308px);
  padding: 7px;
  border-radius: 46px;
  background: linear-gradient(
    158deg,
    oklch(0.3 0.006 75),
    oklch(0.15 0.005 70)
  );
  box-shadow:
    0 50px 90px -34px oklch(0.05 0.004 70 / 0.85),
    0 0 0 1px var(--hairline),
    inset 0 1px 1px oklch(0.97 0.006 85 / 0.14);
}
.phone img {
  display: block;
  width: 100%;
  border-radius: 40px;
}

/* ---- tenets band ---- */
.tenets {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 40px) clamp(24px, 4vw, 56px);
  max-width: var(--shell);
  margin: clamp(40px, 7vh, 88px) auto;
  padding: clamp(28px, 4vw, 40px) clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
}
.tenet {
  flex: 1 1 200px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-faint);
}
.tenet strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 2px;
}

/* ---- faq ---- */
.faq {
  padding: clamp(64px, 11vh, 140px) 0;
}
.faq__list {
  max-width: min(820px, 92vw);
  margin: var(--space-2xl) auto 0;
  padding: 0 clamp(20px, 5vw, 40px);
}
.faq details {
  border-top: 1px solid var(--hairline-soft);
  padding: var(--space-lg) 0;
}
.faq details:last-child {
  border-bottom: 1px solid var(--hairline-soft);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink-faint);
  transition: transform 0.4s var(--ease-fluid);
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  max-width: 64ch;
  margin-top: var(--space-md);
  color: var(--ink-muted);
  line-height: 1.65;
}
.faq details a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}
.faq details a:hover {
  text-decoration-color: var(--ember);
}

/* ---- beta closing band ---- */
.beta {
  padding: clamp(40px, 8vh, 96px) clamp(20px, 5vw, 40px) clamp(72px, 12vh, 140px);
}
.beta__inner {
  position: relative;
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px);
  border-radius: 32px;
  overflow: hidden;
  background:
    radial-gradient(
      120% 140% at 85% 0%,
      oklch(0.81 0.13 70 / 0.1),
      transparent 55%
    ),
    oklch(0.17 0.006 70);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 1px oklch(0.97 0.006 85 / 0.08);
}
.beta__inner .eyebrow {
  margin-bottom: var(--space-lg);
}
.beta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-md);
}
.beta__sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 46ch;
  margin-bottom: var(--space-xl);
}

/* ---- footer ---- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-xl);
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--space-2xl) clamp(20px, 5vw, 40px) var(--space-3xl);
  border-top: 1px solid var(--hairline-soft);
}
.foot__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  font-size: 14px;
}
.foot__links a {
  color: var(--ink-muted);
  transition: color 0.3s var(--ease-out-expo);
}
.foot__links a:hover {
  color: var(--ink);
}
.foot__legal {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---- scroll reveal ---- */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo),
    filter 0.8s var(--ease-out-expo);
}
.reveal-up.in {
  opacity: 1;
  transform: none;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .scrollcue svg {
    animation: none;
  }
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .scrollcue {
    display: none;
  }
  .step,
  .step--rev {
    flex-direction: column;
    text-align: left;
    gap: var(--space-xl);
  }
  .phone {
    width: min(260px, 70vw);
  }
  .foot__legal {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ---- 404 ---- */
.notfound {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-lg);
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 48px);
}
.notfound .mark {
  margin-bottom: var(--space-sm);
}
.notfound h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.notfound p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--ink-muted);
  max-width: 42ch;
}
.notfound .btn {
  margin-top: var(--space-sm);
}
