/* =========================================================
   ELÍAS MORA — Fotografía & Film
   Editorial · Dark · Cinematic
   ========================================================= */

/* ---------- TOKENS ---------- */
:root {
  /* Color — warm near-black editorial */
  --bg:        #0b0a09;
  --bg-2:      #131110;
  --surface:   #181513;
  --line:      #2a2623;
  --fg:        #f4f0ea;   /* warm white */
  --fg-soft:   #b6aea4;   /* muted */
  --fg-faint:  #6f675e;
  --accent:    #c8a062;   /* refined gold */
  --accent-d:  #a9854c;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Spacing scale (8pt) */
  --gut: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(5rem, 12vh, 11rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;

  --maxw: 1480px;
  --radius: 2px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }

::selection { background: var(--accent); color: #1a1410; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- TYPE HELPERS ---------- */
.eyebrow, .hero__eyebrow {
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-soft);
}

/* =========================================================
   PRELOADER
   ========================================================= */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .8s var(--ease), visibility .8s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__inner { width: min(78vw, 420px); text-align: center; }
.preloader__name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: .3em;
  margin-bottom: 1.6rem;
  color: var(--fg);
}
.preloader__bar { height: 1px; background: var(--line); position: relative; overflow: hidden; }
.preloader__fill { position: absolute; inset: 0 100% 0 0; background: var(--accent); transition: right .15s linear; }
.preloader__count {
  display: block; margin-top: 1rem;
  font-size: .75rem; letter-spacing: .3em; color: var(--fg-faint);
}

/* =========================================================
   SCROLL PROGRESS
   ========================================================= */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 1000;
  transition: width .1s linear;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem var(--gut);
  transition: padding .4s var(--ease), background .4s var(--ease), backdrop-filter .4s;
}
.header.is-scrolled {
  padding: .9rem var(--gut);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .7rem; }
.brand__logo {
  display: none;
  height: 32px; width: auto; max-width: 110px;
  object-fit: contain;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .02em;
}

.nav { display: flex; gap: 2.4rem; }
.nav__link {
  position: relative;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-soft);
  padding: .3rem 0;
  transition: color .3s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }

.header__actions { display: flex; align-items: center; gap: 1.2rem; }
.lang { display: flex; align-items: center; gap: .35rem; font-size: .78rem; letter-spacing: .1em; }
.lang__opt { color: var(--fg-faint); transition: color .3s; }
.lang__opt.is-active { color: var(--fg); }
.lang__sep { color: var(--fg-faint); }
.lang:hover .lang__opt:not(.is-active) { color: var(--fg-soft); }

.menu-btn { display: none; width: 34px; height: 34px; position: relative; }
.menu-btn span {
  position: absolute; left: 6px; right: 6px; height: 1.5px; background: var(--fg);
  transition: transform .4s var(--ease), opacity .3s;
}
.menu-btn span:nth-child(1) { top: 13px; }
.menu-btn span:nth-child(2) { bottom: 13px; }
.menu-btn.is-open span:nth-child(1) { top: 16px; transform: rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { bottom: 16px; transform: rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 850;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gut);
  transform: translateY(-100%);
  transition: transform .6s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 1.2rem; }
.mobile-menu__link {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 11vw, 4rem);
  line-height: 1;
  color: var(--fg);
}
.mobile-menu__link:hover { color: var(--accent); font-style: italic; }
.mobile-menu__foot {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--fg-soft); font-size: .95rem;
}

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; height: 100svh; min-height: 600px; overflow: hidden; display: flex; align-items: flex-end; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  animation: heroZoom 14s var(--ease-out) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__video { animation: none; transform: none; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(11,10,9,.92) 0%, rgba(11,10,9,.35) 45%, rgba(11,10,9,.55) 100%);
}
.hero__grain {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  padding: 0 var(--gut) clamp(4rem, 10vh, 8rem);
  max-width: 1100px;
}
.hero__eyebrow { margin-bottom: 1.4rem; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: .96;
  letter-spacing: -.02em;
  margin-bottom: 1.8rem;
}
.line { display: block; overflow: hidden; }
.line__inner { display: block; transform: translateY(110%); }
.line__inner--italic { font-style: italic; font-weight: 400; color: var(--accent); }

