:root {
  --bg: #0a0a0a;
  --text: #ffffff;
  --muted: #c7c7c7;
  --line: rgba(255,255,255,.08);

  --yellow: #ffd400;
  --yellow-soft: rgba(255,212,0,.12);

  --green: #2fb24d;
  --green-soft: rgba(47,178,77,.14);

  --red: #d64040;
  --red-soft: rgba(214,64,64,.14);

  --white-soft: rgba(255,255,255,.1);

  --shadow: 0 20px 50px rgba(0,0,0,.6);
  --nav-offset: 150px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  animation: pageFade 0.9s ease both;
  background:
    linear-gradient(180deg, rgba(36,28,6,.56), rgba(12,10,6,.88)),
    url('../assets/fons_tdf.webp') center top / cover no-repeat fixed;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.is-hidden {
  display: none !important;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(58,45,0,.35) 0%, rgba(34,28,8,.25) 100%);
  border-bottom: 1px solid rgba(255,212,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transition: all .35s ease;
}

.nav.scrolled {
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(58,45,0,.72) 0%, rgba(34,28,8,.62) 100%);
  border-bottom: 1px solid rgba(255,212,0,.18);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  gap: 16px;
}

.nav-top {
  display: flex;
  align-items: center;
  min-height: 86px;
  transition: min-height .3s ease;
}

.nav.scrolled .nav-top {
  min-height: 68px;
}

.nav-menu-row {
  min-height: 58px;
  transition: min-height .3s ease, opacity .25s ease, transform .25s ease;
}

.nav.scrolled .nav-menu-row {
  min-height: 48px;
}

.nav-subline {
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,212,0,.10);
  transition: opacity .25s ease;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 54px;
  width: auto;
  transition: height .3s ease;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.brand-project {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.7px;
  transition: font-size .3s ease;
}

.brand-slogan {
  font-size: 14px;
  line-height: 1.1;
  font-weight: 600;
  color: #f0e3a6;
  letter-spacing: .02em;
  transition: font-size .3s ease;
}

.nav.scrolled .brand-logo {
  height: 40px;
}

.nav.scrolled .brand-project {
  font-size: 22px;
}

.nav.scrolled .brand-slogan {
  font-size: 12px;
}

.nav-links {
  display: flex;
  gap: 28px;
  color: #f0e3a6;
  font-size: 15px;
  font-weight: 600;
  flex-wrap: wrap;
}

.nav-links-main {
  position: relative;
  align-items: center;
}

.nav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(255,212,0,.9), rgba(255,226,110,.95));
  border-radius: 999px;
  transition:
    transform .42s cubic-bezier(.22,1,.36,1),
    width .42s cubic-bezier(.22,1,.36,1),
    opacity .22s ease,
    box-shadow .28s ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255,212,0,.18), 0 0 18px rgba(255,212,0,.10);
}

.nav-links-main a {
  position: relative;
  padding: 16px 0 14px;
  transition: padding .25s ease, color .25s ease;
}

.nav.scrolled .nav-links-main a {
  padding: 12px 0 10px;
}

.nav-links-main a:hover,
.nav-links-main a.active {
  color: #fff7d1;
}

.hero,
.section {
  background: transparent;
}

.hero {
  padding: 44px 0 32px;
  scroll-margin-top: var(--nav-offset);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-card,
.panel,
.resource-card,
.explore-card,
.resources-table-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.hero-card {
  padding: 80px 36px 36px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.7) 40%, rgba(0,0,0,.9) 100%),
    url('../assets/fons_tdf.webp') center 35% / cover no-repeat;
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 40px;
  align-items: center;
  animation: fadeHero 1.1s ease both;
  transform-origin: center center;
  will-change: transform;
}

.hero-chip,
.section-chip,
.resource-type,
.explore-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
}

.hero-chip,
.section-chip-yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
  border: 1px solid rgba(255,212,0,.25);
}

.section-chip-green,
.resource-type {
  background: var(--green-soft);
  color: #7be294;
  border: 1px solid rgba(47,178,77,.28);
}

.section-chip-red {
  background: var(--red-soft);
  color: #ff9696;
  border: 1px solid rgba(214,64,64,.28);
}

.section-chip {
  margin-bottom: 14px;
}

h1 {
  position: relative;
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: .98;
  letter-spacing: -1.5px;
max-width: 100%;
  text-shadow: 0 6px 24px rgba(0,0,0,.35);
  z-index: 1;
}

