/* onboarding + auth — the first run. See public/css/app.css for tokens.
   Tokens only; every rule works in both themes. The sea band is dark in both
   themes (like the Today hero), so type on it is --ink-inv. Motion is
   transform/opacity only and stops under reduce-motion. */

/* ------------------------------------------------------------------ frame */
/* Full-bleed step screens: the sea band, a 28px title, a short lede, the
   step's content, then the actions pinned to the bottom. No tab bar here, so
   none of the .app padding that makes room for one. */
.ob-app {
  max-width: var(--shell); margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.ob-band {
  position: relative; overflow: hidden; isolation: isolate;
  padding: calc(env(safe-area-inset-top) + var(--sp-2)) var(--pad) 0;
  background: linear-gradient(170deg, var(--sea-deep) 0%, var(--sea) 55%, var(--sea-mid) 100%);
  color: var(--ink-inv);
}
@media (min-width: 541px) {
  .ob-band { border-radius: 0 0 var(--r-xl) var(--r-xl); }
}
/* The low sun of the Today hero, so the first screen already looks like the app. */
.ob-band::before {
  content: ''; position: absolute; inset: -40% -20% auto -20%; height: 150%;
  background: radial-gradient(55% 45% at 76% 18%, color-mix(in srgb, var(--sun) 38%, transparent), transparent 70%);
  z-index: -1; pointer-events: none;
}
.ob-band-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  min-height: var(--tap-min);
}
.ob-band-spacer { flex: none; width: var(--tap-min); height: var(--tap-min); }
.ob-band .icon-btn { color: var(--ink-inv); }
.ob-band .icon-btn:hover,
.ob-band .icon-btn:active { background: color-mix(in srgb, var(--ink-inv) 14%, transparent); }
.ob-band .icon-btn:focus-visible { outline-color: var(--ink-inv); }
.ob-band .step-dots i { background: var(--ink-inv); opacity: .35; }
.ob-band .step-dots i.done { background: var(--ink-inv); opacity: .7; }
.ob-band .step-dots i.on { background: var(--seaglass-2); opacity: 1; }

.ob-ship { display: grid; place-items: center; height: 64px; color: var(--ink-inv); }
.ob-ship svg { display: block; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--sea-deep) 40%, transparent)); }
@media (prefers-reduced-motion: no-preference) {
  .ob-ship svg { animation: ob-bob 5.5s ease-in-out infinite; }
}
:root[data-reduce-motion] .ob-ship svg { animation: none; }
@keyframes ob-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
.ob-band .hero-waves {
  display: block; height: 44px;
  margin: 4px calc(var(--pad) * -1) -1px; width: calc(100% + var(--pad) * 2);
}

.ob-body { flex: 1 0 auto; padding: var(--sp-4) var(--pad) var(--sp-6); }
.ob-body > h1 {
  font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700;
  letter-spacing: -.01em; line-height: 1.15; color: var(--ink);
}
/* Focus lands on the title at each step, for a screen reader; it is not a control. */
.ob-body > h1:focus { outline: none; }
.ob-lede { margin-top: var(--sp-2); font-size: var(--fs-body); line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.ob-content { margin-top: var(--sp-5); }
.ob-content > .overline:first-child { margin-top: 0; }

/* The actions, pinned: above the home indicator, and above the keyboard when
   one is open (--kb is set from visualViewport in ui.js). */
.ob-foot {
  position: sticky; bottom: var(--kb, 0px); z-index: 2;
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-3) var(--pad) calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line-soft);
}
.ob-foot .btn { width: 100%; }
.ob-foot .btn.primary { min-height: var(--tap); font-size: var(--fs-md); }
@media (prefers-contrast: more) {
  .ob-foot { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* A text-only action: sign out, the sample voyage, the privacy policy. */
.ob-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap-min); padding: 0 var(--sp-2);
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-note); font-weight: 600;
  color: var(--accent-text); text-decoration: none;
  border-radius: var(--r-sm);
}
.ob-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.ob-signout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 var(--sp-1);
  margin-top: var(--sp-6);
  font-size: var(--fs-note); color: var(--ink-3); text-align: center;
}
.ob-signout > span { overflow-wrap: anywhere; }

.ob-note { margin-top: var(--sp-3); font-size: var(--fs-note); line-height: 1.5; color: var(--ink-3); }
.ob-done {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r);
  background: var(--seaglass-wash); color: var(--ink);
  font-size: var(--fs-body); line-height: 1.5;
}
.ob-done > svg { flex: none; margin-top: 1px; color: var(--accent-text); }
.ob-error { margin-top: var(--sp-2); }
.ob-error[hidden] { display: none; }
.ob-form .field:last-of-type { margin-bottom: var(--sp-2); }

/* ------------------------------------------------------------------ welcome */
.ob-loop {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-soft); box-shadow: var(--shadow-1);
}
.ob-loop p { font-size: var(--fs-body); line-height: 1.6; color: var(--ink); }
.ob-loop p + p { padding-top: var(--sp-3); border-top: 1px dashed var(--line); color: var(--ink-2); }
.ob-tabs .item-lead { color: var(--accent-text); }
.ob-demo { margin-top: var(--sp-2); color: var(--accent-text); }

