/* ══════════════════════════════════════════
   FIRE — LAYOUT
   ══════════════════════════════════════════ */

/* ── Wallet hero ──────────────────────────── */
.product-hero {
  padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-16);
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-bottom: .5px solid var(--border);
}

.product-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.product-hero__content h1 {
  font-size: var(--text-3xl);
  margin: var(--space-3) 0 var(--space-6);
}

.product-hero__sub {
  font-size: var(--text-lg);
  max-width: 440px;
  margin-bottom: var(--space-8);
}

/* Hero entrance animations */
.product-hero__content {
  opacity: 0;
  transform: translateX(-32px);
  animation: heroSlideLeft var(--duration-reveal) var(--ease-out) 200ms forwards;
}

.product-hero__image {
  display: flex;
  justify-content: center;
  position: relative;
  opacity: 0;
  transform: translateX(32px);
  animation: heroSlideRight var(--duration-reveal) var(--ease-out) 400ms forwards;
}

@keyframes heroSlideLeft {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes heroSlideRight {
  to { opacity: 1; transform: translateX(0); }
}

.wallet-img {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hero);
  transition: transform var(--duration-slow) var(--ease-out),
              box-shadow var(--duration-slow) var(--ease-out);
}

/* Image theme switching */
[data-theme="dark"] .wallet-img--light,
[data-theme="light"] .wallet-img--dark {
  display: none;
}

/* ── Developer hero ───────────────────────── */
.dev-hero {
  padding: calc(var(--nav-height) + var(--space-30)) 0 var(--space-30);
  background: linear-gradient(344deg, rgba(23, 24, 26, 1) 0%, rgba(45, 47, 51, 1) 100%);
}

.dev-hero > .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.dev-hero__content {
  opacity: 0;
  animation: devHeroFadeIn var(--duration-reveal) var(--ease-out) 200ms forwards;
}

@keyframes devHeroFadeIn {
  to { opacity: 1; }
}

.dev-hero__content h1 {
  font-size: var(--text-3xl);
  font-weight: 500;
  margin: var(--space-4) 0 var(--space-3);
}

.dev-hero__sub {
  font-size: var(--text-lg);
  max-width: 540px;
  margin-bottom: var(--space-8);
}

/* Hero code panel — right column */
.dev-hero__code {
  opacity: 0;
  animation: devCodeReveal var(--duration-reveal) var(--ease-out) 600ms forwards;
}

@keyframes devCodeReveal {
  to { opacity: 1; }
}

/* Typewriter effect */
#hero-typewriter {
  visibility: hidden;
}

#hero-typewriter.typewriter-ready {
  visibility: visible;
}

#hero-typewriter .typewriter-cursor {
  display: inline-block;
  width: 1px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: cursorBlink 800ms steps(1) infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Merchant page header ─────────────────── */
.merchant-page {
  padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-24);
}

.merchant-page > .container {
  max-width: 880px;
}

.merchant-header {
  margin-bottom: var(--space-8);
}

.merchant-header h1 {
  font-size: var(--text-3xl);
  font-weight: 300;
  margin: var(--space-3) 0 var(--space-4);
}

.merchant-header h1 strong {
  font-weight: 600;
}

.merchant-header__sub {
  font-size: var(--text-lg);
  color: var(--text-2);
  margin-bottom: var(--space-6);
}

.merchant-header__privacy {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.6;
  max-width: none;
}

.merchant-header__lock {
  font-size: var(--text-sm);
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ── Reveal animations ────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger (home page) */
[data-reveal]:nth-child(2) { transition-delay: 80ms; }
[data-reveal]:nth-child(3) { transition-delay: 160ms; }

/* ── Reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .step__number {
    transition: none;
  }

  .product-hero__content,
  .product-hero__image {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .merchants__card {
    opacity: 1;
    transform: none;
    transition: border-color var(--duration-normal) var(--ease-out);
  }

  .dev-hero__content,
  .dev-hero__code {
    opacity: 1;
    animation: none;
  }

  .story-hero__content,
  .story-hero__phone {
    opacity: 1;
    transform: none;
    animation: none;
  }

  #hero-typewriter {
    visibility: visible;
  }

  #hero-typewriter .typewriter-cursor {
    display: none;
  }

  .merchant-status-dot--pulse {
    animation: none;
  }

  .merchant-log__entry {
    animation: none;
  }
}

/* ── Responsive: 768px ────────────────────── */
@media (max-width: 768px) {
  .product-hero {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
  }

  .product-hero__content {
    transform: translateX(-16px);
  }

  .product-hero__image {
    transform: translateX(16px);
  }

  @keyframes heroSlideLeft {
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes heroSlideRight {
    to { opacity: 1; transform: translateX(0); }
  }

  .product-hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .product-hero__image {
    order: -1;
  }

  .wallet-img {
    max-width: 240px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    max-width: 320px;
  }

  .steps__line {
    display: none;
  }

  .merchants__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .final-cta {
    padding: var(--space-20) 0;
  }

  .dev-hero {
    padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
  }

  .dev-hero__code {
    margin-top: var(--space-8);
  }

  .dev-hero > .container {
    grid-template-columns: 1fr;
  }

  .dev-security__layer[data-depth="2"] { margin-left: 0; }
  .dev-security__layer[data-depth="3"] { margin-left: 0; }
  .dev-security__layer[data-depth="4"] { margin-left: 0; }

  .merchant-card__bars {
    grid-template-columns: 1fr;
  }

  .merchant-card__bar--left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .merchant-card__body {
    grid-template-columns: 1fr;
  }

  .merchant-col-form {
    border-right: none;
  }

  .merchant-col-log {
    border-top: 1px solid var(--border);
    min-height: 120px;
  }

  .docs__header h1 {
    font-size: var(--text-xl);
  }

  .docs__full-file .code-panel {
    max-height: 360px;
  }

  .docs__fields {
    font-size: var(--text-xs);
  }

  .docs__fields th,
  .docs__fields td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ── Responsive: 560px ────────────────────── */
@media (max-width: 560px) {
  .comparison__table-wrap {
    display: none;
  }

  .comparison__cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    text-align: left;
  }

  .comparison__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-6);
  }

  .comparison__card--fire {
    border-color: var(--accent);
  }

  .comparison__card h3 {
    font-weight: 500;
    margin-bottom: var(--space-4);
  }

  .comparison__card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-4);
  }

  .comparison__card dt {
    font-size: var(--text-sm);
    color: var(--text-3);
  }

  .comparison__card dd {
    font-size: var(--text-sm);
    text-align: right;
  }

  .merchant-row {
    grid-template-columns: 1fr;
  }

  .docs__nav {
    flex-direction: column;
  }
}

