/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (Swiss Brutalist / Conceptual Minimalist)
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', "SF Mono", Monaco, Consolas, monospace;

  /* Transitions */
  --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  /* Structure */
  --header-height: 80px;
  --container-max-width: 1400px;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: hsl(0, 0%, 93%);        /* Cool, slightly textured grey-white (#ebebeb) */
  --bg-secondary: hsl(0, 0%, 90%);      /* Slightly darker grey for contrast */
  --text-primary: hsl(0, 0%, 9%);       /* Soft deep black */
  --text-secondary: hsl(0, 0%, 25%);    /* Charcoal grey */
  --text-muted: hsl(0, 0%, 45%);       /* Muted grey */
  
  --accent-red: hsl(0, 78%, 50%);       /* Swiss Red (#d61a1a) */
  --accent-red-rgb: 214, 26, 26;
  --accent-red-hover: hsl(0, 85%, 43%);
  
  --line-color: hsl(0, 0%, 9%);         /* Solid black lines for architecture */
  --line-color-soft: hsl(0, 0%, 75%);   /* Soft grey lines for inner grids */
  
  --card-bg: hsla(0, 0%, 100%, 0.15);
  --card-bg-glass: hsla(0, 0%, 93%, 0.75);
  --card-border: hsla(0, 0%, 0%, 0.08);
  
  --selection-bg: hsl(0, 78%, 92%);
  --selection-color: hsl(0, 78%, 40%);
  --hero-overlay: radial-gradient(circle at center, rgba(235, 235, 235, 0.6) 0%, rgba(235, 235, 235, 0.85) 100%);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: hsl(0, 0%, 6%);        /* Rich deep black (#101010) */
  --bg-secondary: hsl(0, 0%, 10%);     /* Dark charcoal */
  --text-primary: hsl(0, 0%, 90%);      /* Crisp white-grey */
  --text-secondary: hsl(0, 0%, 70%);    /* Pale grey */
  --text-muted: hsl(0, 0%, 48%);       /* Medium grey */
  
  --accent-red: hsl(0, 85%, 55%);       /* Glowing Red (#ff2a2a) */
  --accent-red-rgb: 255, 42, 42;
  --accent-red-hover: hsl(0, 95%, 62%);
  
  --line-color: hsl(0, 0%, 90%);        /* Solid white lines */
  --line-color-soft: hsl(0, 0%, 20%);   /* Soft dark borders */
  
  --card-bg: hsla(0, 0%, 0%, 0.3);
  --card-bg-glass: hsla(0, 0%, 6%, 0.75);
  --card-border: hsla(0, 0%, 100%, 0.06);
  
  --selection-bg: hsl(0, 85%, 20%);
  --selection-color: hsl(0, 0%, 100%);
  --hero-overlay: radial-gradient(circle at center, rgba(16, 16, 16, 0.4) 0%, rgba(16, 16, 16, 0.85) 100%);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fix subpixel rendering shift and weight jitter on hover transitions */
a, button, .nav-link, .back-link, .filter-btn, .channel-value, .project-row-title, .featured-name-item, .proto-card-tagline {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform: translateZ(0);
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-color);
}

/* Premium Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E");
  opacity: 0.85;
  pointer-events: none;
  z-index: 9999;
}

/* Custom Interactive Cursor (Hidden on touch devices) */
.custom-cursor {
  width: 8px;
  height: 8px;
  background-color: var(--accent-red);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-follower {
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-red);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.08s cubic-bezier(0.25, 1, 0.5, 1), width 0.2s, height 0.2s, border-color 0.2s, background-color 0.2s;
}

/* Custom Cursor Hover States (Triggered by JS) */
body.hovering-interactive .custom-cursor {
  width: 12px;
  height: 12px;
  background-color: var(--accent-red-hover);
}

body.hovering-interactive .custom-cursor-follower {
  width: 50px;
  height: 50px;
  background-color: rgba(var(--accent-red-rgb), 0.05);
  border-color: var(--accent-red-hover);
}

@media (max-width: 1024px) {
  .custom-cursor, .custom-cursor-follower {
    display: none !important;
  }
}


/* ==========================================================================
   TYPOGRAPHY & ACCENTS
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

p {
  font-family: var(--font-sans);
  color: var(--text-secondary);
}

.highlight-red-word {
  color: var(--accent-red);
  font-weight: 700;
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.highlight-red-word::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  background-color: var(--accent-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.highlight-red-word:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Single Layer Interactive Word */
#interactive-reason-word {
  position: relative;
  display: inline-block;
}

/* Override underline effect for "conectar" */
#interactive-reason-word::after {
  display: none !important;
}

/* Individual letters in "conectar" */
#interactive-reason-word .char {
  display: inline-block;
  color: var(--text-primary);
  opacity: 0.55;
  font-weight: 700;
  transition: color 0.4s ease, opacity 0.4s ease, text-shadow 0.4s ease;
}

/* When scrolled / connected */
#interactive-reason-word .char.connected {
  color: var(--accent-red);
  opacity: 1;
  text-shadow: 0 0 8px rgba(var(--accent-red-rgb), 0.8), 
               0 0 20px rgba(var(--accent-red-rgb), 0.5);
}

/* When hovered, we draw the branch line and light up the letters sequentially */
.manifesto-branch-path {
  fill: none;
  stroke: var(--accent-red);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent-red));
  stroke-dasharray: var(--branch-length, 300);
  stroke-dashoffset: var(--branch-length, 300);
  transition: stroke-dashoffset 1.0s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

#manifesto.hovering-word .manifesto-branch-path {
  stroke-dashoffset: 0;
  opacity: 1;
}

#manifesto.hovering-word #interactive-reason-word .char {
  color: var(--accent-red);
  opacity: 1;
  text-shadow: 0 0 8px rgba(var(--accent-red-rgb), 0.8), 
               0 0 20px rgba(var(--accent-red-rgb), 0.5);
  transition-delay: var(--delay, 0s);
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */

.main-header {
  --header-padding: 4rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(360px - (360px - var(--header-height)) * var(--header-scroll-progress, 0));
  z-index: 100;
  background-color: rgba(var(--bg-primary), calc(0.3 + 0.7 * var(--header-scroll-progress, 0)));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--line-color), calc(0.08 + 0.92 * var(--header-scroll-progress, 0)));
  display: flex;
  align-items: center;
  transform: translateY(0) !important; /* Keep visible at the top during morph */
  transition: background-color 0.3s ease, border-bottom-color 0.3s ease, transform 0.3s ease;
}

@media (max-width: 1024px) {
  .main-header {
    --header-padding: 2rem;
  }
}

@media (max-width: 768px) {
  .main-header {
    --header-padding: 1.5rem;
  }
}

.main-header.scroll-down {
  transform: translateY(-100%) !important;
}

.main-header.scroll-up {
  transform: translateY(0) !important;
  background-color: rgb(var(--bg-primary));
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.header-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--header-padding);
  position: relative;
  height: 100%;
}

.logo {
  position: absolute;
  left: var(--header-padding);
  right: var(--header-padding);
  bottom: 16px;
}

.logo a {
}

