/* ============================================================
   Home page — "settlement terminal" direction.

   Loads after style.css. Everything new is namespaced `hp-` so it
   cannot collide with the shared component styles; only the design
   tokens are shared. Section rhythm is handled by .hp-section here
   rather than the inline padding overrides the old page used.
============================================================ */

/* ---------------- Rhythm ----------------
   One gap value governs the page: sections carry their space on the
   bottom only, so every section-to-section transition is exactly
   --gap. The hero is the one exception — it ends in a rule, and a
   rule needs air on both sides, so it gets --gap split either side
   of the line instead of a full --gap twice. */
:root { --gap: 96px; --gap-rule: 48px; }

.hp-section { padding: var(--gap) 0; }
.hp-section + .hp-section { padding-top: 0; }
.hp-hero + .hp-section { padding-top: var(--gap-rule); }
.hp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.hp-section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hp-section-head p { color: var(--text-dim); font-size: 15px; margin-top: 8px; max-width: 46ch; }
.hp-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hp-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.hp-link:hover { border-bottom-color: currentColor; }

/* ---------------- Denomination rail — the signature ----------------
   One control re-denominates every price on the page. Rates tick so
   the rail reads as live settlement data, not decoration. */
.hp-rail {
  /* Sits at the top of the page and scrolls away with it — deliberately
     not sticky, so it doesn't ride down over the product grids. */
  position: static;
  background: var(--text);
  color: #f2f1ee;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.hp-rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 46px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.hp-rates { display: flex; align-items: center; gap: 22px; min-width: 0; overflow: hidden; }
.hp-rate { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.hp-rate-mark {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
  background: rgba(255, 255, 255, .1);
}
.hp-rate-mark[data-coin="btc"] { color: #f0a341; }
.hp-rate-mark[data-coin="eth"] { color: #9b9fe8; }
.hp-rate-mark[data-coin="usdt"] { color: #48c39c; }
.hp-rate-val { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
/* A brief tint when the rate moves, so a live figure doesn't change
   silently under the reader. */
.hp-rate-up   { animation: hp-tick-up 1.2s ease; }
.hp-rate-down { animation: hp-tick-down 1.2s ease; }
@keyframes hp-tick-up   { 0%, 40% { color: #48c39c; } 100% { color: inherit; } }
@keyframes hp-tick-down { 0%, 40% { color: #e8836f; } 100% { color: inherit; } }
.hp-rate-sync { color: rgba(242, 241, 238, .5); font-size: 11px; }

.hp-denom { display: flex; align-items: center; gap: 10px; }
.hp-denom-label { color: rgba(242, 241, 238, .55); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.hp-denom-set { display: flex; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: var(--radius-s); padding: 2px; }
.hp-denom-set button {
  border: 0;
  background: transparent;
  color: rgba(242, 241, 238, .62);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.hp-denom-set button:hover { color: #fff; }
.hp-denom-set button[aria-pressed="true"] { background: #f2f1ee; color: var(--text); }
.hp-denom-set button:focus-visible { outline: 2px solid #f2f1ee; outline-offset: 2px; }

@media (max-width: 860px) {
  .hp-rail-inner { height: auto; padding: 10px 0; flex-direction: column; align-items: flex-start; gap: 10px; }
  .hp-rates { flex-wrap: wrap; gap: 14px; }
  .hp-rate-sync { display: none; }
}

/* Price readout — re-denominates in place with a short settle animation */
.hp-amount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hp-amount.is-settling { animation: hp-settle .28s ease; }
@keyframes hp-settle {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Hero — product-forward split ---------------- */
.hp-hero { border-bottom: 1px solid var(--border); }
.hp-hero-inner {
  display: grid;
  /* Copy takes the larger share — it carries the headline, and an even
     split left it wrapping far short of its own column. */
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 88px 0 var(--gap-rule);
}
/* No width cap: the copy should fill its grid column. A 34ch limit was
   forcing the headline onto four lines and hyphenating "on-chain"
   mid-word, leaving dead space to the right of every line. */
.hp-hero-copy { max-width: none; }
.hp-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 18px 0 20px;
  /* "on-chain" must never break across lines — it read as "on-" / "chain". */
  hyphens: none;
  overflow-wrap: normal;
}
.hp-hero h1 em { white-space: nowrap; }
.hp-hero h1 em {
  font-style: normal;
  font-weight: 400;
  color: var(--blue);
}
.hp-hero-sub { font-size: 17px; line-height: 1.6; color: var(--text-dim); max-width: 54ch; }
.hp-hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
/* Flagship card: the one product doing the selling */
.hp-flagship {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.hp-flagship-tag {
  position: absolute;
  top: 20px; left: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(14, 110, 91, .08);
  border-radius: 999px;
  padding: 5px 10px;
}
.hp-flagship-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 16px;
}
.hp-flagship-media img { width: 330px; height: 330px; max-width: 100%; object-fit: contain; }
.hp-flagship-name { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }
.hp-flagship-line { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
.hp-flagship-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.hp-flagship-price { display: flex; flex-direction: column; gap: 4px; }
.hp-flagship-price .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.hp-flagship-price .hp-amount { font-size: 27px; font-weight: 600; }

@media (max-width: 960px) {
  .hp-hero-inner { grid-template-columns: 1fr; gap: 44px; padding: 56px 0 var(--gap-rule); }
  .hp-hero-copy { max-width: none; }
  .hp-flagship-media img { width: 200px; height: 200px; }
}

/* ---------------- Product cards ---------------- */
.hp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hp-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 20px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.hp-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hp-card-media {
  background: var(--bg-elevated);
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px;
  margin-bottom: 14px;
}
/* max-width keeps the fixed pixel size from overflowing the card once
   the grid drops to two columns on a phone. */
.hp-card-media img { width: 200px; height: 200px; max-width: 100%; object-fit: contain; }
.hp-card-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--text-faint); }
.hp-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 7px 0 4px; letter-spacing: -0.02em; }
.hp-card-line { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.hp-card-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hp-card-foot .from { font-size: 11px; color: var(--text-faint); }
.hp-card-foot .hp-amount { font-size: 16px; font-weight: 600; }

/* Before / after: the market price struck through, then how far under it
   we sit. Sized down so the price you actually pay stays dominant. */
.hp-was {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-faint);
  text-decoration: line-through;
}
.hp-save {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--success);
  background: rgba(26, 157, 84, .10);
  padding: 2px 6px;
  border-radius: 100px;
}
.hp-flagship-price { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 9px; }
.hp-flagship-price .label { width: 100%; }
.hp-flagship-price .hp-was { font-size: 15px; }

@media (max-width: 1080px) { .hp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .hp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .hp-grid { grid-template-columns: 1fr; } }

/* Horizontal line strips */
.hp-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 270px;   /* fits the larger 200px product image */
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.hp-strip .hp-card { scroll-snap-align: start; }
.hp-strip::-webkit-scrollbar { height: 4px; }
.hp-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ---------------- Payment sequence ----------------
   Numbered because this genuinely is an ordered flow — the customer
   cannot confirm before they send. The numbers carry information. */
.hp-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.hp-step { padding: 34px 30px; border-right: 1px solid var(--border); }
.hp-step:last-child { border-right: 0; }
.hp-step-n {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: .08em;
}
.hp-step h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 14px 0 8px; letter-spacing: -0.02em; }
.hp-step p { font-size: 14px; line-height: 1.65; color: var(--text-dim); }
@media (max-width: 860px) {
  .hp-flow { grid-template-columns: 1fr; }
  .hp-step { border-right: 0; border-bottom: 1px solid var(--border); }
  .hp-step:last-child { border-bottom: 0; }
}

/* ---------------- Assurances ---------------- */
.hp-assure { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; border-top: 1px solid var(--border); padding-top: 34px; }
.hp-assure svg { color: var(--blue); margin-bottom: 14px; }
.hp-assure h3 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.hp-assure p { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
@media (max-width: 860px) { .hp-assure { grid-template-columns: 1fr 1fr; gap: 26px; } }

/* ---------------- Motion & focus floor ---------------- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ---------------- Mobile ---------------- */
@media (max-width: 780px) {
  /* 96px of air between sections is desktop rhythm; on a phone it just
     means scrolling past nothing. Retuning the two variables rescales
     every gap on the page at once. */
  :root { --gap: 56px; --gap-rule: 28px; }

  .hp-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hp-section-head p { max-width: none; }

  /* Centre the hero on mobile, with a little breathing room each side.
     Desktop keeps its left-aligned two-column layout. */
  .hp-hero-copy { text-align: center; padding: 0 6px; }
  .hp-hero-sub { margin-left: auto; margin-right: auto; }
  .hp-hero-cta { flex-direction: column; align-items: center; }
  .hp-hero-cta .btn { width: 100%; max-width: 320px; }

  /* Two-column grid on a phone leaves ~120px per card, so the fixed
     200px height would letterbox into a tall empty box. Let the height
     follow the width instead. */
  .hp-card-media img { height: auto; }
  .hp-flagship-media img { height: auto; }

  .hp-flagship { padding: 24px 20px; }
  .hp-flagship-foot { flex-direction: column; align-items: stretch; gap: 14px; }
  .hp-flagship-foot .btn { width: 100%; }

  /* Denomination buttons are the page's main control — they need real
     thumb targets, not the 22px desktop pills. */
  .hp-denom { width: 100%; flex-direction: column; align-items: flex-start; gap: 6px; }
  .hp-denom-set { width: 100%; }
  .hp-denom-set button { flex: 1; min-height: 40px; font-size: 12px; }

  .hp-step { padding: 26px 22px; }
  .hp-strip { grid-auto-columns: 78vw; }
}

/* The only motion on the page belongs to the signature: a price
   visibly settling into its new denomination. Nothing else moves. */
@media (prefers-reduced-motion: reduce) {
  .hp-amount.is-settling { animation: none; }
  .hp-card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
