/* ============================================
   VARIABLES — dirección creativa: oscuro,
   editorial, acento cálido en gradiente.
   ============================================ */
:root {
  --color-bg: #0a0908;
  --color-text: #f5f1ea;
  --color-muted: #a8a49c;
  --color-accent: #e8582e;        /* coral rojizo */
  --color-accent-pink: #d28cbe;   /* rosa malva */
  --color-accent-soft: #f2c27e;   /* durazno dorado */
  --color-surface: #171613;

  /* El dorado entra solo como un toque en la punta (0%–20%), no como
     tercer color parejo — así hace juego con el fondo (LiquidEther,
     ver "heroLiquidEther" en script.js). El rosa se sostiene sólido
     desde el 55% en vez de aparecer recién en la punta, para que sea
     el color dominante del degradado (pedido explícito de Camila). */
  --gradient-accent: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-accent) 20%, var(--color-accent-pink) 55%, var(--color-accent-pink) 100%);

  --font-heading: "Julius Sans One", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --max-width: 1200px;
  --section-padding: 6rem 1.5rem;
}

/* ============================================
   RESET básico
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* "clip" evita scroll horizontal sin romper position: sticky
     (con "hidden" sticky deja de funcionar) */
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  /* Julius Sans One solo existe en grosor regular:
     sin esto el navegador la engordaría artificialmente */
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

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

section {
  padding: var(--section-padding);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ============================================
   FONDO GLOBAL — simulación de fluido en WebGL
   (LiquidEther, ver js/liquid-ether.js), fixed
   detrás de todo el contenido, en TODA la página
   y en todas las páginas de proyecto, para que no
   se corte al bajar o cambiar de sección.
   ============================================ */
.site-liquid-ether {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Grano editorial sobre toda la página */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  z-index: 100;
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

/* Al bajar, la barra gana un fondo apenas visible (no sólido) — el
   blur ya alcanza para separarla del contenido de atrás, y bajar la
   opacidad evita que se lea como una franja negra dura sobre las
   fotos del portafolio. */
.navbar.is-scrolled {
  background: rgba(13, 13, 12, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(245, 241, 234, 0.05);
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 38px;
  width: auto;
  /* Oculto mientras el hero muestra el logo grande;
     aparece al hacer scroll (con .is-scrolled en la navbar) */
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.navbar.is-scrolled .logo-img {
  opacity: 1;
  transform: translateY(0);
}

.navbar.is-scrolled .logo:hover .logo-img {
  opacity: 0.8;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  /* Sin 100vh a propósito: con el logo/tagline/botón centrados en una
     pantalla completa, quedaba mucho aire vacío antes de "Design With
     Personality". Ahora la altura la define el propio contenido +
     este padding, así el hero termina justo donde termina su
     contenido. */
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 9rem 1.5rem 4rem;
  max-width: none;
}

.hero-content {
  position: relative;
  color: #fff;
  padding: 0 1.5rem;
}

/* ============================================
   INTRO DE MARCA — animación en vivo (HTML/CSS/GSAP),
   reemplaza al círculo de fotos + tagline de texto.
   Proporción real del proyecto original (2851x1674).
   Fondo transparente a propósito: se ve el fondo líquido
   de la página detrás, sin caja negra de video.
   ============================================ */
.hero-intro {
  position: relative;
  /* vw en vez de % del padre: .hero-content no tiene ancho propio
     (se achica a su contenido dentro del flex de .hero), así que un
     % contra ella se resolvía casi a cero. */
  width: min(90vw, 760px);
  aspect-ratio: 2851 / 1674;
  margin: 0 auto 2rem;
}

.hero-intro-stack {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  aspect-ratio: 4 / 5;
  transform-origin: 50% 50%;
}

.hi-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  box-shadow:
    0 18px 34px -14px rgba(0, 0, 0, 0.65),
    0 6px 14px -8px rgba(0, 0, 0, 0.5);
  opacity: 0;
}

.hero-intro-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 52%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 1.4%;
  white-space: nowrap;
}

.hi-logo {
  height: 100%;
  width: auto;
  opacity: 0;
}

.hi-tagline {
  margin: 0;
  font-family: "Julius Sans One", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.75rem, 2vw, 1.4rem);
  color: rgba(245, 241, 234, 0.92);
}

.hi-tagline .char {
  display: inline-block;
  opacity: 0;
}

@media (max-width: 640px) {
  .hero-intro-stack { width: 40%; }
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  display: inline-block;
  position: relative; /* ancla del overlay .specular-button__fx */
  padding: 0.9rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #1a1208;
}

.btn:hover {
  transform: translateY(-3px);
  opacity: 0.85;
}

/* Brillo especular en el borde (WebGL vía OGL, ver "specularButton" en
   script.js) — port de SpecularButton de React Bits sin React. El
   canvas sobresale del botón (para que el glow no se corte justo en el
   borde) y queda detrás del texto; si OGL no llega a cargar, el <span>
   del texto sigue ahí y el botón se ve exactamente igual que antes. */
.specular-button__fx {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: 0;
}

.specular-button__fx canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.specular-button__label {
  position: relative;
  z-index: 1;
}

/* ============================================
   SOBRE MÍ
   ============================================ */
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  /* "stretch" (no "center"): la columna de la foto ahora toma el
     alto real de la columna de texto, así la foto —rectangular, con
     su fondo original— queda a la misma altura que el párrafo de al
     lado en vez de flotar centrada y más chica. */
  align-items: stretch;
}

