/* =============================================================
   Massiveforge brand chrome — root shell styles
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  /* Space at bottom for the Reforge Bar */
  padding-bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
}

/* =============================================================
   Design-mount visibility — toggle by body[data-design]
   ============================================================= */

body[data-design="a"] [data-design="b"] { display: none !important; }
body[data-design="b"] [data-design="a"] { display: none !important; }

body[data-mode="single"] .forge-action--side { display: none; }
body[data-mode="single"] .forge-bar { gap: 0; }

/* =============================================================
   THE REFORGE BAR — canonical, ported from StickyBar.astro
   ============================================================= */

.forge-bar {
  --forge-accent: var(--accent, #e8650a);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.45rem, 3vw, 1.8rem);
  padding: 0.58rem 1.2rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: #0c0a09;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
  overflow: visible;
}

.forge-bar > * {
  position: relative;
  z-index: 1;
}

.forge-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  cursor: pointer;
  padding: 0.42rem 0.8rem;
  border: none;
  background: none;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  flex: 0 0 auto;
  min-width: 56px;
  color: rgba(255, 255, 255, 0.38);
  font-family: inherit;
}

.forge-action--side svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.forge-action__label {
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 0.18rem;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
}

.forge-action[aria-pressed="true"] {
  color: rgba(255, 255, 255, 0.85);
}

.forge-action[aria-pressed="true"] .forge-action__label {
  color: rgba(255, 255, 255, 0.85);
}

.forge-action[aria-pressed="true"] svg {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.18));
}

.forge-action:hover {
  color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.forge-action:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* THE ANVIL */

.forge-anvil {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0 clamp(1rem, 4vw, 2.4rem);
  margin-top: -3.6rem;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.forge-anvil:hover {
  transform: translateY(-3px) scale(1.03);
}

.forge-anvil:active {
  transform: translateY(2px) scale(0.95);
  transition: transform 0.05s ease;
}

.forge-anvil.reforging {
  pointer-events: none;
}

.forge-anvil-face {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, #1c1816 0%, #100d0b 70%);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.8),
    0 16px 40px rgba(0, 0, 0, 0.5),
    inset 0 2px 6px rgba(0, 0, 0, 0.7),
    inset 0 -1px 3px rgba(255, 255, 255, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.forge-anvil:hover .forge-anvil-face {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.85),
    0 18px 44px rgba(0, 0, 0, 0.55),
    inset 0 2px 6px rgba(0, 0, 0, 0.65),
    inset 0 -1px 3px rgba(255, 255, 255, 0.06);
}

.forge-anvil:active .forge-anvil-face {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.9),
    0 8px 20px rgba(0, 0, 0, 0.6),
    inset 0 3px 8px rgba(0, 0, 0, 0.8),
    inset 0 -1px 2px rgba(255, 255, 255, 0.03);
}

.forge-anvil:focus-visible .forge-anvil-face {
  outline: 2px solid rgba(255, 255, 255, 0.2);
  outline-offset: 3px;
}

.forge-anvil-icon {
  width: 44px;
  height: auto;
  position: relative;
  z-index: 1;
  fill: rgba(200, 195, 188, 0.7);
  transition: fill 0.25s ease;
}

.forge-anvil:hover .forge-anvil-icon {
  fill: rgba(220, 215, 208, 0.85);
}

.forge-anvil-heat {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  z-index: 2;
  background: radial-gradient(
    circle at 50% 44%,
    rgba(255, 245, 200, 0.95) 0%,
    rgba(255, 215, 130, 0.78) 30%,
    rgba(255, 162, 52, 0.5) 60%,
    transparent 82%
  );
}

.forge-anvil.reforging .forge-anvil-heat {
  animation: reforgeHeatCooldown 3000ms cubic-bezier(0.12, 0, 0.39, 0) forwards;
}

@keyframes reforgeHeatCooldown {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  100% { opacity: 0; }
}

.forge-anvil-label {
  font-size: 0.54rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  transition: color 0.25s ease;
  margin-top: 0.22rem;
}

.forge-anvil:hover .forge-anvil-label {
  color: rgba(255, 255, 255, 0.78);
}

/* Reforge Bar responsive */

@media (max-width: 480px) {
  .forge-bar {
    gap: 0.3rem;
    padding: 0.42rem 0.76rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .forge-anvil {
    margin: 0 0.72rem;
    margin-top: -2.85rem;
  }
  .forge-anvil-face {
    width: 78px;
    height: 78px;
  }
  .forge-anvil-icon {
    width: 36px;
  }
  .forge-action {
    min-width: 42px;
    padding: 0.3rem 0.5rem;
  }
  .forge-action__label {
    font-size: 0.46rem;
    letter-spacing: 0.2em;
  }
}

@media (max-width: 400px) {
  .forge-action--side svg {
    width: 18px;
    height: 18px;
  }
  .forge-anvil {
    margin-inline: 0.42rem;
  }
}

/* =============================================================
   MASSIVEFORGE FUNNEL MODAL
   ============================================================= */

:root {
  --mf-modal-bg:         #0c0a09;
  --mf-modal-paper:      #F4EDE0;
  --mf-modal-accent:     #e8650a;
  --mf-modal-text:       #F4EDE0;
  --mf-modal-text-muted: rgba(244, 237, 224, 0.62);
  --mf-modal-rule:       rgba(244, 237, 224, 0.12);
  --mf-modal-error:      #C44A1B;
}

.mf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.mf-modal[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.mf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 5, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.mf-modal__card {
  position: relative;
  background: var(--mf-modal-bg);
  color: var(--mf-modal-text);
  width: min(560px, calc(100vw - 2rem));
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: clip;
  border-radius: 8px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--mf-modal-rule);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(24px) scale(0.98);
  transition: transform 280ms ease;
}

.mf-modal[aria-hidden="false"] .mf-modal__card {
  transform: translateY(0) scale(1);
}

.mf-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--mf-modal-rule);
  color: var(--mf-modal-text-muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.18s ease;
}

.mf-modal__close:hover {
  color: var(--mf-modal-text);
  border-color: var(--mf-modal-text);
  transform: rotate(90deg);
}

.mf-modal__close:focus-visible {
  outline: 2px solid var(--mf-modal-accent);
  outline-offset: 2px;
}

/* Section 1: brand */

.mf-modal__brand {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--mf-modal-rule);
  margin-bottom: 1.5rem;
}

.mf-modal__logo {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto 0.6rem;
}

.mf-modal__wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.mf-modal__tagline {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--mf-modal-accent);
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
}

