/* CrossFit SJD · base: fuentes autoalojadas, tokens, tipografía y piezas comunes
   Concepto «Sota el mateix sostre»: el tejado y el suelo del logo enmarcan titulares, fotos y secciones. */

@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlowc-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlowc-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlowc-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  /* Marca: cobre del tejado, hueso de «CROSSFIT», carbón del fondo */
  --carbon: #181816;
  --carbon-2: #222220;
  --carbon-3: #2f2e2b;
  --bone: #e4e1df;
  --paper: #efedea;
  --stone: #d7d2cc;
  --ink: #1d1c1a;
  --muted: #59544e;
  --muted-dark: #a9a29a;
  --copper: #b16316;
  --copper-btn: #a35710;
  --copper-btn-hover: #864609;
  --copper-deep: #87470c;   /* cobre para texto pequeño sobre claro (AA) */
  --copper-hi: #e3954a;     /* cobre para texto sobre oscuro (AA) */
  --gold: linear-gradient(135deg, #e3a52a 0%, #c87a12 55%, #b0590d 100%);
  --line: rgba(29, 28, 26, .16);
  --line-dark: rgba(228, 225, 223, .16);

  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Hanken Grotesk", system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;

  --gutter: 16px;
  --maxw: 1360px;
  --header-h: 64px;
  --abar-h: 52px;
  --eave: clamp(26px, 5vw, 64px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-deep: 0 40px 80px -30px rgba(10, 10, 9, .55), 0 18px 36px -24px rgba(10, 10, 9, .45);
}
@media (min-width: 700px) { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; --header-h: 76px; } }

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Grano fino de papel sobre toda la página */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper-hi); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; z-index: 400; left: 12px; top: -60px; padding: 12px 16px; background: var(--copper-btn); color: #fff; text-decoration: none; }
.skip:focus { top: 12px; }

/* --- Tipografía --- */
.h2 {
  font: 800 clamp(2.9rem, 11.5vw, 7.4rem)/.88 var(--f-display);
  text-transform: uppercase;
  letter-spacing: -.012em;
  color: var(--ink);
}
.h2--light { color: var(--bone); }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.01em; }
.h2 em, .hero__title em, .trial__title em, .mani__quote em { color: var(--copper-deep); }
.h2--light em, .trial__title em { color: var(--copper-hi); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font: 700 .82rem/1 var(--f-display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b { color: var(--copper-deep); font-weight: 800; letter-spacing: .06em; }
.eyebrow__rule { width: 44px; height: 1px; background: currentColor; opacity: .55; }
.eyebrow--light { color: var(--muted-dark); }
.eyebrow--light b { color: var(--copper-hi); }

/* --- Botones: cobre macizo, con flecha que se desliza --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 22px 0 24px;
  border: 1px solid transparent;
  font: 700 1.02rem/1 var(--f-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: color .35s var(--ease), border-color .35s, background-color .35s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn .ico--arrow { width: 20px; height: 20px; transition: transform .45s var(--ease); }
.btn:hover .ico--arrow { transform: translateX(4px); }
.btn--copper { background: var(--copper-btn); color: #fff; }
.btn--copper::before { background: var(--copper-btn-hover); }
.btn--ghost { color: var(--bone); border-color: rgba(228, 225, 223, .45); }
.btn--ghost::before { background: var(--bone); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--bone); }
.btn--dark::before { background: var(--copper-btn); }
.ico { width: 20px; height: 20px; flex: none; }

.tlink { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-underline-offset: 4px; }

/* --- Datos por confirmar: subrayado discontinuo + etiqueta pequeña --- */
.pending { border-bottom: 1px dashed currentColor; }
.pending small, .pending-link small, .pending-tag, .abar__btn small {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px 1px;
  font: 600 .62rem/1.2 var(--f-body);
  letter-spacing: .04em;
  text-transform: lowercase;
  vertical-align: middle;
  color: #6a3a0d;
  background: #f2d9bf;
  border-radius: 2px;
}
.pending-link { cursor: not-allowed; }

/* --- El tejado del logo (línea que se dibuja desde la cumbrera) --- */
.roof { display: block; width: 100%; height: auto; overflow: visible; }
.roof path { fill: none; stroke: var(--copper); stroke-width: 3px; stroke-linejoin: miter; }
.js .roof { clip-path: inset(0 50% 0 50%); transition: clip-path 1.5s var(--ease) .1s; }
.js .roof.is-in, .reveal-all .roof { clip-path: inset(0 0 0 0); }

/* Marco con forma de casa para las fotos (forma fija, no oculta nada) */
.house__frame {
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 var(--eave), 27% var(--eave), 50% 0, 73% var(--eave), 100% var(--eave), 100% 100%, 0 100%);
}
.house__frame img { width: 100%; height: 100%; object-fit: cover; transform: translate3d(0, var(--py, 0), 0) scale(1.12); }

/* --- Apariciones (solo con JS; sin JS todo está visible) --- */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in, .reveal-all [data-reveal] { opacity: 1; transform: none; }
.js [data-bar] { transform: scaleX(0); transform-origin: left; transition: transform 1.3s var(--ease) .5s; }
.js [data-bar].is-in, .reveal-all [data-bar] { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-bar] { opacity: 1; transform: none; }
  .js .roof { clip-path: none; }
}