h1::before {
  content: '';
  position: absolute;
  inset: -20px -30px;
  background: radial-gradient(circle at center, rgba(255,212,0,.35) 0%, rgba(255,212,0,.15) 40%, transparent 70%);
  filter: blur(25px);
  z-index: -1;
  opacity: .9;
}

.hero p {
  margin: 0;
  color: #f0f0f0;
  font-size: 17px;
  line-height: 1.65;
  max-width: 58ch;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  transition: .2s ease;
}

.btn-primary {
  background: var(--yellow);
  color: #000;
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #e4ff70;
}

.btn-secondary {
  background: rgba(255,255,255,.03);
}

.btn-secondary:hover {
  background: rgba(255,255,255,.07);
}

.btn-secondary-green {
  border-color: rgba(47,178,77,.25);
  color: #8af0a1;
  background: rgba(47,178,77,.08);
}

.btn-secondary-green:hover {
  background: rgba(47,178,77,.14);
  border-color: rgba(47,178,77,.4);
}

.btn-secondary-red {
  border-color: rgba(214,64,64,.25);
  color: #ff9a9a;
  background: rgba(214,64,64,.08);
}

.btn-secondary-red:hover {
  background: rgba(214,64,64,.14);
  border-color: rgba(214,64,64,.4);
}

.stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.stats-hero-main {
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.stat {
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.stat strong {
  display: block;
  font-size: 26px;
  margin-bottom: 4px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat-link {
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.stat-yellow {
  border-color: rgba(255,212,0,.14);
}

.stat-yellow:hover {
  border-color: rgba(255,212,0,.34);
  background: rgba(255,212,0,.06);
}

.stat-green {
  border-color: rgba(47,178,77,.16);
}

.stat-green:hover {
  border-color: rgba(47,178,77,.34);
  background: rgba(47,178,77,.06);
}

.stat-red {
  border-color: rgba(214,64,64,.16);
}

.stat-red:hover {
  border-color: rgba(214,64,64,.34);
  background: rgba(214,64,64,.06);
}

.section {
  padding: 42px 0 88px;
  scroll-margin-top: var(--nav-offset);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head-resources {
  align-items: flex-end;
}

.section h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -.8px;
}

.section-copy {
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.65;
  margin-top: 10px;
}

.resource-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(6px);
}

.view-toggle {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.view-toggle:hover {
  background: rgba(255,255,255,.06);
}

.view-toggle.active {
  background: rgba(47,178,77,.18);
  border-color: rgba(47,178,77,.28);
  color: #8af0a1;
}

.video-layout,
.valenti-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.player-panel,
.playlist-panel,
.valenti-feature,
.valenti-list-panel {
  padding: 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.52), rgba(0,0,0,.68));
}

.player-frame {
  position: relative;
  background: #000;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-meta {
  padding: 16px 4px 6px;
}

.eyebrow {
  color: var(--yellow);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  margin-bottom: 8px;
}

.eyebrow-red {
  color: #ff9696;
}

.player-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.8px;
}

.player-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
}

.grid-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.grid-head strong {
  font-size: 22px;
}

.grid-head span {
  color: var(--muted);
  font-size: 14px;
}

.videos-grid,
.valenti-grid,
.resources-grid,
.explore-grid {
  display: grid;
  gap: 18px;
}

.videos-grid,
.valenti-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.resources-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.explore-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card,
.valenti-card {
  background: linear-gradient(180deg, rgba(18,18,18,.82), rgba(10,10,10,.9));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.video-card:hover,
.valenti-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
}

.video-card:hover {
  border-color: rgba(255,212,0,.28);
  background: linear-gradient(180deg, rgba(22,22,22,.88), rgba(12,12,12,.94));
}

.valenti-card:hover {
  border-color: rgba(214,64,64,.32);
  background: linear-gradient(180deg, rgba(28,18,18,.9), rgba(15,10,10,.96));
}

.video-card.active {
  border-color: rgba(255,212,0,.40);
  box-shadow: inset 0 0 0 1px rgba(255,212,0,.18), 0 14px 34px rgba(0,0,0,.28);
  background: linear-gradient(180deg, rgba(34,28,8,.82), rgba(16,14,8,.92));
}

.valenti-card.active {
  border-color: rgba(214,64,64,.4);
  box-shadow: inset 0 0 0 1px rgba(214,64,64,.18), 0 14px 34px rgba(0,0,0,.28);
  background: linear-gradient(180deg, rgba(36,18,18,.86), rgba(16,10,10,.94));
}

