/* ═══════════════════════════════════════════════════════════════════════════
   home.css — page-specific styles for Home.
   Uses tokens from shared/styles.css (--burgundy, --ink, --cream, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */

/* GSAP pre-hidden states */
.hero-sub, .hero-title, .hero-tag, .hero-meta, .hero-scroll, .hero-hashtag { opacity: 0; }
.hero-title.is-ready { opacity: 1; }
.k-title { opacity: 0; }
.k-title.is-ready { opacity: 1; }
.hero-scroll, .hero-hashtag { opacity: 0; }

/* Keyframes used by hero */
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ─── Hero (base, shared with kinetic variant) ─────────────────────────────── */
.hero {
  position: relative; min-height: 100vh; color: #fff; overflow: hidden;
  display: flex; align-items: flex-end;
  padding-bottom: 72px; padding-top: 120px;
  background: #0d0608;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('assets/hero-jump.jpg');
  background-size: cover;
  background-position: center 30%;
  filter: saturate(.9);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(160deg, rgba(26,6,8,.75) 0%, rgba(42,11,17,.55) 45%, rgba(13,6,8,.85) 100%),
    radial-gradient(ellipse at 20% 30%, rgba(166,61,77,.35), transparent 55%);
}
.hero-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.6'/></svg>");
}
.hero-ornament {
  position: absolute; right: -80px; top: 20%; width: 520px; height: 520px;
  border-radius: 50%;
  background: conic-gradient(from 10deg, rgba(199,154,58,.18), transparent 40%, rgba(166,61,77,.25), transparent 70%, rgba(199,154,58,.12));
  filter: blur(30px);
  animation: floatY 9s ease-in-out infinite;
}
.hero-scroll {
  position: absolute; right: 40px; bottom: 40px; color: rgba(255,255,255,.6);
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 14px; z-index: 2;
}
.hero-scroll::after { content: ""; width: 1px; height: 60px; background: linear-gradient(to bottom, rgba(255,255,255,.7), transparent); animation: floatY 2s ease-in-out infinite; }
@media (max-width: 700px) { .hero-scroll { display: none; } }

.hero-hashtag {
  position: absolute; left: 40px; top: 120px;
  color: #c73a4e;
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: .3em;
  writing-mode: vertical-rl; z-index: 2;
  text-shadow: 0 2px 14px rgba(0,0,0,.5), 0 0 24px rgba(199,58,78,.3);
}
@media (max-width: 980px) { .hero-hashtag { display: none; } }

/* ─── Kinetic hero ──────────────────────────────────────────────────────────── */
.hero.kinetic .hero-bg { filter: saturate(.75) brightness(.55); }
.hero.kinetic .hero-bg::after {
  background:
    linear-gradient(180deg, rgba(13,6,8,.78) 0%, rgba(13,6,8,.55) 45%, rgba(13,6,8,.92) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(166,61,77,.35), transparent 60%);
}
.hero.kinetic .hero-ornament { opacity: .35; }