.hero__lede {
  max-width: 46ch;
  color: var(--fg-soft);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  margin-bottom: 2.4rem;
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; right: var(--gut); bottom: clamp(2rem, 6vh, 4rem);
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--fg-soft);
  writing-mode: vertical-rl;
}
.hero__scroll-line { width: 1px; height: 56px; background: var(--fg-soft); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 50%,100% { transform: translateY(100%); } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.7rem;
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
  border-radius: var(--radius);
  transition: transform .4s var(--ease), background .4s var(--ease), color .4s, border-color .4s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: var(--accent); }
.btn--ghost { border: 1px solid var(--fg-soft); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: 1.1rem 2.2rem; }

/* =========================================================
   STATEMENT
   ========================================================= */
.statement {
  padding: var(--section-y) var(--gut) clamp(2rem, 5vh, 4rem);
  max-width: var(--maxw); margin: 0 auto;
}
.statement__text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 4.2vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -.01em;
  max-width: 20ch;
}
.reveal-words .word { display: inline-block; opacity: .12; transition: opacity .5s var(--ease); }

/* =========================================================
   SECTION HEAD
   ========================================================= */
.section-head { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.section-head__index {
  display: inline-block;
  font-size: .72rem; letter-spacing: .3em; color: var(--accent);
  margin-bottom: 1.2rem;
}
.section-head__title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -.02em;
}
.section-head__sub { margin-top: 1rem; color: var(--fg-soft); max-width: 50ch; }

/* =========================================================
   WORK / GALLERY
   ========================================================= */
.work { padding: var(--section-y) 0; }
.filters {
  max-width: var(--maxw); margin: 2.5rem auto 0; padding: 0 var(--gut);
  display: flex; flex-wrap: wrap; gap: .6rem;
}
.filter {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-soft); padding: .55rem 1.1rem;
  border: 1px solid var(--line); border-radius: 100px;
  transition: color .3s, border-color .3s, background .3s;
}
.filter:hover { color: var(--fg); border-color: var(--fg-soft); }
.filter.is-active { color: var(--bg); background: var(--fg); border-color: var(--fg); }

.grid {
  max-width: var(--maxw); margin: 2.5rem auto 0; padding: 0 var(--gut);
  columns: 3; column-gap: clamp(.8rem, 1.6vw, 1.5rem);
}
.card {
  break-inside: avoid; margin-bottom: clamp(.8rem, 1.6vw, 1.5rem);
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.card.in { opacity: 1; transform: none; }
.card.is-hidden { display: none; }
.card img {
  width: 100%; height: auto; display: block;
  transition: transform .9s var(--ease), filter .6s;
  filter: grayscale(.15);
}
.card:hover img { transform: scale(1.05); filter: grayscale(0); }
.card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,10,9,.82), rgba(11,10,9,0) 55%);
  opacity: 0; transition: opacity .5s var(--ease);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
}
.card:hover .card__overlay, .card:focus-visible .card__overlay { opacity: 1; }
.card__cat {
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
  transform: translateY(10px); transition: transform .5s var(--ease) .05s;
}
.card__title {
  font-family: var(--font-display); font-size: 1.35rem; margin-top: .25rem;
  transform: translateY(10px); transition: transform .5s var(--ease) .1s;
}
.card:hover .card__cat, .card:hover .card__title { transform: none; }
.card__badge {
  position: absolute; top: 1rem; right: 1rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
}
.card__badge svg { width: 16px; height: 16px; color: var(--fg); }

.work__more { text-align: center; margin-top: clamp(3rem, 7vh, 5rem); }

/* =========================================================
   SHOWREEL
   ========================================================= */
