/* ============================================================
   LESSSO ENHANCED — Cuaderno de bocetos, limpio
   Sistema visual intencional: papel, tinta, respiración
   ============================================================ */
:root {
  --font-display: 'Poppins', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);

  /* Tokens por defecto (Modo Claro) con el color oficial LESSSO #0b282c */
  --paper: #ffffff;
  --paper-warm: #f6f8f8;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --primary: #0b282c;
  --accent: #0b282c;
  --accent-soft: rgba(11, 40, 44, 0.08);
  --header-bg: rgba(255, 255, 255, 0.92);
  --line: #e2e8f0;
  --shadow: rgba(11, 40, 44, 0.07);
  --text-muted: #64748b;
  color-scheme: light;
}

:root[data-theme="light"],
html[data-theme="light"],
html.light,
body[data-theme="light"],
body.light {
  --paper: #ffffff;
  --paper-warm: #f6f8f8;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --primary: #0b282c;
  --accent: #0b282c;
  --accent-soft: rgba(11, 40, 44, 0.08);
  --header-bg: rgba(255, 255, 255, 0.92);
  --line: #e2e8f0;
  --shadow: rgba(11, 40, 44, 0.07);
  --text-muted: #64748b;
  color-scheme: light;
}

:root[data-theme="dark"],
html[data-theme="dark"],
html.dark,
body[data-theme="dark"],
body.dark {
  --paper: #071315;
  --paper-warm: #0b2024;
  --ink: #f8fafc;
  --ink-soft: #94a3b8;
  --ink-faint: #64748b;
  --primary: #0b282c;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --header-bg: rgba(7, 19, 21, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.45);
  --text-muted: #94a3b8;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.light),
  html:not([data-theme="light"]):not(.light) {
    --paper: #071315;
    --paper-warm: #0b2024;
    --ink: #f8fafc;
    --ink-soft: #94a3b8;
    --ink-faint: #64748b;
    --primary: #0b282c;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --header-bg: rgba(7, 19, 21, 0.92);
    --line: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.45);
    --text-muted: #94a3b8;
    color-scheme: dark;
  }
}

/* ============ BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  line-height: 1.7;
}

/* ============ AMBIENT BACKGROUND GLOW (Sutil y elegante) ============ */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  will-change: transform;
}

body::before {
  top: -10vw;
  right: -5vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.08;
  animation: ambientFloat1 24s ease-in-out infinite alternate;
}

body::after {
  bottom: 5vh;
  left: -8vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.05;
  animation: ambientFloat2 30s ease-in-out infinite alternate;
}

html[data-theme="dark"] body::before,
body[data-theme="dark"]::before { opacity: 0.12; }
html[data-theme="dark"] body::after,
body[data-theme="dark"]::after { opacity: 0.08; }

@keyframes ambientFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3vw, 5vh) scale(1.06); }
  100% { transform: translate(2vw, -3vh) scale(0.96); }
}

@keyframes ambientFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, -4vh) scale(1.08); }
  100% { transform: translate(-2vw, 3vh) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; }
}

::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  overflow: visible;
  padding: 1.1rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(0);
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), padding 0.3s var(--ease);
  will-change: transform;
}

.site-header.header--hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px var(--shadow);
  padding: 0.85rem var(--pad);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand em { color: var(--accent); font-style: normal; }

/* ============ NAV ============ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-links a.nav-cta {
  padding: 0.35rem 0.95rem;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.25s var(--ease);
}

.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.nav-links a.nav-cta::after {
  display: none;
}

.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.85rem 1.25rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    overflow: visible !important;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    background: none;
    border: 1px solid var(--line);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 15%;
    cursor: pointer;
    color: var(--ink);
    transition: all 0.25s var(--ease);
  }

  .nav-toggle:hover {
    background: var(--accent-soft);
  }

  .nav-toggle svg {
    width: 20px;
    height: 20px;
  }

  .nav-toggle .icon-close { display: none; }
  .nav-toggle .icon-menu { display: block; }
  .site-header.is-nav-open .nav-toggle .icon-close { display: block; }
  .site-header.is-nav-open .nav-toggle .icon-menu { display: none; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 36px var(--shadow);
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.35rem;
    animation: navMenuAppear 0.2s var(--ease);
    z-index: 1001;
  }

  @keyframes navMenuAppear {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .site-header.is-nav-open .nav-links {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    border-radius: 8px;
    transition: background 0.2s;
  }

  .nav-links a:hover {
    background: var(--accent-soft);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.nav-cta {
    margin-top: 0.25rem;
    text-align: center;
    background: var(--accent);
    color: var(--paper);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 15%;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  transform: scale(1.05);
}

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

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

html[data-theme="dark"] .theme-toggle .icon-moon,
body[data-theme="dark"] .theme-toggle .icon-moon,
html.dark .theme-toggle .icon-moon,
body.dark .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun,
body[data-theme="dark"] .theme-toggle .icon-sun,
html.dark .theme-toggle .icon-sun,
body.dark .theme-toggle .icon-sun {
  display: block;
}

/* ============ HERO ============ */
.hero {
  min-height: auto;
  display: flex;
  align-items: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

/* Canvas fondo sutil */
#canvas-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.65;
}

