/* ─── FORGE Metal Card Demo — CSS ──────────────────────────────────────────
   Tokens OKLCH · Unbounded + DM Sans + Space Grotesk
   Arquitectura: canvas fixed + capítulos pinned (CSS sticky) sobre él
──────────────────────────────────────────────────────────────────────────── */

/* ─── OKLCH fallback para Safari < 16 ──────────────────────────────────── */
@supports not (color: oklch(0% 0 0)) {
  :root {
    --void:      #0e0806;
    --forge:     #180b08;
    --iron:      #2d1209;
    --oxide:     #8c2413;
    --oxide-mid: #b83420;
    --ember:     #d85535;
    --ember-glow:rgba(216,85,53,.20);
    --raw:       #f5f0ea;
    --bone:      #ddd1c0;
    --graphite:  #4a3025;
  }
}

:root {
  --void:      oklch(7% 0.012 22);
  --forge:     oklch(12% 0.015 24);
  --iron:      oklch(22% 0.020 26);
  --oxide:     oklch(42% 0.160 35);
  --oxide-mid: oklch(55% 0.170 38);
  --ember:     oklch(68% 0.180 42);
  --ember-glow:oklch(68% 0.180 42 / 0.20);
  --raw:       oklch(95% 0.014 65);
  --bone:      oklch(85% 0.020 62);
  --graphite:  oklch(38% 0.014 35);

  --font-display:   'Unbounded', system-ui, sans-serif;
  --font-interface: 'DM Sans', system-ui, sans-serif;
  --font-data:      'Space Grotesk', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto; /* GSAP controla el scroll */
  font-size: 16px;
}

body {
  background: var(--void);
  color: var(--raw);
  font-family: var(--font-interface);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* ─── CURSOR ─────────────────────────────────────────────────────────────── */
.cursor {
  width: 8px; height: 8px;
  background: var(--ember);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid rgba(216,85,53,.45);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
}
@media (hover: none) { .cursor, .cursor-ring { display: none; } body { cursor: auto; } }

/* ─── CANVAS FIXED ───────────────────────────────────────────────────────── */
#forge-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.webgl-fallback {
  display: none;
  position: absolute; inset: 0;
  z-index: 2;
}
.webgl-fallback.visible { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.webgl-fallback img { width: 100%; height: 100%; object-fit: cover; opacity: .18; position: absolute; inset: 0; }
.fallback-msg { position: relative; z-index: 1; font-size: .85rem; color: var(--bone); text-align: center; padding: 2rem; }

/* ─── CONTAINER ──────────────────────────────────────────────────────────── */
.container {
  width: 100%; max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

/* ─── STACKING — todo el contenido sobre el canvas ──────────────────────── */
.nav, section, .chapter, .section-break, .footer { position: relative; z-index: 1; }

/* Zonas 3D: fondo transparente → canvas visible debajo */
.section-hero, .chapter { background: transparent; }

/* Zonas post-3D: fondo sólido → tapa el canvas */
.section-break { height: 2px; background: var(--iron); z-index: 2; }
.section-solid { background: var(--void); z-index: 2; }

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 5vw, 5rem);
  background: oklch(7% 0.012 22 / 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--iron);
  transition: padding .35s;
}
.nav.scrolled { padding: .9rem clamp(1.25rem, 5vw, 5rem); }

.nav-brand { display: flex; flex-direction: column; gap: .1rem; }
.nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .25em; }
.nav-sub   { font-size: .6rem; letter-spacing: .35em; color: var(--graphite); font-family: var(--font-data); }

.nav-links { display: flex; gap: 2.4rem; list-style: none; align-items: center; }
.nav-link { color: var(--bone); text-decoration: none; font-size: .825rem; font-weight: 400; letter-spacing: .04em; transition: color .2s; }
.nav-link:hover { color: var(--raw); }

.nav-cta { padding: .6rem 1.5rem; font-size: .825rem; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .4rem; }
.hamburger span { display: block; width: 22px; height: 1.5px; background: var(--raw); border-radius: 2px; transform-origin: center; }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; background: var(--forge);
  z-index: 99; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2rem;
  transform: translateX(100%); transition: transform .4s var(--ease);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-link { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--raw); text-decoration: none; }
.mobile-cta { margin-top: 1rem; padding: .75rem 2rem; background: var(--oxide); border-radius: 0; font-size: 1rem; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .85em 1.8em;
  background: var(--oxide);
  color: var(--raw);
  font-family: var(--font-interface);
  font-size: .875rem; font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none; border: none; cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: var(--oxide-mid); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .85em 1.8em;
  background: transparent;
  color: var(--bone);
  font-family: var(--font-interface);
  font-size: .875rem; font-weight: 400;
  border: 1px solid var(--iron);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--oxide-mid); color: var(--oxide-mid); }

/* ─── HERO ───────────────────────────────────────────────────────────────── */
.section-hero {
  height: 100vh;
  display: flex; align-items: center;
  padding: 0 clamp(1.25rem, 5vw, 6rem);
  overflow: hidden;
}