/* Static Header for subpages (e.g. project detail page) */
.main-header.static-header {
  height: var(--header-height, 80px) !important;
  background-color: rgb(var(--bg-primary)) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(var(--line-color), 0.08) !important;
}

.static-header .brand-isotype {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: all !important;
}

.static-header .brand-logo-text-scroll {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
}

.static-header .logo {
  bottom: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  height: 48px;
  display: flex;
  align-items: center;
}

.static-header .logo a {
  min-height: 48px !important;
}

.static-header .header-nav-group {
  bottom: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Massive text logo that shrinks and morphs on scroll */
.brand-logo-text-scroll {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: min(calc((100vw - 2 * var(--header-padding)) * 0.24), 21rem);
  color: var(--text-primary);
  letter-spacing: -0.05em;
  text-transform: lowercase;
  
  /* Absolute Position: starts at top row and slides down/left to align with isotype */
  position: absolute;
  left: 0;
  bottom: calc(24px * (1 - var(--header-scroll-progress, 0)));
  transform: translate(calc(var(--logo-translate-x, 0px) * (1 - var(--header-scroll-progress, 0))), 0) 
             scale(calc(1 - (1 - var(--logo-target-scale, 0.11)) * var(--header-scroll-progress, 0)));
  transform-origin: left bottom;
  white-space: nowrap;
  line-height: 0.9;
  
  /* Crossfade & interaction properties */
  opacity: clamp(0, calc((1 - var(--header-scroll-progress, 0)) / 0.3), 1);
  pointer-events: calc(var(--header-scroll-progress, 0) > 0.7 ? 'none' : 'auto');
  transition: opacity 0.1s ease;
  z-index: 5;
}

.brand-logo-text-scroll span {
  color: var(--accent-red);
}

.brand-isotype {
  width: 48px;
  height: 48px;
  /* Bind opacity & scale to scroll progress */
  opacity: clamp(0, calc((var(--header-scroll-progress, 0) - 0.7) / 0.3), 1);
  transform: scale(calc(0.4 + 0.6 * var(--header-scroll-progress, 0)));
  transform-origin: left center;
  pointer-events: calc(var(--header-scroll-progress, 0) > 0.85 ? 'all' : 'none');
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-light {
  display: inline-block;
}

.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: inline-block;
}

.logo a,
.logo a:visited {
  color: var(--text-primary) !important;
}

.logo a:hover .brand-isotype {
  transform: scale(1.15);
}

/* Navigation items pushed to bottom row on load */
.header-nav-group {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: absolute;
  right: var(--header-padding);
  bottom: 20px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  padding: 0.5rem 0;
  position: relative;
  display: inline-block;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--accent-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-link:hover {
  color: var(--accent-red);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 700;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--line-color-soft);
  color: var(--text-primary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   HERO SECTION (Minimalist & Typographic)
   ========================================================================== */

.hero-pin-container {
  height: calc(100vh + 500px);
  position: relative;
  width: 100%;
}

.hero-section-minimal {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 !important;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-color-soft);
  transition: background-color 0.5s ease;
  z-index: 10;
}

.hero-section-minimal .hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.hero-minimal-container {
  position: relative;
  width: 100%;
  max-width: var(--container-max-width);
  height: 100%;
  /* Dynamically adjust padding-top so the text doesn't overlap the large 360px header logo on scroll=0 */
  padding: calc(380px - (380px - (var(--header-height) + 2rem)) * var(--header-scroll-progress, 0)) 4rem 3rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1;
}

.hero-minimal-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border-bottom: 1px solid var(--line-color-soft);
  padding-bottom: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  /* Fade in dynamically only when isotype appears (aligned with progress 0.7 to 1.0) */
  opacity: clamp(0, calc((var(--header-scroll-progress, 0) - 0.7) / 0.3), 1);
  pointer-events: calc(var(--header-scroll-progress, 0) > 0.85 ? 'all' : 'none');
  transition: opacity 0.3s ease;
}

.hero-minimal-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 2rem 0;
}

.hero-huge-title {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(3.2rem, 9.2vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 1.8rem;
  transition: color 0.5s ease;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-subline {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.45;
  transition: color 0.5s ease;
}

.hero-minimal-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--line-color-soft);
  padding-top: 1.5rem;
  width: 100%;
}

.hero-brand-footer-clean {
  line-height: 1;
}

.hero-scroll-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  transition: var(--transition-fast);
  letter-spacing: 0.05em;
}

.hero-scroll-btn:hover {
  color: var(--accent-red);
  transform: translateY(3px);
}

.hero-scroll-arrow {
  display: inline-block;
  animation: bounceArrow 2s infinite;
  font-weight: bold;
}

@keyframes bounceArrow {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* ==========================================================================
   EXPLORE EXPERIMENT SECTION (Interactive Works Showcase)
   ========================================================================== */

.explore-experiment-section {
  position: relative;
  width: 100%;
  background-color: var(--bg-primary);
  transition: background-color 0.5s ease;
  z-index: 2;
}

.explore-scroll-container {
  height: 400vh; /* 100vh for horizontal collapse + 300vh for interactive slides */
  position: relative;
  width: 100%;
}

.explore-sticky-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line-color-soft);
  padding-top: var(--header-height);
  padding-bottom: 2rem;
}

.explore-internal-header {
  position: absolute;
  top: 1.5rem;
  left: 4rem;
  right: 4rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
  border-bottom: 1px solid var(--line-color-soft);
  padding-bottom: 0.5rem;
}