.reel { padding: 0 var(--gut) var(--section-y); max-width: var(--maxw); margin: 0 auto; }
.reel__facade {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 16 / 9; cursor: pointer;
}
.reel__facade img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); transition: transform 1s var(--ease), filter .6s; }
.reel__facade:hover img { transform: scale(1.04); filter: brightness(.55); }
.reel__play {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px;
  display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 92%, transparent); color: var(--bg);
  transition: transform .4s var(--ease), background .4s;
}
.reel__play::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(244,240,234,.4); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
.reel__facade:hover .reel__play { transform: scale(1.08); background: var(--accent); }
.reel__play svg { width: 34px; height: 34px; }
.reel__label {
  position: absolute; left: 1.5rem; bottom: 1.5rem;
  font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--fg);
}
.reel iframe { width: 100%; height: 100%; border: 0; aspect-ratio: 16/9; border-radius: var(--radius); }

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  padding: var(--section-y) var(--gut);
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.about__portrait { overflow: hidden; border-radius: var(--radius); }
.about__portrait img { width: 100%; filter: grayscale(.2); transition: transform 1.2s var(--ease), filter .6s; }
.about__portrait:hover img { transform: scale(1.04); filter: grayscale(0); }
.about__title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; margin: .6rem 0 1.6rem;
}
.about__text { color: var(--fg-soft); margin-bottom: 1.2rem; max-width: 52ch; }
.link-arrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid var(--fg-soft); padding-bottom: .4rem;
  transition: color .3s, border-color .3s, gap .3s;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); gap: 1rem; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact { padding: var(--section-y) var(--gut); border-top: 1px solid var(--line); }
.contact__inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.contact__title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 7rem); line-height: .98; letter-spacing: -.02em;
  margin: 1.4rem 0 2rem;
}
.contact .section-head__index { color: var(--accent); }
.contact__lede { color: var(--fg-soft); max-width: 44ch; margin: 0 auto 2.6rem; }
.contact__email {
  display: inline-block;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line); padding-bottom: .3rem;
  transition: color .3s, border-color .3s;
}
.contact__email:hover { color: var(--accent); border-color: var(--accent); }
.contact__socials { display: flex; justify-content: center; gap: 2rem; margin-top: 2.8rem; }
.contact__socials a {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft);
  position: relative; transition: color .3s;
}
.contact__socials a:hover { color: var(--fg); }
.contact__socials a.is-empty { opacity: .35; pointer-events: none; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { padding: 2rem var(--gut); border-top: 1px solid var(--line); }
.footer__row {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .78rem; letter-spacing: .08em; color: var(--fg-faint);
}
.footer__top { transition: color .3s; }
.footer__top:hover { color: var(--accent); }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(8,7,6,.96); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__figure {
  max-width: 88vw; max-height: 86vh;
  transform: scale(.96); transition: transform .5s var(--ease);
}
.lightbox.is-open .lightbox__figure { transform: scale(1); }
.lightbox__figure img { max-width: 88vw; max-height: 78vh; object-fit: contain; border-radius: var(--radius); }
.lightbox__figure figcaption {
  text-align: center; margin-top: 1rem; color: var(--fg-soft);
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
}
.lightbox__close { position: absolute; top: 1.5rem; right: 1.5rem; width: 48px; height: 48px; color: var(--fg); }
.lightbox__close svg { width: 26px; height: 26px; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px; color: var(--fg);
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  transition: border-color .3s, background .3s;
}
.lightbox__nav:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.lightbox__nav svg { width: 24px; height: 24px; }
.lightbox__nav--prev { left: clamp(1rem, 3vw, 3rem); }
.lightbox__nav--next { right: clamp(1rem, 3vw, 3rem); }

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.is-loaded .line__inner { transition: transform 1s var(--ease); transition-delay: var(--d, 0s); }
.is-loaded .line.in .line__inner { transform: translateY(0); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .grid { columns: 2; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .menu-btn { display: block; }
  .about { grid-template-columns: 1fr; }
  .about__portrait { max-width: 420px; }
  .hero__scroll { display: none; }
  .hero { align-items: flex-start; }
  .hero__content { padding-top: 44vh; padding-bottom: 2.5rem; }
  .grid { columns: 1; }
  .footer__row { justify-content: flex-start; gap: .4rem 1.5rem; }
}
@media (max-width: 420px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero__img { transform: none; animation: none; }
  .line__inner { transform: none !important; }
  .reveal, .card { opacity: 1 !important; transform: none !important; }
  .reveal-words .word { opacity: 1 !important; }
}
