:root {
  --bg: #e9e9e9;
  --fg: #1d1d1b;
  --accent: #f5dd5f;
  --border: #1d1d1b;
  --header-h: 92px;
}

body.dark-mode {
  --bg: #1d1d1b;
  --fg: #e9e9e9;
  --border: #e9e9e9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  padding-top: var(--header-h);
  transition: background 0.3s ease, color 0.3s ease;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

img,
video {
  max-width: 100%;
  display: block;
}

.page-wrapper {
  width: 100%;
  margin: 0;
  border-left: 0;
  border-right: 0;
}

.section-label {
  display: inline-block;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 800;
  background: var(--accent);
  color: #1d1d1b;
  padding: 0.15em 0.35em;
  text-transform: uppercase;
  transition: transform 0.25s ease, filter 0.25s ease;
  transform-origin: center;
}

.section-label:hover {
  transform: scale(1.18);
  filter: brightness(1.04);
}

/* =====================================================
  ANIMACIÓN GENERAL AL HACER SCROLL
====================================================== */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
  MENÚ / HEADER
====================================================== */
.site-header {
  min-height: var(--header-h);
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.logo {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.06em;
  display: inline-block;
  transition: transform 0.25s ease;
  transform-origin: left center;
}

.logo:hover {
  transform: scale(1.06);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.6rem);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.main-nav a:hover,
.footer-nav a:hover,
.legal-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.theme-toggle {
  width: 34px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  position: relative;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
  transition: left 0.25s ease;
}

body.dark-mode .theme-toggle::after {
  left: 23px;
}

.burger {
  display: none;
  width: 34px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
}

.burger span {
  height: 2px;
  width: 100%;
  background: currentColor;
}

/* =====================================================
  ICONOS RRSS FIJOS LATERALES
====================================================== */
.fixed-socials {
  position: fixed;
  top: 22vh;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fixed-socials a,
.footer-socials a {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 1.1rem;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.fixed-socials img {
  width: 22px;
  height: 22px;
  transition: filter 0.3s ease;
}

/* MODO OSCURO */
body.dark-mode .fixed-socials img {
  filter: invert(1);
}

.fixed-socials a:hover,
.footer-socials a:hover {
  transform: translateX(3px);
  background: var(--fg);
  color: var(--bg);
}

/* =====================================================
  HERO / INTRO
  En escritorio ocupa exactamente la primera pantalla:
  se ve menú + hero, pero no la primera barra negra.
====================================================== */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  position: relative;
  padding: 5rem 2rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-text {
  text-align: center;
  font-size: clamp(1rem, 2.1vw, 1.8rem);
  font-weight: 500;
  line-height: 0.95;
  text-transform: uppercase;
  max-width: 360px;
  z-index: 2;
  pointer-events: none;
}

.hero-image-trail {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: crosshair;
  background: transparent;
}

.hero-image-trail.reveal,
.hero-image-trail.reveal.is-visible {
  transform: none;
}

.hero-image-trail img {
  position: absolute;
  width: clamp(110px, 15vw, 140px);
  aspect-ratio: 4 / 5;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86) rotate(-2deg);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 18px 45px none;
}

.hero-image-trail img.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* =====================================================
  BARRAS MARQUEE / SCROLL INFINITO
====================================================== */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.marquee.black {
  background: var(--fg);
  color: var(--bg);
}

.marquee.white {
  background: var(--bg);
  color: var(--fg);
}

.marquee-track {
  display: inline-flex;
  gap: 6rem;
  padding: 1.2rem 0;
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  font-weight: 800;
  animation: marquee-left 18s linear infinite;
}

.marquee.white .marquee-track {
  animation-name: marquee-right;
}

@keyframes marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* =====================================================
  SOBRE MÍ / PROYECTOS / VIDEO
====================================================== */
.about-preview {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 8rem);
  min-height: 100vh;
  border-bottom: 1px solid var(--border);
}

.big-title {
  text-align: center;
  font-size: clamp(3.4rem, 6.9vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  max-width: 1080px;
  margin: 0 auto 2rem;
}

.about-top-link {
  margin-left: 8%;
}

/* Botón de subir eliminado: ahora el menú es fijo. */

.about-copy {
  position: absolute;
  top: 58%;
  width: min(260px, 25vw);
  font-size: clamp(0.55rem, 0.65vw, 0.72rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.about-copy.left { left: 1rem; margin-left: -4vw; }
.about-copy.right { right: 1rem; text-align: right; margin-right: -4vw; }

.video-block {
  width: min(520px, 58vw);
  aspect-ratio: 1 / 1;
  margin: clamp(5rem, 9vw, 8rem) auto 2rem;
  background: var(--fg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.video-block video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1) brightness(0.9);
}

.projects-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
}

/* =====================================================
  SERVICIOS / BLOQUES INTERACTIVOS
  Los nombres se ven cortados por la mitad. Al hover se
  despliegan y al clic abren una ventana con información.
====================================================== */
.services {
  background: var(--fg);
  color: var(--bg);
  border-bottom: 1px solid var(--border);
  min-height: 100vh;
  position: relative;
}

.services-intro {
  min-height: 46vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem;
  border-bottom: 1px solid currentColor;
}

.services-title {
  grid-column: 1 / -1;
  width: 100%;
  font-size: clamp(4rem, 10vw, 10.5rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}

.services-title .line-left {
  display: block;
  text-align: left;
}

.services-title .line-right {
  display: block;
  text-align: right;
}

.services-copy {
  grid-column: 2;
  align-self: start;
  justify-self: start;
  max-width: 360px;
  margin-top: -6rem;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.25;
  text-transform: uppercase;
}

.service-strip {
  width: 100%;
  height: clamp(72px, 8.5vw, 112px);
  display: flex;
  align-items: center;
  padding: 0 4.5vw;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: height 0.35s ease, filter 0.25s ease;
}

.service-strip span {
  display: block;
  font-size: clamp(3.2rem, 8.2vw, 10rem);
  font-weight: 600;
  line-height: 0.72;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  transform: translateY(50%);
  transition: transform 0.35s ease;
  white-space: nowrap;
}

.service-strip:hover {
  height: clamp(118px, 14vw, 180px);
  filter: brightness(1.03);
}

.service-strip:hover span {
  transform: translateY(0);
}

.service-strip.black {
  background: #1d1d1b;
  color: #f3f3f3;
}

.service-strip.yellow {
  background: var(--accent);
  color: #1d1d1b;
}

.service-strip.white {
  background: #f3f3f3;
  color: #1d1d1b;
}

.service-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(29, 29, 27, 0.1);
}

.service-modal.is-open {
  display: flex;
}

.service-modal-box {
  position: relative;
  width: min(720px, 58vw);
  max-height: 78vh;
  min-height: min(760px, 78vh);
  background: var(--bg);
  color: var(--fg);
  border: 3px solid var(--border);
  padding: clamp(2rem, 5vw, 5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.18);
}

.service-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: var(--fg);
  color: var(--bg);
  font-size: clamp(1.6rem, 2.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  padding: 0.1em 0.25em;
}

.service-modal-box h2 {
  font-size: clamp(1.8rem, 3.8vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.service-modal-box p {
  font-size: clamp(0.9rem, 1vw, 1.05rem);
  line-height: 1.5;
  max-width: 62ch;
}

/* =====================================================
  CTA / CONTACTO
====================================================== */
.cta {
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
}

.cta-small {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}

.cta-text {
  font-size: clamp(1.8rem, 4.2vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.cta-arrow-img {
  width: clamp(54px, 8vw, 110px);
  height: auto;
  flex: 0 0 auto;
  transition: transform 0.25s ease;
}

body.dark-mode .cta-arrow-img{
  filter: invert(1);
}

.cta-link:hover .cta-arrow-img {
  transform: rotate(180deg);
}

/* =====================================================
  FOOTER
  Footer amarillo basado en la referencia.
====================================================== */
.site-footer {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 620px;
  background: var(--accent);
  color: #1d1d1b;
  padding: clamp(1.5rem, 3vw, 3rem);
  overflow: hidden;
}

.footer-bg-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.28;
  pointer-events: none;
}

.footer-cookies-button {
  position: absolute;
  top: clamp(1.5rem, 3vw, 3rem);
  right: clamp(1.5rem, 3vw, 3rem);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: transform 0.25s ease;
}

.footer-cookies-button:hover {
  transform: scale(1.12);
}

.footer-cookies-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-phrase {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  font-size: clamp(1.9rem, 3.2vw, 4rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.footer-nav {
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 3vw, 3rem);
  top: 29%;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.45rem;
  font-size: clamp(1rem, 1.35vw, 1.55rem);
  font-weight: 400;
  text-transform: uppercase;
}

.footer-contact {
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 3vw, 3rem);
  right: clamp(1.5rem, 3vw, 3rem);
  top: 52%;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-style: normal;
  font-size: clamp(1.35rem, 2.1vw, 2.6rem);
  font-weight: 900;
}

.footer-legal {
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 3vw, 3rem);
  right: clamp(1.5rem, 3vw, 3rem);
  top: 64%;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: clamp(0.9rem, 1.25vw, 1.45rem);
  font-weight: 400;
}

.footer-legal a {
  transition: font-weight 0.2s ease;
}

.footer-legal a:hover {
  font-weight: 900;
}


.footer-mega-brand {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 100%;
  font-size: clamp(4.5rem, 12.7vw, 16rem);
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -0.075em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* =====================================================
  RESPONSIVE / TABLET Y MÓVIL
====================================================== */
@media (max-width: 900px) {
  .site-header {
    padding: 1.3rem 1.4rem;
  }

  .burger {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--fg);
    color: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 1.4rem 1.4rem;
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a,
  .main-nav .theme-toggle {
    padding: 1rem 0;
    border-top: 1px solid currentColor;
  }

  .fixed-socials {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    flex-direction: row;
  }

  .hero {
    min-height: 420px;
  }

  .hover-gallery {
    bottom: 44px;
  }

  .about-preview {
    min-height: auto;
    padding-bottom: 5rem;
  }

  .about-copy {
    position: static;
    width: auto;
    max-width: 360px;
    margin-top: 2rem;
    text-align: left !important;
  }

  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
    font-size: 2.1rem;
  }

  .video-block {
    width: min(520px, 90vw);
  }

  .services-intro {
    grid-template-columns: 1fr;
  }

  .service-heading {
    padding: 0 1.2rem;
  }

  .service-row,
  .service-content {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
  }

  .footer-top,
  .footer-middle,
  .footer-brand-row {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    align-items: start;
  }

  .footer-bottom {
    align-items: start;
    flex-direction: column;
  }

  .legal-links {
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (max-width: 560px) {
  :root { --header-h: 74px; }

  .site-header,
  .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-text {
    max-width: 260px;
  }

  .hover-card {
    width: 58px;
    height: 58px;
    margin-left: -14px;
  }

  .marquee-track {
    gap: 3rem;
  }

  .big-title {
    font-size: clamp(2.7rem, 16vw, 4.5rem);
  }

  .service-title {
    font-size: clamp(3rem, 18vw, 5.4rem);
  }

  .service-heading {
    min-height: 76px;
  }

  .cta-link {
    align-items: end;
  }
}

/* =====================================================
  FAQ
====================================================== */

.faq-section{
  padding: 7vw 5vw;
}

.faq-title{
  font-size: clamp(4rem,7vw,8rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.07em;
  text-transform: uppercase;
  margin-bottom: 3rem;
}

.faq-container{
  border: 2px solid var(--border);
}

.faq-item + .faq-item{
  border-top: 2px solid var(--border);
}

.faq-question{
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-question span{
  font-size: clamp(1.8rem,2.5vw,3rem);
  font-weight: 800;
  text-transform: uppercase;
}

.faq-arrow{
  width: 42px;
  transition: transform .25s ease, filter .25s ease;
}

body.dark-mode .faq-arrow{
  filter: invert(1);
}

/* hover = flecha abajo */
.faq-question:hover .faq-arrow{
  transform: rotate(180deg);
}

/* abierto */
.faq-item.active .faq-arrow{
  transform: rotate(180deg);
}

.faq-answer{
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.faq-answer p{
  padding: 2rem 3rem 3rem;
  max-width: 900px;
  font-size: .95rem;
  line-height: 1.4;
  text-transform: uppercase;
}

/* =====================================================
  AJUSTES FINALES DE PROPORCIÓN
====================================================== */
.hero-image-trail img {
  width: clamp(70px, 8vw, 140px);
}

.video-area {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: 100%;
  margin: clamp(5rem, 9vw, 8rem) auto 2rem;
}

.video-area .video-block {
  width: 100%;
  margin: 0;
}

.video-area .about-copy {
  position: static;
  top: auto;
  width: auto;
  max-width: 430px;
  font-size: clamp(0.72rem, 0.88vw, 1rem);
  font-weight: 400;
  line-height: 1.35;
  text-transform: uppercase;
  transform: none;
}

.video-area .about-copy.left {
  justify-self: start;
  text-align: left;
}

.video-area .about-copy.right {
  justify-self: end;
  text-align: right;
}

.services-intro {
  position: relative;
  min-height: 46vh;
}

.services-copy {
  grid-column: auto;
  position: absolute;
  top: 18%;
  right: 7.5%;
  max-width: 390px;
  margin-top: 0;
  font-size: clamp(0.78rem, 0.95vw, 1rem);
  line-height: 1.35;
  font-weight: 500;
}

@media (max-width: 900px) {
  .video-area {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .video-area .about-copy,
  .video-area .about-copy.left,
  .video-area .about-copy.right {
    text-align: left;
    justify-self: start;
  }

  .services-copy {
    position: static;
    margin-top: 1.5rem;
  }
}