.hero-layout {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3.5rem;
}

@media (max-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 680px;
}

/* ============ HERO ROADMAP INTERACTIVO 3D ============ */
.hero-roadmap-3d {
  position: relative;
  perspective: 1100px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}

@media (max-width: 960px) {
  .hero-roadmap-3d {
    display: none !important;
  }
}

.roadmap-scene {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transform: rotateX(12deg) rotateY(-14deg) rotateZ(2deg);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
}

.roadmap-scene:hover {
  transform: rotateX(6deg) rotateY(-8deg) rotateZ(1deg);
}

.roadmap-stage-card {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: 0 10px 24px var(--shadow);
  transition: all 0.4s var(--ease);
  transform: translateZ(20px);
}

html[data-theme="dark"] .roadmap-stage-card {
  background: var(--paper-warm);
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.roadmap-stage-card.step-1 { transform: translateZ(40px) translateX(-15px); }
.roadmap-stage-card.step-2 { transform: translateZ(30px) translateX(15px); }
.roadmap-stage-card.step-3 { transform: translateZ(20px) translateX(-10px); }
.roadmap-stage-card.step-4 { transform: translateZ(10px) translateX(10px); }

.stage-pin {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
}

.stage-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: stagePulseAnim 4.8s infinite;
}

.stage-info {
  display: flex;
  flex-direction: column;
}

