/* Public landing page. Reuses the paper-and-moss tokens; the member area keeps
   prototype.css untouched. Motion is opt-in and fully disabled by
   prefers-reduced-motion. */

.landing {
  position: relative;
  overflow-x: clip;
  background:
    radial-gradient(1100px 520px at 76% -6%, #EFF2E4 0%, rgba(239, 242, 228, 0) 62%),
    var(--bg);
}
.landing :where(h1, h2, h3) { margin: 0; }
.landing-offline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid #E7D9CE;
  border-radius: 10px;
  background: #FBF1EA;
  color: #8B5A42;
  font-size: 13px;
}

/* ---------- header (anonymous only) ---------- */
.landing-nav { display: flex; align-items: center; height: 100%; gap: 34px; }
.landing-nav button {
  height: 100%;
  background: none;
  font-size: 14px;
  color: var(--ink-secondary);
  position: relative;
  white-space: nowrap;
}
.landing-nav button:hover { color: var(--primary); }
.landing-signin {
  background: none;
  padding: 8px 2px;
  font-size: 13px;
  color: var(--ink-secondary);
  border-bottom: 1px solid transparent;
}
.landing-signin:hover { color: var(--primary); border-bottom-color: var(--border-strong); }
.landing-join { min-height: 38px; padding: 8px 18px; font-size: 13px; }
.header.scrolled { box-shadow: 0 8px 24px #3A453010; }

/* ---------- hero ---------- */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: 48px;
  padding: 64px 0 56px;
  min-height: min(720px, calc(100vh - 82px));
}
.landing-title {
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: .02em;
  color: #343B2E;
  white-space: pre-line;
  margin: 0 0 24px !important;
}
.landing-lede {
  max-width: 448px;
  margin: 0 0 32px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 2;
}
.landing-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.landing-actions .btn { min-height: 48px; padding: 12px 26px; font-size: 14px; }
.landing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--ink-muted);
}
.landing-trust li { display: flex; align-items: center; gap: 7px; }
.landing-trust li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9DAA86;
}

.landing-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 600px;
  isolation: isolate;
}
.stage-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, 112%);
  aspect-ratio: 1;
  transform: translate(-50%, -54%);
  border-radius: 50%;
  background: radial-gradient(circle, #E6EBD6 0%, #EDF1E2 45%, rgba(248, 247, 243, 0) 71%);
  z-index: -1;
  animation: stage-glow 9s ease-in-out infinite;
}
.stage-badge {
  position: absolute;
  top: 4px;
  right: 0;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #FFFEFBB8;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
}
/* The tree itself stays still: an endlessly moving leaf would be a moving
   click target. The entrance animation carries the "growing" feeling, and the
   glow behind it does the slow breathing. */
.stage-tree { width: min(544px, 97%); }
.stage-tree svg { display: block; width: 100%; height: auto; }
/* Dense sapling: keep each hit area close to its own leaf so neighbouring
   leaves do not steal clicks, while staying above the 24px minimum target. */
.stage-tree .leaf-group > circle:not(.leaf-ring) { r: 18px; }
/* The selected leaf gets a dashed ring, so the card and the tree always agree. */
.stage-tree .leaf-ring { pointer-events: none; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .stage-tree .leaf-ring { animation: ring-in .35s ease-out; }
}
@keyframes ring-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

.stage-card {
  position: absolute;
  left: 0;
  bottom: 26px;
  width: min(342px, 92%);
  padding: 16px 18px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #FFFEFBF2;
  box-shadow: 0 20px 50px #38422C14;
  backdrop-filter: blur(6px);
}
.stage-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .02em;
}
.stage-card-head .dot { flex-shrink: 0; margin: 0; }
.stage-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.stage-quote {
  margin: 11px 0 13px !important;
  color: #37402F;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.75;
  min-height: 60px;
}
.stage-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.stage-tag { padding: 3px 9px; border-radius: 999px; background: #EFF2E6; color: #5B6A48; }
.stage-state { color: var(--ink-muted); }
.stage-next {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: none;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1;
  transition: background .2s, color .2s, transform .2s;
}
.stage-next:hover { background: var(--primary-soft); color: var(--primary); transform: translateX(2px); }

/* Rotating quote swap */
.swap-enter-active, .swap-leave-active { transition: opacity .3s ease, transform .3s ease; }
.swap-enter-from { opacity: 0; transform: translateY(7px); }
.swap-leave-to { opacity: 0; transform: translateY(-7px); }

/* ---------- stats ---------- */
.landing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 26px 0 30px;
  border-top: 1px solid var(--border);
}
.stat-cell { display: flex; align-items: baseline; gap: 2px; padding-left: 34px; }
.stat-cell:first-child { padding-left: 0; }
.stat-cell + .stat-cell { border-left: 1px solid var(--border); }
.stat-cell strong {
  font-family: Georgia, var(--font-display);
  font-size: 46px;
  font-weight: 400;
  line-height: 1;
  color: #3B4632;
  font-variant-numeric: tabular-nums;
  margin-right: .28em;
}
.stat-cell span { font-size: 12px; color: var(--ink-muted); }

