/* Mercanta — Styles
   Media-heavy · Full-bleed bands · Forma/Wealthsimple-inspired
   Token-pure: all colours via brand/tokens.css */

@import '../brand/tokens.css';

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
}
p { max-width: 68ch; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: none; }
::selection { background: var(--brass-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 3px; }

/* Scroll reveals */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; }

/* ========== SKIP LINK ========== */
.skip {
  position: absolute; top: -100%; left: 1rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--dark); color: var(--on-dark); border-radius: 0 0 6px 6px;
}
.skip:focus { top: 0; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; border-radius: 8px; transition: background .2s, transform .1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--primary); color: var(--on-primary);
  padding: 0.875rem 2rem; font-size: 1.0625rem;
}
.btn--primary:hover { background: var(--primary-600); }
.btn--sm { padding: 0.5rem 1.25rem; font-size: 0.9375rem; }

/* ========== NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.nav.scrolled {
  background: rgba(245, 247, 243, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--divider);
  box-shadow: 0 1px 0 rgba(14, 26, 21, 0.04);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.nav__logo { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.nav__logo:hover { text-decoration: none; }
.nav__mark { width: 32px; height: 32px; flex-shrink: 0; }
.nav__wm { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; color: var(--forest); }
.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__links a {
  font-size: 0.9375rem; color: var(--muted); text-decoration: none;
  transition: color .2s ease; position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1.5px;
  background: var(--brass); transition: width .25s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav .btn--sm { margin-left: auto; }
.nav__toggle { display: none; background: none; padding: 0.5rem; }
.nav__hamb {
  display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  position: relative; transition: background .2s ease;
}
.nav__hamb::before, .nav__hamb::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px; transition: transform .25s ease, top .25s ease;
}
.nav__hamb::before { top: -7px; }
.nav__hamb::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__hamb { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__hamb::before { top: 0; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__hamb::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 780px) {
  .nav__links, .nav .btn--sm { display: none; }
  .nav__toggle { display: block; margin-left: auto; }
  .nav__links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--divider);
    padding: 0.5rem 1.5rem 1.25rem;
    box-shadow: 0 24px 40px -30px rgba(20, 51, 42, 0.5);
  }
  .nav__links.open a { padding: 0.875rem 0; border-bottom: 1px solid var(--divider); }
  .nav__links.open a::after { display: none; }
}

/* ========== HERO ========== */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(100px, 14vw, 160px) 1.5rem clamp(80px, 10vw, 120px);
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
  min-height: 100vh;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(55% 45% at 85% 5%, color-mix(in srgb, var(--primary-soft) 70%, transparent), transparent 60%),
    radial-gradient(45% 45% at 5% 95%, color-mix(in srgb, var(--brass-soft) 18%, transparent), transparent 65%);
}
.hero__inner { position: relative; z-index: 1; max-width: 38rem; }
.hero__promise {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 5.5vw, 4.75rem);
  font-weight: 670; line-height: 1.04;
  color: var(--ink); letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  max-width: 17ch;
}

/* Rotating keyword — crossfade stack. inline-grid stacks all words in one cell and
   sizes to the WIDEST word, so nothing overflows or overlaps the line above. */
.hero__rotate {
  display: inline-grid; vertical-align: baseline;
  color: var(--brass-deep);
}
.hero__rotate > span {
  grid-area: 1 / 1;
  opacity: 0; transform: translateY(0.14em);
  animation: rotateWord 12s ease-in-out infinite;
}
.hero__rotate > span:nth-child(1) { animation-delay: 0s; }
.hero__rotate > span:nth-child(2) { animation-delay: 3s; }
.hero__rotate > span:nth-child(3) { animation-delay: 6s; }
.hero__rotate > span:nth-child(4) { animation-delay: 9s; }
@keyframes rotateWord {
  0%        { opacity: 0; transform: translateY(0.14em); }
  4%, 21%   { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-0.14em); }
}
/* Static first word if motion is reduced — no cycling, never blank. */
@media (prefers-reduced-motion: reduce) {
  .hero__rotate > span { animation: none; opacity: 0; transform: none; }
  .hero__rotate > span:nth-child(1) { opacity: 1; }
}

.hero__sub { color: var(--muted); font-size: 1.1875rem; line-height: 1.7; max-width: 34rem; }
.hero__cta { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.875rem; align-items: center; }
.hero__micro { margin-top: 1.25rem; font-size: 0.875rem; color: var(--muted); max-width: 30rem; line-height: 1.55; }

.btn--ghost {
  background: transparent; color: var(--primary); border: 1px solid var(--border);
  padding: 0.875rem 2rem; font-size: 1.0625rem; font-weight: 600; border-radius: 8px;
  transition: background .2s, border-color .2s, color .2s, transform .1s;
}
.btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); text-decoration: none; transform: translateY(-1px); }