/* Left column constraint — card lives in the right ~45% (Three.js space) */
.hero-content {
  max-width: min(52%, 640px);
  position: relative; z-index: 2;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-data);
  font-size: .62rem; font-weight: 600;
  letter-spacing: .14em;
  color: var(--oxide-mid);
  border: 1px solid var(--iron);
  padding: .35em .9em;
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 4.2vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  display: flex; flex-direction: column; gap: .02em;
  margin-bottom: 1.5rem;
}
.word-forge { color: var(--oxide-mid); }
.accent { color: var(--ember); }

.hero-sub {
  font-size: clamp(.85rem, 1.2vw, 1rem);
  font-weight: 300; line-height: 1.7;
  color: var(--bone); max-width: 38ch;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: .875rem; flex-wrap: wrap; align-items: center; }

/* Scroll indicator */
.hero-scroll { position: absolute; bottom: 2.5rem; left: clamp(1.25rem, 6vw, 8rem); }
.hero-scroll-line { width: 1px; height: 52px; background: linear-gradient(to bottom, var(--oxide), transparent); animation: scrollBlink 2s ease-in-out infinite; }
@keyframes scrollBlink { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ─── CHAPTERS — CSS sticky pinning ─────────────────────────────────────── */
.chapter-forge      { height: 300vh; }
.chapter-flip       { height: 250vh; }
.chapter-collection { height: 350vh; }

.pinned-inner {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; align-items: center;
  pointer-events: none;
}

/* Chapter text overlays */
.chapter-text {
  position: absolute;
  max-width: 400px;
}
.chapter-text--right { right: clamp(1.25rem, 8vw, 10rem); text-align: right; }
.chapter-text--left  { left:  clamp(1.25rem, 8vw, 10rem); }

.chapter-text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.1;
  color: var(--raw);
  margin-bottom: 1rem;
}
.chapter-text p {
  font-size: clamp(.875rem, 1.2vw, 1rem);
  font-weight: 300; line-height: 1.7;
  color: var(--bone);
}

/* NFC labels */
.nfc-label-group {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-30%, -60%);
  display: flex; flex-direction: column; gap: .5rem;
}
.nfc-tag {
  font-family: var(--font-data);
  font-size: .72rem; font-weight: 600;
  color: var(--ember);
  letter-spacing: .1em;
  padding: .3em .9em;
  border: 1px solid var(--oxide);
  background: oklch(12% 0.015 24 / 0.7);
}

/* Tier labels */
.tier-label {
  position: absolute;
  bottom: 10vh; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 300px;
}
.tier-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 3rem);
  letter-spacing: .18em;
  color: var(--raw);
  margin-bottom: .6rem;
}
.tier-prop { font-size: 1rem; font-weight: 300; color: var(--bone); margin-bottom: .3rem; }
.tier-cta-hint { font-family: var(--font-data); font-size: .78rem; color: var(--oxide-mid); letter-spacing: .06em; }

/* ─── POST-3D: SECTION SHARED STYLES ────────────────────────────────────── */
.eyebrow {
  display: block;
  font-family: var(--font-data);
  font-size: .65rem; font-weight: 600;
  letter-spacing: .2em;
  color: var(--oxide-mid);
  margin-bottom: 1.5rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--raw);
  margin-bottom: 3rem;
}

/* ─── BENEFITS ───────────────────────────────────────────────────────────── */
.section-benefits { padding: 8rem 0; }
.section-benefits .section-heading { max-width: 22ch; }

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  margin-top: 0;
}

.benefit-card {
  padding: 3rem 2.5rem;
  background: var(--forge);
  border: 1px solid var(--iron);
  position: relative;
  transition: border-color .3s;
  overflow: hidden;
}
.benefit-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--oxide), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.benefit-card:hover::before { transform: scaleX(1); }
.benefit-card:hover { border-color: var(--oxide); }

.benefit-num {
  font-family: var(--font-data);
  font-size: .65rem; font-weight: 700;
  letter-spacing: .12em;
  color: var(--oxide-mid);
  margin-bottom: 1.5rem;
}
.benefit-icon {
  width: 36px; height: 36px;
  color: var(--oxide-mid);
  margin-bottom: 1.25rem;
}
.benefit-icon svg { width: 100%; height: 100%; }

.benefit-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
  margin-bottom: .75rem;
  color: var(--raw);
}
.benefit-card p { font-size: .875rem; line-height: 1.7; color: var(--bone); }

/* ─── STATS ──────────────────────────────────────────────────────────────── */
.section-stats { padding: 5rem 0; }

