/* Variables globales reutilizables. Los valores por defecto son mobile-first (los más pequeños). */
:root {
  --text-dark: #181811;
  --radius: 20px;
  --gap: 16px;
  --margin: 16px;
}

/* --- 1. RESET Y GLOBALES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Quicksand', sans-serif;
  background-color: #3E402F;
  color: var(--text-dark);
  overflow-x: hidden;
}


/* Tipografías: Comfortaa para títulos (personalidad), Quicksand para cuerpo (legibilidad) */
h1, h2, h3, h4, .logo, .resume-link, .about-title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
}

/* --- 2. FONDO ANIMADO --- */
/* Dos capas (::before y ::after) con gradientes radiales animados en sentido alternado → efecto líquido orgánico */
.bg-animation-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-color: #3E402F;
  overflow: hidden;
}

.bg-animation-container::before,
.bg-animation-container::after {
  content: "";
  position: absolute;
  top: -75%;
  left: -75%;
  width: 250%;
  height: 250%;
  background-image:
    radial-gradient(circle at 15% 25%, #9BB877 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, #A1A67A 0%, transparent 40%),
    radial-gradient(circle at 25% 85%, rgba(40, 41, 30, 0.4) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, #3E402F 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, #9BB877 0%, transparent 35%);
  filter: blur(30px);
  opacity: 0.8;
  animation: liquid-flow 15s infinite alternate ease-in-out;
}

.bg-animation-container::after {
  opacity: 0.5;
  animation-duration: 25s;
  animation-direction: alternate-reverse;
  background-image:
    radial-gradient(circle at 40% 10%, rgba(40, 41, 30, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 10% 40%, #A1A67A 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, #9BB877 0%, transparent 45%);
}

@keyframes liquid-flow {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(-8%, 10%) rotate(5deg) scale(1.1); }
  66% { transform: translate(10%, -8%) rotate(-5deg) scale(0.95); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

/* --- 3. HEADER & HERO --- */
/* Logo + frase rotatoria del hero (script.js la alterna cada 4s con .text-hidden) + botón CTA Resume */
.header {
  padding: 28px var(--margin) 20px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

.header.scrolled {
  padding: 20px var(--margin) 16px;
  background: transparent;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-text {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 300;
  color: #DBD6C1;
  line-height: 1.2;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-hidden {
  opacity: 0;
  transform: translateY(4px);
}

.resume-button {
  background: #DBD6C1;
  color: #181811;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 24px;
  font-size: 0.9rem;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Navigation — visible on all screen sizes */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 32px;
  border-radius: 60px;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled .desktop-nav {
  background: rgba(58, 60, 47, 0.75);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-top: 24px;
}

.desktop-nav-item {
  color: #DBD6C1;
  text-decoration: none;
  font-family: 'Comfortaa', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  border-radius: 8px;
}

.desktop-nav-item:hover {
  color: #9BB877;
  background: rgba(217, 214, 195, 0.15);
}

.desktop-nav-item.active {
  color: #9BB877;
  background: rgba(217, 214, 195, 0.15);
  font-weight: 600;
}

/* Resume button style in nav */
.desktop-nav-item:last-child {
  background: #DBD6C1;
  color: #181811;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.desktop-nav-item:last-child:hover {
  background: #c9c6b3;
  color: #181811;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-separator {
  color: #DBD6C1;
  opacity: 0.3;
  font-size: 0.9rem;
}

/* --- HERO SECTION --- */
.hero-section {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px var(--margin) 30px;
  position: relative;
  text-align: center;
  margin-top: 0;
}

.hero-content-main {
  max-width: 1000px;
  z-index: 1;
}

.hero-title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  color: #DBD6C1;
  line-height: 1.1;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-line-1 {
  font-size: clamp(3rem, 8vw, 6rem);
  display: block;
}

.hero-line-2 {
  font-size: clamp(3rem, 8vw, 6rem);
  display: block;
}

.hero-subtitle {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #DBD6C1;
  line-height: 1.6;
  font-weight: 400;
  max-width: 700px;
  margin: 0 auto;
}

.hero-decoration-top,
.hero-decoration-bottom {
  color: #DBD6C1;
  font-size: clamp(3rem, 4.5vw, 4.5rem);
  opacity: 0.85;
  position: absolute;
}

.hero-decoration-top {
  top: 18%;
  right: 10%;
}

.hero-decoration-bottom {
  bottom: 20%;
  left: 8%;
}

/* --- TITLE SECTION (Index.html rotating title) --- */
.title-section {
  padding: 180px var(--margin) 40px;
  text-align: center;
  position: relative;
}

.rotating-title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #DBD6C1;
  line-height: 1.3;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile adjustments for title section */
@media (max-width: 768px) {
  .title-section {
    padding: 120px var(--margin) 30px;
  }

  /* Mobile: Single column layout - image appears at top, text below */
  .portfolio-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr;
  }

  /* Image at top */
  .image-placeholder {
    grid-column: 1;
    grid-row: 1;
    max-height: 400px;
  }

  .image-placeholder img {
    object-fit: cover;
    object-position: center;
  }

  /* Text below image */
  .intro {
    grid-column: 1;
    grid-row: 2;
  }
}

/* --- 4. BENTO GRID BASE --- */
/* Grid de 2 columnas base. En mobile: intro + imagen van lado a lado, resto ocupa ancho completo.
   En tablet y desktop se reconfigura (ver responsive). Las cards tienen efecto glassmorphism. */
.portfolio-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--gap);
  padding: 20px var(--margin) 20px;
  margin-top: 0;
}

/* ============================================================
   LIQUID GLASS — shared base for every card.
   .image-placeholder opts out below (full-bleed image, no glass).

   Layer stack (bottom → top):
     1. .card            — frosted bg  + backdrop-blur
     2. .card::before    — floating light highlight (cursor-reactive)
     3. .card::after     — inset edge glow
     4. direct children  — lifted to z-index 1

   Cursor tracking is an IIFE in script.js that writes --mx / --my.
   A CSS transition on ::before turns that into a smooth glide.
   ============================================================ */
.card {
  background: rgba(217, 214, 195, 0.6);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;                          /* clips the oversized ::before */

  /* Diffused drop shadow + thin top-edge inner highlight */
  box-shadow:
    0 8px 32px rgba(40, 42, 30, 0.4),
    0 4px 16px rgba(50, 52, 35, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);

  /* JS writes these on mousemove → ::before translates */
  --mx: 0px;
  --my: 0px;

  /* Explicit list — border-radius is deliberately excluded so
     the glass-morph animation owns it without transition fighting */
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Organic shape breathing — border-radius drifts ±2 px over 14 s */
  animation: glass-morph 14s ease-in-out infinite;

  /* Performance: GPU acceleration + layout containment */
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

/* Floating highlight — the "liquid light" inside each card.
   150 % oversized so panning via --mx / --my never reveals a hard edge. */
.card::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  top: 50%;
  left: 50%;

  /* -50 % centres; the vars add the cursor offset.
     The transition is why the highlight glides rather than snaps. */
  transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my)));
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Feathered radial glow — centre brightest, edges dissolve */
  background: radial-gradient(
    ellipse 55% 55% at 50% 50%,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 72%
  );

  pointer-events: none;                      /* clicks fall through */
  z-index: 0;

  /* Idle opacity pulse — calm "alive" feel without position shift */
  animation: glass-highlight-breathe 6s ease-in-out infinite;
}

/* Inset edge glow — tightens the frosted boundary */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;                    /* follows glass-morph */
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.07),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 0;
}

/* Lift every direct child above the two glass layers. */
.card:not(.image-placeholder) > * {
  position: relative;
  z-index: 1;
}

/* Organic border-radius drift — ±2 px over 14 s sits below the
   threshold of conscious perception; it just makes the shape alive. */
@keyframes glass-morph {
  0%, 100% { border-radius: var(--radius) var(--radius) var(--radius) var(--radius); }
  25%      { border-radius: calc(var(--radius) + 2px) calc(var(--radius) - 1px) calc(var(--radius) + 1px) calc(var(--radius) - 2px); }
  50%      { border-radius: calc(var(--radius) - 1px) calc(var(--radius) + 2px) calc(var(--radius) - 2px) calc(var(--radius) + 1px); }
  75%      { border-radius: calc(var(--radius) + 1px) calc(var(--radius) - 2px) calc(var(--radius) + 2px) calc(var(--radius) - 1px); }
}

/* Idle highlight breathing — opacity only, no layout shift */
@keyframes glass-highlight-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* En mobile solo intro + imagen van lado a lado (span 1 cada una); el resto ocupa ancho completo */
.projects,
.resume-card,
.about {
  grid-column: span 2;
}

/* --- 5. CARD SECTIONS --- */

/* Intro — structured statement card */
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.intro-statement {
  max-width: 660px;
}

.intro-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(24, 24, 17, 0.5);
  margin-bottom: 20px;
}