.mf-modal__opener {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--mf-modal-text);
  margin: 0 0 0.4rem;
  line-height: 1.4;
}

.mf-modal__subline {
  font-size: 0.92rem;
  color: var(--mf-modal-text-muted);
  margin: 0;
  line-height: 1.45;
}

/* Section 2: offer */

.mf-modal__offer {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--mf-modal-rule);
  margin-bottom: 1.5rem;
  text-align: center;
}

.mf-modal__refused {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 1.5rem);
  flex-wrap: wrap;
}

.mf-modal__refused li {
  font-size: 0.82rem;
  color: var(--mf-modal-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--mf-modal-accent);
  text-decoration-thickness: 1.5px;
  letter-spacing: 0.03em;
}

.mf-modal__price {
  margin: 0.8rem 0 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
}

.mf-modal__price-amount {
  font-size: clamp(2.8rem, 9vw, 4rem);
  font-weight: 700;
  color: var(--mf-modal-accent);
  letter-spacing: -0.03em;
}

.mf-modal__truth {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 3vw, 1.8rem);
  flex-wrap: wrap;
}

.mf-modal__truth li {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mf-modal-text);
}

.mf-modal__value {
  font-size: 0.9rem;
  color: var(--mf-modal-text-muted);
  line-height: 1.55;
  max-width: 38ch;
  margin: 0 auto;
}

.mf-modal__value strong {
  color: var(--mf-modal-text);
  font-weight: 600;
}

/* Section 3: form */

.mf-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mf-modal__form-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.mf-modal__form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--mf-modal-text-muted);
  letter-spacing: 0.02em;
}

.mf-modal__form label span {
  font-weight: 500;
}

.mf-modal__form label em {
  font-style: normal;
  color: rgba(244, 237, 224, 0.4);
  font-size: 0.78rem;
}

.mf-modal__form input,
.mf-modal__form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--mf-modal-rule);
  color: var(--mf-modal-text);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: border-color 0.18s ease, background 0.18s ease;
  width: 100%;
}

.mf-modal__form input:focus,
.mf-modal__form textarea:focus {
  outline: none;
  border-color: var(--mf-modal-accent);
  background: rgba(255, 255, 255, 0.06);
}

.mf-modal__form textarea {
  resize: vertical;
  font-family: inherit;
}

.mf-modal__submit {
  margin-top: 0.6rem;
  background: var(--mf-modal-accent);
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.mf-modal__submit:hover {
  background: #f37820;
  transform: translateY(-1px);
}

.mf-modal__submit:active {
  transform: translateY(1px);
}

.mf-modal__submit:focus-visible {
  outline: 2px solid var(--mf-modal-text);
  outline-offset: 2px;
}

.mf-modal__reassure {
  font-size: 0.8rem;
  color: var(--mf-modal-text-muted);
  text-align: center;
  margin: 0.4rem 0 0;
  line-height: 1.4;
}

/* Success */

.mf-modal__success {
  text-align: center;
  padding: 2rem 0;
}

.mf-modal__success h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: var(--mf-modal-accent);
  margin: 0 0 0.8rem;
}

.mf-modal__success p {
  color: var(--mf-modal-text);
  font-size: 1rem;
}

.mf-modal__success strong {
  color: var(--mf-modal-accent);
}

/* Mobile modal — full-screen sheet on small screens */

@media (max-width: 560px) {
  .mf-modal__card {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 1.25rem;
    transform: translateY(100%);
  }
  .mf-modal[aria-hidden="false"] .mf-modal__card {
    transform: translateY(0);
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .forge-action,
  .forge-anvil,
  .forge-anvil-face,
  .forge-anvil-label,
  .forge-anvil-heat,
  .mf-modal,
  .mf-modal__card,
  .mf-modal__close {
    transition: none !important;
    animation: none !important;
  }
}

/* =============================================================
   Mobile overflow defense — root-level
   ============================================================= */

html { max-width: 100%; overflow-x: clip; }
body { max-width: 100%; }
img, svg:not([data-keep-size]) { max-width: 100%; height: auto; }