/* ---------- shared section frame ---------- */
.landing-section { padding: 92px 0 0; scroll-margin-top: 92px; }
.landing-head { max-width: 660px; }
.landing-head h2 {
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .01em;
  color: #343B2E;
  margin: 0 0 14px !important;
}
.landing-head p:not(.eyebrow) {
  margin: 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-secondary);
}

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.step {
  display: flex;
  flex-direction: column;
  padding: 30px 28px 26px;
  background: var(--surface);
  transition: background .3s ease;
}
.step:hover { background: #FDFDF7; }
.step-no {
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: .2em;
  color: #8C9A72;
}
.step h3 { margin: 14px 0 9px !important; font-size: 17px; font-weight: 500; color: #3A4432; }
.step p { margin: 0; font-size: 13px; line-height: 1.95; color: var(--ink-secondary); }
.step-art { margin-top: auto; padding-top: 26px; }
.step-art svg {
  width: 108px;
  height: 62px;
  fill: none;
  stroke: #B4BEA0;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s cubic-bezier(.2, .7, .3, 1), stroke .3s;
}
.step:hover .step-art svg { transform: translateY(-4px); stroke: #8C9A72; }

/* ---------- dimensions ---------- */
.dim-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 40px 0 0;
}
.dim-card {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 22px 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1), border-color .3s, box-shadow .3s;
}
.dim-card:hover {
  transform: translateY(-3px);
  border-color: var(--dim, var(--border-strong));
  box-shadow: 0 14px 34px #39442D10;
}
.dim-ico {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #EFF2E6;
  background: color-mix(in srgb, var(--dim, #8C9A72) 15%, #FFFEFB);
  color: var(--dim, #8C9A72);
  font-size: 15px;
  margin-bottom: 12px;
}
.dim-card strong { font-size: 15px; font-weight: 500; color: #39432F; }
.dim-card small { font-size: 12px; line-height: 1.75; color: var(--ink-muted); }

/* ---------- promise band ---------- */
.landing-band {
  margin-top: 96px;
  padding: 74px 0 78px;
  background: #2E3728;
  color: #E9EDE1;
  scroll-margin-top: 92px;
}
.landing-band .eyebrow { color: #AEBD97; }
.landing-band .landing-head h2 { color: #F1F4EA; }
.landing-band .landing-head p:not(.eyebrow) { color: #C0C8B4; }
.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 46px;
}
.promise-grid article { border-top: 1px solid #4A5540; padding-top: 22px; }
.promise-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #55614A;
  border-radius: 50%;
  color: #CAD7B2;
  font-size: 12px;
}
.promise-grid h3 { margin: 15px 0 9px !important; font-size: 15px; font-weight: 500; color: #EFF3E7; }
.promise-grid p { margin: 0; font-size: 13px; line-height: 1.95; color: #BAC3AD; }

/* ---------- closing call to action ---------- */
.landing-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 96px 0 104px;
}
.landing-final h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.5;
  color: #343B2E;
  margin: 0 0 14px !important;
}
.landing-final p { margin: 0 0 30px; font-size: 14px; color: var(--ink-secondary); }
.landing-final .btn { min-height: 48px; padding: 12px 28px; }

/* ---------- auth inside the drawer ---------- */
.auth-card.auth-drawer {
  max-width: none;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  justify-self: stretch;
}
.auth-drawer .auth-tabs { margin-top: 2px; }
.auth-drawer .auth-intro { margin: 20px 0 4px; }
.auth-drawer .auth-privacy { margin-top: 26px; }

/* ---------- motion ---------- */
.is-animating .branch-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: branch-draw 1.05s cubic-bezier(.4, .05, .2, 1) both;
}
.is-animating .leaf-group {
  transform-box: fill-box;
  transform-origin: center;
  animation: leaf-pop .62s cubic-bezier(.2, .85, .3, 1.05) backwards;
}
@keyframes branch-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes leaf-pop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }
@keyframes stage-glow {
  0%, 100% { opacity: .62; transform: translate(-50%, -54%) scale(1); }
  50% { opacity: .92; transform: translate(-50%, -54%) scale(1.045); }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .8s cubic-bezier(.2, .7, .3, 1),
    transform .8s cubic-bezier(.2, .7, .3, 1);
  transition-delay: calc(var(--step, 0) * 90ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .is-animating .branch-line,
  .is-animating .leaf-group,
  .stage-glow,
  .stage-tree { animation: none !important; }
  .is-animating .branch-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .swap-enter-active, .swap-leave-active { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  .landing-hero { gap: 34px; padding: 52px 0 48px; }
  .landing-title { font-size: 43px; }
  .landing-stage { min-height: 520px; }
  .stage-tree { width: min(470px, 95%); }
  .stage-card { width: min(310px, 94%); }
  .promise-grid { gap: 30px; }
}
@media (max-width: 1023px) {
  .landing-nav { display: none; }
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 44px 0 40px;
  }
  .landing-title { font-size: 40px; max-width: 620px; }
  .landing-stage { min-height: 470px; margin-top: 6px; }
  .stage-tree { width: min(460px, 98%); }
  .stage-card { left: 0; bottom: 6px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { padding: 26px 24px; }
  .step-art { padding-top: 18px; }
  .dim-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promise-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .promise-grid article { padding: 22px 0; }
  .promise-grid article + article { border-top: 1px solid #4A5540; }
  .landing-band { margin-top: 74px; padding: 60px 0 64px; }
}
@media (max-width: 767px) {
  .landing-hero { padding: 30px 0 28px; gap: 4px; }
  .landing-title { font-size: 31px; line-height: 1.5; margin-bottom: 18px !important; }
  .landing-lede { font-size: 13px; line-height: 1.95; margin-bottom: 24px; }
  .landing-actions .btn { flex: 1 1 auto; }
  .landing-trust { gap: 6px 14px; margin-top: 22px; font-size: 11px; }
  .landing-stage {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 18px;
  }
  .stage-badge { position: static; align-self: flex-end; margin-bottom: 2px; }
  .stage-glow { width: 100%; }
  .stage-tree { width: min(330px, 88%); align-self: center; }
  .stage-card { position: static; width: 100%; margin-top: -6px; }
  .stage-quote { font-size: 16px; min-height: 0; }
  .landing-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 20px 0 22px; }
  .stat-cell { padding-left: 14px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .stat-cell:first-child { padding-left: 0; }
  .stat-cell strong { font-size: 30px; }
  .stat-cell span { font-size: 11px; }
  .landing-section { padding: 54px 0 0; }
  .landing-head h2 { font-size: 25px; }
  .landing-head p:not(.eyebrow) { font-size: 13px; }
  .steps { margin-top: 26px; border-radius: 14px; }
  .dim-grid { gap: 12px; margin-top: 26px; }
  .dim-card { padding: 17px 16px 18px; }
  .dim-card strong { font-size: 14px; }
  .dim-card small { font-size: 11px; }
  .landing-band { margin-top: 54px; padding: 45px 0 48px; }
  .landing-final { padding: 58px 0 62px; }
  .landing-final h2 { font-size: 25px; }
  .landing-final p { font-size: 13px; }
  .landing-signin { display: none; }
  .landing-join { min-height: 34px; padding: 6px 13px; font-size: 12px; }
  .landing-offline { margin-top: 14px; font-size: 12px; }
}
@media (max-width: 480px) {
  .dim-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-title { font-size: 27px; }
  .landing-stats { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stat-cell { flex-direction: row; align-items: baseline; padding: 12px 0; }
  .stat-cell + .stat-cell { border-left: 0; border-top: 1px solid var(--border); }
  .stat-cell strong { font-size: 28px; }
  .stat-cell span { font-size: 12px; }
}