.stage-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.stage-info h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.stage-detail {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.roadmap-connector-3d {
  width: 2px;
  height: 18px;
  margin-left: 28px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  transform: translateZ(15px);
}

.connector-beam {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: beamTravelAnim 4.8s infinite;
}

.step-1 .stage-pulse { animation-delay: 0s; }
.connector-1-2 .connector-beam { animation-delay: 0.6s; }

.step-2 .stage-pulse { animation-delay: 1.2s; }
.connector-2-3 .connector-beam { animation-delay: 1.8s; }

.step-3 .stage-pulse { animation-delay: 2.4s; }
.connector-3-4 .connector-beam { animation-delay: 3.0s; }

.step-4 .stage-pulse { animation-delay: 3.6s; }

@keyframes stagePulseAnim {
  0%, 15% {
    opacity: 0.9;
    transform: scale(1.15);
  }
  30%, 100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes beamTravelAnim {
  0% {
    top: -100%;
    opacity: 0;
  }
  15% {
    top: 0;
    opacity: 1;
  }
  30% {
    top: 100%;
    opacity: 0;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(-8deg);
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 11vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

/* Underline ondulante */
.underline {
  position: relative;
  display: inline-block;
  padding-bottom: 0.3em;
}

.underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 3"><path d="M0 1.5 Q 25 0.2, 50 1.5 T 100 1.5 T 150 1.5 T 200 1.5" stroke="%230b282c" stroke-width="2" fill="none" stroke-linecap="round"/></svg>');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

html[data-theme="dark"] .underline::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 3"><path d="M0 1.5 Q 25 0.2, 50 1.5 T 100 1.5 T 150 1.5 T 200 1.5" stroke="%232dd4bf" stroke-width="2" fill="none" stroke-linecap="round"/></svg>');
}

.hero-desc {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.85rem;
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
  line-height: 1.2;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  z-index: -1;
  transition: left 0.3s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow);
}

.cta:hover::before { left: 0; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.cta--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.cta--ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.cta--block {
  display: inline-flex;
  width: 100%;
  text-align: center;
}

/* ============ SECCIONES ============ */
section {
  padding: 6rem 2rem;
  position: relative;
  z-index: 2;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 2.25rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.3em;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 160px;
  height: 3px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 3"><path d="M0 1.5 Q 18 0.2, 37 1.5 T 75 1.5 T 112 1.5 T 150 1.5" stroke="%230b282c" stroke-width="2" fill="none" stroke-linecap="round"/></svg>');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

html[data-theme="dark"] h2::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 3"><path d="M0 1.5 Q 18 0.2, 37 1.5 T 75 1.5 T 112 1.5 T 150 1.5" stroke="%232dd4bf" stroke-width="2" fill="none" stroke-linecap="round"/></svg>');
}

.section-intro {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 600px;
  line-height: 1.65;
}

/* About Section */
.about-section {
  background: var(--accent-soft);
}

.about-section .section-header {
  margin-bottom: 1.75rem;
}

.about-text {
  max-width: 720px;
}

.about-text p {
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
  line-height: 1.65;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

@media (max-width: 860px) {
  .services-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.25rem;
    padding: 0.5rem 1rem 1.75rem 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .services-grid::-webkit-scrollbar {
    display: none;
  }

  .services-grid .service {
    flex: 0 0 min(82vw, 320px);
    scroll-snap-align: start;
    min-height: 280px;
    display: flex;
    flex-direction: column;
  }
}

.service {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: all 0.3s var(--ease);
  position: relative;
}

.service::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}

.service:hover {
  transform: translateY(-4px);
  border-color: var(--accent-soft);
  box-shadow: 0 8px 16px var(--shadow);
}

.service:hover::before { width: 40px; }

.service-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 6px;
  transition: all 0.3s;
}

.service:hover .service-icon {
  background: var(--accent);
  transform: scale(1.08);
}

.service-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service:hover .service-icon svg { stroke: var(--paper); }

.service h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.service p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.service-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

/* Contact Section */
.contact-section {
  background: var(--accent-soft);
}

/* ============ PROYECTOS (CAROUSEL HORIZONTAL) ============ */
.projects-carousel-wrapper {
  margin-top: 2rem;
  position: relative;
}

.projects-carousel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}

.carousel-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.carousel-arrows {
  display: flex;
  gap: 0.5rem;
}

.carousel-arrow {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.carousel-arrow svg {
  width: 14px;
  height: 14px;
}

.carousel-arrow:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  transform: scale(1.05);
}

.projects-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1.75rem;
  padding: 0.75rem 0.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.projects-grid::-webkit-scrollbar {
  display: none;
}

.project {
  flex: 0 0 clamp(310px, 80vw, 370px);
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.carousel-progress-track {
  width: 140px;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  margin: 1.5rem auto 0.75rem;
  overflow: hidden;
  position: relative;
}

.carousel-progress-bar {
  height: 100%;
  width: 33.33%;
  background: var(--accent);
  border-radius: 4px;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.carousel-dots .dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

.project {
  min-width: min(100%, 360px);
  max-width: 380px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-warm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px var(--shadow);
  border-color: var(--accent);
}

.project-window {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 15%;
  background: var(--line);
}

.window-url {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.15rem 0.5rem;
  background: var(--paper-warm);
  border-radius: 4px;
  border: 1px solid var(--line);
}

.project-preview {
  padding: 1.15rem 1.25rem 0.85rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.preview-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.preview-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 15%;
  background: var(--accent);
}

.preview-stat {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.project-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

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

.project-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.project-body h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0.15rem 0;
}

.project-body p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.6;
  flex: 1;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.2s var(--ease);
}

.project-link:hover {
  gap: 0.6rem;
  text-decoration: underline;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-top: 1rem;
}

.contact-form-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 2.2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .contact-form-card {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.contact-form-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.contact-form-card p.form-subtitle {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-intro {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.contact-email {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s var(--ease);
}

.contact-email:hover {
  opacity: 0.85;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.contact-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.contact-detail-item svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  stroke: var(--accent);
  stroke-width: 2;
  margin-top: 2px;
  flex-shrink: 0;
  display: inline-block;
}

.contact-detail-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.4;
}

.contact-detail-text strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
}

.contact-detail-text span,
.contact-detail-text a {
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.contact-detail-text a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Map Wrapper */
.contact-map-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.map-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  background: var(--paper);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.contact-map {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--paper-warm);
  position: relative;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
  display: block;
}

html[data-theme="dark"] .contact-map iframe {
  filter: contrast(0.95) brightness(0.85) saturate(0.8);
}

.contact-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}

/* ============ SOCIAL LINKS ============ */
.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.social-icon {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink-soft);
  transition: all 0.3s var(--ease);
  background: transparent;
}

.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-3px);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ============ MODAL FORM ============ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--paper);
  padding: 2.5rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s var(--ease);
}

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

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 0.3s;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--ink);
}

.modal h2 {
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

.modal h2::after { display: none; }

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.3s;
}

