/* First run: guide panel and landing (welcome card, ticker, floating coins). */

.guide-panel {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.75rem 1.6rem;
  background:
    radial-gradient(600px 220px at 85% -10%, rgba(255, 255, 255, 0.06), transparent 65%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin-bottom: 0.5rem;
}

.guide-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.guide-step {
  margin: 0 0 0.7rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  /* Optical centering for all-caps: cap glyphs leave dead descent space
     below the baseline, so the top padding runs thicker than the bottom. */
  padding: 0.42rem 0.8rem 0.28rem;
}

.guide-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.guide-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 34rem;
}

.guide-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.guide-ctas button { min-height: 3rem; padding: 0.7rem 1.6rem; font-size: 0.95rem; border-radius: 999px; }

button.linklike {
  background: none;
  border: none;
  min-height: 0;
  padding: 0.2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.linklike:hover { color: var(--text); background: none; border-color: transparent; }

/* main must NOT create a stacking context: the mobile bottom-sheet menus
   (.filter-panel, fixed) have to paint above the footer and the FAB. */
main { position: relative; }
footer { border-top: 1px solid var(--border); flex-shrink: 0; }

/* ————— Landing ————— */
#landing {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 3.25rem 2.5rem 2.25rem;
  background:
    radial-gradient(700px 280px at 78% -8%, rgba(255, 255, 255, 0.07), transparent 65%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  margin-top: 1.25rem;
}
#landing::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
/* Sample-price ribbon: sits ABOVE the welcome card on its own row, centered.
   The negative bottom margin tightens the home grid gap so it hugs the card
   instead of floating a full row away. */
#landing-ticker-wrap { display: flex; justify-content: center; margin-bottom: -0.9rem; }
#landing-ticker-wrap[hidden] { display: none !important; }
.landing-eyebrow {
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}
.landing-eyebrow svg { flex-shrink: 0; }
/* Live sample-price ribbon: fixed pill box, fluid values — prices truncate
   inside their slots and never push the card wider. */
.landing-ticker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 1rem;
}
.tick { display: inline-flex; align-items: baseline; gap: 0.45rem; min-width: 0; overflow: hidden; }
.tick-sym { color: var(--muted); font-weight: 600; }
.tick-val {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 4.2rem;
  max-width: 9rem;
}
.tick-sep { color: var(--muted-2); }
.landing-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 500;
  max-width: 20ch;
}
.landing-title .crayon {
  white-space: nowrap;
  padding-bottom: 0.12em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 15' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 15 4, 28 4, 40 9 S 58 13, 72 7 S 98 5, 117 9' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.38em;
}
.landing-sub {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 38rem;
}
.landing-sub .nowrap { white-space: nowrap; }
.landing-ctas { display: flex; align-items: center; gap: 0.8rem 1.25rem; flex-wrap: wrap; margin-bottom: 2rem; }
.landing-ctas button { min-height: 3.2rem; padding: 0.8rem 1.9rem; font-size: 1rem; }
#landing-create { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; font-family: var(--font-ui); font-weight: 650; border-radius: 999px; }
#landing-create svg { flex-shrink: 0; }
/* Restore keeps the quiet link look inside the CTA row: generous tap height,
   no box — the id selector beats the generic .landing-ctas button padding. */
