/* ==========================================================================
   AUREL · relojería — réplica fiel de VALCÈRE
   Secciones: tokens · base · header · hero (pinned 300vh) · sección 2 crema ·
   sección 3 negra · colección · cierre · footer · responsive · reduced motion
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* paleta (hex de la referencia) */
  --burdeos: #2a0d14;
  --burdeos-deep: #150609;
  --wine: #7a1f2e;
  --gold: #c9a24a;
  --cream: #f1e6d2;
  --cream-bg: #ede9e1;
  --light-bg: #e5e2da;
  --black: #060304;
  --ink: #1c1412;
  --ink-soft: #5b504b;
  --warm-gray: #cfc9c0;

  /* tipografía */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;

  /* escala */
  --fs-xl: clamp(56px, 6.7vw, 96px);
  --fs-lg: clamp(40px, 4.45vw, 64px);
  --fs-card: 30px;
  --fs-body: 12px;
  --fs-label: 9px;
  --fs-lead: 14px;

  /* ritmo */
  --gutter: 5vw;
  --radius: 2px;

  /* movimiento */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.8s;
  --gear-spin: 240s;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--burdeos);
  color: var(--cream);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,
h2,
h3,
p,
figure,
ul {
  margin: 0;
  padding: 0;
}
ul {
  list-style: none;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* Titulares serif display con itálica verdadera */
.display {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.display em {
  font-style: italic;
  font-weight: 300;
}
.display--xl {
  font-size: var(--fs-xl);
  color: var(--cream);
}
.display--lg {
  font-size: var(--fs-lg);
}
.display--cream {
  color: var(--cream);
}

/* Overlines y labels diminutos */
.overline {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 26px;
}
.overline--gold {
  color: var(--gold);
}
.foot-label {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(241, 230, 210, 0.7);
}

/* Link con línea inferior */
.link-line {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.3s var(--ease-out);
}
.link-line:hover {
  opacity: 0.7;
}
.link-line--caps {
  font-size: var(--fs-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px var(--gutter);
  color: var(--cream);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: transform 0.6s var(--ease-out), opacity 0.4s;
}
.header__menu {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.header__burger {
  font-size: 13px;
}
.header__brand {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.header__overline {
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241, 230, 210, 0.6);
}
.header__wordmark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.3em;
  padding-left: 0.3em; /* compensa el tracking del último carácter */
  line-height: 1;
}
.header__link {
  justify-self: end;
}
body.is-pinned .header,
body.is-scrolling-down .header {
  transform: translateY(-110%);
  opacity: 0;
}

/* ---------- Hero (pinned 300vh) ---------- */
.hero {
  position: relative;
  height: 300vh;
}
.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, var(--burdeos) 0%, var(--burdeos-deep) 100%);
  isolation: isolate;
}
/* Glow cálido detrás del reloj */
.hero__glow {
  position: absolute;
  left: 46%;
  top: 8%;
  width: 46%;
  height: 84%;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(122, 31, 46, 0.7) 0%,
    rgba(201, 162, 74, 0.12) 45%,
    rgba(21, 6, 9, 0) 72%
  );
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
/* Engranajes gigantes translúcidos */
.gear {
  position: absolute;
  color: rgba(201, 162, 74, 0.09);
  pointer-events: none;
  z-index: 0;
  animation: spin var(--gear-spin) linear infinite;
}
.gear--tr {
  width: 62vh;
  height: 62vh;
  top: -24vh;
  right: -18vh;
}
.gear--bl {
  width: 78vh;
  height: 78vh;
  bottom: -36vh;
  left: -26vh;
  animation-direction: reverse;
  animation-duration: calc(var(--gear-spin) * 1.35);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero__copy {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  width: 30vw;
  max-width: 460px;
  z-index: 2;
}
.hero__copy .overline {
  margin-bottom: 34px;
}
.hero__lead {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: rgba(241, 230, 210, 0.82);
  margin: 34px 0 34px;
}

.hero__watch {
  position: absolute;
  left: 50%;
  top: 4%;
  width: 35%;
  height: 93%;
  z-index: 1;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  filter: sepia(0.35) saturate(0.9) brightness(0.95);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 55%, transparent 100%);
}
html.has-webgl .hero__fallback {
  display: none;
}
html:not(.has-webgl) .hero__canvas {
  display: none;
}

.hero__foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 30px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 2;
}
.foot-label--right {
  justify-self: end;
}
.hero__progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: var(--cream);
}
.ring {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
}
.ring__track,
.ring__fill {
  fill: none;
  stroke-width: 1.4;
}
.ring__track {
  stroke: rgba(241, 230, 210, 0.25);
}
.ring__fill {
  stroke: var(--gold);
  stroke-dasharray: 56.55; /* 2π·9 */
  stroke-dashoffset: calc(56.55 * (1 - var(--p, 0)));
  stroke-linecap: round;
}