/* ── Responsive: 480px ────────────────────── */
@media (max-width: 480px) {
  .merchants__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Story Hero (homepage) ─────────────────
   Two-column: text left, wallet screenshot right */
.story-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(344deg, rgba(23, 24, 26, 1) 0%, rgba(45, 47, 51, 1) 100%);
}
.story-hero__container {
  max-width: 1200px;
  width: 90%;
  justify-content: start;
  margin: auto;
  position: relative;
  z-index: 1;
}
.story-hero__content {
  width: 100%;
  max-width: 620px;
  opacity: 0;
  transform: translateY(12px);
  animation: heroContentRise 600ms var(--ease-out) 200ms both;
}
.story-hero__wordmark {
  margin-bottom: var(--space-4);
}
.story-hero__content h1 {
  font-size: var(--text-4xl);
  margin: var(--space-3) 0 var(--space-6);
}
.story-hero__content h1 strong {
  font-weight: 500;
}
.story-hero__sub {
  font-size: var(--text-lg);
  color: var(--text-2);
  margin-bottom: var(--space-8);
  max-width: 440px;
}
.story-hero__note {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: var(--space-4);
}

.story-hero__phone {
  position: absolute;
  right: 6%;
  top: 8%;
  width: 50%;
  height: auto;
  pointer-events: none;
  will-change: transform;
}

@keyframes heroContentRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroPhoneIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .story-hero__content {
    text-align: center;
  }
  .story-hero__content .actions-row { justify-content: center; }
  .story-hero__sub { margin-left: auto; margin-right: auto; }
  .story-hero__phone {
    position: relative;
    right: auto;
    top: auto;
    width: 60%;
    max-width: 280px;
    margin: var(--space-8) auto 0;
    display: block;
    opacity: 1;
    animation: none;
  }
}

/* ── Ecosystem Manifesto ── */
.ecosystem-manifesto {
  padding: 0 0 var(--space-30);
  text-align: center;
}
.ecosystem-manifesto .container {
  border: 1px solid var(--border);
  padding: 120px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0px 0px 32px 4px var(--accent-dim);
}
.ecosystem-manifesto__title {
  font-size: var(--text-4xl);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: var(--space-6);
}
.ecosystem-manifesto__title strong {
  font-weight: 500;
}
.ecosystem-manifesto__subtitle {
  font-size: var(--text-lg);
  color: var(--text-2);
  margin: 0 auto var(--space-8);
}
.ecosystem-manifesto__body {
  font-size: var(--text-lg);
  color: var(--text-3);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Ecosystem Sections ── */
.ecosystem-section {
  padding: var(--space-30) 0;
}
.ecosystem-section--alt {
  background: var(--surface);
}
.ecosystem-section--suite {
  background: var(--surface);
}
.ecosystem-section--developers {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ecosystem-suite__intro {
  max-width: 640px;
  text-align: center;
  margin: 0 auto;
}
.ecosystem-suite__intro h2 {
  margin-bottom: var(--space-4);
}
.ecosystem-suite__intro .ecosystem-section__lede {
  margin-left: auto;
  margin-right: auto;
}
.ecosystem-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
}
.ecosystem-section__grid--reverse {
  direction: rtl;
}
.ecosystem-section__grid--reverse > * {
  direction: ltr;
}
.ecosystem-section__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.ecosystem-section__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: var(--space-4);
}
.ecosystem-section__subtitle {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: var(--space-4);
}

.ecosystem-section__content h2 {
  margin-bottom: var(--space-4);
}
.ecosystem-section__lede {
  font-size: var(--text-lg);
  color: var(--text-2);
  margin-bottom: var(--space-8);
  max-width: 480px;
}
@media (max-width: 768px) {
  .ecosystem-section__grid,
  .ecosystem-section__grid--reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .ecosystem-section__demo { order: -1; }
}

/* ── Scroll Progress (homepage only) ── */
body[data-page="home"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: var(--accent);
  z-index: var(--z-progress);
  pointer-events: none;
}

/* ── Homepage responsive section padding ── */
@media (max-width: 1024px) {
  .ecosystem-section { padding: var(--space-20) 0; }
}
@media (max-width: 768px) {
  .story-hero { min-height: auto; }
  .home-verbs,
  .ecosystem-section { padding: var(--space-16) 0; }
}