/* Hero product mockup */
.hero__visual { position: relative; z-index: 1; }
.hero__mockup {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 80px -48px rgba(20, 51, 42, 0.5);
}
/* Browser-framed live-app screenshot */
.hero__mockup-bar {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem;
  background: var(--dark);
}
.hero__dots { display: inline-flex; gap: 0.4rem; flex: 0 0 auto; }
.hero__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.hero__addr {
  flex: 1; text-align: center; margin-right: 46px;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em;
  color: var(--on-dark-mut);
  background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 0.25rem 0.75rem;
}
.hero__shot { display: block; width: 100%; height: auto; background: #0f141b; }

/* Trust strip */
.trust-strip {
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.trust-strip__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.875rem 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.625rem;
  font-size: 0.8125rem; flex-wrap: wrap;
}
.trust-strip__label { color: var(--muted); }
.trust-strip__item { font-weight: 600; color: var(--ink); }
.trust-strip__sep { color: var(--brass-soft); }

/* ========== EYEBROW ========== */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brass-deep);
  margin-bottom: 1.25rem;
}
.eyebrow--dark { color: var(--brass-soft); }

/* ========== BANDS ========== */
.band {
  padding: clamp(80px, 12vw, 140px) 1.5rem;
}
section[id] { scroll-margin-top: 80px; }
.band--dark {
  background: var(--dark); color: var(--on-dark);
}
.band--light {
  background: var(--surface-2);
}
.band--surface {
  background: var(--surface);
}
.band__inner { max-width: var(--maxw); margin: 0 auto; }
.band__heading {
  font-family: var(--serif);
  font-size: clamp(1.875rem, 3.8vw, 3.25rem);
  font-weight: 670; letter-spacing: -0.025em; line-height: 1.12;
  margin-bottom: 1.5rem; max-width: 36rem;
}
.band__lede {
  font-size: 1.0625rem; color: var(--muted); max-width: 40rem;
  line-height: 1.65; margin-bottom: 2.5rem;
}

/* ========== THE GAP ========== */
.gap__content {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}
.gap__text { max-width: 34rem; }
.gap__text p { margin-bottom: 1.125rem; color: var(--on-dark-mut); font-size: 1.0625rem; line-height: 1.7; }
.gap__text p:last-child { margin-bottom: 0; color: var(--on-dark); }
.gap__visual {
  display: flex; align-items: center; justify-content: center;
}
.stat-pair {
  display: flex; flex-direction: column; gap: 2.5rem;
}
.stat {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.stat__num {
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 700; line-height: 1;
  color: var(--brass);
}
.stat__unit { font-size: 0.5em; font-weight: 600; }
.stat__label {
  font-family: var(--mono);
  font-size: 0.8125rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--on-dark-mut); margin-top: 0.5rem;
}

/* ========== THE ARC ========== */
.arc {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.arc__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 2rem;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.arc__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(20, 51, 42, 0.35);
  border-color: color-mix(in srgb, var(--brass) 35%, var(--border));
}
.arc__step {
  font-family: var(--mono);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--primary);
  display: block; margin-bottom: 0.75rem;
}
.arc__title {
  font-family: var(--serif); font-size: 1.375rem; font-weight: 700;
  color: var(--ink); margin-bottom: 0.75rem; line-height: 1.3;
}
.arc__card p { font-size: 1rem; color: var(--muted); line-height: 1.6; }

/* ========== PRODUCT TEASER ========== */
.product {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}
.product__text { max-width: 30rem; }
.product__text p { font-size: 1.0625rem; color: var(--muted); margin-bottom: 1rem; line-height: 1.65; }
.product__note { font-size: 0.9375rem !important; color: var(--muted) !important; font-style: italic; }

/* Live-app demo video, browser-framed */
.demo {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 80px -48px rgba(20, 51, 42, 0.5);
}
.demo__bar {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem;
  background: var(--dark);
}
.demo__dots { display: inline-flex; gap: 0.4rem; flex: 0 0 auto; }
.demo__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.demo__addr {
  flex: 1; text-align: center; margin-right: 46px;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em;
  color: var(--on-dark-mut);
  background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 0.25rem 0.75rem;
}
.demo__video { display: block; width: 100%; height: auto; background: #0f141b; }
.demo__cap {
  padding: 0.75rem 1.25rem; background: var(--surface-2); border-top: 1px solid var(--divider);
  font-family: var(--mono); font-size: 0.6875rem; color: var(--muted);
}
.demo__still { display: none; }
@media (max-width: 600px) { .demo__video { display: none; } .demo__still { display: block; } }

/* ========== SUPPORTING STILLS ========== */
.stills { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 680px) { .stills { grid-template-columns: 1fr; } }
.still__frame {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 48px -32px rgba(20, 51, 42, 0.35);
}
.still__img { display: block; width: 100%; height: auto; }
.still__cap {
  margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.55;
  color: var(--muted); max-width: 52ch;
}

/* ========== MODULES ========== */
.modules {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 820px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .modules { grid-template-columns: 1fr; } }
.module {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.module:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -20px rgba(20, 51, 42, 0.3);
}
.module--core { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--primary-soft); }
.module__badge {
  display: inline-block; font-family: var(--mono); font-size: 0.625rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.25rem 0.625rem; border-radius: 999px; margin-bottom: 0.875rem;
  color: var(--muted); border: 1px solid var(--border);
}
.module__badge--live { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.module__name {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
  color: var(--ink); margin-bottom: 0.25rem;
}
.module__role {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.625rem;
}
.module__desc { font-size: 0.9375rem; color: var(--muted); line-height: 1.55; }

/* ========== WHO ========== */
.who-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 780px) { .who-grid { grid-template-columns: 1fr; } .who__visual { display: none; } }
.who__copy { max-width: 38rem; }
.who { max-width: none; }
.who p { font-size: 1.0625rem; color: var(--on-dark-mut); margin-bottom: 1rem; line-height: 1.7; }
.who p:last-of-type { color: var(--on-dark); }
.who__img { width: 100%; height: auto; border-radius: 14px; }