/* ---------- Sección 2 · crema ---------- */
.rarest {
  position: relative;
  background: var(--cream-bg);
  color: var(--ink);
  padding: 14vh var(--gutter) 14vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  z-index: 2;
}
.ghost {
  position: absolute;
  right: 4vw;
  top: -4vh;
  font-family: var(--serif);
  font-size: 34vw;
  line-height: 1;
  font-weight: 300;
  color: rgba(28, 20, 18, 0.035);
  pointer-events: none;
  user-select: none;
}
.rarest__text {
  position: relative;
  max-width: 520px;
}
.rarest__lines {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink);
  margin: 36px 0 22px;
}
.rarest__body {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 400px;
  margin-bottom: 40px;
}
.rarest__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
  justify-self: end;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #1a1210;
}
.rarest__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 48%;
  transform: scale(2.6);
  transform-origin: 62% 48%;
  filter: sepia(0.55) saturate(0.9) contrast(1.05) brightness(0.9);
}

/* ---------- Sección 3 · negra ---------- */
.inner {
  background: var(--black);
  color: var(--cream);
}
.inner__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
  padding: 16vh var(--gutter) 10vh;
  min-height: 100vh;
}
.inner__lines {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: rgba(241, 230, 210, 0.82);
  margin-top: 36px;
}
.inner__pedestal {
  justify-self: end;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--black);
}
.inner__pedestal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inner__macro {
  height: 100vh;
  overflow: hidden;
}
.inner__macro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}
/* Sin WebGL: la foto de acero en negro, muy cerca */
.inner .snap--fallback {
  filter: sepia(0.5) saturate(1.3) contrast(1.15) brightness(0.8);
}
.inner__pedestal .snap--fallback {
  transform: scale(1.9);
  transform-origin: 50% 46%;
}
.inner__macro .snap--fallback {
  transform: scale(2.6);
  transform-origin: 50% 46%;
}

/* ---------- Sección 4 · colección ---------- */
.collection {
  background: var(--light-bg);
  color: var(--ink);
  padding: 14vh var(--gutter) 10vh;
}
.collection__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 4vw;
  margin-bottom: 8vh;
}
.collection__lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink);
  justify-self: end;
  text-align: left;
  max-width: 360px;
}

/* Reveal del titular: máscara de izquierda a derecha con borde desenfocado */
@property --w {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
.wipe__line {
  display: inline-block;
  --w: 0%;
  mask-image: linear-gradient(90deg, #000 var(--w), transparent calc(var(--w) + 12%));
  -webkit-mask-image: linear-gradient(90deg, #000 var(--w), transparent calc(var(--w) + 12%));
  filter: blur(6px);
}
.wipe.is-in .wipe__line {
  animation: wipe-in 0.55s var(--ease-out) forwards;
}
.wipe.is-in .wipe__line--2 {
  animation-delay: 0.2s;
}
@keyframes wipe-in {
  from {
    --w: 0%;
    filter: blur(6px);
  }
  60% {
    filter: blur(0);
  }
  to {
    --w: 110%;
    filter: blur(0);
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2vw;
}
.card {
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.cards.is-in .card {
  opacity: 1;
  transform: none;
}
.cards.is-in .card:nth-child(2) {
  transition-delay: 0.15s;
}
.cards.is-in .card:nth-child(3) {
  transition-delay: 0.3s;
}
.card__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--warm-gray);
  overflow: hidden;
  border-radius: var(--radius);
}
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
/* Sin WebGL: variantes de la misma foto con filtros */
.card[data-variant="nocturne"] .snap--fallback {
  filter: sepia(0.9) hue-rotate(-30deg) saturate(2.2) brightness(0.75);
}
.card[data-variant="ivoire"] .snap--fallback {
  filter: sepia(0.35) saturate(0.6) brightness(1.15) contrast(0.95);
}
.card[data-variant="celeste"] .snap--fallback {
  filter: sepia(0.9) hue-rotate(180deg) saturate(1.8) brightness(0.8);
}
.card__num {
  position: absolute;
  left: 18px;
  top: 16px;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
  z-index: 1;
}
.card__arrow {
  position: absolute;
  right: 14px;
  bottom: 14px; /* abajo a la derecha de la foto */
  width: 34px;
  height: 34px;
  border: 1px solid rgba(28, 20, 18, 0.3);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--ink);
  background: rgba(229, 226, 218, 0.6);
  backdrop-filter: blur(4px);
  transition: background 0.3s;
  z-index: 1;
}
.card__arrow:hover {
  background: var(--ink);
  color: var(--cream);
}
.card__name {
  font-family: var(--serif);
  font-size: var(--fs-card);
  font-weight: 400;
  line-height: 1.1;
  margin-top: 22px;
}
.card__sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 6px 0 12px;
}
.card__more {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.collection__foot {
  margin-top: 10vh;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
}

/* ---------- Cierre · burdeos ---------- */
.invite {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 16vh var(--gutter);
  background: radial-gradient(90% 70% at 50% 60%, var(--burdeos) 0%, var(--burdeos-deep) 100%);
  overflow: hidden;
}
.invite__mark {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 40px;
}
.invite .overline {
  margin-bottom: 30px;
}
.invite__lines {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: rgba(241, 230, 210, 0.82);
  margin: 36px 0 40px;
}
.btn-outline {
  justify-self: center;
  display: inline-block;
  padding: 14px 28px;
  border: 1px solid rgba(201, 162, 74, 0.7);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  transition: background 0.35s var(--ease-out), color 0.35s;
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--burdeos-deep);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--burdeos-deep);
  color: rgba(241, 230, 210, 0.6);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px var(--gutter);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.footer__brand {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--cream);
}
.footer__collection {
  justify-self: end;
  border-bottom: 1px solid rgba(241, 230, 210, 0.3);
}

