/* ICON CrossFit & Training — base, tokens, cabecera, pie, componentes compartidos */

@view-transition { navigation: auto; }

:root {
  --ink: #0b0b0a;
  --ink-2: #141412;
  --ink-3: #1e1e1b;
  --bone: #f2f0ea;
  --bone-2: #e4e1d8;
  --volt: #d0ff71;
  --volt-ink: #10140a;
  --graphite: #494949;
  --muted: #a9a79f;
  --muted-on-bone: #4a4944;
  --line: rgba(242, 240, 234, 0.14);
  --line-on-bone: rgba(11, 11, 10, 0.16);
  --display: "League Gothic", "Arial Narrow", Impact, sans-serif;
  --text: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.7, 0, 0.2, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --header-h: 72px;
  --dock-h: 0px;
  --radius: 4px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--text);
  font-size: clamp(16px, 0.35vw + 15px, 18px);
  line-height: 1.55;
  overflow-x: clip;
  padding-bottom: var(--dock-h);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; color: var(--volt); }
::selection { background: var(--volt); color: var(--volt-ink); }

:focus-visible { outline: 3px solid var(--volt); outline-offset: 3px; border-radius: 2px; }
.on-bone :focus-visible { outline-color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200; padding: 12px 18px;
  background: var(--volt); color: var(--volt-ink); font-weight: 700; transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip:focus { transform: none; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }

/* Tipografía ------------------------------------------------------------ */
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); margin: 0 0 1.2rem; display: flex; align-items: center; gap: 0.6em;
}
.on-bone .eyebrow { color: var(--muted-on-bone); }
.h-xxl, .h-xl, .h-lg, .display {
  font-family: var(--display); text-transform: uppercase; line-height: 0.88; letter-spacing: 0.005em;
  font-variation-settings: "wdth" 100;
}
.h-xxl { font-size: clamp(4rem, 13vw, 13rem); }
.h-xl { font-size: clamp(3rem, 8vw, 7.5rem); }
.h-lg { font-size: clamp(2.6rem, 5vw, 4.6rem); }
.h-lg a { text-decoration: none; }

/* Líneas enmascaradas: el texto se ve siempre; solo se oculta si el JS de movimiento está activo */
.mask-lines { display: block; }
.ln { display: block; overflow: hidden; padding: 0.14em 0 0.08em; margin: -0.14em 0 -0.08em; }
.ln__in { display: block; }
.motion .mask-lines .ln__in { transition: transform 1.15s var(--ease-out); }
.motion .mask-lines .ln:nth-child(2) .ln__in { transition-delay: 0.09s; }
.motion .mask-lines .ln:nth-child(3) .ln__in { transition-delay: 0.18s; }
.motion .mask-lines:not(.is-in) .ln__in { transform: translate3d(0, 108%, 0); }

.motion [data-reveal=""] { transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.motion [data-reveal=""]:not(.is-in) { opacity: 0; transform: translate3d(0, 28px, 0); }

/* Botones --------------------------------------------------------------- */
.btn {
  --bg: transparent; --fg: var(--bone); --bd: var(--bone);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0.8em 1.5em; border: 1.5px solid var(--bd); border-radius: 999px;
  background: var(--bg); color: var(--fg); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  transition: color 0.35s var(--ease-out), border-color 0.35s, transform 0.35s var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fill, var(--bone));
  transform: translateY(101%); transition: transform 0.45s var(--ease-out); border-radius: inherit;
}
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn--volt { --bg: var(--volt); --fg: var(--volt-ink); --bd: var(--volt); --fill: var(--bone); }
.btn--ghost { --fill: var(--bone); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--ink); }
.btn--ink { --bg: var(--ink); --fg: var(--bone); --bd: var(--ink); --fill: var(--volt); }
.btn--ink:hover, .btn--ink:focus-visible { color: var(--volt-ink); }
.btn--sm { min-height: 44px; padding: 0.55em 1.2em; font-size: 0.88rem; }
.btn--lg { min-height: 56px; padding: 1em 1.9em; font-size: 1rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; font-weight: 700;
  text-decoration: none; border-bottom: 1.5px solid currentColor; padding-top: 0.3em;
}
.link-arrow::after { content: "→"; transition: transform 0.35s var(--ease-out); }
.link-arrow:hover::after { transform: translateX(6px); }