.intro-headline {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  color: #181811;
  margin-bottom: 28px;
}

.intro-supporting {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(24, 24, 17, 0.65);
}

.intro-supporting strong {
  font-weight: 600;
  color: rgba(24, 24, 17, 0.85);
}

/* Imagen — full-bleed photo; opts out of the liquid glass effect */
.image-placeholder {
  padding: 0;
  overflow: hidden;
  display: flex;
  /* Restore plain card values — glass layers would cover the photo */
  background: rgba(217, 214, 195, 0.7);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  animation: none;
}

.image-placeholder::before,
.image-placeholder::after {
  display: none;
}

.image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* Projects — cada project-item es un enlace clicable */
.projects {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.projects h2 {
  margin-bottom: 8px;
  align-self: flex-start;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.project-item {
  background: rgba(169, 168, 146, 0.5);
  min-height: 105px;
  border-radius: 20px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.project-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  z-index: 0;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: blur(1.5px);
}

.project-item:hover .project-image {
  transform: scale(1.05);
  filter: blur(0px);
}

/* Gray overlay sobre la imagen */
.project-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(63, 67, 47, 0.5);
  border-radius: 20px;
  z-index: 0;
  pointer-events: none;
}

.project-tag {
  background: #DBD6C1;
  color: #181811;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* Skills Card — dos vistas intercambiables (Skills / Values) controladas por script.js.
   .skills-wrapper se oculta por defecto; .active la muestra con animación dissolve.
   El indicador de la tab activa se dibuja con ::after */
.resume-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.skills-wrapper {
  display: none;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  opacity: 0;
}

.skills-wrapper.active {
  display: flex;
  animation: dissolve 0.6s ease-out forwards;
}

.resume-footer {
  display: flex;
  gap: 25px;
  margin-top: 30px;
  position: relative;
  padding-bottom: 8px;
}

.tab-btn {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.4;
  position: relative;
}

.tab-btn:hover {
  opacity: 0.8;
  transform: translateY(-2px);
  color: var(--text-dark);
}

.tab-btn:not(.active) {
  color: #2e2e2e;
  opacity: 0.5;
}

.tab-btn.active {
  opacity: 1;
  transform: translateY(0);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-dark);
  border-radius: 2px;
  animation: fadeIn 0.4s ease;
}

@keyframes dissolve {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

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

.skill-group h3 {
  margin-bottom: 10px;
  color: var(--text-dark);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill {
  background-color: #DBD6C1;
  color: #181811;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: normal;
  border: 1px solid rgba(24, 24, 17, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* About card — Methodology Slider */
.about {
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  gap: 0;
}

.about .intro-label {
  margin-bottom: 20px;
}

/* --- Method Nav (pill tabs) --- */
.method-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.method-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(24, 24, 17, 0.2);
  border-radius: 50px;
  background-color: #DBD6C1;
  color: #181811;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.method-tab:hover {
  background: #3F432F;
  color: #DBD6C1;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.method-tab:active {
  transform: scale(0.97);
}

.method-tab.active {
  background: #3F432F;
  color: #DBD6C1;
  border-color: #3F432F;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.method-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Method Viewport (content panels) --- */
.method-viewport {
  position: relative;
  min-height: 90px;
  flex: 1;
}

.method-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.method-panel.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.method-title {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.method-desc {
  font-size: clamp(0.88rem, 1.6vw, 0.95rem);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(24, 24, 17, 0.65);
}

.method-desc strong {
  color: var(--text-dark);
}

/* Progress bar — hidden */
.method-progress {
  display: none;
}

@keyframes floatBubble {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -8px); }
}

/* Socials — centred icon row (glass effect inherited from .card) */
.social {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.icons {
  display: flex;
  gap: 30px;
}

.icons img {
  height: 24px;
  transition: transform 0.3s ease;
  /* Faint shadow keeps icons crisp against the frosted glass */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* --- 6. FOOTER --- */
/* En mobile es una columna centrada. En tablet+ pasa a row con space-between.
   .footer-bottom separa el botón back-to-top del resto con un border-top */
.footer {
  background: rgba(40, 41, 31, 0.9);
  backdrop-filter: blur(15px);
  color: #DBD6C1;
  padding: 36px var(--margin) 28px;
  display: flex;
  flex-direction: column;
}

.footer-greeting {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  margin-bottom: 48px;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: center;
  width: 100%;
}

.footer-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-col.align-right {
  align-items: center;
  text-align: center;
}

.col-title {
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  opacity: 0.6;
}

.footer-link {
  color: #DBD6C1;
  text-decoration: none;
  font-size: 1rem;
  transition: 0.3s;
}

.footer-link:hover {
  opacity: 0.7;
}

.separator {
  opacity: 0.35;
  margin: 0 6px;
}

.back-to-top {
  background: #DBD6C1;
  color: #181811;
  padding: 14px 38px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: 0.3s;
}

.footer-bottom {
  text-align: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(217, 214, 195, 0.15);
}

.copyright {
  font-size: 0.9rem;
  margin: 0;
}

.made-with {
  font-size: 0.9rem;
  margin: 0;
}

/* --- 7. INTERACCIONES (hover) --- */
/* Todo dentro de @media (hover: hover) para que solo aplique en dispositivos con mouse,
   evitando estados hover pegajosos en pantallas táctiles */
@media (hover: hover) {
  /* Liquid glass hover — gentle lift, shadow deepens */
  .card:hover {
    transform: translateY(-4px);
    background: rgba(217, 214, 195, 0.65);
    box-shadow:
      0 14px 40px rgba(0, 0, 0, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  /* Image card keeps its original stronger lift (no glass to preserve) */
  .image-placeholder:hover {
    transform: translateY(-12px) scale(1.01);
    background: rgba(217, 214, 195, 0.7);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  .image-placeholder:hover img {
    transform: scale(1.03);
  }
  .resume-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
  .back-to-top:hover {
    background: #3F432F;
    color: #DBD6C1;
  }
  .project-item:hover {
    min-height: 140px;
    background: rgba(150, 149, 127, 0.7);
    transform: scale(1.02);
  }
  .skill-pill:hover {
    background-color: #3F432F;
    transform: scale(1.05);
    color: #DBD6C1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .icons img:hover {
    transform: scale(1.1);
  }
  .next-project a:hover {
    opacity: 0.7;
  }
}

/* --- 8. RESPONSIVE (mobile-first) --- */
/* Los valores base (arriba) son los más pequeños. Cada min-width agrega una capa de complejidad hacia arriba:
   481px → phones grandes | 769px → tablet (2 col) | 1025px → desktop (12 col bento) */

/* 481px — Phones más grandes / landscape: restaura tamaños de botones, pills en una línea */
@media (min-width: 481px) {
  :root {
    --radius: 24px;
    --gap: 18px;
    --margin: 20px;
  }

  .header {
    padding: 40px var(--margin);
  }

  .resume-button {
    padding: 14px 38px;
    font-size: 1rem;
  }

  .skill-pill {
    white-space: nowrap;
  }

  .footer {
    padding: 48px var(--margin) 36px;
  }
}

/* 769px — Tablet: intro + imagen siguen lado a lado; proyectos y socials van ancho completo.
   resume-card y about se ponen lado a lado. Footer pasa a row. */
@media (min-width: 769px) {
  :root {
    --radius: 35px;
    --gap: 20px;
    --margin: 40px;
  }

  .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 20px var(--margin) 40px;
  }

  /* Proyectos y socials van ancho completo; intro + imagen siguen lado a lado */
  .projects,
  .social {
    grid-column: span 2;
  }

  /* En mobile resume-card y about son span 2; aquí vuelven a span 1 para estar lado a lado */
  .resume-card,
  .about {
    grid-column: span 1;
  }

  .project-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .intro {
    text-align: left;
    align-items: flex-start;
    padding: 60px 48px;
  }

  .about {
    padding: 36px 40px;
  }

  .projects {
    padding: 32px;
  }

  /* Footer: horizontal layout */
  .footer {
    padding: 48px var(--margin) 36px var(--margin);
  }

  .footer-main {
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    text-align: left;
  }

  .footer-col.align-right {
    align-items: flex-end;
    text-align: right;
  }
}

/* 1025px — Desktop: grid de 12 columnas con placements específicos (bento layout).
   project-list vuelve a columna porque la card es estrecha y alta. */
@media (min-width: 1025px) {
  :root {
    --margin: 100px;
  }

  .header {
    padding: 80px var(--margin) 40px var(--margin);
  }

  .portfolio-grid {
    grid-template-columns: repeat(12, 1fr);
    padding: 20px var(--margin) 40px;
  }

  .intro-headline {
    font-size: 1.55rem;
  }

  /* Bento grid placements */
  .intro {
    grid-column: 1 / span 5;
    grid-row: 1 / span 5;
  }

  .image-placeholder {
    grid-column: 6 / span 3;
    grid-row: 1 / span 5;
  }

  .projects {
    grid-column: 9 / span 4;
    grid-row: 1 / span 7;
  }

  .resume-card {
    grid-column: 1 / span 4;
    grid-row: 6 / span 3;
  }

  .about {
    grid-column: 5 / span 4;
    grid-row: 6 / span 3;
  }

  .social {
    grid-column: 9 / span 4;
    grid-row: 8 / span 1;
  }

  /* Project list returns to single column in the narrow desktop card */
  .project-list {
    display: flex;
    flex-direction: column;
  }
}

/*case study page*/
/* --- Estilos del Header Superior --- */
.header-case {
  padding: 28px var(--margin) 20px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(40, 41, 31, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(155, 184, 119, 0.2);
}

.by-author {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  color: #DBD6C1;
  font-weight: 300;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.by-author:hover {
  opacity: 0.7;
}

/* --- Estilos del Hero Principal --- */
.project-hero {
  padding: 180px var(--margin) 20px;
  display: flex;
  justify-content: center;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: clamp(30px, 5vw, 60px);
}

/* Contenedor de la Imagen */
.hero-mockup-container {
  flex: 1.6; /* Laptop toma más espacio */
  display: flex;
  justify-content: center;
}

.hero-mockup-img {
  width: 100%;
  height: auto;
  max-width: 900px;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Make andys_cover image smaller */
.hero-mockup-img[src*="andys_cover"] {
  max-width: 600px;
  transform: scale(0.85);
}

.hero-mockup-img:hover {
  transform: translateY(-8px) scale(1.02);
}

.hero-mockup-img[src*="andys_cover"]:hover {
  transform: translateY(-8px) scale(0.87);
}

/* Contenedor del Título */
.hero-project-info {
  flex: 0.6;
  text-align: left;
}

.project-main-title {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: #DBD6C1;
}

/* --- Responsive para Mobile --- */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .hero-project-info {
    text-align: center;
    order: 1;
  }

  .hero-mockup-container {
    order: 2;
  }

  .project-hero {
    padding-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .header-case {
    padding: 28px var(--margin) 20px;
  }

  .ia-card,
  .glass-results,
  .glass-mockup-display {
    padding: 24px;
  }
}


/* Case Study Main Section */
.case-study {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 32px var(--margin) 20px;
  position: relative;
}

.context-group {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.context-label {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #DBD6C1;
  margin-bottom: 24px;
}

/* Tarjeta de Overview Centrada */
.glass-text-center {
  text-align: center;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-text-center p {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  max-width: 800px;
  color: #181811;
}

/* Fila para Problema y Solución */
.context-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.glass-context {
  height: 100%;
  padding: 32px;
}

/* Tipografía Interna */
.context-main-text {
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-bottom: 20px;
  color: #181811;
  opacity: 0.95;
  line-height: 1.6;
}

.context-list {
  list-style: none;
  margin-bottom: 30px;
}

.context-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: #181811;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.5;
}

.context-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #181811;
  font-weight: 700;
}

.context-footer-text {
  font-size: clamp(0.95rem, 1.8vw, 1rem);
  color: #181811;
  opacity: 0.85;
  line-height: 1.5;
}

.context-highlight {
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.6;
  color: #181811;
}

.context-highlight strong {
  font-weight: 700;
  color: #181811;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .context-row {
    grid-template-columns: 1fr;
    gap: var(--gap);
  }

  .glass-text-center {
    padding: 24px;
  }

  .glass-text-center p {
    font-size: 1.1rem;
  }

  .glass-context {
    padding: 24px;
  }
}

/* ===================================================================
   TIMELINE STRUCTURE — Overview → Problem → Solution Flow
   =================================================================== */

/* Hamburger Menu Button - Removed duplicate definition, see line ~2355 for active definition */

/* Timeline Navigation — In header navigation bar */
.timeline-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

.timeline-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.nav-link {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 600;
  color: #DBD6C1;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(217, 214, 195, 0.1);
  border: 1px solid rgba(155, 184, 119, 0.3);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(155, 184, 119, 0.2);
  border-color: rgba(155, 184, 119, 0.6);
  color: #9BB877;
  opacity: 1;
  transform: translateY(-2px);
}

.nav-link:active {
  transform: translateY(0);
  background: rgba(155, 184, 119, 0.3);
}

/* Timeline Node — Individual Story Block */
.timeline-node {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: start;
  position: relative;
  padding: 40px 0;
}

.timeline-node:first-child {
  padding-top: 0;
}

/* Timeline Icon Container */
.timeline-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(155, 184, 119, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(155, 184, 119, 0.3);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-node:hover .timeline-icon {
  background: rgba(155, 184, 119, 0.2);
  border-color: rgba(155, 184, 119, 0.5);
  transform: scale(1.08);
}

.timeline-icon svg {
  width: 32px;
  height: 32px;
}

/* Timeline Content */
.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

/* Timeline Content with Media - Two Column Layout */
.timeline-content-with-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.timeline-text-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Comments Grid for Pain Points */
.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.comment-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comment-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Mobile Mockups Grid */
.mockups-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.mockups-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
}

.mockups-grid--5 {
  grid-template-columns: repeat(5, 1fr);
}

/* High Fidelity Before/After */
.hifi-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
  align-items: start;
  max-width: 480px;
}

.hifi-before-after--right {
  margin-left: auto;
}

.hifi-hero-mockup {
  max-width: 200px;
  width: 200px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hifi-hero-mockup {
    max-width: 130px;
    width: 130px;
  }
}

@media (max-width: 480px) {
  .hifi-hero-mockup {
    max-width: 110px;
    width: 110px;
  }
}

.hifi-pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hifi-label {
  font-family: 'Capriola', sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
}

@media (max-width: 600px) {
  .hifi-before-after {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

.mockups-with-text {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}

.mockup-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mockup-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  .mockups-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

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

  .mockups-grid--5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .mockups-with-text {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .mockups-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .mockups-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mockups-grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mockup-img {
    border-radius: 10px;
  }

  .mockups-with-text {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.timeline-media-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

/* Timeline Title — Uses Capriola Font */
.timeline-title {
  font-family: 'Capriola', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  color: #DBD6C1;
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}

/* Timeline Text — Body content using Quicksand */
.timeline-text {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.7;
  color: #DBD6C1;
  margin: 0;
  opacity: 0.95;
}

/* Timeline List — Bullet points */
.timeline-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.timeline-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: #DBD6C1;
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  opacity: 0.9;
}

.timeline-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #9BB877;
  font-weight: 700;
}

/* Timeline Footer Text */
.timeline-footer {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  color: #DBD6C1;
  margin: 8px 0 0 0;
  opacity: 0.85;
  font-style: italic;
}

/* Timeline Highlight — Emphasized text */
.timeline-highlight {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.7;
  color: #DBD6C1;
  margin: 8px 0 0 0;
  opacity: 0.95;
}

.timeline-highlight strong {
  font-weight: 700;
  color: #9BB877;
}

/* Timeline Connecting Line — Flows through all nodes */
.timeline-line {
  display: none; /* Hidden - keeping timeline icons only */
  position: absolute;
  left: 39px; /* Center of the icon (80px/2 - border) */
  width: 2px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(155, 184, 119, 0.5) 0%,
    rgba(155, 184, 119, 0.3) 50%,
    rgba(155, 184, 119, 0.5) 100%
  );
  z-index: 1;
  top: 64px;
}

.timeline-line:last-of-type {
  height: calc(100% - 64px);
}

/* Timeline Node Styling */
.timeline-node {
  opacity: 1;
  transform: none;
}

/* Timeline GIF - Professional media display */
.timeline-gif {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin: 24px 0 0 0;
  display: block;
}

/* Timeline IA Image - Information Architecture diagram */
.timeline-ia-img {
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 12px;
  background: rgba(217, 214, 195, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin: 24px 0 0 0;
  display: block;
  border: 1px solid rgba(155, 184, 119, 0.3);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-ia-img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Image Modal Styles */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.image-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-modal-content {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.3s ease;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.image-modal-close:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}

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

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Timeline Research Subtitle */
.research-subtitle {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: #9BB877;
  margin: 0 0 16px 0;
  letter-spacing: 0.02em;
}

/* Timeline Research Table - Research insight table within timeline */
.timeline-media-column .research-table-container {
  width: 100%;
  max-width: 600px;
  margin: 24px 0 0 0;
  overflow-x: auto;
}

.timeline-media-column .research-table {
  margin: 0;
}

.timeline-media-column .research-table th {
  padding: 16px 20px;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.timeline-media-column .research-table td {
  padding: 16px 20px;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
}

.timeline-media-column .row-number {
  font-size: 0.7rem;
  padding: 3px 8px;
  min-width: 32px;
  margin-right: 10px;
}

.timeline-media-column .cell-content {
  max-width: calc(100% - 50px);
}

/* UI Kit Timeline Grid */
.uikit-timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
  width: 100%;
}

.uikit-timeline-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.uikit-timeline-subtitle {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: #9BB877;
  margin: 0;
  letter-spacing: 0.02em;
}

.uikit-timeline-card {
  background: rgba(217, 214, 195, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.uikit-timeline-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.uikit-timeline-img {
  width: 100%;
  height: 100%;
  max-height: 250px;
  border-radius: 8px;
  object-fit: contain;
}

/* Caption text below UI Kit cards */
.uikit-caption {
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: #DBD6C1;
  opacity: 0.85;
  text-align: center;
  line-height: 1.5;
  margin: 16px 0 0 0;
  font-style: italic;
  padding: 0 16px;
}

.uikit-full-width {
  grid-column: span 2;
}

.uikit-full-width .uikit-timeline-img {
  max-width: 800px;
}

/* --- Responsive Timeline --- */
@media (max-width: 900px) {
  /* Center header content on mobile */
  .header-inner {
    justify-content: center;
    position: relative;
  }

  /* Hide navigation by default on mobile */
  .timeline-nav {
    position: absolute;
    top: 100%;
    right: var(--margin);
    background: rgba(40, 41, 31, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(155, 184, 119, 0.3);
    border-radius: 16px;
    padding: 20px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    justify-content: flex-start;
    width: auto;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
  }

  /* Show navigation when active */
  .timeline-nav.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 10px 16px;
    text-align: left;
    width: 100%;
  }

  .header-case {
    padding: 20px var(--margin) 16px;
    position: static; /* Remove sticky positioning on mobile */
  }

  .timeline-node {
    grid-template-columns: 60px 1fr;
    gap: 24px;
    padding: 32px 0;
  }

  .timeline-icon {
    width: 52px;
    height: 52px;
  }

  .timeline-icon svg {
    width: 26px;
    height: 26px;
  }

  .timeline-line {
    left: 29px;
    top: 52px;
  }

  .timeline-title {
    font-size: clamp(1.5rem, 4.5vw, 2rem);
  }

  .timeline-text,
  .timeline-highlight {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
  }

  .timeline-list li {
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  }

  .timeline-content-with-media {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .uikit-timeline-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .uikit-full-width {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .timeline-nav {
    top: 100%;
    right: var(--margin);
    min-width: 180px;
    padding: 16px;
    gap: 10px;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  .header-case {
    padding: 16px var(--margin) 12px;
    position: relative; /* Needed for absolute positioning of nav dropdown */
  }

  .by-author {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  .timeline-node {
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 28px 0;
  }

  .timeline-icon {
    width: 44px;
    height: 44px;
  }

  .timeline-icon svg {
    width: 22px;
    height: 22px;
  }

  .timeline-line {
    left: 23px;
    top: 44px;
  }

  .timeline-content {
    gap: 12px;
  }

  .hero-text {
    font-size: clamp(1.5rem, 4.5vw, 2.8rem);
  }

  .timeline-title {
    font-size: clamp(1.3rem, 5vw, 1.7rem);
    margin-bottom: 4px;
  }

  .timeline-gif,
  .timeline-ia-img {
    border-radius: 8px;
    margin-top: 16px;
  }

  .research-subtitle {
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    margin-bottom: 12px;
  }

  .timeline-media-column .research-table-container {
    margin-top: 16px;
  }

  .timeline-ia-img {
    padding: 12px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .timeline-media-column .research-table th {
    padding: 12px 16px;
    font-size: clamp(0.85rem, 2vw, 1rem);
  }

  .timeline-media-column .research-table td {
    padding: 12px 16px;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  }

  .timeline-media-column .row-number {
    font-size: 0.65rem;
    padding: 2px 6px;
    min-width: 28px;
    margin-right: 8px;
  }

  .uikit-timeline-card {
    min-height: 250px;
    padding: 20px;
  }

  .uikit-timeline-subtitle {
    font-size: clamp(1rem, 2.8vw, 1.2rem);
  }
}

/* MOCKUPS IMAGES */
/* --- Contenedor General --- */
.process-visuals {
  padding: 32px var(--margin) 20px;
}

.glass-mockup-display {
  background: transparent;
  min-height: clamp(400px, 50vw, 600px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  padding: 32px 24px;
  /* Anular el efecto glass heredado de .card */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

.quad-mockup-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 30px;
  width: 100%;
}

/* Mockup containers - visible by default on desktop */
.mockup-with-overlay {
  opacity: 1;
  transform: none;
}

/* Base de imágenes */
.m-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4));
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Capa de Atrás (Fila superior) --- */
.layer-back {
  display: contents; /* Permite que los hijos se comporten como parte del grid */
}

.m-back-left {
  grid-column: 1;
  grid-row: 1;
}

.m-back-right {
  grid-column: 2;
  grid-row: 1;
}

/* --- Capa de Adelante (Fila inferior) --- */
.layer-front {
  display: contents;
}

.m-front-left {
  grid-column: 1;
  grid-row: 2;
}

.m-front-right {
  grid-column: 2;
  grid-row: 2;
}

/* --- Animación Hover individual --- */
.m-img:hover {
  transform: translateY(-10px) scale(1.03);
  filter: drop-shadow(0 25px 50px rgba(0,0,0,0.5));
}

/* --- Mockup with Overlay Card --- */
.mockup-with-overlay {
  position: relative;
  width: 100%;
  height: 100%;
}

.mockup-overlay-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 400px;
  padding: 32px;
  background: rgba(217, 214, 195, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(155, 184, 119, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10;
}

.overlay-card-title {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: #9BB877;
  margin: 0 0 16px 0;
}

.overlay-card-text {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
  color: #DBD6C1;
  margin: 0;
}

/* Desktop: Show overlay on hover */
@media (min-width: 769px) {
  .mockup-with-overlay:hover .mockup-overlay-card {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Mobile: Show overlay when visible (controlled by JS) */
.mockup-overlay-card.overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: Grid 2x2 con animaciones de entrada */
@media (max-width: 768px) {
  .glass-mockup-display { min-height: 450px; }

  /* Grid 2x2 para mockups */
  .quad-mockup-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
  }

  /* Reset positioning para mobile */
  .layer-back,
  .layer-front {
    display: contents;
  }

  .mockup-with-overlay {
    position: relative;
    overflow: hidden;
  }

  /* Tamaño de imágenes en mobile */
  .m-img {
    width: 100%;
    height: auto;
    position: relative;
    display: block;
    margin: 0;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
  }

  /* Estado inicial: invisible */
  .mockup-with-overlay {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Estado visible: animación de entrada */
  .mockup-with-overlay.mockup-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  /* Staggered animation delays */
  .mockup-with-overlay:nth-child(1) { transition-delay: 0.1s; }
  .mockup-with-overlay:nth-child(2) { transition-delay: 0.2s; }

  .layer-front .mockup-with-overlay:nth-child(1) { transition-delay: 0.3s; }
  .layer-front .mockup-with-overlay:nth-child(2) { transition-delay: 0.4s; }

  .m-back-left, .m-back-right, .m-front-left, .m-front-right {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none !important;
  }
}

/* ===================================================================
   TAP FEEDBACK EFFECT — Interactive tap visualization on entire page
   3 concentric circles expand from tap point anywhere on screen
   =================================================================== */

/* Tap circle ripple effect - fixed position for viewport coordinates */
.tap-ripple {
  position: fixed;
  border-radius: 50%;
  border: 2px solid rgba(155, 184, 119, 0.6);
  pointer-events: none;
  z-index: 9999; /* Above all content */
  animation: tap-expand 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Three ripples with staggered delays */
.tap-ripple:nth-child(1) {
  animation-delay: 0s;
  border-width: 2px;
}

.tap-ripple:nth-child(2) {
  animation-delay: 0.15s;
  border-width: 1.5px;
  opacity: 0.7;
}

.tap-ripple:nth-child(3) {
  animation-delay: 0.3s;
  border-width: 1px;
  opacity: 0.5;
}

@keyframes tap-expand {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
    transform: translate(-50%, -50%) scale(0);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ===================================================================
   RESEARCH INSIGHT - Interactive Pain Points & Opportunities Table
   Responsive table with hover effects
   =================================================================== */

.research-section {
  padding: 32px var(--margin) 20px;
}

.research-table-container {
  margin-top: var(--gap);
  width: 100%;
  overflow-x: auto;
}

.research-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Quicksand', sans-serif;
}

/* Table Headers with Icons */
.research-table th {
  text-align: left;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: #9BB877;
  padding: 20px 40px;
  border-bottom: 2px solid rgba(155, 184, 119, 0.5);
  background: rgba(155, 184, 119, 0.08);
  position: relative;
}

.th-icon {
  font-size: 1.3rem;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

.th-text {
  display: inline-block;
  vertical-align: middle;
}

/* Interactive Table Rows */
.research-row {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.research-row:hover {
  background: rgba(155, 184, 119, 0.12);
}

.research-row.active {
  background: rgba(155, 184, 119, 0.15);
  box-shadow: inset 4px 0 0 #9BB877;
}

/* Table Cells */
.research-table td {
  padding: 30px 40px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
  color: #DBD6C1;
  border-bottom: 1px solid rgba(155, 184, 119, 0.2);
  vertical-align: top;
  width: 50%;
  position: relative;
}

/* Row Numbers */
.row-number {
  display: inline-block;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #9BB877;
  background: rgba(155, 184, 119, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  margin-right: 16px;
  vertical-align: middle;
  min-width: 40px;
  text-align: center;
}

.cell-content {
  display: inline-block;
  vertical-align: middle;
  max-width: calc(100% - 60px);
}

/* Pain Point Column */
.pain-point {
  border-right: 1px solid rgba(155, 184, 119, 0.4);
}

/* Opportunity Column */
.opportunity .cell-content {
  font-weight: 500;
}

/* Remove bottom border from last row */
.research-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 900px) {
  .research-table th {
    padding: 16px 20px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
  }

  .research-table td {
    padding: 20px;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
  }

  .row-number {
    font-size: 0.75rem;
    padding: 3px 8px;
    min-width: 36px;
    margin-right: 12px;
  }

  .th-icon {
    font-size: 1.1rem;
    margin-right: 6px;
  }
}

@media (max-width: 600px) {
  .research-table th {
    padding: 12px 16px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
  }

  .research-table td {
    padding: 16px;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
  }

  .row-number {
    font-size: 0.7rem;
    padding: 2px 6px;
    min-width: 32px;
    margin-right: 8px;
  }

  .cell-content {
    max-width: calc(100% - 45px);
  }

  .th-icon {
    font-size: 1rem;
    margin-right: 4px;
  }
}

/* ai Architecture */
/* --- Information Architecture --- */
.ia-section {
  padding: 32px var(--margin) 20px;
}

.ia-header {
  margin-bottom: 24px;
  text-align: left;
}

/* Título alineado a la derecha como en la captura */
.ia-header .align-right {
  text-align: right;
  width: 100%;
  display: block;
  margin-bottom: var(--gap);
}

.ia-description {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.6;
  color: #DBD6C1;
  max-width: 850px;
  opacity: 0.95;
}

/* Color cobre para el énfasis */
.highlight-text {
  color: #9BB877; 
  font-weight: 500;
}

.ia-card {
  background: rgba(217, 214, 195, 0.6);
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ia-map-img {
  width: 100%;
  height: auto;
  max-width: 1100px; /* Ajusta según el tamaño de tu mapa */
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.2));
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ia-header .align-right {
    text-align: left;
  }
  .ia-description {
    font-size: 1rem;
  }
}

/* Mobile mockups */
/* --- Showcase de iPhones --- */
.mobile-showcase {
  padding: 32px var(--margin) 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.mockups-container {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  justify-content: center;
  align-items: center;
  padding: 20px var(--margin);
}

.iphone-wrapper {
  flex: 0 1 auto;
  width: 220px; /* Tamaño uniforme para todos */
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.iphone-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.35));
  transition: filter 0.4s ease;
}

/* --- Layout Uniforme con Variación Sutil --- */
.ip-1 { transform: translateY(0); }
.ip-2 { transform: translateY(0); }
.ip-3 { transform: translateY(0); }
.ip-4 { transform: translateY(0); }

/* Efecto hover individual para darle vida */
@media (hover: hover) {
  .iphone-wrapper:hover {
    transform: scale(1.08) translateY(-8px);
    z-index: 10;
  }

  .iphone-wrapper:hover .iphone-img {
    filter: drop-shadow(0 25px 50px rgba(0,0,0,0.45));
  }
}

/* --- Adaptación para Móviles --- */
@media (max-width: 900px) {
  .mockups-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 16px var(--margin);
  }

  .iphone-wrapper {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .mockups-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px var(--margin);
  }

  .iphone-wrapper {
    width: 100%;
    max-width: 160px;
  }

  .iphone-img {
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.3));
  }
}

/* --- Estilos UI Kit --- */
.uikit-section {
  padding: 32px var(--margin) 20px;
}

.uikit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: var(--gap);
}

.uikit-item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uikit-item-wrapper .context-label {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
}

.card-uikit {
  background: rgba(217, 214, 195, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.uikit-img {
  width: 100%;
  height: 100%;
  max-height: 350px;
  border-radius: 12px;
  object-fit: contain;
}

/* Los botones ocupan las dos columnas */
.full-width {
  grid-column: span 2;
}

.full-width .uikit-img {
  max-width: 900px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .uikit-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: span 1;
  }
}

/* --- Sección de Resultados --- */
.results-section {
  padding: 32px var(--margin) 20px;
}

.glass-results {
  background: rgba(217, 214, 195, 0.6);
  padding: 32px;
}

.results-intro {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  color: #181811;
  margin-bottom: 40px;
}

.results-intro strong {
  display: block;
  margin-top: 20px;
  color: #181811;
  font-weight: 600;
}

/* Listado de Puntos Clave */
.results-list {
  list-style: none;
  padding: 0;
}

.results-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 20px;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: #181811;
  line-height: 1.6;
}

/* Viñetas personalizadas (puntos pequeños) */
.results-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #9BB877;
  font-size: 1.5rem;
  top: -2px;
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  
  .results-intro {
    font-size: 1.1rem;
  }
  
  .results-list li {
    font-size: 1rem;
  }
}

/* --- Final Showcase & Next Project --- */
.final-showcase {
  padding: 32px var(--margin) 20px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* Contenedor de Laptops - Layout horizontal */
.laptops-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  width: 100%;
}

.final-laptop {
  flex: 1;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.4));
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Hover para laptops */
@media (hover: hover) {
  .final-laptop:hover {
    transform: translateY(-10px) scale(1.03);
    filter: drop-shadow(0 25px 60px rgba(0,0,0,0.5));
  }
}

/* --- Botón Next Project --- */
.next-project-footer {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.next-project-btn {
  background: #DBD6C1;
  color: #181811;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 38px;
  font-size: 1rem;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-family: 'Comfortaa', sans-serif;
}

.next-project-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* --- Responsive --- */
/* Tablet: Keep horizontal flex layout */
@media (max-width: 900px) and (min-width: 601px) {
  .laptops-display {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
  }

  .final-laptop {
    flex: 1 1 calc(50% - 10px);
    max-width: 45%;
    min-width: 0;
  }

  .next-project-footer {
    justify-content: center;
  }
}

/* Mobile: Optimized Single Column Layout */
@media (max-width: 768px) {
  .final-showcase {
    padding: 32px var(--margin) 40px;
    width: 100%;
    overflow: visible;
  }

  .laptops-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
  }

  .final-laptop {
    width: 90%;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 30px rgba(0,0,0,0.35));
  }

  /* Featured laptop (middle one) slightly larger */
  .final-laptop.lap-main {
    width: 95%;
    filter: drop-shadow(0 15px 40px rgba(0,0,0,0.4));
  }

  .next-project-footer {
    justify-content: center;
    margin-top: 32px;
  }

  .next-project-btn {
    width: 90%;
    max-width: 280px;
    text-align: center;
  }
}

/* Mobile navigation (max-width: 600px): static sizing */
@media (max-width: 600px) {
  .desktop-nav {
    position: static;
    transform: none;
    left: auto;
    padding: 8px 16px;
    gap: 4px;
  }

  .desktop-nav-item {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  .desktop-nav-item:last-child {
    padding: 8px 16px;
    font-size: 0.95rem;
  }

  .nav-separator {
    display: none;
  }
}

/* Tablet navigation (601px–900px): adjust nav sizing */
@media (min-width: 601px) and (max-width: 900px) {
  .desktop-nav {
    padding: 10px 20px;
    gap: 12px;
    position: static;
    transform: none;
    left: auto;
  }

  .desktop-nav-item {
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  .nav-separator {
    font-size: 0.75rem;
  }

  .header.scrolled .desktop-nav {
    margin-top: 0;
    background: rgba(58, 60, 47, 0.75);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  }

  /* Hero adjustments for mobile */
  .hero-section {
    min-height: 55vh;
    padding: 80px var(--margin) 20px;
  }

  .hero-title {
    margin-bottom: 24px;
  }

  .hero-decoration-top {
    top: 12%;
    right: 8%;
    font-size: 3rem;
  }

  .hero-decoration-bottom {
    bottom: 15%;
    left: 8%;
    font-size: 3rem;
  }
}

/* Desktop — restore absolute centering for larger screens */
@media (min-width: 901px) {
  .desktop-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    gap: 20px;
    padding: 12px 32px;
  }
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

/* Visually hidden - maintains layout but invisible to users */
.visually-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ===================================================================
   WORK GRID PAGE
   =================================================================== */

.work-grid-container {
  min-height: auto;
  padding: 60px var(--margin) 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  max-width: 1200px;
  width: 100%;
}

.work-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Glassmorphism effect like index.html cards */
  background: rgba(217, 214, 195, 0.6);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.work-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.work-card-content {
  position: relative;
  z-index: 1;
}

.work-card-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 700;
}

.work-card-description {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-dark);
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 16px;
}

.work-card-link {
  display: inline-block;
  color: var(--text-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.work-card-link:hover {
  color: #9BB877;
  transform: translateX(4px);
}

/* Dual laptop card styles - inherits glassmorphism from .work-card */

.work-card-images {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  z-index: 0;
}

.work-card-laptop {
  width: 48%;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.laptop-left {
  transform: translateX(10px);
}

.laptop-right {
  transform: translateX(-10px);
}

.work-card-dual:hover .laptop-left {
  transform: translateX(0px) scale(1.02);
}

.work-card-dual:hover .laptop-right {
  transform: translateX(0px) scale(1.02);
}

/* Dark text for dual laptop card */
.work-card-dual .work-card-title {
  color: var(--text-dark);
}

.work-card-dual .work-card-description {
  color: var(--text-dark);
  opacity: 0.85;
}

.work-card-dual .work-card-link {
  color: var(--text-dark);
}

/* Single image card with overlay effect */
.work-card-single-image {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.work-card-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.work-card-single-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale down specific images to match UX Redesign size */
.work-card-single-img[src*="reflecly_cover"] {
  transform: scale(0.85);
}

.work-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.work-card-single-image:hover .work-card-overlay {
  opacity: 0;
}

.work-card-single-image:hover .work-card-single-img {
  transform: scale(1.05);
}

.work-card-single-image .work-card-content {
  padding: 32px;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
}

.work-card-content .skills-grid {
  margin: 12px 0;
}

.work-card-single-image .work-card-title {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
}

.work-card-single-image .work-card-link {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* Make entire card clickable */
.work-card-single-image .work-card-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  /* Expand to cover entire card */
  inset: -9999px;
}

/* Asymmetric grid layout - desktop */
/* Patrón alternado: wide|small, small|wide */

/* Fila 1: Wide (60%) | Small (40%) */
.work-card:nth-child(1) {
  grid-column: span 3;  /* 60% ancho */
  min-height: 350px;
}

.work-card:nth-child(2) {
  grid-column: span 2;  /* 40% ancho */
  min-height: 350px;
}

/* Fila 2: Small (40%) | Wide (60%) */
.work-card:nth-child(3) {
  grid-column: span 3;  /* 60% ancho */
  min-height: 350px;
  order: 4;  /* Aparece a la derecha */
}

.work-card:nth-child(4) {
  grid-column: span 2;  /* 40% ancho */
  min-height: 350px;
  order: 3;  /* Aparece a la izquierda */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .work-grid-container {
    padding: 40px var(--margin) 60px;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .work-card {
    grid-column: span 1 !important;
    min-height: 250px !important;
  }
}

/* ===================================================================
   VIEW TRANSITIONS — Smart Animation CSS
   Smooth page transitions between index.html and work.html
   =================================================================== */

/* Default transition - fade and slide */
::view-transition-old(root) {
  animation: fade-out 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-new(root) {
  animation: fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Navigation bar morphs smoothly */
.header,
.desktop-nav {
  view-transition-name: header-nav;
}

/* Hero sections morph */
.hero-section {
  view-transition-name: hero-content;
}

/* Cards have unique transitions */
.work-card:nth-child(1) {
  view-transition-name: card-1;
}

.work-card:nth-child(2) {
  view-transition-name: card-2;
}

.work-card:nth-child(3) {
  view-transition-name: card-3;
}

.work-card:nth-child(4) {
  view-transition-name: card-4;
}

/* Portfolio cards */
.card.intro {
  view-transition-name: intro-card;
}

.card.projects {
  view-transition-name: projects-card;
}

/* Smooth morph for shared elements */
::view-transition-old(header-nav),
::view-transition-new(header-nav) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(hero-content),
::view-transition-new(hero-content) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}


/* ===================================================================
   CONTACT MODAL
   =================================================================== */

/* Overlay — darkens + blurs everything behind */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 22, 14, 0.65);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.contact-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Glass card */
.contact-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: linear-gradient(145deg, rgba(219, 214, 193, 0.92) 0%, rgba(219, 214, 193, 0.52) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(212, 163, 129, 0.3);
  border-radius: 28px;
  padding: 48px 40px 40px;
  box-shadow:
    0 24px 64px rgba(20, 22, 14, 0.55),
    0 8px 24px rgba(20, 22, 14, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: scale(0.88) translateY(24px);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-card::-webkit-scrollbar { display: none; }

.contact-overlay.is-open .contact-card {
  transform: scale(1) translateY(0);
}

/* Close button */
.contact-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(62, 64, 47, 0.1);
  color: #3E402F;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.3s ease;
}

.contact-close:hover {
  background: rgba(63, 67, 47, 0.12);
  transform: rotate(90deg);
}

/* Header */
.contact-header {
  margin-bottom: 32px;
}

.contact-title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: #181811;
  margin-bottom: 8px;
  line-height: 1.2;
}

.contact-subtitle {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  color: rgba(24, 24, 17, 0.6);
  font-weight: 500;
}

/* Fields */
.contact-form {
  display: flex;
  flex-direction: column;
}

.contact-field {
  position: relative;
  margin-bottom: 30px;
}

.contact-label {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 24, 17, 0.45);
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.contact-field:focus-within .contact-label {
  color: #3F432F;
}

.contact-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(62, 64, 47, 0.2);
  padding: 8px 0 10px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #181811;
  outline: none;
  resize: none;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact-input::placeholder {
  color: transparent;
}

.contact-textarea {
  min-height: 84px;
}

/* Underline sweep on focus */
.contact-underline {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #3F432F;
  border-radius: 1px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.contact-field:focus-within .contact-underline {
  width: 100%;
}

/* Submit button */
.contact-submit {
  margin-top: 8px;
  width: 100%;
  padding: 15px 32px;
  background: #181811;
  color: #DBD6C1;
  border: none;
  border-radius: 50px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              background 0.3s ease;
  box-shadow: 0 4px 20px rgba(20, 22, 14, 0.3);
}

.contact-submit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(63, 67, 47, 0.2) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  border-radius: 50%;
}

.contact-submit:hover::before {
  width: 320px;
  height: 320px;
}

.contact-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(20, 22, 14, 0.4);
  background: #2C2E1E;
}

.contact-submit:active {
  transform: translateY(0);
}

.contact-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== SUCCESS STATE ===== */
.contact-form-state {
  transition: opacity 0.3s ease;
}

.contact-form-state.is-fading {
  opacity: 0;
  pointer-events: none;
}

.contact-success-state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0 8px;
}

.contact-success-state.is-visible {
  display: flex;
  animation: contactFadeUp 0.5s ease forwards;
}

@keyframes contactFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.contact-sprout {
  width: 96px;
  height: 116px;
  margin-bottom: 24px;
}

.contact-sprout svg {
  width: 100%;
  height: 100%;
  animation: sproutPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes sproutPop {
  from { transform: scale(0.4) translateY(24px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.contact-success-title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #181811;
  margin-bottom: 10px;
}

.contact-success-msg {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  color: rgba(24, 24, 17, 0.62);
  font-weight: 500;
  line-height: 1.65;
  margin-bottom: 32px;
}

.contact-done-btn {
  padding: 12px 32px;
  background: transparent;
  color: #181811;
  border: 1.5px solid rgba(63, 67, 47, 0.35);
  border-radius: 50px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-done-btn:hover {
  background: rgba(63, 67, 47, 0.08);
  border-color: #3F432F;
}

/* Validation error states */
.contact-field.has-error .contact-label {
  color: #b94040;
}

.contact-field.has-error .contact-input {
  border-bottom-color: rgba(185, 64, 64, 0.5);
}

.contact-error-msg {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b94040;
  margin-top: 5px;
  animation: contactFadeUp 0.2s ease forwards;
}

@keyframes contactShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.contact-submit.shake {
  animation: contactShake 0.4s ease;
}

/* Mobile */
@media (max-width: 480px) {
  .contact-card {
    padding: 40px 22px 30px;
    border-radius: 22px;
  }

  .contact-title {
    font-size: 1.5rem;
  }
}