.stats-divider { height: 1px; background: var(--iron); margin-bottom: 3.5rem; }
.stats-divider:last-child { margin-top: 3.5rem; margin-bottom: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stat-item { padding: 0 2rem; border-left: 1px solid var(--iron); }
.stat-item:first-child { padding-left: 0; border-left: none; }

.stat-label {
  display: block;
  font-family: var(--font-data);
  font-size: .6rem; font-weight: 600;
  letter-spacing: .14em;
  color: var(--oxide-mid);
  margin-bottom: .75rem;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  line-height: 1; color: var(--raw);
}

/* ─── CONTACT / FORM ─────────────────────────────────────────────────────── */
.section-contact { padding: 8rem 0; }

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.contact-heading { margin-bottom: 1.25rem; }
.contact-sub { font-size: .95rem; line-height: 1.7; color: var(--bone); margin-bottom: 2rem; }

.contact-perks { list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.contact-perks li { font-size: .875rem; color: var(--bone); display: flex; gap: .75rem; }
.perk-mark { color: var(--oxide-mid); font-weight: 500; }

/* Form */
.forge-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .7rem; font-weight: 500; letter-spacing: .08em; color: var(--graphite); text-transform: uppercase; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--forge);
  border: 1px solid var(--iron);
  color: var(--raw);
  font-family: var(--font-interface);
  font-size: .875rem; font-weight: 300;
  padding: .85rem 1rem;
  outline: none;
  width: 100%;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--oxide-mid); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--graphite); }
.form-group select option { background: var(--forge); }
.form-group textarea { resize: vertical; min-height: 90px; }

.field-error { font-size: .72rem; color: #f97316; margin-top: .2rem; }
.field-border-error { border-color: #f97316 !important; }

.btn-submit { width: 100%; padding: 1.1rem; font-size: .95rem; letter-spacing: .06em; margin-top: .5rem; }
.form-legal { font-size: .7rem; color: var(--graphite); line-height: 1.6; text-align: center; margin-top: .5rem; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.footer { padding: 3rem 0; border-top: 1px solid var(--iron); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.footer-brand { display: flex; flex-direction: column; gap: .2rem; }
.footer-logo { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .25em; }
.footer-sub { font-size: .55rem; letter-spacing: .3em; color: var(--graphite); font-family: var(--font-data); }
.footer-note { font-size: .78rem; color: var(--graphite); }
.footer-note a { color: var(--oxide-mid); text-decoration: none; transition: color .2s; }
.footer-note a:hover { color: var(--ember); }
.footer-copy { font-size: .72rem; color: oklch(22% 0.020 26); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .stat-item { border-left: none; padding-left: 0; border-top: 1px solid var(--iron); padding-top: 1.5rem; }
  .stat-item:first-child { border-top: none; }
  .contact-inner { grid-template-columns: 1fr; gap: 3.5rem; }
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  .section-hero {
    padding: 0 1.25rem;
    align-items: flex-end;
    padding-bottom: 8vh;
  }
  /* Mobile: content full-width, card floats semi-transparently behind */
  .hero-content {
    max-width: 100%;
    background: linear-gradient(to top, oklch(7% 0.012 22 / 0.85) 60%, transparent);
    padding: 2rem 1.25rem 0;
    border-radius: 4px;
  }
  .hero-headline { font-size: clamp(2.1rem, 10vw, 3.2rem); }
  .hero-sub { font-size: .875rem; }
  .br-d { display: none; }

  .chapter-forge      { height: 220vh; }
  .chapter-flip       { height: 200vh; }
  .chapter-collection { height: 280vh; }

  .chapter-text { max-width: calc(100vw - 2.5rem); }
  .chapter-text--right { right: 1.25rem; left: 1.25rem; text-align: left; top: auto; bottom: 8vh; }
  .chapter-text--left  { left: 1.25rem; right: 1.25rem; bottom: 8vh; top: auto; }

  .tier-label { min-width: auto; width: calc(100% - 2.5rem); }
  .nfc-label-group { transform: translate(-50%, -50%); }

  .benefits-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-item { border-left: none; padding-left: 0; }

  .form-row { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: flex-start; width: 100%; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: .75rem; }

  .section-benefits, .section-contact { padding: 5rem 0; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .section-heading { font-size: 2rem; }
}

/* ─── PAGE LOADER ─────────────────────────────────────────────────────────── */
.page-loader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--void);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem;
  transition: opacity .7s var(--ease), visibility .7s;
}
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-logotype {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; letter-spacing: .35em; color: var(--raw);
}
.loader-track {
  width: 100px; height: 1px; background: var(--iron);
  overflow: hidden; position: relative;
}
.loader-track::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -100%; width: 100%;
  background: linear-gradient(90deg, transparent, var(--oxide), var(--ember), transparent);
  animation: loaderSweep 1.4s ease-in-out infinite;
}
@keyframes loaderSweep {
  from { transform: translateX(0); }
  to   { transform: translateX(200%); }
}

/* ─── SCROLL PROGRESS ─────────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 101; pointer-events: none;
}
.scroll-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--oxide), var(--ember));
  transition: width .08s linear;
}

/* ─── SELECT ARROW ────────────────────────────────────────────────────────── */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a3025' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ─── STAT INITIAL DASH ───────────────────────────────────────────────────── */
.stat-num { transition: opacity .3s; }

/* ─── FORM SUCCESS ────────────────────────────────────────────────────────── */
.btn-submit.success { background: oklch(50% 0.17 145) !important; }