/* ========== TRUST ========== */
.trust { max-width: 38rem; }
.trust__quote { border-left: 3px solid var(--brass); padding-left: 1.5rem; margin-bottom: 2rem; }
.trust__quote p { font-size: 1.0625rem; color: var(--muted); margin-bottom: 1rem; line-height: 1.7; font-style: italic; }
.trust__quote cite {
  display: block; font-size: 0.9375rem; font-style: normal; font-weight: 600;
  color: var(--ink); margin-top: 0.5rem;
}
.trust__provenance {
  font-family: var(--mono); font-size: 0.8125rem; color: var(--brass-deep);
  letter-spacing: 0.02em;
}

/* ========== CTA BAND ========== */
.cta-band {
  background: var(--dark); color: var(--on-dark);
  padding: clamp(80px, 12vw, 140px) 1.5rem; text-align: center;
}
.cta-band__inner { max-width: 560px; margin: 0 auto; }
.cta-band__heading {
  font-family: var(--serif); font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700; margin-bottom: 1rem; line-height: 1.15; letter-spacing: -0.02em;
}
.cta-band__sub { font-size: 1.0625rem; color: var(--on-dark-mut); margin-bottom: 2rem; }
.cta-band__fine { margin-top: 1rem; font-size: 0.8125rem; color: var(--on-dark-mut); opacity: 0.85; }
.cta-band__fine a { color: var(--on-dark); text-decoration: underline; }
.cta-band__fine a:hover { color: var(--primary); }
.cta-band__form {
  display: flex; gap: 0.75rem; max-width: 420px; margin: 0 auto;
}
.cta-band__input {
  flex: 1; padding: 0.75rem 1rem;
  background: var(--dark-2); color: var(--on-dark);
  border: 1px solid rgba(237, 239, 234, 0.15); border-radius: 8px;
  font-size: 1rem;
}
.cta-band__input::placeholder { color: var(--on-dark-mut); }
.cta-band__input:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.cta-band__msg { margin-top: 1rem; font-size: 0.9375rem; }
.cta-band__msg--success { color: var(--primary); }
.cta-band__msg--error { color: var(--brass); }

/* ========== FOOTER ========== */
.footer {
  padding: clamp(60px, 10vw, 100px) 1.5rem 2.5rem;
  background: var(--dark); color: var(--on-dark-mut);
}
.footer__inner { max-width: var(--maxw); margin: 0 auto; }
.footer__grid {
  display: grid; grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem; margin-bottom: 3rem;
}
@media (max-width: 680px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__wm { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--on-dark); text-decoration: none; }
.footer__wm:hover { color: var(--primary); text-decoration: none; }
.footer__essence { font-style: italic; color: var(--brass-soft); margin-top: 0.5rem; font-size: 0.9375rem; font-variation-settings: "opsz" 24, "SOFT" 12, "WONK" 0; }
.footer__tagline { margin-top: 0.75rem; font-size: 0.875rem; color: var(--on-dark-mut); max-width: 20ch; line-height: 1.5; }
.footer__col h4 {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brass-soft); margin-bottom: 0.875rem;
  font-weight: 500;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer__col a, .footer__col span { font-size: 0.9375rem; color: var(--on-dark-mut); text-decoration: none; }
.footer__col a:hover { color: var(--on-dark); }
.footer__soon { font-family: var(--mono); font-size: 0.6875rem; color: color-mix(in srgb, var(--on-dark-mut) 60%, transparent); }
.footer__base {
  padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, var(--on-dark) 12%, transparent);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; min-height: auto; padding-top: 5rem; }
  .hero__mockup { max-width: 480px; }
  .gap__content { grid-template-columns: 1fr; gap: 2.5rem; }
  .gap__visual { order: -1; }
  .stat-pair { flex-direction: row; gap: 2rem; }
  .arc { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; gap: 2rem; }
  .cta-band__form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 540px) {
  .hero { padding: 4.5rem 1.25rem 3rem; }
  .band { padding: clamp(60px, 8vw, 90px) 1.25rem; }
  .cta-band { padding: clamp(60px, 8vw, 90px) 1.25rem; }
  .hero__promise { font-size: clamp(2rem, 8vw, 2.75rem); }
  .stat-pair { flex-direction: column; gap: 1.5rem; }
  .stat__num { font-size: 2.5rem; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero__rotate span { animation: none !important; }
}