.explore-left-area {
  width: 25%;
  padding: 3rem 1.5rem 1rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2; /* Por encima de la animación de fotos inicial */
  opacity: 0; /* JS animará de 0 a 1 */
  transform: translateX(-30px);
  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-titles {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.explore-main-title {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(2.0rem, 4.2vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin: 0;
  transition: color 0.5s ease;
}

.explore-learn-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0;
  margin-bottom: 1rem;
  align-self: flex-start;
  transition: color 0.3s ease;
}

.explore-learn-more .learn-more-arrow {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-learn-more .learn-more-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-primary);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

.explore-learn-more:hover {
  color: var(--accent-red);
}

.explore-learn-more:hover .learn-more-arrow {
  transform: translateX(6px);
}

.explore-learn-more:hover .learn-more-line {
  transform: scaleX(0.7);
  background-color: var(--accent-red);
}

.explore-footer-left {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.explore-center-area {
  width: 40%;
  padding: 3rem 1.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--line-color-soft);
  position: relative;
  z-index: 2; /* Por encima de la animación de fotos inicial */
  opacity: 0; /* JS animará de 0 a 1 */
  transform: translateX(-30px);
  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-counter {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  height: 2rem;
  overflow: hidden;
  line-height: 1;
}

.counter-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  align-self: flex-start;
}

.counter-num {
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.counter-divider {
  color: var(--text-muted);
  user-select: none;
}

.counter-total {
  color: var(--text-muted);
  user-select: none;
}

.explore-featured-list {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
  padding: 1rem 0;
}

.featured-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.featured-names {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.featured-name-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.featured-name-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  opacity: 0.25;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.4s ease, color 0.4s ease, transform 0.4s ease;
  padding: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.featured-name-category {
  font-family: var(--font-mono);
  font-size: 0.42em;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: 0.6rem;
  letter-spacing: 0.05em;
  display: inline-block;
  vertical-align: middle;
  transition: color 0.4s ease;
}

.featured-name-item.active {
  opacity: 1;
  color: var(--text-primary);
  font-weight: 900;
  transform: translateX(4px);
}

.featured-name-item.active .featured-name-category {
  color: var(--accent-red);
}

.featured-name-item:hover {
  opacity: 1;
  color: var(--accent-red);
}

.explore-footer-center {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.explore-photo-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none; /* Let clicks pass to background elements */
}

.explore-photo-item {
  position: absolute;
  top: 0;
  height: 100vh;
  overflow: hidden;
  pointer-events: auto; /* Habilita clics para ir al enlace */
  transition: left 1.0s cubic-bezier(0.16, 1, 0.3, 1), width 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-photo-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
}

.explore-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s ease;
}

.explore-photo-item.active img {
  transform: scale(1.03);
}

.explore-photo-item .photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

/* Responsive adjustments for Explore Showcase */
@media (max-width: 1024px) {
  .explore-scroll-container {
    height: auto;
  }
  .explore-sticky-wrapper {
    position: relative;
    height: auto;
    overflow: visible;
    flex-direction: column;
    padding-top: calc(var(--header-height) + 1rem);
    padding-bottom: 3rem;
  }
  .explore-internal-header {
    left: 2rem;
    right: 2rem;
  }
  .explore-left-area {
    width: 100%;
    padding: 2rem 2rem 1rem 2rem;
    gap: 1.5rem;
    opacity: 1 !important;
    transform: none !important;
  }
  .explore-center-area {
    width: 100%;
    padding: 2rem;
    border-left: none;
    border-top: 1px solid var(--line-color-soft);
    border-bottom: 1px solid var(--line-color-soft);
    gap: 2rem;
    opacity: 1 !important;
    transform: none !important;
  }
  .explore-featured-list {
    margin-top: 1rem;
    gap: 1rem;
  }
  .explore-photo-slider {
    position: relative;
    width: 100%;
    height: 55vh;
    order: -1; /* Muestra las imágenes en la parte superior en móviles */
    pointer-events: auto;
  }
  .explore-photo-item {
    top: 0;
    left: 0 !important;
    width: 100% !important;
    height: 100%;
    transform: none !important;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .explore-photo-item.active {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .explore-internal-header {
    display: none;
  }
  .explore-left-area {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  }
  .explore-center-area {
    padding: 1.5rem;
  }
  .featured-name-item {
    font-size: 1.5rem;
  }
  .explore-photo-slider {
    height: 40vh;
  }
}

/* ==========================================================================
   SECTIONS GENERAL
   ========================================================================== */

.section-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 4rem;
}

.section-header-block {
  margin-bottom: 4rem;
  border-bottom: 1px solid var(--line-color-soft);
  padding-bottom: 1.5rem;
}

.section-large-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}

/* ==========================================================================
   TRABAJOS SECTION (Projects List + Filtering)
   ========================================================================== */

.trabajos-section {
  padding: 3rem 0 8rem 0;
  border-bottom: 1px solid var(--line-color-soft);
}

.trabajos-filters-horizontal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1.5px solid var(--line-color);
  border-bottom: 1.5px solid var(--line-color);
  padding: 1.2rem 0;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.filter-group.years {
  font-family: var(--font-sans);
}

.filter-group.categories {
  font-family: var(--font-mono);
}

.filter-divider-dot {
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.15s ease;
  text-transform: uppercase;
}

.filter-btn:hover {
  color: var(--text-primary);
}

/* Category Toggles as tag/box style */
.filter-btn.category-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: -0.01em;
  border: 1px solid var(--line-color-soft);
  padding: 6px 14px;
  background-color: transparent;
  transition: border-color 0.35s cubic-bezier(0.25, 1, 0.5, 1), color 0.35s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.filter-btn.category-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background-color: rgba(var(--accent-red-rgb), 0.04);
}

.filter-btn.category-btn.active {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff !important;
}

/* Year buttons: large, bold, text-only with active underline trace */
.filter-btn.year-btn {
  font-size: 1.15rem;
  font-weight: 700;
  background: none;
  border: none;
}

.filter-btn.year-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.filter-btn.year-btn.active {
  color: var(--accent-red);
  font-weight: 700;
}

.filter-btn.year-btn.active::after {
  transform: scaleX(1);
}

@media (max-width: 900px) {
  .trabajos-filters-horizontal {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }
  .filter-divider-dot {
    display: none;
  }
  .filter-group.categories {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
}

/* View Selector Block (matches reference image) */
.view-selector-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 3rem;
  align-items: flex-start;
}

.view-selector-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 0.4rem;
}

.view-toggle-group {
  display: flex;
  gap: 0.6rem;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.view-btn.active {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary) !important;
}

.view-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: var(--transition-fast);
}

.view-btn.active .view-icon {
  stroke: var(--accent-red);
}

.view-btn.active .view-icon rect {
  fill: var(--accent-red) !important;
  stroke: var(--accent-red) !important;
}

.view-btn.active .view-icon line {
  stroke: var(--accent-red) !important;
}

