/* ==========================================================================
   Edfocarte Visual Media — production stylesheet
   Design tokens: see README.md in project root for full spec.
   ========================================================================== */

:root {
  --ink-900: #0B0E1F;
  --ink-800: #14182B;
  --text-primary: #F5F6FA;
  --text-muted: #6E7388;
  --cyan: #5B9DFF;
  --cyan-rgb: 91, 157, 255;
  --violet: #6C63FF;
  --violet-rgb: 108, 99, 255;
  --magenta: #D946EF;
  --magenta-rgb: 217, 70, 239;
  --gradient-accent: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 50%, var(--magenta) 100%);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  font-family: var(--font-body);
  color: var(--text-primary);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--magenta); }
::selection { background: var(--violet); color: #fff; }

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

/* ---------- Scroll progress bar ---------- */
.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(245, 246, 250, 0.08);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 6vw;
  background: rgba(11, 14, 31, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 246, 250, 0.06);
}
.nav-brand { display: flex; align-items: center; gap: 14px; }
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink-800);
  border: 1px solid rgba(245,246,250,0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.logo-plain { color: var(--text-primary); }
.logo-accent {
  font-size: 1.2em;
  line-height: 1;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--violet) 55%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  line-height: 1.3;
  white-space: nowrap;
}
.wordmark span { color: var(--text-muted); font-size: 9px; }

.nav-links { display: flex; gap: 40px; }
.nav-link {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.nav-link.primary { color: var(--text-primary); }
.nav-link:hover { color: var(--cyan); }
.nav-social { display: flex; align-items: center; gap: 6px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--ink-900);
  padding: 110px 6vw 130px;
  overflow: hidden;
  text-align: center;
}
.hero-glow {
  position: absolute;
  top: -260px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--violet-rgb),0.30) 0%, rgba(var(--cyan-rgb),0.08) 45%, rgba(11,14,31,0) 72%);
  animation: ef-drift 14s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ef-drift {
  0% { transform: translate(-50%, 0); }
  50% { transform: translate(calc(-50% - 3%), 2%); }
  100% { transform: translate(-50%, 0); }
}
.eyebrow {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--violet);
  margin: 0 0 26px;
}
.hero-title {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 92px);
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0 auto;
  max-width: 1150px;
  background: linear-gradient(100deg, var(--text-primary) 12%, var(--cyan) 38%, var(--violet) 58%, var(--magenta) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ef-shine 7s ease-in-out infinite alternate;
}
@keyframes ef-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.hero-subhead {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  margin: 28px auto 0;
}
.hero-ctas {
  position: relative; z-index: 1;
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 44px;
  flex-wrap: wrap;
}
.btn {
  padding: 17px 34px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  border-radius: 40px;
  cursor: pointer;
  display: inline-block;
}
.btn-primary {
  background: var(--gradient-accent);
  color: var(--ink-900);
  transition: transform .35s ease, box-shadow .35s ease;
}
.btn-primary:hover {
  color: var(--ink-900);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(var(--violet-rgb),0.4);
}
.btn-secondary {
  border: 1px solid rgba(245,246,250,0.35);
  color: var(--text-primary);
  font-weight: 600;
  transition: background .35s ease, color .35s ease, border-color .35s ease;
}
.btn-secondary:hover {
  background: var(--gradient-accent);
  color: var(--ink-900);
  border-color: transparent;
}
.hero-video {
  position: relative; z-index: 1;
  margin: 70px auto 0;
  width: 100%;
  max-width: 1150px;
  height: min(480px, 55vw);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.hero-video iframe {
  width: 100%; height: 100%; border: 0; display: block;
}

/* ---------- Servicios ---------- */
.servicios { background: var(--ink-800); padding: 90px 6vw; }
.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--text-primary);
  margin: 0 0 50px;
  text-align: center;
}
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}
.servicio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 28px 12px;
  border-radius: 16px;
  background: rgba(245,246,250,0.03);
  transition: background .35s ease, transform .35s ease;
}
.servicio-card:hover {
  background: rgba(245,246,250,0.07);
  transform: translateY(-4px);
}
.servicio-badge {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--cyan-rgb),0.18), rgba(var(--violet-rgb),0.22));
  border: 1px solid rgba(245,246,250,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-primary);
}
.servicio-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
}
.servicio-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  margin: -8px 0 0;
}