.video-card .thumb,
.valenti-card .thumb {
  border-radius: 0;
  border: 0;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  background: #0b0b0b;
}

.video-card-body,
.valenti-card-body {
  padding: 16px 16px 18px;
  display: grid;
  gap: 10px;
  flex: 1;
  align-content: start;
}

.video-card-index,
.valenti-card-index {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.video-card-index {
  color: var(--yellow);
}

.valenti-card-index {
  color: #ff9696;
}

.video-card-title,
.valenti-card-title {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.22;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0,0,0,.28);
  min-height: 2.44em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-text,
.valenti-card-text {
  color: rgba(255,255,255,.88);
  font-size: 15px;
  line-height: 1.62;
  min-height: 4.86em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta,
.valenti-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  font-weight: 600;
  margin-top: auto;
  padding-top: 6px;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.06);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  padding: 0;
  background: #0a0a0a;
  transform: scale(1);
  transition: transform .28s ease, filter .28s ease;
  filter: saturate(.98) contrast(1.04);
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.04) 0%, rgba(0,0,0,.16) 55%, rgba(0,0,0,.34) 100%);
  pointer-events: none;
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,.28);
}

.play-icon::before {
  content: "";
  display: block;
  margin-left: 3px;
  width: 0;
  height: 0;
  border-left: 14px solid #ffd400;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.valenti-card .play-icon::before {
  border-left-color: #ff9696;
}

.video-card:hover .thumb img,
.video-card.active .thumb img,
.valenti-card:hover .thumb img,
.valenti-card.active .thumb img {
  transform: scale(1.03);
  filter: saturate(1.04) contrast(1.04);
}

.video-card:hover .play-icon,
.video-card.active .play-icon,
.valenti-card:hover .play-icon,
.valenti-card.active .play-icon {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(0,0,0,.72);
}

.video-card:hover .play-icon,
.video-card.active .play-icon {
  border-color: rgba(255,212,0,.35);
}

.valenti-card:hover .play-icon,
.valenti-card.active .play-icon {
  border-color: rgba(214,64,64,.35);
}

.duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #111;
  padding: 6px 10px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
}

.video-card .duration {
  background: rgba(255,212,0,.96);
}

.valenti-card .duration {
  background: rgba(255,255,255,.96);
}

.resource-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(16,24,16,.78), rgba(10,16,10,.9));
  border-color: rgba(47,178,77,.18);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.resource-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47,178,77,.35);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
}

.resource-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 600;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
}

.file-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resource-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.resource-link,
.resource-secondary-link {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: .2s ease;
  white-space: nowrap;
}

.resource-link {
  background: var(--green);
  color: #fff;
}

.resource-link:hover {
  background: #259440;
  transform: translateY(-1px);
}

.resource-secondary-link {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: #ffffff;
}

.resource-secondary-link:hover {
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

.resource-link svg,
.resource-secondary-link svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
}

.resources-table-wrap {
  padding: 0;
  overflow: hidden;
}

.resources-table-head,
.resources-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 150px 180px 180px;
  gap: 16px;
  align-items: center;
}

.resources-table-head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.resources-table-body {
  display: grid;
}

.resources-table-row {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .2s ease;
}

.resources-table-row:last-child {
  border-bottom: 0;
}

.resources-table-row:hover {
  background: rgba(255,255,255,.03);
}

.resources-col-title {
  display: grid;
  gap: 6px;
}

.resources-col-title strong {
  font-size: 20px;
  line-height: 1.25;
}

.resources-col-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.resources-col-type,
.resources-col-category {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  min-width: 0;
}

.resources-col-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.resource-link-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: .2s ease;
  white-space: nowrap;
}

.resource-link-compact:hover {
  background: #259440;
  transform: translateY(-1px);
}

.resource-link-compact svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
}

.resource-icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  transition: .2s ease;
}

.resource-icon-button:hover {
  background: rgba(255,255,255,.09);
  transform: translateY(-1px);
}

.resource-icon-button svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke: #ffffff;
}

.explore-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  transition: .2s ease;
}

.explore-card:hover {
  transform: translateY(-4px);
}

.explore-card h3 {
  margin: 0;
  font-size: 24px;
}

.explore-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.explore-link {
  font-weight: 800;
}

.explore-yellow {
  border-color: rgba(255,212,0,.2);
}

.explore-green {
  border-color: rgba(47,178,77,.2);
}