/* Dark theme specific active background pill adjustments */
[data-theme="dark"] .view-btn.active {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .view-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   CONNECTIVE SKILLS SECTION (Scroll-driven path)
   ========================================================================== */
.skills-path-section {
  position: relative;
  min-height: 180vh;
  padding: 8rem 0 0 0;
  overflow: hidden;
  background-color: var(--bg-primary);
  /* Technical Grid Background */
  background-image: 
    linear-gradient(var(--line-color-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-color-soft) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center;
}

[data-theme="light"] .skills-path-section {
  background-color: hsl(0, 0%, 93%);
  /* Soft opacity for grid in light mode */
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
}

[data-theme="dark"] .skills-path-section {
  background-color: var(--bg-primary);
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.skills-path-container {
  max-width: var(--container-max-width);
  height: 1500px;
  margin: 0 auto;
  position: relative;
  padding: 0 4rem;
}

.skills-connector-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.skills-track-path {
  fill: none;
  stroke: var(--line-color-soft);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
}

[data-theme="dark"] .skills-track-path {
  stroke: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.skills-active-path {
  fill: none;
  stroke: var(--accent-red);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent-red));
  transition: stroke-dashoffset 0.1s linear;
}

/* Skill Nodes */
.skill-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 10;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-node-icon {
  width: 65px;
  height: 65px;
  background-color: var(--bg-primary);
  border: 2px solid var(--line-color);
  box-shadow: 4px 4px 0px var(--line-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.skill-node-icon svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

/* Active Node State */
.skill-node.active {
  transform: translate(-50%, -50%) scale(1.15);
}

.skill-node.active .skill-node-icon {
  background-color: var(--accent-red);
  color: #ffffff;
  border-color: var(--line-color);
  box-shadow: 6px 6px 0px var(--line-color);
}

.skill-node:hover .skill-node-icon svg {
  transform: rotate(8deg) scale(1.1);
}

/* Brutalist Tooltips */
.skill-node-tooltip {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--line-color);
  color: var(--bg-primary);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 4px;
  border: 1.5px solid var(--line-color);
  box-shadow: 4px 4px 0px var(--accent-red);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 20;
}

[data-theme="light"] .skill-node-tooltip {
  background-color: var(--line-color);
  color: #ffffff;
}

[data-theme="dark"] .skill-node-tooltip {
  background-color: var(--line-color);
  color: var(--bg-primary);
  border-color: var(--line-color);
}

.skill-node.active .skill-node-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .skills-path-section {
    min-height: 100vh;
    padding: 6rem 0 0 0;
  }
  
  .skills-path-container {
    height: 800px;
    padding: 0 2rem;
  }
  
  .skill-node-icon {
    width: 55px;
    height: 55px;
  }
  
  .skill-node-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .skill-node-tooltip {
    font-size: 0.65rem;
    padding: 0.5rem 1rem;
    bottom: 70px;
  }
}

@media (max-width: 768px) {
  /* On very small devices, keep it static but visually connecting */
  .skills-path-section {
    min-height: auto;
    padding: 4rem 0;
  }
  
  .skills-path-container {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 0 1.5rem;
  }
  
  .skills-connector-svg {
    display: none;
  }
  
  .skill-node {
    position: static !important;
    transform: none !important;
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  
  .skill-node-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    box-shadow: 3px 3px 0px var(--line-color);
  }
  
  .skill-node-tooltip {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    white-space: normal !important;
    box-shadow: 3px 3px 0px var(--accent-red) !important;
    width: 100%;
  }
  
  .skill-node.active .skill-node-icon {
    box-shadow: 4px 4px 0px var(--line-color) !important;
  }
}

/* Section Connector SVG Styles */
.section-connector-wrapper {
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: calc(100% + 4px);
  pointer-events: none;
  z-index: 10;
}

.section-connector-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.connector-track-path {
  fill: none;
  stroke: var(--line-color-soft);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
}

[data-theme="dark"] .connector-track-path {
  stroke: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.connector-active-path {
  fill: none;
  stroke: var(--accent-red);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent-red));
  transition: stroke-dashoffset 0.1s linear;
}

/* Ensure relative positioning for sections to anchor absolute SVG lines */
.trabajos-section,
.quote-section,
.sobremi-section,
.contacto-section {
  position: relative !important;
}

@media (max-width: 768px) {
  .section-connector-wrapper {
    display: none !important;
  }
}

/* Projects Table/List */
.projects-list-container {
  border-top: 1.5px solid var(--line-color);
}

.project-card-img-wrapper {
  display: none;
}

.project-row {
  display: grid;
  grid-template-columns: 0.8fr 1.8fr 1.2fr 0.4fr;
  align-items: center;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line-color-soft);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.project-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: -20px;
  width: calc(100% + 40px);
  height: 100%;
  background-color: rgba(var(--accent-red-rgb), 0.02);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
}

.project-row:hover::before {
  transform: scaleY(1);
}

.project-row:hover {
  border-bottom-color: var(--accent-red);
  padding-left: 1rem;
}

.project-row:hover .project-row-title {
  color: var(--accent-red);
  transform: translateX(5px);
}

.project-row-year {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.project-row:hover .project-row-year {
  color: var(--text-primary);
}

.project-row-title {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.03em;
  transition: color 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-row-category {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-row-arrow {
  font-size: 1.2rem;
  text-align: right;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.project-row:hover .project-row-arrow {
  color: var(--accent-red);
  transform: translate(5px, -2px);
}

/* Grid View styling */
.projects-list.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  border-top: none;
  padding-top: 1rem;
}

.projects-list.view-grid .project-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1.5rem;
  border: 1px solid var(--line-color-soft);
  background-color: var(--card-bg);
  transition: var(--transition-smooth);
  position: relative;
}

.projects-list.view-grid .project-row::before {
  display: none;
}

.projects-list.view-grid .project-row:hover {
  border-color: var(--accent-red);
  transform: translateY(-6px);
  padding-left: 1.5rem;
}

.projects-list.view-grid .project-card-img-wrapper {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
  background-color: var(--bg-secondary);
}

.projects-list.view-grid .project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.projects-list.view-grid .project-row:hover .project-card-img {
  transform: scale(1.04);
}

.projects-list.view-grid .project-row-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.projects-list.view-grid .project-row-title {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  text-transform: none;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.projects-list.view-grid .project-row-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.projects-list.view-grid .project-row-arrow {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 1.1rem;
  z-index: 5;
}

/* Projects Hover Preview Window */
.project-hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 95;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line-color);
}

.project-hover-preview.active {
  opacity: 1;
  transform: scale(1);
}

.preview-inner {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: var(--bg-secondary);
}

.preview-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-year {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: var(--accent-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 6px;
  font-weight: 700;
}

/* ==========================================================================
   PROJECT DETAILS MODAL
   ========================================================================== */

.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  max-height: 92vh;
  background-color: var(--bg-primary);
  border: 1.5px solid var(--line-color);
  z-index: 2;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.project-modal.active .modal-content {
  transform: translateY(0) scale(1);
}

/* Landscape / Stacked layout overrides for wide assets */
.modal-content.layout-landscape {
  overflow-y: auto;
}

.modal-content.layout-landscape .modal-body-grid {
  grid-template-columns: 1fr;
}

.modal-content.layout-landscape .modal-image-area {
  border-right: none;
  border-bottom: 1.5px solid var(--line-color);
  padding: 0;
  height: auto;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
}

.modal-content.layout-landscape .modal-gallery {
  width: 100%;
  height: auto;
  display: block;
}

.modal-content.layout-landscape .gallery-slide img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.modal-content.layout-landscape .modal-info-area {
  padding: 3rem;
  max-height: none;
  overflow-y: visible;
}

.modal-close {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--line-color-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close span {
  width: 16px;
  height: 1.5px;
  background-color: var(--text-primary);
  display: block;
  transition: var(--transition-fast);
}

.modal-close span:first-child {
  transform: translateY(1px) rotate(45deg);
}

.modal-close span:last-child {
  transform: translateY(-0.5px) rotate(-45deg);
}

.modal-close:hover {
  border-color: var(--accent-red);
  transform: rotate(90deg);
}

.modal-close:hover span {
  background-color: var(--accent-red);
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-image-area {
  background-color: var(--bg-secondary);
  border-right: 1.5px solid var(--line-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.modal-gallery {
  width: 100%;
  position: relative;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

.gallery-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 1.5px solid var(--line-color);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition-fast);
  opacity: 0.7;
}

.gallery-nav:hover {
  opacity: 1;
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.gallery-nav svg {
  width: 18px;
  height: 18px;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  border: 1px solid var(--line-color);
  padding: 0.2rem 0.8rem;
  border-radius: 100px;
  z-index: 10;
  letter-spacing: 0.1em;
}

.modal-info-area {
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-red);
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: none;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-features {
  border-top: 1px solid var(--line-color-soft);
  padding-top: 1.5rem;
}

.modal-features h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.modal-features ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-features li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.2rem;
}

.modal-features li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-size: 0.75rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--line-color-soft);
  padding: 4px 8px;
  color: var(--text-secondary);
}

.modal-actions {
  margin-top: 1rem;
}

.modal-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background-color: var(--accent-red);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 1rem 2rem;
  transition: var(--transition-fast);
  border: 1px solid var(--accent-red);
}

.modal-btn-primary:hover {
  background-color: transparent;
  color: var(--accent-red);
}

.modal-btn-primary svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.modal-btn-primary:hover svg {
  transform: translate(3px, -3px);
}

@media (max-width: 768px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-image-area {
    height: 250px;
    border-right: none;
    border-bottom: 1.5px solid var(--line-color);
  }

  .gallery-nav {
    width: 32px;
    height: 32px;
  }

  .gallery-nav svg {
    width: 14px;
    height: 14px;
  }

  .gallery-prev { left: 8px; }
  .gallery-next { right: 8px; }

  .gallery-counter {
    font-size: 0.65rem;
    padding: 0.15rem 0.6rem;
    bottom: 8px;
  }
  
  .modal-info-area {
    padding: 2rem;
  }
}

/* ==========================================================================
   QUOTE SECTION (Philosophy Statement)
   ========================================================================== */

.quote-section {
  padding: 10rem 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--line-color-soft);
  transition: background-color 0.5s ease;
}

.manifesto-quote {
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--text-primary);
  max-width: 1100px;
}

