/* =========================================================
   Brodats Moheamoo — página de entrada 3D
   Identidad de la primera web: blanco cálido, naranja #F26A21, Outfit + Lato
   ========================================================= */
:root {
  --paper: #f6f4f0;
  --ink: #16161a;
  --orange: #F26A21;
  --orange-dark: #d9561a;
  /* naranja accesible para botones y textos pequeños (5,2:1 con blanco); --orange queda para decoración */
  --orange-ui: #C2410C;
  --orange-ui-hover: #9A3412;
  --line: #e2ddd5;
  --muted: #6b6b76;
  --dark: #16161a;
  --dark-line: #2c2c31;
  --m: clamp(16px, 2vw, 28px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --display: "Outfit", system-ui, sans-serif;
  --text: "Lato", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
.js body.is-loading { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Carga ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; display: none;
  place-items: center; align-content: center; gap: 22px;
  background: var(--paper);
  transition: opacity .7s var(--ease), visibility .7s;
}
.js .loader { display: grid; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__hoop { width: 96px; height: 96px; animation: hoop-spin 6s linear infinite; }
.loader__stitch { stroke-dasharray: 0 100; transition: stroke-dasharray .3s ease; }
.loader__text { margin: 0; font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .04em; color: var(--muted); }
.loader__text strong { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes hoop-spin { to { transform: rotate(360deg); } }

/* ---------- Fondo de hilos ---------- */
.threads { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.threads path { fill: none; stroke: var(--line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.threads .thread-hot { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 9 7; animation: stitch-run 2.4s linear infinite; }
@keyframes stitch-run { to { stroke-dashoffset: -32; } }

/* ---------- Escena 3D ---------- */
.stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; touch-action: pan-y; }
.lens {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none;
  width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%;
  border: 2px dashed var(--orange);
  display: grid; place-items: end center; padding-bottom: 18px;
  opacity: 0; transition: opacity .4s ease, width .5s var(--ease), height .5s var(--ease), margin .5s var(--ease);
  will-change: transform;
}
.lens span {
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: #fff; background: var(--orange-ui); padding: 3px 9px; border-radius: 99px;
}
.lens.is-on { opacity: 1; }
.lens.is-full { opacity: 0; }

/* ---------- Cabecera ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  padding: var(--m); pointer-events: none;
  transition: opacity .4s ease, transform .5s var(--ease);
}
.top > * { pointer-events: auto; }
.top.is-away .brand { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange-ui); color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  padding: 12px 16px; border-radius: 10px;
  transition: transform .2s var(--ease), background-color .2s ease;
}
.pill svg { width: 18px; height: 18px; }
.pill:hover { background: var(--orange-ui-hover); transform: translateY(-2px); }
.pill:active { transform: scale(.97); }
.brand { display: grid; justify-items: center; gap: 6px; text-decoration: none; text-align: center; margin-top: 8px; transition: opacity .4s ease, transform .5s var(--ease); }
.brand__mark { width: 40px; height: 40px; }
.brand__name { font-family: var(--display); font-size: clamp(26px, 3vw, 40px); line-height: 1; letter-spacing: -.01em; margin-top: 6px; }
.brand__light { font-weight: 300; margin-right: .28em; }
.brand__bold { font-weight: 900; }
.brand__tag { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.burger {
  justify-self: end; width: 46px; height: 46px; border-radius: 10px;
  border: 1.5px solid var(--ink); background: var(--paper);
  display: grid; place-content: center; gap: 6px;
  transition: background-color .2s ease, color .2s ease;
}
.burger span { display: block; width: 18px; height: 1.6px; background: currentColor; transition: transform .3s var(--ease); }
.burger span:last-child { width: 10px; justify-self: end; }
.burger:hover { background: var(--ink); color: var(--paper); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.8px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { width: 18px; transform: translateY(-3.8px) rotate(-45deg); }
body.on-dark .burger { border-color: var(--paper); background: var(--dark); color: var(--paper); }

/* ---------- Portada ---------- */
main { position: relative; z-index: 3; }
.hero { position: relative; height: 100svh; min-height: 560px; pointer-events: none; }
.hero > * { pointer-events: auto; }
.card {
  position: absolute; left: var(--m); bottom: var(--m); width: 112px;
  display: grid; justify-items: center; gap: 4px; text-align: center;
  border: 1.5px solid var(--ink); border-radius: 6px; padding: 10px 8px 12px;
  background: var(--paper);
  font-family: var(--display);
}
.card__label { font-weight: 800; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; justify-self: start; }
.card__icon { width: 34px; height: 34px; margin: 6px 0 2px; }
.card__big { font-weight: 900; font-size: 18px; letter-spacing: .02em; }
.card__small { font-weight: 700; font-size: 11px; color: var(--orange-ui); text-transform: uppercase; letter-spacing: .06em; }
.card__foot { font-weight: 500; font-size: 10px; line-height: 1.3; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }

.scroll-hint {
  position: absolute; left: 50%; bottom: var(--m); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint i { width: 2px; height: 34px; background: var(--line); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--orange); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }

.look {
  position: absolute; right: var(--m); bottom: var(--m);
  display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0;
}
.look__text { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.look__btn {
  width: 58px; height: 58px; border-radius: 12px; background: var(--orange-ui); color: #fff;
  display: grid; place-items: center; transition: transform .2s var(--ease), background-color .2s ease;
}
.look__btn svg { width: 28px; height: 28px; }
.look:hover .look__btn { transform: translateY(-2px) rotate(-6deg); }
.look[aria-pressed="true"] .look__btn { background: var(--ink); }

/* ---------- Segunda pantalla ---------- */
.motto {
  position: relative; min-height: 100svh; overflow: hidden;
  background: var(--dark); color: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; justify-items: center;
  padding: 110px 0 calc(var(--m) * 2);
}
.motto__threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.motto__threads path { fill: none; stroke: var(--dark-line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.motto__head { position: relative; display: grid; justify-items: center; gap: 10px; color: var(--paper); }
.motto__mark { width: 36px; height: 36px; }
.motto__head p { margin: 0; font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.motto__frame {
  position: relative; align-self: center; width: min(520px, 82vw); aspect-ratio: 16 / 10;
  display: grid; place-items: center; margin: 40px 0;
}
.motto__quote {
  margin: 0; text-align: center; font-family: var(--display); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.02em; color: #8c8c94;
}
.sign { position: absolute; left: 50%; top: 50%; width: 175%; transform: translate(-50%, -46%) rotate(-8deg); overflow: visible; pointer-events: none; }
.sign text {
  font-family: "Great Vibes", cursive; font-size: 250px;
  fill: transparent; stroke: var(--orange); stroke-width: 3.2; stroke-linejoin: round;
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
}
.sign.is-drawn text { animation: sign-draw 3.2s var(--ease) forwards; }
@keyframes sign-draw { 70% { fill: transparent; } to { stroke-dashoffset: 0; fill: rgba(242,106,33,.12); } }

.marquee { position: relative; width: 100%; overflow: hidden; display: grid; gap: 4px; margin-bottom: 44px; }
.marquee__row { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee__row--rev { animation-direction: reverse; animation-duration: 40s; }
.marquee__row span {
  font-family: var(--display); font-weight: 900; font-size: clamp(40px, 7.4vw, 112px); line-height: .95;
  letter-spacing: -.02em; white-space: nowrap; padding-right: .3em;
}
.marquee__row--rev span { color: transparent; -webkit-text-stroke: 1.5px var(--orange); }
@keyframes marquee { to { transform: translateX(-50%); } }

.motto__actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 var(--m); }
.enter {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--orange-ui); color: #fff; padding: 16px 26px; border-radius: 10px;
  font-family: var(--display); font-weight: 800; font-size: 17px;
  transition: transform .2s var(--ease), background-color .2s ease;
}
.enter svg { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.enter:hover { transform: translateY(-2px); background: var(--orange-ui-hover); }
.enter:hover svg { transform: translateX(4px); }
.enter--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px #4a4a52; }
.enter--ghost:hover { background: var(--paper); color: var(--ink); }

/* ---------- Menú ---------- */
.menu {
  position: fixed; inset: 0; z-index: 15; background: var(--dark); color: var(--paper);
  display: grid; align-content: center; justify-items: center; gap: 4px; padding: 100px var(--m) 40px;
  opacity: 0; transition: opacity .35s ease;
}
.menu[hidden] { display: grid; visibility: hidden; pointer-events: none; }
.menu.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.menu > a {
  font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6vw, 72px); line-height: 1.08;
  text-decoration: none; letter-spacing: -.02em; transition: color .2s ease, transform .3s var(--ease);
}
.menu > a:hover { color: var(--orange); transform: translateX(8px); }
.menu__foot { margin: 32px 0 0; color: #9a9aa2; font-size: 14px; }
body.menu-open .top .pill { visibility: hidden; }
body.menu-open .burger { border-color: var(--paper); background: var(--dark); color: var(--paper); }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  .pill { padding: 10px 12px; font-size: 12px; }
  .pill svg { display: none; }
  .brand__mark { width: 32px; height: 32px; }
  .brand__name { font-size: 22px; display: grid; }
  .brand__tag { font-size: 9px; max-width: 18em; }
  .card { width: 92px; padding: 8px 6px 10px; }
  .card__big { font-size: 15px; }
  .card__foot { display: none; }
  .scroll-hint { display: none; }
  .look__text { display: none; }
  .lens { width: 200px; height: 200px; margin: -100px 0 0 -100px; }
  .motto { padding-top: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .threads .thread-hot, .marquee__row, .loader__hoop, .scroll-hint i::after { animation: none; }
  .sign text { stroke-dashoffset: 0; fill: rgba(242,106,33,.12); }
  .sign.is-drawn text { animation: none; }
}

/* ---------- Alternativa sin 3D (sin WebGL o sin JavaScript) ---------- */
.sin3d {
  position: fixed; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: 180px var(--m) 120px; text-align: center; pointer-events: none;
}
.sin3d[hidden] { display: none; }
.sin3d > * { pointer-events: auto; }
.sin3d__shirt { width: min(280px, 60vw); height: auto; }
.sin3d p { margin: 0; max-width: 34ch; font-family: var(--display); font-weight: 500; font-size: 17px; }
body.sin-3d .stage, body.sin-3d .lens, body.sin-3d .look { display: none; }