.explore-red {
  border-color: rgba(214,64,64,.2);
}

.footer.footer-ajuntament {
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #f2f2f2;
  background: #000;
  backdrop-filter: none;
  padding: 0;
}

.footer-ajuntament-inner {
  padding-top: 34px;
  padding-bottom: 28px;
}

.footer-ajuntament-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.footer-brand-logo {
  display: block;
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.footer-brand-text strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.04em;
}

.footer-brand-text span {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  color: rgba(255,255,255,.68);
  letter-spacing: .02em;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 24px;
}

.footer-menu a {
  color: rgba(255,255,255,.88);
  font-size: 14px;
  font-weight: 700;
  transition: color .2s ease, opacity .2s ease;
}

.footer-menu a:hover {
  color: #fff;
  opacity: .9;
}

.footer-ajuntament-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, .75fr) minmax(180px, .75fr);
  gap: 28px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-col {
  min-width: 0;
}

.footer-col h3 {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.58);
}

.footer-copy {
  margin: 0;
  max-width: 56ch;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  line-height: 1.75;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-col li {
  margin: 0;
}

.footer-col a {
  color: rgba(255,255,255,.9);
  font-size: 15px;
  line-height: 1.4;
  transition: color .2s ease, opacity .2s ease;
}

.footer-col a:hover {
  color: #fff;
  opacity: .95;
}

.footer-ajuntament-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.52);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .footer-ajuntament-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-menu {
    justify-content: flex-start;
  }

  .footer-ajuntament-main {
    grid-template-columns: 1fr 1fr;
  }

  .footer-col-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-ajuntament-inner {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .footer-brand {
    align-items: flex-start;
  }

  .footer-brand-logo {
    height: 46px;
  }

  .footer-brand-text strong {
    font-size: 20px;
  }

  .footer-ajuntament-main {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-menu {
    gap: 14px 18px;
  }
}

@media (max-width: 1180px) {
  .resources-table-head,
  .resources-table-row {
    grid-template-columns: minmax(0, 1.5fr) 120px 160px 170px;
  }
}

@media (max-width: 980px) {
  .hero-card {
    grid-template-columns: 1fr;
    gap: 28px;
  }

}

@media (max-width: 980px) {
  .hero-grid,
  .video-layout,
  .valenti-layout {
    grid-template-columns: 1fr;
  }

  .videos-grid,
  .valenti-grid,
  .resources-grid,
  .explore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head-resources {
    flex-direction: column;
    align-items: flex-start;
  }

  .resources-table-head {
    display: none;
  }

  .resources-table-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .resources-col-actions {
    justify-content: flex-start;
  }
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeHero {
  from {
    opacity: 0;
    transform: translateY(22px) scale(1.015);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (max-width: 900px) {
  .nav-top {
    min-height: 72px;
  }

  .brand-logo {
    height: 44px;
  }

  .brand-project {
    font-size: 24px;
  }

  body {
    background:
      linear-gradient(180deg, rgba(36,28,6,.58), rgba(12,10,6,.9)),
      url('../assets/fons_tdf.webp') center top / cover no-repeat;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding: 28px 0 24px;
  }

  .hero-card,
  .panel,
  .resource-card,
  .explore-card,
  .resources-table-wrap {
    border-radius: 22px;
  }

  .hero-card {
    padding: 28px 22px 22px;
    min-height: 520px;
  }

  .stats,
  .stats-hero-main,
  .videos-grid,
  .valenti-grid,
  .resources-grid,
  .explore-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 18px;
    font-size: 14px;
  }

  .resource-view-switch {
    width: 100%;
  }

  .view-toggle {
    flex: 1;
  }

  .resources-col-actions {
    justify-content: flex-start;
  }

  .resource-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .resource-link,
  .resource-secondary-link {
    width: 100%;
    justify-content: center;
  }
}

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 24px));
  z-index: 999;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: rgba(0,0,0,.94);
  box-shadow: 0 24px 60px rgba(0,0,0,.48);
  backdrop-filter: blur(12px);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
}

.cookie-banner__content {
  min-width: 0;
}

.cookie-banner__content strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.25;
  color: #fff;
}

.cookie-banner__content p {
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 14px;
  line-height: 1.6;
}