/* ==========================================================================
   SOBRE MÍ ACCORDION STYLES
   ========================================================================== */

.sobremi-item {
  border-bottom: 1.5px solid var(--line-color);
  transition: var(--transition-smooth);
}

.sobremi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.2rem 0;
  cursor: pointer;
}

.sobremi-index {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-red);
  font-weight: 700;
  width: 100px;
}

.sobremi-title {
  font-size: clamp(1.3rem, 2.5vw, 2.2rem);
  font-weight: 700;
  flex-grow: 1;
  text-align: left;
  letter-spacing: -0.03em;
  transition: color 0.35s cubic-bezier(0.25, 1, 0.5, 1), padding-left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.sobremi-toggle-btn {
  background: none;
  border: 1px solid var(--line-color-soft);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.sobremi-toggle-btn .toggle-icon {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.sobremi-item:hover .sobremi-title {
  color: var(--accent-red);
  padding-left: 0.5rem;
}

.sobremi-item:hover .sobremi-toggle-btn {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Accordion Active State */
.sobremi-item.active {
  background-color: rgba(var(--accent-red-rgb), 0.015);
}

.sobremi-item.active .sobremi-toggle-btn {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.sobremi-item.active .toggle-icon {
  transform: rotate(45deg);
}

.sobremi-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding-bottom 0.4s ease;
  padding-left: 100px;
  padding-right: 44px;
}

.sobremi-item.active .sobremi-body {
  padding-bottom: 2.5rem;
}

.sobremi-body p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 700px;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.sobremi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sobremi-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--line-color-soft);
  padding: 4px 10px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .sobremi-header {
    padding: 1.8rem 0;
  }
  
  .sobremi-index {
    width: 60px;
  }
  
  .sobremi-body {
    padding-left: 60px;
    padding-right: 0;
  }
}

/* ==========================================================================
   SOBRE MÍ SECTION (Accordion Format)
   ========================================================================== */

.sobremi-section {
  padding: 8rem 0;
  border-bottom: 1px solid var(--line-color-soft);
}

.sobremi-grid-accordion {
  border-top: 1.5px solid var(--line-color);
  margin-top: 1rem;
}

/* Estudios Timeline inside Sobre Mí Accordion */
.estudios-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  max-width: 700px;
  padding: 0.5rem 0;
}

.estudio-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: baseline;
  gap: 2rem;
  border-bottom: 1px dashed var(--line-color-soft);
  padding-bottom: 1.2rem;
}

.estudio-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.estudio-institution {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-red);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.estudio-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.estudio-degree {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.estudio-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .estudio-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   CONTACTO SECTION (Minimal Form + Float labels)
   ========================================================================== */

.contacto-section {
  padding: 8rem 0;
  border-bottom: 1px solid var(--line-color-soft);
}

.contacto-large-title {
  font-size: clamp(2.2rem, 5.2vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  line-height: 1.1;
  max-width: 100%;
}

.contacto-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr; /* Left (text) is wider than right (channels) */
  gap: 6rem;
  align-items: center;
}

.contacto-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

/* Contact channels */
.contact-channels-list {
  display: flex;
  flex-direction: column;
  border-top: 1.5px solid var(--line-color);
}

.channel-item {
  display: grid;
  grid-template-columns: 0.8fr 1.8fr 0.4fr;
  align-items: center;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line-color-soft);
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
  position: relative; /* Anchor for floating preview cards */
}

.channel-item:hover {
  border-bottom-color: var(--accent-red);
  padding-left: 0.5rem;
}

.channel-item:hover .channel-value {
  color: var(--accent-red);
}

.channel-item:hover .channel-arrow {
  color: var(--accent-red);
  transform: translate(3px, -3px);
}

/* Premium Floating Link Previews */
.channel-preview-card {
  position: absolute;
  bottom: 110%; /* Place above the item */
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.95);
  width: 290px;
  background: var(--card-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-color-soft);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: left;
}

/* Arrow indicator for preview card */
.channel-preview-card::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--line-color-soft);
  z-index: 101;
}

.channel-preview-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-1px);
  border: 6px solid transparent;
  border-top-color: var(--bg-primary); /* Matches theme background */
  z-index: 102;
}

/* Hover reveal trigger */
.channel-item:hover .channel-preview-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Header style inside preview card */
.preview-card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.preview-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--line-color);
  background-color: var(--bg-primary);
}

.preview-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.active-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #10b981; /* Green dot for active */
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
}

.preview-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--accent-red-rgb), 0.08);
  color: var(--accent-red);
  border: 1px solid var(--line-color-soft);
}

.linkedin-icon {
  background-color: rgba(10, 102, 194, 0.08);
  color: #0a66c2;
}

.figma-icon {
  background-color: rgba(242, 78, 30, 0.08);
  color: #f24e1e;
}

.instagram-icon {
  background-color: rgba(225, 48, 108, 0.08);
  color: #e1306c;
}

.preview-logo {
  width: 22px;
  height: 22px;
}

.preview-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.preview-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.preview-subtitle {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.preview-card-divider {
  height: 1px;
  background-color: var(--line-color-soft);
  width: 100%;
}

.preview-card-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.text-accent {
  color: var(--accent-red);
}

.preview-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.preview-card-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line-color-soft);
  transition: transform 0.2s ease;
}

.preview-card-grid img:hover {
  transform: scale(1.05);
}

/* Hide preview cards on mobile/tablets to prevent touch-clashing and layout issues */
@media (max-width: 1024px) {
  .channel-preview-card {
    display: none !important;
  }
}

.channel-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.channel-value {
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-block;
}