#landing-restore { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.8rem 0.25rem; font-family: var(--font-ui); font-weight: 400; font-size: 0.825rem; }
#landing-restore svg { flex-shrink: 0; }
.landing-step {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.landing-feats {
  list-style: none;
  margin: 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
/* Feat rows are a two-column grid: the icon owns column 1, so the title
   and its description share column 2 and their text lines up exactly. */
.landing-feats li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; row-gap: 0.15rem; align-items: center; }
.landing-feats .feat-ico { grid-column: 1; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border: 1px solid var(--border-strong); border-radius: 50%; flex-shrink: 0; color: var(--text); }
.landing-feats strong { grid-column: 2; grid-row: 1; font-family: var(--font-display); font-size: 0.93rem; font-weight: 650; }
.feat-sub { grid-column: 2; grid-row: 2; font-size: 0.83rem; color: var(--muted); }
/* Floating glass symbols (welcome card): Dollar left, Bitcoin tall in the
   middle behind, Euro right — shared baseline, lightly interlaced. Each
   wrapper hovers on its own rhythm (separate durations + phases). No shadows
   or filters anywhere near the animated cluster (see perf note below).
   On wide
   screens the card is a two-column grid with the cluster centered in the
   right cell; text can never collide. On narrow screens the cluster becomes
   an ambient backdrop (see below). */
#landing[hidden] { display: none !important; }
.landing-copy { min-width: 0; }
.landing-coins {
  display: none;
  pointer-events: none;
}
/* Phones/tablets: coins become an ambient backdrop — bleeding off the
   right edge (clipped by the card), faded into the text, softly blurred.
   `translate` (not `transform`) centers vertically so the per-coin float
   animation still composes. Copy stays above via z-index. */
@media (max-width: 1023.98px) {
  .landing-coins {
    display: flex;
    position: absolute;
    top: 2.75rem;
    right: -44px;
    translate: none;
    align-items: flex-end;
    padding: 20px 0;
    opacity: 0.5;
    filter: blur(2px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%);
    mask-image: linear-gradient(90deg, transparent 0, #000 45%);
  }
  /* Higher specificity than the later base coin rules, which would
     otherwise win on source order and render desktop sizes here. */
  #landing .landing-coins .coin-btc { height: 230px; }
  #landing .landing-coins .coin-usd { height: 148px; position: relative; left: 83px; }
  #landing .landing-coins .coin-eur { height: 148px; margin-left: -78px; }
  .landing-copy, .landing-feats { position: relative; z-index: 1; }
}
@media (min-width: 1024px) {
  #landing:not([hidden]) { display: flex; }
  #landing {
    flex-wrap: wrap;
    align-items: stretch;
    /* A stretched card must not stretch the content: packs the text row +
       feats at the top so the art column matches the text height. */
    align-content: start;
    column-gap: 2.5rem;
  }
  /* Left text column: eyebrow, headline, step, actions stack in flow.
     No grid areas, no display:contents — plain flow next to art. */
  .landing-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1.15 1 0; min-width: 0; }
  .landing-eyebrow { align-self: flex-start; }
  .landing-herotext { min-width: 0; }
  .landing-feats { flex: 1 1 100%; }
  /* Right art column: stretches to the text height; the row is pinned to
     the top of the block (beside pill + headline), never centered. */
  .landing-coins {
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* Nudge the whole cluster 5px left of center. `translate` (not
       `left`) so it composes with the children's float animation;
       the mobile query already resets it with `translate: none`. */
    translate: -5px 0;
  }
  /* Sides tuck slightly behind Bitcoin's edges — a light overlap, clearly
     less than the deep mobile bleed (83px). Negative margins (not relative
     offsets) keep the centered cluster deterministic at any width. The left
     tuck is deeper (-71px): the USD canvas grew wider with symmetric
     padding, so this restores the exact ink interlock. */
  .landing-coins .coin-float-usd { margin-right: -71px; }
  .landing-coins .coin-float-eur { margin-left: -64px; }
}
/* No shadows or filters anywhere near the animated cluster: any filter
   (even a static drop-shadow on the <img>) makes Firefox re-rasterize on
   every frame of the wrapper's transform animation. The wrappers are
   transform-only layers (translate3d + will-change) so a GPU compositor
   moves them for free. */
.landing-coins .coin { display: block; width: auto; }
.landing-coins .coin-btc { height: 310px; opacity: 0.94; }
.landing-coins .coin-usd { height: 214px; }
.landing-coins .coin-eur { height: 214px; }
.coin-float { display: flex; align-items: flex-end; will-change: transform; backface-visibility: hidden; }
/* Inner row: shared baseline + interlock for the three coins. The column
   (.landing-coins) centers this row; the row keeps the bottom alignment. */
.coin-row { display: flex; align-items: flex-end; justify-content: center; }
.coin-float-btc { z-index: 1; }
.coin-float-usd { z-index: 2; }
.coin-float-eur { z-index: 3; }
@media (max-width: 720px) {
  #landing { padding: 2.25rem 1.4rem 1.6rem; }
  /* Mobile tagline breaks: line 1 = ledgers, line 2 = commodities.,
     line 3 = FREE. Desktop keeps its own single break (hidden here). */
  .landing-sub .br-desktop { display: none; }
  .landing-sub { font-size: 0.95rem; }
  .landing-sub .ls-a, .landing-sub .ls-b, .landing-sub .ls-free { display: block; }
  .landing-ctas { flex-direction: column; align-items: stretch; }
  .landing-ctas button { width: 100%; }
  #landing-restore { width: auto; align-self: center; min-height: 2.75rem; }
  .landing-ticker { justify-content: space-between; width: 100%; }
  #landing-ticker-wrap { margin-bottom: -0.35rem; }
  .landing-feats { grid-template-columns: 1fr; gap: 1rem; }
}
