/* dorflerpatrik.com/headroom/plan — one field, then the plan.
   Tokens, type and the pill form come from ../base.css. The page has two faces:
   .ask (centred, the landing's voice) and .sheet (a left-aligned reading column).
   plan.js switches #plan[data-state]: empty | loading | running | done | shared. */

.plan {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--menubar-h) + 24px) var(--gutter) calc(48px + env(safe-area-inset-bottom));
}
.plan[data-state="loading"] .ask { visibility: hidden; }

/* ================= ASK ================= */
.ask {
  flex: 1;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding-bottom: 8vh;
}
.ask[hidden], .sheet[hidden], .after[hidden] { display: none; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none;
  animation: rise 0.7s var(--out) both;
}
.brand img { width: 30px; height: 30px; border-radius: 22.37%; }

.ask-title {
  margin-top: clamp(16px, 2.6vh, 26px);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02; font-weight: 700; letter-spacing: -0.04em;
  text-wrap: balance;
  animation: rise 0.9s 0.06s var(--out) both;
}
.ask-form {
  margin-top: clamp(32px, 5.4vh, 52px);
  width: min(100%, 540px);
  animation: rise 0.9s 0.14s var(--out) both;
}
.ask[data-back] > * { animation: none; }
.ask .join-note:empty { visibility: hidden; }

/* ================= SHEET ================= */
.sheet {
  width: min(100%, 680px);
  padding-top: clamp(40px, 9vh, 104px);
  animation: rise 0.6s var(--out) both;
}

.site-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 36px;
}
.site-host {
  min-width: 0;
  display: flex; align-items: center; gap: 9px;
  min-height: 22px;
  font-size: 15px; font-weight: 500; color: var(--muted);
  letter-spacing: -0.005em;
}
.site-icon { width: 20px; height: 20px; border-radius: 5px; flex: none; background: #fff; }
.site-icon[hidden] { display: none; }

.site-title {
  margin-top: 10px;
  min-height: 1.1em;
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.1; font-weight: 700; letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.site-desc {
  margin-top: 14px;
  font-size: 19px; line-height: 1.45;
  color: rgba(255, 255, 255, 0.6);
  text-wrap: pretty;
}
.site-desc[hidden] { display: none; }

/* ---------- the steps ---------- */
.steps {
  margin-top: clamp(44px, 7vh, 64px);
  border-top: 1px solid var(--hair);
}
.steps > li {
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--hair);
}
.num {
  font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.steps > .next { border-bottom: 0; }
.steps > .next .num { color: rgba(255, 255, 255, 0.18); }

.step h2 {
  font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em;
  text-wrap: pretty;
}
.step p {
  margin-top: 10px;
  font-size: 18px; line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  text-wrap: pretty;
}
.step.static { animation: rise 0.6s var(--out) both; }
.step.static:nth-child(2) { animation-delay: 60ms; }
.step.static:nth-child(3) { animation-delay: 120ms; }

/* a word arriving */
.w {
  display: inline-block;
  animation: word 0.56s var(--out) both;
  animation-delay: var(--d, 0ms);
}
@keyframes word {
  from { opacity: 0; filter: blur(8px); transform: translateY(0.18em); }
  to { opacity: 1; filter: none; transform: none; }
}

/* their own words, marked as they land */
.cite {
  color: #fff;
  background-image: linear-gradient(rgba(255, 77, 99, 0.4), rgba(255, 77, 99, 0.4));
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: 100% 100%;
  border-radius: 5px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0.04em 0.18em;
  margin: 0 -0.06em;
}
.live .cite {
  animation: mark var(--len, 600ms) cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes mark { from { background-size: 0% 100%; } }
.sheet[data-still] .w, .static .w { animation: none; }

/* ================= AFTER ================= */
.after {
  margin-top: 40px;
  animation: rise 0.7s var(--out) both;
}

.share-copy {
  flex: none;
  height: 36px; padding: 0 16px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.2s var(--out), background-color 0.2s;
}
.share-copy[hidden] { display: none; }
.share-copy:not([hidden]) { animation: rise 0.5s var(--out) both; }
.share-copy:hover { background: rgba(255, 255, 255, 0.2); }
.share-copy:active { transform: scale(0.96); }
.share-copy[data-done="1"] { background: #fff; color: #000; }

.keep {
  margin-top: clamp(64px, 11vh, 104px);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.keep-title {
  margin-bottom: 24px;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.1; font-weight: 700; letter-spacing: -0.03em;
  text-wrap: balance;
}
.keep .join { width: min(100%, 480px); }

.again {
  display: flex; justify-content: center; gap: 28px;
  margin-top: clamp(56px, 9vh, 88px);
  font-size: 15px;
}
.again a { color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.again a:hover { color: #fff; }

@media (max-width: 600px) {
  .ask { padding-bottom: 12vh; }
  .ask-title { font-size: clamp(36px, 10.4vw, 52px); }
  .sheet { padding-top: 28px; }
  .site-title { font-size: 32px; }
  .site-desc { font-size: 17px; }
  .steps > li { grid-template-columns: 34px minmax(0, 1fr); padding: 24px 0 26px; }
  .num, .step h2 { font-size: 21px; }
  .step p { font-size: 17px; }
  .keep-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .plan *, .plan *::before { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