/* ---------- Obra / Portfolio ---------- */
.obra-block {
  position: relative;
  background-color: var(--ink-900);
  height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-top: 1px solid rgba(245,246,250,0.06);
  cursor: pointer;
  transition: transform .6s ease, filter .6s ease;
}

#obra > article:nth-child(6) > img{
    object-position: top !important;
}
.obra-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
#obra > article:nth-child(5) .obra-media {
  object-position: top;
}

.obra-block:hover { transform: scale(1.02); filter: brightness(1.08); }
.obra-block:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.obra-block.is-hidden { display: none; }
.obra-scrim {
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(11,14,31,0.92) 0%, rgba(11,14,31,0.15) 62%, rgba(11,14,31,0) 100%);
  pointer-events: none;
}
.obra-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(11,14,31,0.55);
  border: 1px solid rgba(245,246,250,0.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
  z-index: 1;
}
.obra-block:hover .obra-play,
.obra-block:focus-visible .obra-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.obra-text { position: relative; z-index: 1; padding: 0 6vw 44px; pointer-events: none; }
.obra-cat {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.3em;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 14px;
}
.obra-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 48px);
  color: var(--text-primary);
  margin: 0;
}

/* ---------- Esencia ---------- */
.esencia {
  background: var(--ink-800);
  padding: 110px 6vw;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.esencia-glow {
  position: absolute;
  bottom: -200px; right: -100px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--magenta-rgb),0.16) 0%, rgba(11,14,31,0) 70%);
  pointer-events: none;
}
.esencia-statement {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.4;
  color: var(--text-primary);
  max-width: 820px;
  margin: 0 auto 44px;
}
.valores {
  position: relative; z-index: 1;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Director ---------- */
.director {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 680px;
  margin: 56px auto 0;
  padding: 28px;
  border-radius: 20px;
  background: rgba(245,246,250,0.03);
  border: 1px solid rgba(245,246,250,0.08);
  text-align: left;
}
.director-photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--ink-900);
  border: 1px solid rgba(245,246,250,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.director-photo img { width: 100%; height: 100%; object-fit: cover; }
.director-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.director-role {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--violet);
  margin: 0 0 12px;
}
.director-bio {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.director-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.director-skills .valor-pill { padding: 6px 14px; font-size: 11px; }
.valor-pill {
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid rgba(245,246,250,0.2);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-primary);
  transition: background .3s ease, border-color .3s ease;
}
.valor-pill:hover {
  background: rgba(245,246,250,0.1);
  border-color: rgba(245,246,250,0.4);
}

/* ---------- Footer / Contacto ---------- */
.footer { background: var(--ink-900); padding: 80px 6vw; text-align: center; }
.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  background: linear-gradient(100deg, var(--cyan) 10%, var(--violet) 50%, var(--magenta) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 20px;
  animation: ef-shine 6s ease-in-out infinite alternate;
}
.footer-lead {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 36px;
}
.footer-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.footer-ig { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.footer-contact a { color: var(--text-muted); }
.footer-contact a:hover { color: var(--cyan); }
.footer-credit {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  margin: 16px 0 0;
}
.footer-credit a { color: var(--text-muted); }
.footer-credit a:hover { color: var(--cyan); }

/* ---------- Video modal ---------- */
body.modal-open { overflow: hidden; }
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.video-modal.is-open { display: flex; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11,14,31,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.video-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink-800);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
@supports (height: 100dvh) {
  .video-modal-frame {
    width: min(100%, calc((100dvh - 48px - 46px) * 16 / 9));
  }
}
.video-modal-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-modal-close {
  align-self: flex-end;
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(245,246,250,0.3);
  background: rgba(245,246,250,0.05);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.video-modal-close:hover {
  background: var(--gradient-accent);
  color: var(--ink-900);
  border-color: transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 14, 31, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(245,246,250,0.06);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav-links.is-open { max-height: 260px; }
  .nav-link { padding: 16px 6vw; border-top: 1px solid rgba(245,246,250,0.06); }
  .nav-toggle { display: flex; }

  .hero { padding: 90px 6vw 90px; }
  .hero-video { margin-top: 48px; }
  .obra-block { height: 320px; }

  .director {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .director-skills { justify-content: center; }

  .video-modal { padding: 12px; }
}
@supports (height: 100dvh) {
  @media (max-width: 720px) {
    .video-modal-frame { width: min(100%, calc((100dvh - 24px - 46px) * 16 / 9)); }
  }
}
