:root {
  --bg: #f5f8fd;
  --bg-2: #ffffff;
  --bg-3: #e9eff8;
  --ink: #0a1633;
  --mute: #566178;
  --line: rgba(10, 22, 51, .1);
  --ice: #4cb9ee;
  --accent: #1d4fb4;
  --radius: 28px;
  --pad: clamp(20px, 4vw, 56px);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { font-family: "Inter Tight", system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Header */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .3s, backdrop-filter .3s; }
.header.scrolled { background: rgba(6,14,32,.72); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 var(--pad); gap: 24px; }
.nav-left { display: flex; align-items: center; gap: 18px; }
.logo { font-weight: 600; letter-spacing: .22em; font-size: 1.15rem; text-decoration: none; }
.logo span { color: var(--ice); }
.menu { display: flex; gap: 32px; align-items: center; margin-left: auto; margin-right: 12px; }
.menu a { text-decoration: none; font-size: .95rem; color: var(--mute); transition: color .2s; }
.menu a:hover { color: var(--ink); }
.menu .menu-tel { color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; width: 36px; height: 36px; }
.menu-btn i { display: block; width: 22px; height: 2px; background: var(--ink); margin: 6px 7px; transition: .25s; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 10px; background: var(--grad_unused); color: #0b1620; font: inherit; font-weight: 600; padding: 14px 28px; border-radius: 999px; border: 0; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .25s; white-space: nowrap; }
.pill:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 40px rgba(76,185,238,.28); }
.pill span { transition: transform .2s; }
.pill:hover span { transform: translateX(4px); }
.pill-sm { padding: 10px 22px; font-size: .95rem; }
.pill-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(247,244,239,.3); }
.pill-ghost:hover { background: rgba(247,244,239,.08); box-shadow: none; }