.cookie-banner__content a {
  color: var(--yellow);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

.cookie-btn--primary {
  background: var(--yellow);
  color: #000;
}

.cookie-btn--primary:hover {
  background: #ffe45c;
}

.cookie-btn--secondary {
  background: rgba(255,255,255,.04);
  color: #fff;
  border-color: rgba(255,255,255,.12);
}

.cookie-btn--secondary:hover {
  background: rgba(255,255,255,.08);
}

@media (max-width: 820px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cookie-banner {
    bottom: 12px;
    width: calc(100% - 16px);
    border-radius: 18px;
  }

  .cookie-banner__inner {
    padding: 16px;
  }

  .cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
#mapaTour {
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
}

.hero-card {
  padding: 80px 36px 36px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.7) 40%, rgba(0,0,0,.9) 100%),
    url('../assets/fons_tdf.webp') center 35% / cover no-repeat;
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 680px);
  gap: 48px;
  align-items: center;
  animation: fadeHero 1.1s ease both;
  transform-origin: center center;
  will-change: transform;
}


.hero-video {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-video-frame {
  position: relative;
  width: 100%;
  max-width: 680px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #000;
  box-shadow:
    0 24px 60px rgba(0,0,0,.42),
    0 10px 24px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.06);
  transition:
    transform .28s ease,
    box-shadow .28s ease,
    border-color .28s ease;
}

.hero-video-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 22%),
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  z-index: 3;
}

.hero-video-frame:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(255,212,0,.22);
  box-shadow:
    0 34px 72px rgba(0,0,0,.50),
    0 14px 30px rgba(0,0,0,.32),
    0 0 0 1px rgba(255,212,0,.08);
}

.hero-video-frame video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

@media (max-width: 980px) {
  .hero-card {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-video-frame {
    max-width: 100%;
  }
}

.peloto-icon-wrapper {
  background: transparent !important;
  border: 0 !important;
}

.peloto-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
  transform: translateZ(0);
}
.peloto-marker--small {
  font-size: 18px;
}
#etapaActual {
  display: block;
  min-height: 1.3em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-tour {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.stats-tour .stat {
  min-width: 0;
  padding: 16px 14px;
}

.stats-tour .stat strong {
  display: block;
  font-size: clamp(22px, 3vw, 26px);
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stats-tour .stat span {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* tablet gran */
@media (max-width: 1100px) {
  .stats-tour {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* tablet */
@media (max-width: 820px) {
  .stats-tour {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-tour .stat {
    min-height: 120px;
  }
}

/* mòbil */
@media (max-width: 520px) {
  .stats-tour {
    grid-template-columns: 1fr;
  }

  .stats-tour .stat {
    min-height: auto;
  }

  .stats-tour .stat strong {
    font-size: 20px;
  }
}
#velocitat span {
  font-size: 0.95em;
  line-height: 1.1;
}
#etapaActual {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* El menú ha d'estar sempre per sobre del mapa */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* El contenidor del mapa ha de quedar per sota */
#mapaTour,
.leaflet-container {
  position: relative;
  z-index: 1;
}

/* Baixem explícitament les capes internes de Leaflet */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom,
.leaflet-control {
  z-index: 10 !important;
}

/* Evita que popups/tooltips superin la nav */
.leaflet-popup,
.leaflet-tooltip {
  z-index: 11 !important;
}

#repte {
  scroll-margin-top: 160px;
}

#mapaTour {
  margin-top: 8px;
}
.hero-actions-compact .btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 999px;
}

.hero-actions-compact .btn-primary {
  padding: 0 16px;
}

.hero-actions-compact .btn-secondary {
  padding: 0 14px;
}
.repte-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;

  background: rgba(214,64,64,.08);
  border: 2px solid rgba(214,64,64,.45);
  box-shadow: 0 0 0 1px rgba(214,64,64,.15), 0 12px 28px rgba(0,0,0,.25);

  color: #fff;
  text-decoration: none;

  transition: all .2s ease;
}

.repte-card:hover {
  transform: translateY(-2px);
  background: rgba(214,64,64,.14);
 border-color: rgba(214,64,64,.75);
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}

.repte-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;

  background: rgba(214,64,64,.18);
  color: #ff9a9a;
}

.repte-card-icon svg {
  width: 18px;
  height: 18px;
}

.repte-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.repte-card-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.6);
  font-weight: 700;
}

.repte-card-content strong {
  font-size: 14px;
  line-height: 1.3;
}

.repte-card-arrow {
  font-size: 18px;
  color: #ff9a9a;
  transition: transform .2s ease;
}

.repte-card:hover .repte-card-arrow {
  transform: translateX(4px);
}