/* ---------- Reveals genéricos (disparados) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal--late {
  transition-delay: 0.15s;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  :root {
    --fs-xl: clamp(48px, 9vw, 80px);
  }
  .hero__copy {
    width: 40vw;
  }
  .hero__watch {
    left: 46%;
    width: 46%;
  }
  .rarest,
  .inner__grid,
  .collection__head {
    grid-template-columns: 1fr;
  }
  .rarest__photo,
  .inner__pedestal {
    justify-self: start;
  }
  .collection__lead {
    justify-self: start;
  }
  .hero__foot {
    grid-template-columns: 1fr auto;
  }
  .foot-label--right {
    display: none;
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 6vw;
    --fs-xl: 56px;
    --fs-lg: 42px;
  }
  .header {
    padding: 18px var(--gutter);
    grid-template-columns: auto 1fr auto;
  }
  .header__menu span:not(.header__burger),
  .header__link span {
    display: none;
  }
  .header__wordmark {
    font-size: 20px;
  }
  .header__overline {
    display: none;
  }
  .hero__copy {
    top: 14vh;
    transform: none;
    width: 82vw;
  }
  .hero__copy .overline {
    margin-bottom: 20px;
  }
  .hero__lead {
    margin: 22px 0 22px;
  }
  .hero__watch {
    left: 10%;
    top: 46%;
    width: 80%;
    height: 48%;
  }
  .hero__glow {
    left: 10%;
    top: 40%;
    width: 80%;
    height: 56%;
  }
  .hero__foot {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
    bottom: 18px;
  }
  .foot-label--right {
    display: none;
  }
  .gear--tr {
    width: 60vw;
    height: 60vw;
    top: -20vw;
    right: -22vw;
  }
  .gear--bl {
    width: 70vw;
    height: 70vw;
    bottom: -30vw;
    left: -30vw;
  }
  .rarest {
    padding: 12vh var(--gutter);
    min-height: 0;
  }
  .ghost {
    font-size: 60vw;
    top: -6vw;
  }
  .inner__grid {
    padding: 12vh var(--gutter) 8vh;
    min-height: 0;
  }
  .inner__macro {
    height: 60vh;
  }
  .collection {
    padding: 12vh var(--gutter) 10vh;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 8vh;
  }
  .footer {
    grid-template-columns: 1fr 1fr;
  }
  .footer__note {
    grid-column: 1 / -1;
    order: 3;
    margin-top: 8px;
  }
}

/* ---------- Reduced motion: todo visible y quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .gear {
    animation: none;
  }
  .reveal,
  .card {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .wipe__line {
    --w: 110%;
    filter: none;
    animation: none;
  }
  .header {
    transition: none;
  }
  .ring__fill {
    stroke-dashoffset: 0;
  }
}