/* Hero */
.hero { position: relative; min-height: 100vh; padding: 150px 0 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; text-align: center; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .75; animation: float 16s ease-in-out infinite; pointer-events: none; }
.g1 { width: 55vw; height: 55vw; max-width: 760px; max-height: 760px; left: -10%; top: -20%; background: radial-gradient(circle, #1d4ed8, transparent 65%); }
.g2 { width: 45vw; height: 45vw; max-width: 620px; max-height: 620px; right: -8%; top: 5%; background: radial-gradient(circle, #6d28d9, transparent 65%); animation-delay: -5s; }
.g3 { width: 60vw; height: 40vw; max-width: 900px; left: 20%; top: -10%; background: radial-gradient(circle, rgba(76,185,238,.22), transparent 65%); animation-delay: -9s; }
@keyframes float { 50% { transform: translate(40px, -30px) scale(1.08); } }
.grain { position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay; pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.hero-in { position: relative; padding: 0 var(--pad); max-width: 980px; margin: 0 auto; }
.tag { display: inline-block; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ice); border: 1px solid rgba(111,216,255,.3); padding: 7px 16px; border-radius: 999px; backdrop-filter: blur(8px); }
h1 { font-size: clamp(2.6rem, 7.2vw, 5.6rem); font-weight: 500; line-height: 1.04; letter-spacing: -.035em; margin: 26px 0 22px; min-height: 2.1em; }
#typed { background: var(--grad_unused); -webkit-background-clip: text; background-clip: text; color: transparent; }
.caret { display: inline-block; width: 3px; height: .9em; background: var(--ice); margin-left: 6px; vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: #d6d2cb; font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 56ch; margin: 0 auto 36px; }

/* Caja tipo prompt */
.prompt { text-align: left; background: rgba(16,32,63,.72); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 28px; padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.prompt textarea { width: 100%; background: transparent; border: 0; color: var(--ink); font: inherit; font-size: 1.08rem; resize: none; outline: none; }
.prompt textarea::placeholder { color: var(--mute); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.chip { font: inherit; font-size: .88rem; color: var(--mute); background: var(--bg-3); border: 1px solid transparent; padding: 8px 15px; border-radius: 999px; cursor: pointer; transition: .2s; }
.chip:hover { color: var(--ink); }
.chip.on { color: var(--ink); border-color: var(--ice); background: rgba(111,216,255,.12); }
.prompt-row { display: flex; gap: 10px; flex-wrap: wrap; }
.prompt-row input { flex: 1 1 160px; min-width: 0; background: var(--bg-3); border: 1px solid transparent; color: var(--ink); font: inherit; padding: 13px 18px; border-radius: 999px; outline: none; }
.prompt-row input:focus { border-color: var(--ice); }
.prompt-row input::placeholder { color: var(--mute); }
.form-msg { font-size: .88rem; min-height: 1.3em; margin-top: 10px; color: var(--ice); }

/* Marquee */
.marquee { position: relative; margin-top: 70px; padding: 26px 0; overflow: hidden; border-top: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.track { display: flex; width: max-content; gap: 64px; animation: scroll 38s linear infinite; }
.track span { font-size: 1.25rem; font-weight: 500; color: rgba(247,244,239,.45); white-space: nowrap; letter-spacing: -.01em; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Bloques */
.block { padding: clamp(72px, 10vw, 140px) 0 0; }
.wrap { padding: 0 var(--pad); max-width: 1320px; margin: 0 auto; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.08; max-width: 18ch; }
.sub { color: var(--mute); font-size: 1.1rem; max-width: 52ch; margin-top: 16px; }
.note { padding: 22px var(--pad) 0; max-width: 1320px; margin: 0 auto; font-size: .8rem; color: #6c6963; }

/* Carruseles */
.rail { display: flex; gap: 20px; overflow-x: auto; padding: 44px var(--pad) 8px; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.drag { cursor: grabbing; scroll-snap-type: none; }
.proj { flex: 0 0 clamp(250px, 26vw, 340px); scroll-snap-align: start; }
.ph { position: relative; aspect-ratio: 1/1.1; border-radius: 22px; overflow: hidden; background: var(--bg-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.proj:hover .ph img { transform: scale(1.07); }
.badge { position: absolute; left: 12px; bottom: 12px; background: rgba(6,14,32,.7); backdrop-filter: blur(10px); font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 10px; }
.proj h3 { font-size: 1.08rem; font-weight: 600; margin-top: 14px; }
.proj p { color: var(--mute); font-size: .92rem; }

.rail-cards { padding-top: 48px; }
.fcard { flex: 0 0 clamp(280px, 30vw, 400px); scroll-snap-align: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 38px 34px 46px; min-height: 340px; display: flex; flex-direction: column; transition: background .3s, transform .3s; }
.fcard:hover { background: var(--bg-3); transform: translateY(-6px); }
.fcard .n { font-size: .9rem; color: var(--ice); letter-spacing: .1em; margin-bottom: auto; padding-bottom: 60px; }
.fcard h3 { font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; margin-bottom: 12px; }
.fcard p { color: var(--mute); }

/* Cifras */
.stats { margin-top: clamp(72px, 10vw, 140px); border-block: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 64px; }
.stats strong { display: block; font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.stats span { display: block; margin-top: 10px; color: var(--mute); }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 300px; gap: 18px; margin-top: 52px; }
.b { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.b img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.b::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,14,32,.1) 30%, rgba(6,14,32,.92)); }
.b:hover img { transform: scale(1.06); }
.b > div { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 26px 28px; }
.b h3 { font-size: 1.4rem; font-weight: 500; letter-spacing: -.02em; }
.b p { color: #cfcbc4; font-size: .95rem; margin-top: 4px; }
.b-big { grid-column: span 2; grid-row: span 2; }
.b-wide { grid-column: span 2; }

/* Proceso */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 56px; border-top: 1px solid var(--line); }
.steps li { padding: 30px 28px 10px 0; border-right: 1px solid var(--line); padding-left: 28px; }
.steps li:first-child { padding-left: 0; }
.steps li:last-child { border-right: 0; }
.steps span { color: var(--ice); font-size: .9rem; letter-spacing: .1em; }
.steps h3 { font-size: 1.5rem; font-weight: 500; margin: 14px 0 8px; letter-spacing: -.02em; }
.steps p { color: var(--mute); }

/* Testimonios */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 52px; }
blockquote { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 38px 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
blockquote p { font-size: 1.3rem; letter-spacing: -.015em; line-height: 1.35; }
blockquote footer { color: var(--mute); font-size: .9rem; }
blockquote footer b { color: var(--ink); font-weight: 600; display: block; }

/* Final */
.final { position: relative; margin-top: clamp(72px, 10vw, 140px); padding: clamp(90px, 14vw, 180px) var(--pad); text-align: center; overflow: hidden; border-top: 1px solid var(--line); }
.final-in { position: relative; max-width: 800px; margin: 0 auto; }
.final h2 { max-width: none; font-size: clamp(2.4rem, 6vw, 4.8rem); }
.final .sub { margin: 18px auto 36px; }
.final-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.meta { margin-top: 36px; color: var(--mute); font-size: .9rem; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 44px var(--pad); }
.foot { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.foot nav { display: flex; gap: 26px; }
.foot nav a, .foot p, .foot p a { color: var(--mute); text-decoration: none; font-size: .9rem; }
.foot nav a:hover { color: var(--ink); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .glow, .track, .caret { animation: none; } html { scroll-behavior: auto; } }

/* Responsive */
@media (max-width: 980px) {
  .menu { position: fixed; inset: 76px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px var(--pad) 28px; margin: 0; background: rgba(6,14,32,.97); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .35s; }
  .menu.open { transform: none; }
  .menu a { font-size: 1.6rem; color: var(--ink); padding: 8px 0; }
  .menu-btn { display: block; }
  .nav { justify-content: flex-start; }
  .nav .pill-sm { margin-left: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 44px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .b-big, .b-wide { grid-column: span 2; }
  .b-big { grid-row: span 1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); }
  .steps li:nth-child(4) { border-top: 1px solid var(--line); }
  .quotes { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding-top: 120px; }
  .br { display: none; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .b-big, .b-wide { grid-column: auto; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li:nth-child(n) { border-right: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .steps { border-top: 0; }
  .prompt-row .pill { width: 100%; justify-content: center; }
  .foot nav { flex-wrap: wrap; }
}


/* ===== Refinamiento: portada fotográfica y acabado editorial ===== */
.hero { text-align: left; justify-content: flex-end; padding: 0; min-height: 100svh; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.05); transform: scale(1.04); animation: drift 24s ease-out forwards; }
@keyframes drift { to { transform: scale(1); } }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,14,32,.92) 0%, rgba(6,14,32,.6) 48%, rgba(6,14,32,.15) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
.grain { opacity: .14; }
.hero-in { position: relative; width: 100%; max-width: 1320px; padding: 0 var(--pad) clamp(70px, 12vh, 130px); margin: 0 auto; }
.tag { border: 0; padding: 0; border-radius: 0; backdrop-filter: none; color: var(--ice); font-size: .8rem; letter-spacing: .22em; display: flex; align-items: center; gap: 14px; }
h1 { font-size: clamp(2.9rem, 8.4vw, 7.4rem); font-weight: 500; letter-spacing: -.045em; line-height: .98; margin: 28px 0 26px; min-height: 0; max-width: 11ch; }
h1 em { font-style: normal; color: var(--ice); font-weight: 400; }
.lead { margin: 0 0 40px; max-width: 46ch; color: #cfd3d8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.scroll-hint { position: absolute; right: var(--pad); bottom: 46px; width: 1px; height: 70px; background: rgba(247,244,239,.25); overflow: hidden; }
.scroll-hint i { display: block; width: 1px; height: 30px; background: var(--ice); animation: drop 2.2s ease-in-out infinite; }
@keyframes drop { from { transform: translateY(-30px); } to { transform: translateY(70px); } }
.marquee { margin-top: 0; border-top: 0; }

/* Contacto */
.final { text-align: left; padding: clamp(80px, 12vw, 160px) var(--pad); }
.final-in { max-width: 1320px; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 7vw, 110px); align-items: start; }
.final h2 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 12ch; }
.final .sub { margin: 18px 0 40px; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.contact-list small { color: var(--mute); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.contact-list a, .contact-list span { font-size: 1.25rem; text-decoration: none; letter-spacing: -.01em; }
.contact-list a:hover { color: var(--ice); }
.quote { background: rgba(16,32,63,.8); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; display: grid; gap: 14px; }
.quote h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; }
.quote .chips { margin: 0 0 4px; }
.quote input, .quote textarea { width: 100%; background: var(--bg-3); border: 1px solid transparent; color: var(--ink); font: inherit; padding: 15px 18px; border-radius: 16px; outline: none; resize: none; }
.quote input:focus, .quote textarea:focus { border-color: var(--ice); }
.quote input::placeholder, .quote textarea::placeholder { color: var(--mute); }
.quote .pill { justify-content: center; margin-top: 6px; }
.chip.on { background: rgba(76,185,238,.14); }

@media (max-width: 980px) {
  .final-in { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-shade { background: linear-gradient(0deg, rgba(6,14,32,.95) 25%, rgba(6,14,32,.4)); }
  .scroll-hint { display: none; }
  .quote { padding: 24px; }
  .hero-actions .pill { flex: 1 1 100%; justify-content: center; }
}


/* ===== Tema blanco: secciones claras con portada, cierre y pie oscuros ===== */
.hero, .final, .footer { --bg: #0a1326; --bg-2: #10203f; --bg-3: #172a52; --ink: #f7f4ef; --mute: #a7b3cc; --line: rgba(247,244,239,.12); --accent: var(--ice); color: var(--ink); }
.final, .footer { background: var(--bg); }
.header:not(.scrolled) { --bg: #0a1326; --ink: #f7f4ef; --mute: #d0d3d6; --accent: var(--ice); }
.header.scrolled { background: rgba(245,248,253,.86); }
.logo span { color: var(--accent); }
.pill { background: var(--ink); color: var(--bg); }
.pill:hover { background: var(--accent); color: var(--bg); box-shadow: 0 12px 34px rgba(29,79,180,.28); }
.pill-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.pill-ghost:hover { background: rgba(247,244,239,.1); box-shadow: none; color: var(--ink); }
.hero-shade { background: linear-gradient(90deg, rgba(6,14,32,.92) 0%, rgba(6,14,32,.6) 48%, rgba(6,14,32,.2) 100%), linear-gradient(0deg, rgba(6,14,32,.92) 0%, transparent 38%); }
.hero-bg { filter: saturate(.85) contrast(1.05); }
.fcard .n, .steps span { color: var(--accent); }
.chip.on { border-color: var(--accent); color: var(--ink); background: rgba(29,79,180,.1); }
.final .chip.on { border-color: var(--ice); background: rgba(76,185,238,.14); }
.badge { color: #fff; }
.b h3 { color: #fff; }
.fcard, blockquote { box-shadow: 0 1px 2px rgba(10,22,51,.04); }
.fcard:hover { background: var(--bg-2); box-shadow: 0 24px 50px rgba(10,22,51,.1); }
.ph { box-shadow: 0 1px 2px rgba(10,22,51,.06); }
.stats { background: var(--bg-2); }
.quote { background: rgba(16,32,63,.8); }
@media (max-width: 980px) {
  .menu { --bg: #0a1326; --ink: #f7f4ef; --mute: #d0d3d6; --line: rgba(247,244,239,.12); background: rgba(6,14,32,.97); }
}

/* Logo del cliente sobre placa blanca para que se lea en fondos oscuros y claros */
.logo { background: #fff; border-radius: 14px; padding: 6px 14px; display: inline-flex; align-items: center; }
.logo img { height: 46px; width: auto; display: block; }
.footer .logo img { height: 56px; }
@media (max-width: 600px) { .logo img { height: 38px; } .logo { padding: 5px 11px; } }


/* ===== Marca JP Mechanical Soft: azul marino y amarillo del logo ===== */
.hero .pill:not(.pill-ghost), .final .pill:not(.pill-ghost), .header:not(.scrolled) .pill { background: #4cb9ee; color: #0a1326; }
.hero .pill:not(.pill-ghost):hover, .final .pill:not(.pill-ghost):hover, .header:not(.scrolled) .pill:hover { background: #8dd3f6; color: #0a1326; box-shadow: 0 12px 34px rgba(76,185,238,.3); }
.stats strong { font-size: clamp(1.8rem, 3.6vw, 3rem); letter-spacing: -.03em; }
.creed { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.2; padding-top: 56px; max-width: 24ch; }
.creed span { display: block; color: var(--mute); font-weight: 400; margin-top: 6px; }
.stats-grid { padding-block: 44px 60px; }
.fcard { min-height: 260px; justify-content: flex-end; }
.hero { padding-top: 130px; }
h1 { font-size: clamp(2.7rem, 6.6vw, 6rem); max-width: 14ch; }

/* Logo transparente: versión clara sobre fondo oscuro, original sobre fondo claro */
.logo { background: none; padding: 0; border-radius: 0; }
.logo img { height: 52px; }
.footer .logo img { height: 64px; }
.header:not(.scrolled) .logo-on-light { display: none; }
.header.scrolled .logo-on-dark { display: none; }
@media (max-width: 600px) { .logo img { height: 42px; } .logo { padding: 0; } }


/* Logo vectorial: tinta blanca sobre la foto y azul marino sobre fondo claro */
.logo-img-off { display: none; }
.logo { --logo-ink: #0b2a6b; }
.header:not(.scrolled) .logo, .footer .logo { --logo-ink: #ffffff; }
.logo-svg { height: 58px; width: auto; display: block; overflow: visible; }
.footer .logo-svg { height: 72px; }
@media (max-width: 600px) { .logo-svg { height: 46px; } }

/* 3D de la portada */
#gl { position: absolute; top: 0; right: 0; width: min(62%, 900px); height: 100%; z-index: 1; pointer-events: none; }
.hero-in { z-index: 2; }
.scroll-hint { z-index: 2; }
@media (max-width: 760px) { #gl { display: none; } }
.b, .fcard, .ph { transform-style: preserve-3d; will-change: transform; }
.b { box-shadow: 0 30px 60px -30px rgba(6,14,32,.5); }
.fcard:hover { transform: none; }

.logo-svg { height: 66px; }
.footer .logo-svg { height: 88px; }
@media (max-width: 600px) { .logo-svg { height: 50px; } }
#gl { width: min(58%, 820px); }

/* Nieve cayendo al costado derecho */
#snow { position: fixed; top: 0; right: 0; width: clamp(90px, 13vw, 210px); height: 100vh; z-index: 5; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
@media (max-width: 600px) { #snow { width: 64px; opacity: .8; } }

/* Hueco sobre el contacto */
.final { margin-top: 0; }
#proceso { padding-bottom: clamp(56px, 7vw, 100px); }

/* Escarcha en el borde derecho */
.frost-glass, #frost { position: fixed; top: 0; right: 0; height: 100vh; pointer-events: none; animation: freeze 5s ease-out both; }
.frost-glass { width: clamp(46px, 5vw, 86px); z-index: 3; backdrop-filter: blur(5px) saturate(1.25); -webkit-backdrop-filter: blur(5px) saturate(1.25); -webkit-mask-image: linear-gradient(270deg, #000, transparent); mask-image: linear-gradient(270deg, #000, transparent); }
#frost { width: clamp(80px, 9.5vw, 160px); z-index: 4; }
@keyframes freeze { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .frost-glass, #frost { animation: none; } }
@media (max-width: 600px) { #frost { width: 54px; } .frost-glass { width: 36px; } }

/* Aire acondicionado 3D también en celular, arriba del texto */
@media (max-width: 760px) {
  #gl { display: block; top: 70px; left: 0; right: 0; width: 100%; height: 300px; }
  .hero { padding-top: 360px; }
}
#gl { -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%); }
@media (max-width: 760px) { #gl { -webkit-mask-image: none; mask-image: none; } }

/* Hielo que avanza al bajar: --p va de 0.25 (arriba) a 1 (abajo) */
@property --reveal { syntax: '<number>'; inherits: false; initial-value: 1; }
@keyframes freeze2 { from { --reveal: 0; } to { --reveal: 1; } }
:root { --p: 0.25; }
#frost { width: clamp(150px, 18vw, 290px); animation: freeze2 5s ease-out both;
  clip-path: inset(0 0 calc((1 - var(--reveal)) * 100%) calc((1 - var(--p)) * 55%)); }
.frost-glass { width: calc(clamp(46px, 5vw, 86px) * (0.65 + var(--p) * 1.1)); animation: freeze2 5s ease-out both;
  clip-path: inset(0 0 calc((1 - var(--reveal)) * 100%) 0); }
@media (prefers-reduced-motion: reduce) { #frost, .frost-glass { animation: none; } }
@media (max-width: 600px) { #frost { width: 110px; } .frost-glass { width: calc(36px * (0.65 + var(--p) * 1.1)); } }

/* Borde interior difuminado (sin corte recto) */
:root { --p: 0.35; }
#frost { clip-path: inset(0 0 calc((1 - var(--reveal)) * 100%) 0);
  -webkit-mask-image: linear-gradient(90deg, transparent calc((1 - var(--p)) * 62%), #000 calc((1 - var(--p)) * 62% + 32%));
  mask-image: linear-gradient(90deg, transparent calc((1 - var(--p)) * 62%), #000 calc((1 - var(--p)) * 62% + 32%)); }

/* Congelamiento progresivo: cada bloque se cubre de hielo al salir por arriba y se descongela al volver */
.fz { position: relative; }
.ice { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 6; visibility: hidden; opacity: var(--f, 0);
  background: var(--frost-img) 0 0 / 280px 280px repeat, linear-gradient(160deg, rgba(212,237,255,.6), rgba(150,200,240,.38) 55%, rgba(228,245,255,.55));
  -webkit-backdrop-filter: blur(calc(var(--f, 0) * 7px)) saturate(calc(1 - var(--f, 0) * .5)) brightness(calc(1 + var(--f, 0) * .12));
  backdrop-filter: blur(calc(var(--f, 0) * 7px)) saturate(calc(1 - var(--f, 0) * .5)) brightness(calc(1 + var(--f, 0) * .12));
  box-shadow: inset 0 0 18px rgba(200,235,255,.55); }
.fz-on > .ice { visibility: visible; }
.hero-bg { filter: saturate(calc(.85 - var(--hf, 0) * .6)) contrast(1.05) brightness(calc(1 + var(--hf, 0) * .2)) blur(calc(var(--hf, 0) * 3px)); }
#gl { filter: saturate(calc(1 - var(--hf, 0) * .7)) blur(calc(var(--hf, 0) * 4px)); opacity: calc(1 - var(--hf, 0) * .6); }

/* Técnico animado: abrigado, con casco, congelándose */
.mascot { position: relative; margin-top: 36px; width: min(100%, 430px); height: 330px; }
.m-svg { position: absolute; left: 0; bottom: 0; height: 100%; width: auto; overflow: visible; }
.m-body { transform-box: fill-box; transform-origin: 50% 100%; animation: shiver .11s linear infinite alternate; }
.m-head { transform-box: fill-box; transform-origin: 50% 90%; animation: shiverH .09s linear infinite alternate; }
.m-mouth { transform-box: fill-box; transform-origin: 50% 0; animation: chatter .14s steps(2) infinite alternate; }
.m-eye { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 4.2s infinite; }
.puff { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; animation: puff 2.1s ease-out infinite; }
.fl { animation: fall 4.4s linear infinite; opacity: 0; }
@keyframes shiver { from { transform: translate(-1.6px, 0) rotate(-.6deg); } to { transform: translate(1.6px, .8px) rotate(.6deg); } }
@keyframes shiverH { from { transform: translate(1.2px, 0) rotate(.8deg); } to { transform: translate(-1.2px, .6px) rotate(-.8deg); } }
@keyframes chatter { from { transform: scaleY(1); } to { transform: scaleY(.42); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes puff { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 20% { opacity: .85; } 100% { transform: translate(34px, -34px) scale(1.9); opacity: 0; } }
@keyframes fall { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(340px); opacity: 0; } }
.bubble { position: absolute; left: 205px; top: 24px; max-width: 190px; background: #fff; color: #0a1633; font-weight: 600; font-size: .98rem; line-height: 1.3; padding: 14px 16px; border-radius: 18px; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.bubble::before { content: ""; position: absolute; left: -9px; top: 36px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
@media (max-width: 560px) { .mascot { height: 300px; } .bubble { left: 168px; max-width: 150px; font-size: .9rem; } }
@media (prefers-reduced-motion: reduce) { .mascot * { animation: none !important; } .puff { opacity: .5; } }


/* Técnico 3D */
.mascot { height: 360px; }
.mascot canvas { position: absolute; left: 0; bottom: 0; width: 280px; height: 100%; }
.bubble { left: 250px; top: 40px; }
@media (max-width: 560px) { .mascot canvas { width: 230px; } .bubble { left: 200px; max-width: 130px; font-size: .85rem; } }

/* Nieve con viento sobre la zona azul */
.final { overflow: hidden; }
#blizzard { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

/* Hielo en esquinitas */
.corner { position: absolute; width: var(--cs, 150px); height: var(--cs, 150px); pointer-events: none; z-index: 5;
  background: var(--corner-img) 0 0 / 100% 100% no-repeat; opacity: 0;
  transform: scale(calc(var(--fx, 1) * var(--g, .55)), calc(var(--fy, 1) * var(--g, .55)));
  transition: opacity 1.4s ease, transform 1.8s cubic-bezier(.2, .7, .2, 1); }
.corner.on { opacity: 1; --g: 1; }
.corner.tr { top: -1px; right: -1px; --fx: 1; --fy: 1; }
.corner.tl { top: -1px; left: -1px; --fx: -1; --fy: 1; }
.corner.br { bottom: -1px; right: -1px; --fx: 1; --fy: -1; }
.corner.bl { bottom: -1px; left: -1px; --fx: -1; --fy: -1; }
.fcard, .steps li, .quote { overflow: hidden; }
.stats, #proceso, #proyectos { position: relative; }
.stats { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .corner { transition: none; opacity: 1; --g: 1; } }

/* Congelamiento adherido al objeto: la letra y la imagen mismas se vuelven hielo (sin cuadros encima) */
.ice { display: none !important; }
html body .fz-t { color: color-mix(in srgb, var(--c0) calc((1 - var(--f, 0)) * 100%), var(--c1) calc(var(--f, 0) * 100%));
  text-shadow: 0 0 calc(var(--f, 0) * 12px) rgba(110, 200, 255, calc(var(--f, 0) * .8)), 0 1px calc(var(--f, 0) * 1px) rgba(255, 255, 255, calc(var(--f, 0) * .9));
  -webkit-text-stroke: calc(var(--f, 0) * .6px) rgba(196, 234, 255, .95); }
html body .fz-c img { filter: grayscale(var(--f, 0)) sepia(var(--f, 0)) hue-rotate(calc(var(--f, 0) * 168deg)) brightness(calc(1 + var(--f, 0) * .22)) contrast(calc(1 - var(--f, 0) * .05)); }
html body .fcard.fz-c { background: color-mix(in srgb, var(--bg-2) calc((1 - var(--f, 0)) * 100%), #dff2ff calc(var(--f, 0) * 100%));
  border-color: color-mix(in srgb, var(--line) calc((1 - var(--f, 0)) * 100%), #9fd8f5 calc(var(--f, 0) * 100%));
  box-shadow: inset 0 0 calc(var(--f, 0) * 26px) rgba(150, 215, 250, calc(var(--f, 0) * .8)), 0 1px 2px rgba(13, 19, 23, .04); }
.b::after { box-shadow: inset 0 0 calc(var(--f, 0) * 30px) rgba(190, 230, 255, calc(var(--f, 0) * .9)); }
.ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 calc(var(--f, 0) * 30px) rgba(190, 230, 255, calc(var(--f, 0) * .9)); }
.hero-bg { filter: saturate(.85) contrast(1.05) grayscale(var(--hf, 0)) sepia(var(--hf, 0)) hue-rotate(calc(var(--hf, 0) * 168deg)) brightness(calc(1 + var(--hf, 0) * .2)); }
#gl { filter: grayscale(var(--hf, 0)) sepia(var(--hf, 0)) hue-rotate(calc(var(--hf, 0) * 168deg)); opacity: calc(1 - var(--hf, 0) * .5); }


/* El técnico se dibuja sobre toda la zona azul para que casco y peluca puedan volar hasta salir de ella */
#mascot3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.mascot canvas { display: none; }
.bubble { transition: none; }

/* Logo principal más grande: grande arriba, se compacta al bajar */
.header { --nav-h: 108px; }
.header.scrolled { --nav-h: 80px; }
.nav { height: var(--nav-h); transition: height .3s ease; }
.header .logo-svg { height: calc(var(--nav-h) - 18px); transition: height .3s ease; }
.hero { padding-top: 160px; }
@media (max-width: 980px) { .menu { inset: var(--nav-h) 0 auto 0; } }
@media (max-width: 600px) {
  .header { --nav-h: 88px; }
  .header.scrolled { --nav-h: 68px; }
  .hero { padding-top: 380px; }
}

.header:not(.scrolled) .logo, .footer .logo { --logo-so: #5cc3f5; }

/* ===== Versión bilingüe, calefacción, fotos y videos reales ===== */
/* Cabecera con el logo real */
.header .logo img { height: calc(var(--nav-h) - 18px); width: auto; display: block; transition: height .3s ease; }
.footer .logo img { height: 92px; width: auto; display: block; }
.pill b { font-weight: inherit; }
.menu { margin: 0 auto; }
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: 0; }
.menu-cta { display: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.lang button { font: inherit; font-weight: 600; font-size: .8rem; letter-spacing: .05em; color: var(--mute); background: none; border: 0; border-radius: 999px; padding: 6px 11px; cursor: pointer; transition: .2s; }
.lang button:hover { color: var(--ink); }
.lang button.on { background: var(--ink); color: var(--bg); }
@media (max-width: 1180px) { .menu a.menu-tel { display: none; } .menu { gap: 20px; } }
@media (max-width: 980px) {
  .nav-right { margin-left: auto; }
  .menu-cta { display: inline-flex; justify-content: center; margin-top: 8px; }
  .menu a.menu-tel { display: block; }
}
@media (max-width: 600px) { .nav-cta { display: none; } .lang button { padding: 6px 9px; } .header .logo img { height: calc(var(--nav-h) - 22px); } }

/* Interruptor Frío | Calor */
.mode-switch { display: inline-flex; gap: 4px; padding: 4px; background: rgba(10, 19, 38, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; }
.mode-switch button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: .85rem; color: #cfd6e6; background: none; border: 0; border-radius: 999px; padding: 8px 15px; cursor: pointer; transition: background .25s, color .25s; }
.mode-switch button:hover { color: #fff; }
.mode-switch button.on { color: #08122a; background: #4cb9ee; }
.mode-switch button[data-mode="heat"].on { background: #ffa64d; }
.hero-mode { position: absolute; right: var(--pad); bottom: 96px; z-index: 3; }
.mascot .mode-switch { position: absolute; left: 0; top: 0; z-index: 5; }
.mascot { margin-top: 28px; }
.bubble { top: 70px; }
.hero-warm { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(ellipse at 72% 28%, rgba(255, 150, 50, .42), transparent 55%), linear-gradient(90deg, rgba(60, 20, 8, 0), rgba(120, 45, 10, .22)); }
.hero.hot .hero-warm { opacity: 1; }
.hero.hot .tag { color: #ffbf7a; }
@media (max-width: 760px) {
  .hero { padding-top: 440px; }
  .hero-mode { top: 372px; bottom: auto; left: var(--pad); right: auto; }
}

/* Calor en la sección azul de contacto */
.final .warm { position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none; transition: opacity 1.6s ease;
  background: radial-gradient(ellipse at 82% -8%, rgba(255, 176, 74, .5), transparent 55%), radial-gradient(ellipse at 12% 105%, rgba(255, 106, 40, .3), transparent 60%), linear-gradient(180deg, rgba(150, 52, 14, .28), rgba(40, 16, 10, .1)); }
.final .sun { position: absolute; right: 5%; top: -150px; width: 460px; height: 460px; border-radius: 50%; opacity: 0; pointer-events: none; z-index: 0; transition: opacity 1.6s ease;
  background: radial-gradient(circle, rgba(255, 236, 160, .95) 0, rgba(255, 184, 76, .6) 38%, rgba(255, 150, 60, 0) 68%); animation: sunpulse 6s ease-in-out infinite; }
@keyframes sunpulse { 50% { transform: scale(1.07); } }
.final.hot .warm, .final.hot .sun { opacity: 1; }
.final.hot > .corner { opacity: 0 !important; }
.final-in { position: relative; z-index: 1; }

/* Frío y calor: dos tarjetas */
.climate { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 48px; }
.clim { position: relative; overflow: hidden; border-radius: var(--radius); padding: 38px 34px 34px; color: #fff; min-height: 330px; display: flex; flex-direction: column; }
.clim.cool { background: linear-gradient(150deg, #0b2d6e, #1d4fb4 55%, #3aa7e6); }
.clim.heat { background: linear-gradient(150deg, #6e2406, #cf5b17 55%, #ffb04a); }
.clim::after { content: ""; position: absolute; right: -90px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); pointer-events: none; }
.clim-ic { width: 66px; height: 66px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; margin-bottom: 22px; }
.clim h3 { font-size: 1.9rem; font-weight: 500; letter-spacing: -.025em; margin-bottom: 14px; color: #fff; }
.clim ul { list-style: none; padding: 0; display: grid; gap: 10px; margin-bottom: 26px; }
.clim li { padding-left: 26px; position: relative; font-size: 1.05rem; color: #fff; }
.clim li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: rgba(255, 255, 255, .7); }
.clim-tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.clim-tags span { font-size: .8rem; border: 1px solid rgba(255, 255, 255, .42); border-radius: 999px; padding: 5px 12px; color: #fff; }
@media (max-width: 760px) { .climate { grid-template-columns: 1fr; } }

/* Fotos reales en las tarjetas de servicios */
.b img { object-fit: cover; }

/* Videos */
.rail-vid .vid-card { flex: 0 0 clamp(190px, 19vw, 250px); }
.proj .vph { aspect-ratio: 9 / 14; background: #0a1326; }
.vph video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
html body .fz-c video { filter: grayscale(var(--f, 0)) sepia(var(--f, 0)) hue-rotate(calc(var(--f, 0) * 168deg)) brightness(calc(1 + var(--f, 0) * .22)); }
.promo { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; margin-top: 70px; }
.promo video { width: 100%; border-radius: 22px; background: #0a1326; box-shadow: 0 30px 60px -30px rgba(10, 22, 51, .5); display: block; }
.promo h3 { font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; margin-bottom: 8px; }
.promo p { color: var(--mute); }
@media (max-width: 800px) { .promo { grid-template-columns: 1fr; gap: 20px; } }
.rail { scroll-padding-left: var(--pad); }