.channel-arrow {
  font-size: 1.1rem;
  text-align: right;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

/* Contact form */
.contacto-form-wrapper {
  position: relative;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.form-row {
  position: relative;
}

.input-group {
  position: relative;
  width: 100%;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 0.8rem 0;
  background: none;
  border: none;
  border-bottom: 1.5px solid var(--line-color-soft);
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  resize: none;
}

.input-group label {
  position: absolute;
  top: 0.8rem;
  left: 0;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

/* Focus and input value styling */
.input-group input:focus,
.input-group textarea:focus {
  border-bottom-color: var(--accent-red);
}

.input-group input:focus ~ label,
.input-group textarea:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
  top: -1.2rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-red);
  text-transform: uppercase;
}

/* Underline Animation on Focus */
.input-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--accent-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.input-group input:focus ~ .input-line,
.input-group textarea:focus ~ .input-line {
  transform: scaleX(1);
  transform-origin: left;
}

/* Submit Button */
.submit-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--line-color);
  color: var(--bg-primary);
  border: 1px solid var(--line-color);
  padding: 1.2rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.submit-btn:hover {
  background-color: transparent;
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.submit-btn .btn-arrow {
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.submit-btn:hover .btn-arrow {
  transform: translateX(6px);
}

.submit-btn.connected {
  background-color: transparent !important;
  color: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 15px rgba(var(--accent-red-rgb), 0.5), 
              0 0 30px rgba(var(--accent-red-rgb), 0.2),
              inset 0 0 10px rgba(var(--accent-red-rgb), 0.2) !important;
}

/* Form Success Toast Notification */
.form-toast {
  position: absolute;
  bottom: -70px;
  left: 0;
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--accent-red);
  padding: 1rem 1.5rem;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.form-toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--accent-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.toast-message {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* ==========================================================================
   MAIN FOOTER
   ========================================================================== */

.main-footer {
  padding: 4rem 0;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--line-color-soft);
  transition: background-color 0.5s ease;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.credit-accent {
  color: var(--accent-red);
  font-weight: 700;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
}

/* ==========================================================================
   UTILITY & RESPONSIVE PADDINGS
   ========================================================================== */

@media (max-width: 1024px) {
  .header-container,
  .hero-section,
  .section-container,
  .footer-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .scroll-prompt {
    left: 2rem;
  }
  
  .hero-main-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .hero-title {
    font-size: clamp(3.5rem, 11vw, 6.5rem);
  }
  
  .hero-details-area {
    gap: 2.5rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  
  .main-nav {
    display: none; /* Hide desktop nav on small mobile - could implement mobile hamburger if needed, but simplicity fits the Swiss style */
  }
  
  .header-container,
  .hero-section,
  .section-container,
  .footer-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .scroll-prompt {
    left: 1.5rem;
  }
  
  .hero-title {
    font-size: 3.2rem;
  }
  
  .project-row {
    grid-template-columns: 1.8fr 1fr;
    padding: 1.5rem 0;
  }
  
  .project-row-year {
    display: none; /* Hide year in mobile grid to save space */
  }
  
  .project-row-category {
    display: none;
  }
  
  .channel-item {
    grid-template-columns: 1fr 1fr;
  }
  
  .channel-value {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   PROJECT DETAILS PAGE (proyecto.html)
   ========================================================================== */
.proyecto-detalle-page {
  padding-top: 10rem;
  padding-bottom: 8rem;
  min-height: 80vh;
  position: relative;
}

.project-page-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 4rem;
}

.back-link-wrapper {
  margin-bottom: 4rem;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.15s ease;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.back-link:hover {
  color: var(--accent-red);
}

.back-link:hover .back-arrow {
  transform: translateX(-4px);
}

.back-arrow {
  font-size: 1.1rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
  line-height: 1;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8rem;
}

.project-sticky-info {
  position: sticky;
  top: 8rem;
  align-self: start;
  z-index: 10;
}

.project-sticky-info.has-left-gallery {
  position: relative;
  top: auto;
}

.project-left-gallery {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.project-meta-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-red);
  font-weight: 700;
  display: block;
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}

.project-main-title {
  font-size: clamp(2.5rem, 4.5vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: none;
  line-height: 1.05;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.project-detail-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 3.5rem;
}

.project-detail-features {
  display: none !important;
}

.project-detail-tags {
  display: none !important;
}

.project-detail-features h2,
.project-detail-tags h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.features-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.features-ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.features-ul li::before {
  content: '✕';
  position: absolute;
  left: 0;
  top: 3px;
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 700;
}

.tags-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.proj-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--line-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
  transition: var(--transition-fast);
}

.proj-tag:hover {
  border-color: var(--accent-red);
  color: var(--text-primary);
}

.project-gallery-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gallery-img-container {
  width: 100%;
  border: none;
  overflow: hidden;
  background-color: var(--bg-secondary);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.gallery-img-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-img-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-img-container:hover img {
  transform: scale(1.02);
}

/* Specific styling for the first square logo representation */
.gallery-img-container.first-square-logo {
  aspect-ratio: 1 / 1;
  max-width: 550px;
  margin: 0 auto;
  border-radius: 8px;
}

.gallery-img-container.first-square-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2rem;
}

/* Responsiveness for Project Detail */
@media (max-width: 1024px) {
  .project-detail-grid {
    gap: 4rem;
  }
}

@media (max-width: 992px) {
  .proyecto-detalle-page {
    padding-top: 8rem;
  }
  
  .project-detail-grid {
    grid-template-columns: 1fr;
    gap: 5rem;
  }
  
  .project-sticky-info {
    position: static;
  }
  
  .back-link-wrapper {
    margin-bottom: 3rem;
  }

  .gallery-img-container.first-square-logo {
    max-width: 100%;
  }
}

/* Lazy Video Player Styles */
.gallery-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
  border: 1.5px solid var(--line-color);
  margin-bottom: 2rem;
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px;
}

.gallery-video-container img.video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.gallery-video-container:hover img.video-poster {
  transform: scale(1.02);
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease;
}

.gallery-video-container:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.video-play-btn {
  background: var(--accent-red);
  border: none;
  color: white;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease;
}

.video-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.gallery-video-container:hover .video-play-btn {
  transform: scale(1.1);
  background-color: var(--accent-red-hover);
}

.gallery-video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  border-radius: 8px;
}

/* Fullscreen Video Case Study Layout */
body.has-fullscreen-video {
  overflow-y: auto;
}

body.has-fullscreen-video .gallery-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: none;
  border-radius: 0;
  z-index: 5;
  background: #000;
  pointer-events: auto;
}

body.has-fullscreen-video .gallery-video-container img.video-poster,
body.has-fullscreen-video .gallery-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

body.has-fullscreen-video .back-link-wrapper {
  display: none !important; /* Hide original top-left link since it is now inside the card */
}

body.has-fullscreen-video .project-sticky-info {
  z-index: 150;
  background: var(--card-bg-glass);
  border: 1.5px solid var(--line-color);
  border-radius: 12px;
  padding: 2.2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 993px) {
  body.has-fullscreen-video .project-sticky-info {
    position: fixed;
    top: 8rem;
    left: 4rem;
    width: 460px;
    max-width: calc(50% - 6rem);
  }
  
  body.has-fullscreen-video .project-detail-grid {
    display: flex;
    justify-content: flex-end;
    position: relative;
  }
  
  body.has-fullscreen-video .project-sticky-info.at-bottom {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
  }
  
  body.has-fullscreen-video .project-gallery-area {
    width: 100%;
    max-width: calc(100% - 500px);
    align-items: flex-end;
  }
}

@media (min-width: 1528px) {
  body.has-fullscreen-video .project-sticky-info {
    left: calc((100vw - 1400px) / 2 + 4rem);
  }
}

body.has-fullscreen-video .project-main-title {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  margin-bottom: 0.8rem;
  line-height: 1.15;
}

body.has-fullscreen-video .project-detail-description {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* Card Back Link styling - hidden by default, visible on video pages */
.card-back-link {
  display: none !important;
}

body.has-fullscreen-video .card-back-link {
  display: block !important;
  color: var(--text-primary) !important;
  border-top: 1px solid var(--line-color-soft);
  width: 100%;
  padding-top: 1.2rem;
  margin-top: 0.5rem;
}

/* Fade out header and details card when video is playing in fullscreen mode */
body.video-playing.has-fullscreen-video .project-sticky-info,
body.video-playing.has-fullscreen-video .main-header {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  pointer-events: none !important;
}

body.has-fullscreen-video .main-header {
  z-index: 200 !important;
  /* Dark overlay gradient from the top for high contrast header elements */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0) 100%) !important;
  border-bottom: none !important;
  box-shadow: none !important;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Force light colors inside header for contrast in video mode */
body.has-fullscreen-video .main-header .brand-logo-text-scroll,
body.has-fullscreen-video .main-header .logo a,
body.has-fullscreen-video .main-header .nav-link,
body.has-fullscreen-video .main-header .theme-toggle {
  color: #ffffff !important;
}

body.has-fullscreen-video .main-header .nav-link::after {
  background-color: #ffffff !important;
}

[data-theme="dark"] body.has-fullscreen-video .logo-light {
  display: none !important;
}

[data-theme="dark"] body.has-fullscreen-video .logo-dark {
  display: inline-block !important;
}

/* Video Playing Fade-Out States - Removed to keep header & details card visible */

/* Laptop Mockup Styles */
.computer-mockup-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 2rem 0 4rem auto;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.computer-mockup-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.laptop-device {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.laptop-screen {
  width: 92%;
  aspect-ratio: 16 / 10;
  background: #0d0d0d;
  border: 12px solid #1e1e1e;
  border-bottom-width: 18px;
  border-radius: 16px 16px 0 0;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1), 0 15px 35px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

/* Metallic laptop base */
.laptop-keyboard-base {
  width: 100%;
  height: 16px;
  background: linear-gradient(to bottom, #e2e2e2 0%, #b5b5b5 100%);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

[data-theme="dark"] .laptop-keyboard-base {
  background: linear-gradient(to bottom, #444444 0%, #222222 100%);
}

.laptop-keyboard-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4%;
  width: 92%;
  height: 3px;
  background: #0d0d0d;
}

.laptop-keyboard-base::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18%;
  height: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

[data-theme="dark"] .laptop-keyboard-base::after {
  background: rgba(255, 255, 255, 0.1);
}

/* Static nested video container style for mobile/tablet */
body.has-fullscreen-video .laptop-screen .gallery-video-container,
body.has-fullscreen-video .tablet-screen .gallery-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  z-index: 1;
}

/* Tablet Mockup Styles */
.tablet-mockup-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 2rem 0 4rem auto;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.tablet-mockup-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.tablet-device.portrait {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1e1e1e; /* metallic border */
  border: 14px solid #1e1e1e;
  border-radius: 28px;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1), 0 20px 45px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

[data-theme="light"] .tablet-device.portrait {
  background: #e2e2e2;
  border-color: #e2e2e2;
}

.tablet-device.portrait::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #333;
  border-radius: 50%;
  z-index: 2;
}

.tablet-screen {
  width: 100%;
  aspect-ratio: 3 / 4; /* Portrait screen */
  background: #0d0d0d;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

/* Video fullscreen spacer */
.video-fullscreen-spacer {
  height: 75vh;
  width: 100%;
}

/* ==========================================================================
   3D INTERACTIVE FLIPBOOK STYLES
   ========================================================================== */
.flipbook-container {
  width: 100%;
  margin: 1.5rem auto 3rem auto;
}

.flipbook-desktop-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
}

.book-viewport {
  width: 100%;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1800px; /* Essential depth for 3D page flip */
}

.book-3d {
  width: 720px; /* Spread width (double page width) */
  height: 470px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

.book-sheet {
  position: absolute;
  width: 50%; /* Holds a single page */
  height: 100%;
  top: 0;
  left: 50%; /* Anchors left edge to the center spine */
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.25, 1, 0.3, 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.book-sheet.flipped {
  transform: rotateY(-180deg);
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--line-color-soft);
  overflow: hidden;
}

.page-front {
  z-index: 2;
  transform: rotateY(0deg);
  border-radius: 0 6px 6px 0;
}

.page-back {
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
}

/* Visibility toggles to resolve backface visibility rendering issues in some browsers */
.book-sheet .page-back {
  visibility: hidden;
}

.book-sheet.flipped .page-back {
  visibility: visible;
}

.book-sheet .page-front {
  visibility: visible;
}

.book-sheet.flipped .page-front {
  visibility: hidden;
}

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

/* Split Page Styles for Editorial Spreads */
.editorial-book .page-front img {
  width: 200% !important;
  height: 100% !important;
  object-fit: fill !important;
  position: absolute !important;
  left: -100% !important;
  top: 0 !important;
}

.editorial-book .page-back img {
  width: 200% !important;
  height: 100% !important;
  object-fit: fill !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
}

.page-blank {
  width: 100%;
  height: 100%;
  background-color: var(--bg-secondary);
}

/* Gutter shadow overlay for realistic 3D folding illusion */
.page-front::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 5;
}

.page-back::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 25px;
  height: 100%;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 5;
}

/* Flipbook Controls */
.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

.flipbook-btn {
  background: var(--bg-primary);
  border: 1.5px solid var(--line-color);
  color: var(--text-primary);
  padding: 0.6rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: 4px;
  box-shadow: 3.5px 3.5px 0 var(--line-color);
}

.flipbook-btn:hover:not(:disabled) {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--line-color);
  box-shadow: 3.5px 3.5px 0 var(--line-color);
}

.flipbook-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.flipbook-progress-track {
  width: 320px;
  height: 4px;
  background-color: var(--line-color-soft);
  border-radius: 2px;
  margin-bottom: -0.5rem;
  cursor: pointer;
  position: relative;
}

/* Invisible hit area expansion to make clicking and dragging easier */
.flipbook-progress-track::after {
  content: '';
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: 0;
  right: 0;
  z-index: 10;
  cursor: pointer;
}

.flipbook-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-red);
  transition: width 0.6s cubic-bezier(0.25, 1, 0.3, 1);
  border-radius: 2px;
  pointer-events: none;
}