.phone-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.phone-lada-select {
  flex: 0 0 86px !important;
  width: 86px !important;
  min-width: 86px !important;
  padding: 0.75rem 0.35rem !important;
  padding-right: 1.4rem !important;
  font-size: 0.84rem !important;
  border-radius: 6px !important;
}

.phone-input-row input {
  flex: 1;
  min-width: 0;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.form-label-row label {
  margin-bottom: 0;
}

.char-counter {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.char-counter.counter-limit {
  color: #ef4444;
  font-weight: 600;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2357534e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

html[data-theme="dark"] .form-group select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23a8a29e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
}

.form-group input:not([type="checkbox"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
}

.form-privacy {
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
}

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem !important;
  color: var(--ink-soft) !important;
  line-height: 1.4;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.checkbox-label a {
  color: var(--accent);
  text-decoration: underline;
}

.form-status {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.form-status.success {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

html[data-theme="dark"] .form-status.success {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.form-status.error {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

html[data-theme="dark"] .form-status.error {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.form-submit {
  width: 100%;
  padding: 0.95rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(9, 54, 60, 0.25);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============ DOCK DE ESTADO Y PRIVACIDAD (INMUNE A ADBLOCKERS) ============ */
.site-notice-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  max-width: 440px;
  width: calc(100% - 3rem);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.35rem 1.45rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  z-index: 999;
  display: none;
  animation: slideUp 0.35s var(--ease);
}

.site-notice-dock.active {
  display: block !important;
}

.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.dock-header h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.dock-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.2s;
}

.dock-close:hover {
  color: var(--ink);
}

.adblock-alert {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

html[data-theme="dark"] .adblock-alert {
  background: rgba(16, 185, 129, 0.14);
}

.adblock-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

html[data-theme="dark"] .adblock-badge {
  color: #34d399;
}

.site-notice-dock p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.site-notice-dock p a {
  color: var(--accent);
  text-decoration: underline;
}

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

.btn-dock-accept {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: center;
}

.btn-dock-accept:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-dock-reject {
  padding: 0.65rem 0.95rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn-dock-reject:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.site-notice-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.site-notice-link:hover {
  color: var(--accent);
}

/* ============ FOOTER ============ */
footer {
  padding: 3rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ============ ANIMATIONS ============ */
.reveal {
  opacity: 1;
  transform: none;
}

/* Solo se oculta si el motor de animación confirma estar activo y observando */
html.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease) 0.1s, transform 0.8s var(--ease) 0.1s;
}

html.reveal-ready .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.service.reveal {
  transition: opacity 0.8s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}

.service.reveal:nth-child(2) {
  transition-delay: 0.25s, 0.25s;
}

.service.reveal:nth-child(3) {
  transition-delay: 0.35s, 0.35s;
}

.service.reveal:nth-child(4) {
  transition-delay: 0.25s, 0.25s;
}

.service.reveal:nth-child(5) {
  transition-delay: 0.35s, 0.35s;
}

.service.reveal:nth-child(6) {
  transition-delay: 0.45s, 0.45s;
}

/* ============ BOTÓN FLOTANTE DE CONTACTO (SOLO ICONO) ============ */
.fab-contact {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 90;
  width: 52px;
  height: 52px;
  border-radius: 15%;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(11, 40, 44, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: fabIn 0.6s var(--ease) 1.2s both;
}

html[data-theme="dark"] .fab-contact {
  background: var(--accent);
  color: #071315;
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.3);
}

.fab-contact::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 15%;
  border: 2px solid var(--accent);
  opacity: 0.45;
  animation: fabPulse 2.6s ease-out infinite;
  pointer-events: none;
}

.fab-contact:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 14px 34px rgba(9, 54, 60, 0.45);
}

.fab-contact svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.fab-contact:hover svg {
  transform: rotate(-8deg) scale(1.1);
}

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

@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

@media (max-width: 768px) {
  .fab-contact {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .contact-map,
  .contact-map iframe {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  :root { --pad: clamp(1rem, 3vw, 2rem); }

  .site-header { padding: 1rem var(--pad); }

  .hero { padding: 5rem 1.5rem 3rem; }

  h1 { margin-bottom: 1rem; }

  h2::after { width: 120px; }

  section { padding: 4rem 1.5rem; }

  .services-grid { grid-template-columns: 1fr; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-map,
  .contact-map iframe {
    min-height: 300px;
  }

  .site-notice-dock {
    bottom: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
  }

  body.has-notice-dock .fab-contact {
    bottom: 12.5rem;
    transition: bottom 0.35s var(--ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