.caret {
  width: 0.5em; height: 0.5em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-25%) rotate(45deg); display: inline-block; transition: transform 0.3s;
}

/* Rayo: el corte diagonal de la «I» del logo convertido en motivo gráfico */
.bolt {
  display: block; width: clamp(56px, 9vw, 140px); aspect-ratio: 1 / 2.4; background: var(--volt);
  clip-path: polygon(38% 0, 100% 0, 62% 46%, 100% 46%, 0 100%, 36% 54%, 0 54%);
}

.bolt--inline { display: inline-block; width: auto; height: 0.78em; aspect-ratio: 1 / 2.4; margin-left: 0.12em; vertical-align: 0; }
.motion .bolt--inline { animation: bolt-in 1s 0.9s var(--ease-out) both; }
@keyframes bolt-in { from { clip-path: polygon(38% 0, 38% 0, 38% 0, 38% 0, 38% 0, 38% 0, 38% 0); } }

/* Cabecera ------------------------------------------------------------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 100; transition: transform 0.45s var(--ease-out); }
.site-header__bar {
  height: var(--header-h); display: flex; align-items: center; gap: 24px;
  padding-inline: var(--gutter); position: relative; z-index: 2;
  transition: background-color 0.35s, backdrop-filter 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid .site-header__bar,
.site-header.is-open .site-header__bar,
.site-header:has(.nav__item--mega:hover) .site-header__bar {
  background: rgba(11, 11, 10, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header.is-hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; min-height: 44px; color: var(--bone); flex: none; }
.brand svg { height: 30px; width: auto; display: block; }
.nav { margin-inline: auto; }
.nav__list { display: flex; gap: 4px; }
.nav__link {
  display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; padding: 0 14px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; border-radius: 999px; position: relative;
}
.nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px; background: var(--volt);
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease-out);
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.site-header__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav + .site-header__tools { margin-left: 0; }

/* Mega-menú de centros */
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1; background: rgba(11, 11, 10, 0.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  visibility: hidden; opacity: 0; transform: translateY(-12px);
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out), visibility 0s 0.35s;
}
.site-header:has(.nav__item--mega:hover) .mega, .mega:hover, .mega:focus-within, .site-header.is-mega .mega {
  visibility: visible; opacity: 1; transform: none; transition-delay: 0s;
}
.mega__inner { max-width: var(--max); margin-inline: auto; padding: 28px var(--gutter) 32px; }
.mega__list { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.mega__item {
  display: grid; gap: 6px; padding: 22px 20px 22px 0; text-decoration: none; border-right: 1px solid var(--line);
  margin-right: 20px; min-height: 44px;
}
.mega__list li:last-child .mega__item { border-right: 0; }
.mega__num { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.mega__name {
  font-family: var(--display); text-transform: uppercase; font-size: clamp(2.2rem, 3.4vw, 3.4rem); line-height: 0.9;
  transition: color 0.3s, transform 0.4s var(--ease-out);
}
.mega__meta { font-size: 0.85rem; color: var(--muted); }
.mega__go { font-size: 0.85rem; font-weight: 700; margin-top: 8px; }
.mega__item:hover .mega__name, .mega__item:focus-visible .mega__name { color: var(--volt); transform: translateX(6px); }
.mega__all { display: inline-flex; min-height: 44px; align-items: center; margin-top: 12px; font-weight: 700; }

/* Hamburguesa y menú móvil */
.burger {
  display: none; width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(11, 11, 10, 0.4); align-items: center; justify-content: center; flex-direction: column; gap: 6px;
}
.burger__l { width: 20px; height: 2px; background: var(--bone); transition: transform 0.35s var(--ease-out); }
.site-header.is-open .burger__l:first-of-type { transform: translateY(4px) rotate(45deg); }
.site-header.is-open .burger__l:last-of-type { transform: translateY(-4px) rotate(-45deg); }
.mm {
  display: none; position: fixed; inset: var(--header-h) 0 0; background: var(--ink); z-index: 1;
  padding: 24px var(--gutter) calc(110px + env(safe-area-inset-bottom)); overflow-y: auto;
}
.mm:target, .site-header.is-open .mm { display: block; }
.mm__links a {
  display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-family: var(--display); text-transform: uppercase; font-size: clamp(2.8rem, 13vw, 4rem); line-height: 1;
  text-decoration: none;
}
.mm__idx { font-family: var(--text); font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.mm__eyebrow { margin-top: 28px; }
.mm__centers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm__centers a {
  display: flex; align-items: center; min-height: 52px; padding: 0 16px; border: 1px solid var(--line);
  border-radius: 999px; font-weight: 700; text-decoration: none;
}
.mm__centers a.is-active { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
.motion .site-header.is-open .mm__links li { animation: mm-in 0.6s var(--ease-out) both; }
.motion .site-header.is-open .mm__links li:nth-child(2) { animation-delay: 0.05s; }
.motion .site-header.is-open .mm__links li:nth-child(3) { animation-delay: 0.1s; }
.motion .site-header.is-open .mm__links li:nth-child(4) { animation-delay: 0.15s; }
.motion .site-header.is-open .mm__links li:nth-child(5) { animation-delay: 0.2s; }
@keyframes mm-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Pie ------------------------------------------------------------------ */
.site-footer { background: var(--ink); border-top: 1px solid var(--line); padding-top: clamp(56px, 8vw, 110px); }
.foot__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.foot__logo { color: var(--bone); display: block; }
.foot__logo svg { width: clamp(220px, 30vw, 380px); height: auto; display: block; }
.foot__cta { display: grid; gap: 16px; justify-items: start; }
.foot__claim { font-family: var(--display); text-transform: uppercase; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 0.95; margin: 0; }
.foot__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: clamp(48px, 6vw, 80px);
  padding-top: 32px; border-top: 1px solid var(--line);
}
.foot__center h3 { font-family: var(--display); text-transform: uppercase; font-size: 2rem; line-height: 1; margin-bottom: 12px; }
.foot__center h3 a { text-decoration: none; }
.foot__center h3 a:hover { color: var(--volt); }
.foot__center p { color: var(--muted); font-size: 0.92rem; }
.foot__center p a { color: var(--bone); display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.foot__bottom { padding-block: 32px 40px; margin-top: 32px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.foot__legal { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.foot__legal a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 0.92rem; }
.foot__kit, .foot__copy { color: var(--muted); font-size: 0.78rem; max-width: 90ch; margin: 0; }

/* Barra fija inferior (móvil) ----------------------------------------- */
.dock { display: none; }

/* Cursor propio (solo escritorio con ratón) --------------------------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .motion.has-cursor .cursor { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 300; }
  .motion.has-cursor, .motion.has-cursor a, .motion.has-cursor button { cursor: none; }
  .motion.has-cursor input, .motion.has-cursor textarea, .motion.has-cursor select { cursor: auto; }
  .cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; transform: translate3d(-120px, -120px, 0); }
  .cursor__dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--volt); }
  .cursor__ring {
    width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1.5px solid rgba(242, 240, 234, 0.6);
    display: grid; place-items: center; transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), background-color 0.3s, border-color 0.3s;
  }
  .cursor.is-label .cursor__ring { width: 104px; height: 104px; margin: -52px 0 0 -52px; background: var(--volt); border-color: var(--volt); }
  .cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--volt); }
  .cursor__txt { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--volt-ink); opacity: 0; transition: opacity 0.2s; }
  .cursor.is-label .cursor__txt { opacity: 1; }
  .cursor.is-label .cursor__dot { opacity: 0; }
}

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav__link { padding: 0 10px; }
}
@media (max-width: 899px) {
  :root { --header-h: 64px; --dock-h: calc(68px + env(safe-area-inset-bottom)); }
  .nav, .hide-sm, .mega { display: none; }
  .burger { display: inline-flex; }
  .brand svg { height: 26px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .dock {
    display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(11, 11, 10, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .dock__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 999px;
    border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; text-decoration: none;
  }
  .dock__btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
  .dock__btn--volt { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
}
@media (max-width: 520px) {
  .foot__grid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .dock__btn span { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  @view-transition { navigation: none; }
}