/* Closed book layout helper styles */
.editorial-book.closed-front {
  box-shadow: none !important;
}

.editorial-book.closed-front #sheet-1 .page-front {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.editorial-book.closed-front .page-back {
  display: none !important;
}

.editorial-book.closed-front .book-sheet:not(#sheet-1) {
  display: none !important;
}

.editorial-book.closed-back {
  box-shadow: none !important;
}

.editorial-book.closed-back .book-sheet:last-child .page-back {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.editorial-book.closed-back .page-front {
  display: none !important;
}

.editorial-book.closed-back .book-sheet:not(:last-child) {
  display: none !important;
}

.flipbook-progress {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  min-width: 120px;
  text-align: center;
}

.flipbook-mobile-view {
  display: none;
}

/* Mobile Split Page Layout */
.mobile-page-container {
  position: relative;
  width: 100%;
  aspect-ratio: 0.778;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--line-color-soft);
}

.mobile-page-container img {
  width: 200% !important;
  height: 100% !important;
  object-fit: fill !important;
  position: absolute !important;
  top: 0 !important;
}

.left-page-container img {
  left: 0 !important;
}

.right-page-container img {
  left: -100% !important;
}

/* Responsive Scaling for Flipbook Mockup */
@media (max-width: 1024px) {
  .book-viewport {
    height: 420px;
  }
  
  .book-3d {
    width: 560px;
    height: 370px;
  }
}