.about-image {
  display: flex;
  justify-content: center;
}

.about-photo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 320px;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--color-muted);
}

/* ============================================
   SERVICIOS
   ============================================ */
.services h2,
.portfolio h2,
.tools h2,
.contact h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

/* Pila de tarjetas de servicios: una al frente, 3 asomando detrás
   (posiciones 0–3 vía data-pos). Cambiar data-pos con JS hace que la
   transición de CSS anime el reacomodo — no hace falta animar cada
   frame a mano. */
.services-stack {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  margin: 0 auto 2rem;
}

.service-card-stacked {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  /* Esquinas rectas, igual que las fotos del portafolio (.portfolio-item),
     en vez del redondeo grande de antes que no combinaba con el resto */
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font: inherit;
  /* La imagen de fondo se pone inline en el HTML (background-image),
     no como custom property: una url() dentro de una variable CSS se
     resuelve relativa a la hoja de estilos (css/), no al HTML, y
     rompía la ruta. Acá solo van encuadre/color de respaldo. */
  background-color: var(--color-surface);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, filter 0.5s ease;
}

.service-card-stacked[data-pos="0"] { transform: translateY(0) scale(1); opacity: 1; z-index: 4; filter: brightness(1); }
.service-card-stacked[data-pos="1"] { transform: translateY(-16px) scale(0.94); opacity: 0.9; z-index: 3; filter: brightness(0.82); pointer-events: none; }
.service-card-stacked[data-pos="2"] { transform: translateY(-28px) scale(0.89); opacity: 0.65; z-index: 2; filter: brightness(0.62); pointer-events: none; }
.service-card-stacked[data-pos="3"] { transform: translateY(-38px) scale(0.85); opacity: 0.4; z-index: 1; filter: brightness(0.48); pointer-events: none; }

.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 7, 6, 0.88), rgba(8, 7, 6, 0.25) 55%, transparent 82%);
}

.service-card-text {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
}

.service-card-text h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.service-card-text p {
  color: rgba(245, 241, 234, 0.85);
  font-size: 0.92rem;
  line-height: 1.5;
}

.services-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.services-dots .dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(245, 241, 234, 0.25);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.services-dots .dot.active {
  /* Mismo degradado vivo del botón principal, en vez del dorado suave
     de antes — más presencia/contraste */
  background: var(--gradient-accent);
  transform: scale(1.3);
}

/* ============================================
   PORTAFOLIO — foco en imagen grande
   ============================================ */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 241, 234, 0.25);
  background: none;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--gradient-accent);
  color: #1a1208;
  border-color: transparent;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  /* Esquinas rectas: más editorial, menos plantilla */
  border-radius: 0;
  cursor: pointer;
  display: block;
  transition: box-shadow 0.55s ease;
}

.portfolio-item img {
  width: 100%;
  /* Proporción fija 4:5 — las portadas se exportan a 1200x1500 */
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.55s ease;
}

.portfolio-item:hover img {
  transform: scale(1.1);
  filter: saturate(1.18) brightness(1.05) contrast(1.05);
}