.k-texture { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.k-word {
  position: absolute;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: #f5d5a6; opacity: 0; white-space: nowrap;
  will-change: opacity, transform;
}
.k-word::after {
  content: ""; position: absolute; top: -2px; left: -4px; width: 0; height: calc(100% + 4px);
  background-color: #f5d5a6; transition: width .5s cubic-bezier(.34,1.56,.64,1);
}
.k-word.highlight::after { width: calc(100% + 8px); }
.k-word.highlight-reverse::after { width: 0; right: -4px; left: auto; }
@media (max-width: 700px) { .k-word { font-size: 9px; } .k-word.hide-mobile { display: none; } }

.k-type {
  position: absolute; inset: 0;
  display: grid; align-content: center; justify-content: center;
  z-index: 3; pointer-events: none; transform-style: preserve-3d; overflow: hidden;
}
.k-type-line {
  font-family: 'Playfair Display', serif; font-weight: 700; text-transform: uppercase;
  font-size: clamp(5rem, 16vh, 14rem); line-height: .85;
  color: #fff; opacity: 0.04; white-space: nowrap; user-select: none;
  will-change: transform, opacity; text-align: center; letter-spacing: -.01em;
}
.k-type-line.odd { z-index: 50; }
.k-type-line.even { z-index: 150; color: #f5d5a6; }

.k-stage {
  position: relative; z-index: 10; width: 100%;
  display: flex; flex-direction: column; align-items: center; padding: 0 20px;
}
.k-title { display: flex; flex-direction: column; align-items: center; gap: clamp(2px, .4vh, 10px); margin: 0 0 36px; }
.k-row {
  position: relative; display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 500;
  font-size: clamp(48px, 10vw, 158px); line-height: .9;
  letter-spacing: -.02em; color: #fff; text-transform: none; overflow: visible;
}
.k-row.italic { font-style: italic; color: #f5d5a6; font-weight: 400; }
.k-row .k-char { display: inline-block; position: relative; will-change: transform, opacity, filter; backface-visibility: hidden; }
.k-row .k-char.space { width: .3em; }

.k-eyebrow {
  font-family: 'Inter', sans-serif; font-size: 12px;
  letter-spacing: .34em; text-transform: uppercase; color: #f5d5a6;
  margin-bottom: 28px; display: inline-flex; align-items: center; gap: 14px; opacity: 0;
}
.k-eyebrow::before, .k-eyebrow::after { content: ""; width: 40px; height: 1px; background: currentColor; }

.k-tag {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(18px, 2vw, 26px); color: rgba(255,255,255,.88);
  max-width: 560px; text-align: center; line-height: 1.35; margin: 0 0 32px; opacity: 0;
}
.k-meta { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: center; opacity: 0; }
.k-stats { display: flex; gap: 32px; color: rgba(255,255,255,.75); font-family: 'Inter', sans-serif; margin-left: 8px; }
.k-stats b { display: block; font-family: 'Playfair Display', serif; font-size: 26px; color: #fff; font-weight: 600; line-height: 1; margin-bottom: 4px; }
.k-stats span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
@media (max-width: 700px) { .k-stats { gap: 18px; margin-left: 0; width: 100%; justify-content: center; margin-top: 12px; } }

.hero.kinetic { align-items: center; justify-content: center; padding-top: 90px; padding-bottom: 90px; }
.hero.kinetic .hero-inner-kinetic {
  position: relative; z-index: 10; width: 100%;
  display: flex; flex-direction: column; align-items: center;
}

/* ─── Events ────────────────────────────────────────────────────────────────── */
.events { background: var(--cream); position: relative; }
.events::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.events-grid {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2px;
  background: var(--line); border: 1px solid var(--line);
}
@media (max-width: 980px) { .events-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .events-grid { grid-template-columns: 1fr; } }
/* Live data can bring fewer than 3 events — never leave an empty grid cell. */
.events-grid--2 { grid-template-columns: 1.2fr 1fr; }
.events-grid--1 { grid-template-columns: 1fr; }
@media (max-width: 620px) { .events-grid--2, .events-grid--1 { grid-template-columns: 1fr; } }

.event {
  background: var(--cream); padding: 36px 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 360px; transition: background .3s;
  position: relative; cursor: pointer;
}
.event:hover { background: #fff; }
.event .date {
  font-family: 'Playfair Display', serif; font-weight: 500;
  display: flex; align-items: baseline; gap: 14px; color: var(--burgundy);
  border-bottom: 1px solid rgba(139,35,50,.2); padding-bottom: 20px; margin-bottom: 20px;
}
.event .date .d { font-size: 64px; line-height: 1; letter-spacing: -0.03em; }
.event .date .my { font-family: 'Inter',sans-serif; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.event h3 { font-size: 24px; line-height: 1.15; margin-bottom: 14px; }
.event .meta { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--mute); display:flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.event .meta span { display: inline-flex; gap: 8px; align-items: center; }
.event .arrow { align-self: flex-end; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--burgundy); color: var(--burgundy); display: inline-flex; align-items: center; justify-content: center; transition: all .3s; }
.event:hover .arrow { background: var(--burgundy); color: #fff; transform: translate(4px,-4px); }
.event.featured { background: var(--burgundy); color: #fff; }
.event.featured .date, .event.featured .date .my, .event.featured .meta { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.25); }
.event.featured .date { color: #fff; }
.event.featured:hover { background: var(--burgundy-light); }
.event.featured .arrow { border-color: rgba(255,255,255,.5); color: #fff; }
.event.featured:hover .arrow { background: #fff; color: var(--burgundy); border-color: #fff; }
.event .tag { position: absolute; top: 24px; right: 24px; font-family:'Inter',sans-serif; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }

/* ─── Gallery (marquee) ─────────────────────────────────────────────────────── */
.gallery { padding: 120px 0; background: #fff; overflow: hidden; }
.marquee-row { display: flex; gap: 16px; width: max-content; animation: marquee 60s linear infinite; }
.marquee-row:hover { animation-play-state: paused; }
.gallery-item { flex: 0 0 auto; width: 360px; height: 480px; position: relative; }
.gallery-item .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px;
  color: #fff; font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
}

/* ─── Who ───────────────────────────────────────────────────────────────────── */
.who { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.who::before {
  content: "1908"; position: absolute; right: -40px; bottom: -80px;
  font-family: 'Playfair Display', serif; font-weight: 800;
  font-size: clamp(280px, 40vw, 560px); color: rgba(166,61,77,.12);
  letter-spacing: -0.05em; line-height: 1; pointer-events: none;
}
.who-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
@media (max-width: 900px) { .who-inner { grid-template-columns: 1fr; gap: 48px; } }
.who h2 { font-size: clamp(40px, 5.5vw, 72px); line-height: 1.02; margin-bottom: 28px; }
.who h2 em { font-style: italic; color: #f5d5a6; font-weight: 400; }
.who p { font-size: 18px; line-height: 1.7; color: rgba(255,255,255,.8); margin: 0 0 18px; max-width: 540px; font-family: 'Lora', serif; }
.who-activities { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); margin-top: 40px; }
@media (max-width: 540px) { .who-activities { grid-template-columns: 1fr; } }
.who-activities .item { padding: 22px 24px; background: var(--ink); display:flex; gap:14px; align-items: flex-start; }
.who-activities .item .num { font-family:'Playfair Display',serif; font-style: italic; color: var(--burgundy-light); font-size: 14px; font-weight: 500; min-width: 26px; }
.who-activities .item .t { font-family:'Playfair Display',serif; font-size: 17px; line-height: 1.3; }
.who-media { aspect-ratio: 3/4; width: 100%; max-width: 520px; margin-left: auto; position: relative; perspective: 1400px; }
.who-media .frame {
  position: absolute; inset: 0; overflow: hidden; background: #0a0507;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  will-change: transform, clip-path; transform-style: preserve-3d;
}
.who-media .frame .frame-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.2); will-change: transform;
}
.who-media .frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(139,35,50,.15) 100%);
  pointer-events: none; mix-blend-mode: multiply; z-index: 2;
}
.who-media .frame.one .frame-img { background-image: url('assets/who-1.jpg'); }
.who-media .frame.two .frame-img { background-image: url('assets/who-2.jpg'); }
.who-media .frame.two {
  inset: auto -30px -40px auto;
  width: 62%; aspect-ratio: 3/4;
  border: 8px solid var(--ink); z-index: 2;
}

/* ─── Dance ─────────────────────────────────────────────────────────────────── */
.dance { background: var(--cream); }
.dance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .dance-grid { grid-template-columns: 1fr; } }
.dance-card {
  background: #fff; padding: 40px 32px; position: relative;
  border: 1px solid var(--line); transition: all .3s;
  display: flex; flex-direction: column;
}
.dance-card:hover { border-color: var(--burgundy); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(139,35,50,.08); }
.dance-card .num {
  font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400;
  color: var(--burgundy); font-size: 14px; letter-spacing: .1em;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.dance-card .num b { font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: .22em; color: var(--mute); font-weight: 500; text-transform: uppercase; }
.dance-card h3 { font-size: 36px; line-height: 1; margin-bottom: 10px; }
.dance-card .sub { color: var(--mute); font-size: 14px; margin-bottom: 28px; font-family: 'Inter', sans-serif; }
.dance-card .days { font-family:'Playfair Display',serif; font-style: italic; font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.dance-card .time { font-family:'Playfair Display',serif; font-weight: 600; font-size: 32px; color: var(--burgundy); margin-bottom: 24px; letter-spacing: -0.01em; }
.dance-card .note { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-top: auto; padding-top: 20px; border-top: 1px dashed var(--line); }

.dance-cta {
  margin-top: 48px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  padding: 32px 40px; background: var(--burgundy); color: #fff;
}
@media (max-width: 700px) { .dance-cta { grid-template-columns: 1fr; padding: 28px; } }
.dance-cta .addr { font-family:'Playfair Display',serif; font-style: italic; font-size: 22px; }
.dance-cta .addr small { display:block; font-family:'Inter',sans-serif; font-style: normal; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 6px; }

/* ─── Danses del patrimoni (secció «danses»; de moment només a l'ordre B) ───── */
.danses-ref { background: var(--ink); color: #fff; padding: 88px 0; }
.danses-ref__inner { display: grid; grid-template-columns: 1.5fr auto; gap: 48px; align-items: center; }
@media (max-width: 820px) { .danses-ref__inner { grid-template-columns: 1fr; gap: 28px; } }
.danses-ref h2 { font-size: clamp(34px, 4.5vw, 56px); line-height: 1.05; }
.danses-ref h2 em { font-style: italic; color: var(--gold-soft); font-weight: 400; }
.danses-ref p { font-size: 17px; line-height: 1.7; color: rgba(255,255,255,.8); max-width: 560px; margin: 18px 0 0; font-family: 'Lora', serif; }

/* ─── News ──────────────────────────────────────────────────────────────────── */
.news { background: #fff; }
.news-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 2px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 980px) { .news-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { background: #fff; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; min-height: 380px; transition: background .25s; cursor: pointer; }
.news-card:hover { background: var(--cream); }
.news-card.big { grid-row: span 2; min-height: 100%; padding: 0; position: relative; overflow: hidden; color: #fff; }
.news-card.big .ph { position: absolute; inset: 0; }
.news-card.big .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,10,12,.9) 0%, rgba(26,10,12,.3) 60%, transparent 100%); }
.news-card.big .content { position: relative; z-index: 2; padding: 40px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.news-card.big:hover { background: #fff; }
.news-card .tag { font-family:'Inter',sans-serif; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 14px; }
.news-card.big .tag { color: #f5d5a6; }
.news-card .date-small { font-family:'Inter',sans-serif; font-size: 12px; color: var(--mute); margin-bottom: 10px; letter-spacing: .1em; }
.news-card.big .date-small { color: rgba(255,255,255,.75); }
.news-card h3 { font-size: 22px; line-height: 1.2; margin-bottom: 14px; }
.news-card.big h3 { font-size: clamp(28px, 3.5vw, 42px); line-height: 1.08; margin-bottom: 18px; }
.news-card p { color: var(--mute); font-size: 15px; line-height: 1.55; margin: 0 0 24px; font-family:'Lora',serif; }
.news-card.big p { color: rgba(255,255,255,.85); max-width: 540px; }
.news-card .read { font-family:'Inter',sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--burgundy); display:inline-flex; align-items:center; gap:10px; }
.news-card.big .read { color: #fff; }
.news-card .read::after { content:"→"; transition: transform .25s; }
.news-card:hover .read::after { transform: translateX(6px); }

/* ─── Patrimoni split ──────────────────────────────────────────────────────── */
.patrimoni { background: var(--bone); padding: 0; }
.patrimoni .cols { display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; }
@media (max-width: 900px) { .patrimoni .cols { grid-template-columns: 1fr; } }
.patrimoni .col { padding: 80px 60px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 700px) { .patrimoni .col { padding: 60px 28px; } }
.patrimoni .left { background: var(--burgundy); color: #fff; }
.patrimoni .right { background: var(--bone); color: var(--ink); position: relative; overflow: hidden; }
.patrimoni h2 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.02; margin-bottom: 20px; max-width: 500px; }
.patrimoni h2 em { font-style: italic; font-weight: 400; }
.patrimoni .left h2 em { color: #f5d5a6; }
.patrimoni .right h2 em { color: var(--burgundy); }
.patrimoni p { font-size: 17px; line-height: 1.6; max-width: 480px; margin-bottom: 32px; }
.patrimoni .left p { color: rgba(255,255,255,.85); }
.patrimoni .right p { color: var(--mute); }
.patrimoni .right::after {
  content: "♪"; position: absolute; right: -40px; bottom: -120px;
  font-family: 'Playfair Display', serif; font-size: 520px; color: rgba(139,35,50,.08); line-height: 1;
}
.patrimoni .eyebrow-white { color: #f5d5a6; }
.patrimoni .eyebrow-white::before { background: #f5d5a6; }

/* ╔═══════════════════════════════════════════════════════════════════════════╗
   ║  TEMPORAL · TOGGLE A/B — ESBORRAR AQUEST BLOC quan es decideixi l'ordre   ║
   ║  final de la Home (vegeu el bloc TEMPORAL homònim a home-bundle.jsx).     ║
   ╚═══════════════════════════════════════════════════════════════════════════╝ */
.ab-toggle {
  position: fixed; bottom: 20px; left: 20px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: rgba(26, 26, 26, .92);
  border: 1px dashed var(--gold);
  color: var(--cream);
  font-family: var(--ff-mono);
  max-width: 200px;
}
.ab-toggle__tag {
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold-soft);
}
.ab-toggle__label { font-size: 11px; letter-spacing: .06em; }
.ab-toggle__btns { display: flex; gap: 6px; }
.ab-toggle__btns button {
  flex: 1; padding: 6px 8px; cursor: pointer;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .08em;
  background: transparent; color: var(--cream);
  border: 1px solid rgba(246, 241, 234, .35);
  white-space: nowrap;
}
.ab-toggle__btns button.is-on {
  background: var(--cream); color: #1a1a1a; border-color: var(--cream);
}
@media (max-width: 700px) {
  .ab-toggle { bottom: 14px; left: 14px; padding: 10px 12px; }
}
/* ╚═══ FI DEL BLOC TEMPORAL ═══╝ */