@media (max-width: 768px) {
  .flipbook-desktop-view {
    display: none;
  }
  
  .flipbook-mobile-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
  }
}

/* Bento Grid Gallery for Video Projects */
.bento-grid-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 240px;
  gap: 1.5rem;
  margin-top: 6rem;
  margin-bottom: 4rem;
  width: 100%;
}

.bento-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background-color: var(--card-bg);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.bento-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.bento-item:hover img {
  transform: scale(1.04);
}

/* Bento grid items layout */
.bento-item:nth-child(1) {
  grid-column: span 4;
  grid-row: span 2;
}

.bento-item:nth-child(2) {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-item:nth-child(3) {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-item:nth-child(4) {
  grid-column: span 6;
  grid-row: span 2;
}

@media (max-width: 1024px) {
  .bento-grid-gallery {
    padding: 0 2rem;
  }
}

@media (max-width: 768px) {
  .bento-grid-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 1rem;
    margin-top: 2rem;
  }
  .bento-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    aspect-ratio: 16/10;
  }
}

/* Lightbox Modal for Gallery Images */
.project-lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 3rem;
  color: #fff;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--accent-red);
  transform: scale(1.1);
}

.lightbox-caption {
  position: absolute;
  bottom: 2rem;
  color: #ccc;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
  padding: 0 2rem;
}

/* Linktree Icon Custom Color Styling */
.linktree-icon {
  background-color: rgba(57, 224, 155, 0.08) !important;
  color: #39e09b !important;
}

/* Contact Form Modal Styles */
.contact-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4); /* subtle dark dim */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* stays on top of everything */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.contact-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.contact-modal-card {
  width: 90%;
  max-width: 500px;
  background: var(--card-bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--line-color);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

.contact-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  border-radius: 50%;
  border: 1px solid transparent;
}

.contact-modal-close:hover {
  border-color: var(--line-color-soft);
  background: rgba(var(--accent-red-rgb), 0.05);
  color: var(--accent-red);
}

.contact-modal-close svg {
  width: 18px;
  height: 18px;
}

.contact-modal-title {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 2rem;
  color: var(--text-primary);
  border-left: 4px solid var(--accent-red);
  padding-left: 0.8rem;
  line-height: 1.1;
}

/* Premium Full-Overlay Success Toast inside Modal */
.contact-modal-card .form-toast {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  border: none;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  transform: none; /* remove transition */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  z-index: 50;
  box-sizing: border-box;
}

.contact-modal-card .form-toast.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Modal open body lock */
body.modal-open {
  overflow: hidden !important;
}

/* ==========================================================================
   26. Figma Prototypes Page Styles
   ========================================================================== */
.prototipos-page {
  padding-top: 100px;
  padding-bottom: 80px;
  min-height: 100vh;
  box-sizing: border-box;
}

.prototypes-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.prototypes-header {
  margin-top: 2rem;
  margin-bottom: 4rem;
  text-align: center;
}

.prototypes-meta-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 1rem;
}

.prototypes-title {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1.5rem 0;
}

.prototypes-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

/* Grid Layout for Prototypes */
.prototypes-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4.5rem;
  margin-top: 2rem;
  margin-bottom: 6rem;
}

.proto-grid-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.proto-grid-card:hover .device-mockup-link {
  transform: translateY(-6px);
}

.proto-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.proto-card-title {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.proto-card-tagline {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-red);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.proto-card-desc {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}



/* Right Mockup Panel */
.prototype-mockup-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 120px;
}

.device-mockup {
  width: 100%;
  background-color: #080808;
  border: 12px solid #1c1c1c;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  position: relative;
}

.tablet-device {
  border-radius: 32px;
  aspect-ratio: 4 / 3;
  padding: 0;
}

.tablet-device .device-header {
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: -24px;
  left: 0;
  width: 100%;
  z-index: 10;
}

.tablet-device .camera-lens {
  width: 6px;
  height: 6px;
  background-color: #222;
  border-radius: 50%;
}

.tablet-device .device-screen {
  background-color: #000;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.tablet-device .device-home-bar {
  width: 120px;
  height: 4px;
  background-color: #333;
  border-radius: 2px;
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.phone-device {
  border-radius: 36px;
  aspect-ratio: 9 / 18.5;
  max-width: 250px;
  margin: 0 auto;
  border: 10px solid #1c1c1c;
}

.phone-device .device-header {
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
}

.phone-device .camera-lens {
  width: 6px;
  height: 6px;
  background-color: #222;
  border-radius: 50%;
  margin-right: 6px;
}

.phone-device .speaker-grill {
  width: 35px;
  height: 3px;
  background-color: #222;
  border-radius: 1.5px;
}

.phone-device .device-screen {
  background-color: #000;
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
}

.phone-device .device-home-bar {
  width: 90px;
  height: 4px;
  background-color: #333;
  border-radius: 2px;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.desktop-device {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background-color: var(--bg-secondary);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.desktop-device .device-header {
  height: 36px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--line-color-soft);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: relative;
}

.browser-dots {
  display: flex;
  gap: 0.35rem;
  position: absolute;
  left: 1rem;
}

.browser-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.browser-address {
  margin: 0 auto;
  width: 60%;
  height: 22px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--line-color-soft);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-device .device-screen {
  height: calc(100% - 36px);
  position: relative;
  background-color: #000;
}

/* Screen Placement and Loading Button */
.device-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0d0d0d;
}

.screen-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-overlay-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: backdrop-filter 0.3s, background-color 0.3s;
}

.screen-placeholder:hover .screen-overlay-btn {
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
}

.load-proto-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background-color: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.9rem 1.6rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.load-proto-btn:hover {
  background-color: #f24e1e;
  border-color: #f24e1e;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(242, 78, 30, 0.3);
}

.play-icon {
  font-size: 0.95rem;
}

.mockup-caption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  max-width: 90%;
}

/* Media Queries for Prototipos Grid page */
@media (max-width: 900px) {
  .prototypes-grid-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 640px) {
  .prototypes-container {
    padding: 0 1.2rem;
  }
}

.device-mockup-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-mockup-link:hover {
  transform: translateY(-4px);
}