.portfolio-item:hover {
  box-shadow:
    0 50px 100px -20px rgba(232, 118, 58, 0.3),
    0 30px 60px -15px rgba(0, 0, 0, 0.5);
}

.portfolio-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-caption {
  opacity: 1;
}

.portfolio-item.hidden {
  display: none;
}

/* ============================================
   PÁGINAS DE PROYECTO (case studies)
   ============================================ */
/* En subpáginas no hay logo grande en hero:
   el logo de la navbar se muestra siempre */
.subpage .logo-img {
  opacity: 1;
  transform: none;
}

.case-study {
  padding-top: 9rem;
  max-width: 1000px;
}

.case-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.case-category {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent-soft);
  margin-bottom: 1rem;
}

.case-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 1.25rem;
}

.case-intro {
  color: var(--color-muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* Grid de 2 columnas: las imágenes normales caen en pares del
   mismo tamaño y recorte. Las que llevan .case-full ocupan las
   2 columnas (foto/pieza protagonista, sin recortar). */
.case-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.case-gallery img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.case-gallery img.case-full {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  height: auto;
}

/* Páginas de un PDF: una sola columna, sin recorte, apiladas
   con separación mínima — se leen como el documento original */
.case-gallery.case-pdf {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.case-pdf img {
  aspect-ratio: auto;
  height: auto;
}

@media (max-width: 640px) {
  .case-gallery {
    grid-template-columns: 1fr;
  }

  .case-gallery img {
    aspect-ratio: auto;
  }
}

.case-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(245, 241, 234, 0.12);
}

.case-nav a {
  font-size: 0.95rem;
  color: var(--color-muted);
  transition: color 0.25s ease;
}

.case-nav a:hover {
  color: var(--color-accent-soft);
}

/* ============================================
   HERRAMIENTAS
   ============================================ */
.tools-list {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.tools-list span {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-muted);
}

/* ============================================
   CONTACTO
   ============================================ */
.contact {
  text-align: center;
}

.contact p {
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.contact .btn {
  background: var(--gradient-accent);
  color: #1a1208;
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ============================================
   SCROLL REVEAL (animación de movimiento)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   STAGGERED MENU — menú de pantalla completa animado
   (React Bits, portado a JS + GSAP puro en script.js)
   ============================================ */
.staggered-menu-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

/* Capas de color que entran primero, escalonadas, antes que el panel
   (la "cortina" de acento detrás del panel oscuro) */
.sm-prelayers {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(240px, 30vw, 340px);
  pointer-events: none;
  z-index: 150;
}

.sm-prelayer {
  position: absolute;
  inset: 0;
}

.sm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  z-index: 210;
}

.sm-toggle-textWrap {
  position: relative;
  display: inline-block;
  height: 1em;
  overflow: hidden;
}

.sm-toggle-textInner {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.sm-toggle-line {
  display: block;
  height: 1em;
  line-height: 1;
}

.sm-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sm-icon-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.sm-icon-line-v {
  transform: translate(-50%, -50%) rotate(90deg);
}

.staggered-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(240px, 30vw, 340px);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  padding: 6.5rem 2rem 2rem;
  overflow-y: auto;
  z-index: 160;
  pointer-events: auto;
  opacity: 0;
}

.sm-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sm-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  counter-reset: smItem;
}

.sm-panel-itemWrap {
  position: relative;
  overflow: hidden;
  line-height: 1;
}

.sm-panel-item {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 1.85rem);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-right: 1.5em;
  text-decoration: none;
  transition: color 0.25s ease;
}

.sm-panel-item:hover {
  color: var(--color-accent);
}

.sm-panel-itemLabel {
  display: inline-block;
  will-change: transform;
  transform-origin: 50% 100%;
}

.sm-panel-list[data-numbering] .sm-panel-item::after {
  counter-increment: smItem;
  content: counter(smItem, decimal-leading-zero);
  position: absolute;
  top: 0.25em;
  right: 0.2em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-accent);
  opacity: var(--sm-num-opacity, 0);
}

.sm-socials {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sm-socials-title {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-soft);
}

.sm-socials-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}

.sm-socials-link {
  font-size: 1rem;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.sm-socials-link:hover {
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .staggered-menu-panel,
  .sm-prelayers {
    width: 100%;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .about {
    grid-template-columns: 1fr;
  }
}