.ob-crew-card { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.ob-crew-mark {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem;
  background: color-mix(in srgb, var(--seaglass) 14%, var(--surface));
}
.ob-crew-name { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 650; line-height: 1.3; }
.ob-crew-sub { font-size: var(--fs-note); color: var(--ink-3); line-height: 1.45; margin-top: 2px; }

/* ------------------------------------------------------------------ plan */
/* 50 + 25 + 25 = 100, as arithmetic someone can check. */
.ob-sum {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--line);
}
.ob-sum-part { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.ob-sum-part b { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.ob-sum-part span { font-size: var(--fs-caption); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ob-sum-part.total b { color: var(--xp-text); }
.ob-sum-op { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--ink-3); }

.ob-commits { padding: 0; overflow: hidden; }
.ob-commit { padding: var(--sp-4); }
.ob-commit + .ob-commit { border-top: 1px solid var(--line-soft); }
.ob-commit-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ob-commit-emoji {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem; line-height: 1;
  background: color-mix(in srgb, var(--seaglass) 14%, var(--surface));
}
.ob-commit-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.ob-commit-sub { font-size: var(--fs-note); color: var(--ink-3); line-height: 1.45; margin-top: 2px; }
.ob-xp {
  flex: none; padding: 3px 9px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--sun) 16%, var(--surface));
  color: var(--xp-text); font-size: var(--fs-caption); font-weight: 700; white-space: nowrap;
}
.ob-commit .field { margin-bottom: 0; }
.ob-chips .chip.day, .ob-chips .chip { justify-content: center; }
.ob-ideas { margin-top: var(--sp-2); }
.ob-ideas .chip { border-style: dashed; }
.ob-commits > .ob-note { margin: 0; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); }
.ob-commits > .ob-note[hidden] { display: none; }

/* ------------------------------------------------------------------ your move */
.ob-wait-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.ob-wait-emoji {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem; line-height: 1;
  background: color-mix(in srgb, var(--seaglass) 14%, var(--surface));
}
.ob-wait-kind {
  font-family: var(--font-display); font-size: var(--fs-overline); font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.ob-wait-title { font-size: var(--fs-h3); font-weight: 650; line-height: 1.3; margin-top: 2px; }
.ob-wait-desc { margin-top: var(--sp-3); font-size: var(--fs-body); line-height: 1.55; color: var(--ink-2); }
.ob-wait-actions { margin-top: var(--sp-4); }
.ob-wait-done, .ob-wait-later {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-4); font-size: var(--fs-body); font-weight: 600;
}
.ob-wait-done { color: var(--ok-text); }
.ob-wait-later { color: var(--ink-3); font-weight: 500; }

/* ------------------------------------------------------------------ auth */
.auth .ob-body > h1 { text-align: center; }
.auth .ob-lede { text-align: center; margin-left: auto; margin-right: auto; }
.auth .ob-content { margin-top: var(--sp-5); }
.auth-card {
  padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-soft); box-shadow: var(--shadow-1);
}
.auth-seg { margin-bottom: var(--sp-4); }
.auth-form .field:last-of-type { margin-bottom: var(--sp-3); }
.auth-submit { min-height: var(--tap); margin-top: var(--sp-1); font-size: var(--fs-md); }
.auth-error:empty { display: none; }
.auth-error .banner { margin-bottom: var(--sp-3); }
.auth-forgot { margin-top: var(--sp-3); font-size: var(--fs-note); line-height: 1.5; color: var(--ink-3); text-align: center; }
.auth-symbols .chip { font-size: 1.15rem; min-width: var(--tap-min); justify-content: center; }

/* A password box with its Show/Hide button inside the right edge. */
.input-affix { position: relative; }
.input-affix input { padding-right: calc(var(--tap-min) + 6px); }
.input-affix .auth-reveal {
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  color: var(--ink-3);
}
.input-affix .auth-reveal:active { transform: translateY(-50%) scale(.92); }
.input-affix .auth-reveal[aria-pressed="true"] { color: var(--accent-text); }

/* Install first — an invitation opened in iPhone Safari. */
.auth-install { padding: var(--sp-5) var(--sp-4); }
.auth-install-title { font-size: var(--fs-h2); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.auth-steps { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-step { display: flex; align-items: flex-start; gap: var(--sp-3); }
.auth-step-n {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-accent); color: var(--on-accent);
  font-family: var(--font-display); font-size: var(--fs-body); font-weight: 700;
}
.auth-step-title { font-size: var(--fs-md); font-weight: 650; line-height: 1.35; }
.auth-step-text { font-size: var(--fs-body); line-height: 1.5; color: var(--ink-2); margin-top: 2px; }
.auth-inline-icon {
  display: inline-grid; place-items: center; vertical-align: -4px;
  width: 26px; height: 26px; border-radius: var(--r-xs);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text);
}
.auth-code { display: flex; gap: var(--sp-2); align-items: stretch; margin: var(--sp-5) 0 var(--sp-3); }
.auth .auth-code-text {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.125rem; font-weight: 600;
  letter-spacing: .04em; background: var(--surface-2);
}
.auth-copy { flex: none; min-height: var(--tap); }
.auth-why { font-size: var(--fs-note); line-height: 1.55; color: var(--ink-2); }
.auth-browser { margin-top: var(--sp-2); }

.auth-result-title { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 650; }
.auth-result-text { margin-top: var(--sp-2); font-size: var(--fs-body); line-height: 1.55; color: var(--ink-2); }
.auth-result .btn { margin-top: var(--sp-4); min-height: var(--tap); }

.auth-foot { margin-top: var(--sp-6); text-align: center; }
.auth-honesty { font-size: var(--fs-note); line-height: 1.6; color: var(--ink-3); max-width: 32em; margin: 0 auto; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--sp-3); margin-top: var(--sp-3); }
