/* ---------- Temas: azul medianoche ---------- */
:root {
  color-scheme: light;
  --bg: #f7f9fc; --surface: #e9eef7; --card: #fff0e0; --text: #0f1b33; --muted: #3a4660;
  --accent: #a63a00; --btn: #0f1b33; --btn-text: #fff; --strip: #14203a;
  --featured: linear-gradient(160deg, #234075 0%, #0b1630 100%); --featured-text: #fff;
  --contact: linear-gradient(135deg, #234075 0%, #0b1630 70%);
  --pill-border: rgba(245,150,60,.45);
  --pill-bg: linear-gradient(180deg, rgba(255,236,214,.75) 0%, rgba(255,205,153,.5) 60%, rgba(255,224,190,.8) 100%);
  --pill-shadow: inset 0 0 0 3px rgba(255,255,255,.5), inset 0 -5px 9px rgba(255,255,255,.75), inset 0 6px 10px rgba(245,119,0,.12), 0 8px 18px rgba(245,119,0,.26);
  --pill-shine: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1224; --surface: #101b33; --card: #172545; --text: #f2f5fb; --muted: #bcc6da;
  --accent: #ff9d45; --btn: #fff; --btn-text: #0f1b33; --strip: #050b18;
  --featured: linear-gradient(160deg, #ff9420 0%, #ee5f00 100%); --featured-text: #111;
  --contact: linear-gradient(135deg, #27467f 0%, #101b33 75%);
  --pill-border: rgba(255,170,90,.45);
  --pill-bg: linear-gradient(180deg, rgba(255,150,50,.22) 0%, rgba(255,119,0,.1) 60%, rgba(255,150,50,.28) 100%);
  --pill-shadow: inset 0 0 0 3px rgba(255,255,255,.07), inset 0 -5px 9px rgba(255,160,70,.3), 0 8px 20px rgba(245,119,0,.22);
  --pill-shine: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0));
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 19px/1.55 Carlito, Calibri, sans-serif; }
img, svg { max-width: 100%; }
a { color: var(--accent); }
a, button, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(245,119,0,.25); }
h1, h2, h3 { margin: 0; font-family: Urbanist, system-ui, sans-serif; text-wrap: balance; }
h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid #f57700; outline-offset: 3px; }
section[id], main[id] { scroll-margin-top: 16px; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.section { padding-block: 88px; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 10; background: #f57700; color: #000; padding: 12px 20px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 16px; }
.button { display: inline-block; background: #f57700; color: #000; font-weight: 700; text-decoration: none; padding: 16px 32px; border-radius: 8px; text-align: center; transition: background-color .2s ease; }
.button:hover { background: #ff8e26; }

/* ---------- Encabezado ---------- */
.header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 20px; }
.logo img { display: block; width: 150px; height: auto; }
.logo .logo-dark, [data-theme="dark"] .logo .logo-light { display: none; }
[data-theme="dark"] .logo .logo-dark { display: block; }
.header-actions { display: flex; align-items: flex-start; gap: 12px; }
.nav-desktop { display: flex; align-items: center; gap: 32px; font-weight: 700; margin-right: 8px; }
.nav-desktop a { color: var(--text); text-decoration: none; padding: 10px 0; }
.nav-desktop a:hover { color: var(--accent); }
.nav-desktop .nav-button { color: var(--btn-text); background: var(--btn); padding: 12px 24px; border-radius: 8px; }
.nav-desktop .nav-button:hover { color: var(--btn-text); opacity: .88; }
.theme-toggle { display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 2px solid var(--text); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
.nav-mobile { display: none; font-weight: 700; }
.nav-mobile summary { list-style: none; cursor: pointer; min-height: 52px; padding: 9px 18px; border: 2px solid var(--text); border-radius: 8px; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile { position: relative; }
.nav-mobile nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; display: flex; flex-direction: column; min-width: 220px; padding: 8px 16px; background: var(--bg); border: 2px solid var(--text); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.nav-mobile a { color: var(--text); text-decoration: none; padding: 12px 4px; }

/* ---------- Banner ---------- */
.banner { display: flex; overflow: hidden; background: #0b0c0f; color: #fff; }
.banner-photo { display: block; flex: none; align-self: center; width: min(64%, max(660px, calc((100vh - 126px) * 1.5))); height: auto; aspect-ratio: 3 / 2;
  -webkit-mask-image: linear-gradient(to right, #000 86%, transparent); mask-image: linear-gradient(to right, #000 86%, transparent); }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: clamp(12px, 2.4vh, 28px); padding: 24px 3% 24px 1%; }
.banner-text > * { max-width: 760px; }
.banner h1 { font-size: clamp(32px, min(3.5vw, 8vh), 76px); font-weight: 800; line-height: 1.08; letter-spacing: -.015em; }
.banner p { font-size: clamp(18px, min(1.6vw, 3.2vh), 28px); line-height: 1.4; color: #e8e8ea; }
.banner-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; font-size: clamp(18px, min(1.4vw, 3vh), 24px); }
.banner-actions .button { padding: clamp(14px, 2.2vh, 20px) 36px; }
.banner-link { color: #ffab5c; font-weight: 700; padding: 12px 0; }

.road { display: flex; align-items: center; height: 48px; background: var(--strip); }
.road div { width: 100%; height: 5px; background: repeating-linear-gradient(to right, #f9b233 0 36px, transparent 36px 64px); background-size: 640px 100%; }

/* ---------- Servicios ---------- */
.services { display: flex; flex-direction: column; gap: 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--card); }
.card-featured { background: var(--featured); color: var(--featured-text); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.card div { display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.card h3 { font-size: 27px; line-height: 1.2; }

/* ---------- Quiénes somos ---------- */
.about { background: var(--surface); }
.about-grid { display: flex; flex-wrap: wrap; gap: 48px; }
.team { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 28px; align-self: flex-start; position: sticky; top: 32px; }
.team figure { margin: 0; }
.team img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 20px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.about-text { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.about h3 { margin-bottom: 8px; font-size: 24px; color: var(--accent); }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.values li { position: relative; isolation: isolate; min-width: 0; padding: 9px 12px; text-align: center; font-weight: 700; border: 1px solid var(--pill-border); border-radius: 999px; background: var(--pill-bg);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%); box-shadow: var(--pill-shadow); transition: translate .25s ease; }
.values li::before { content: ""; position: absolute; z-index: -1; left: 12px; right: 12px; top: 4px; height: 38%; border-radius: 999px; background: var(--pill-shine); pointer-events: none; }
.values li:hover { translate: 0 -3px; }

/* ---------- Contacto ---------- */
.contact { position: relative; overflow: hidden; background: var(--contact); color: #fff; }
.contact-grid { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 48px; }
.contact-text { flex: 1 1 320px; min-width: 0; }
.contact h2 { margin-bottom: 16px; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.1; }
.contact p { margin-bottom: 28px; font-size: 22px; }
.contact address { font-size: 22px; font-style: normal; font-weight: 700; overflow-wrap: anywhere; }
.contact address a:not(.button) { color: inherit; }
.contact .button { margin-top: 24px; }
.route { flex: 1 1 300px; max-width: 440px; width: 100%; height: auto; overflow: visible; }
.route-line { fill: none; stroke: #f57700; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 18; }
.route-start { fill: none; stroke: #f57700; stroke-width: 8; }
.route-pin { fill: #f57700; }
.route-dot { fill: #fff; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 32px; font-size: 16px; color: var(--muted); }

/* ---------- Tamaños ---------- */
@media (max-width: 960px) {
  .banner { flex-direction: column; }
  .banner-photo { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .banner-text { align-items: flex-start; text-align: left; gap: 20px; padding: 32px 24px 48px; }
  .banner h1 { font-size: clamp(36px, 4.4vw, 62px); }
  .banner p { font-size: 22px; }
  .banner-actions { justify-content: flex-start; font-size: 19px; }
}
@media (max-width: 860px) {
  .team { position: static; flex-basis: 100%; }
}
@media (max-width: 700px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .section { padding-block: 56px; }
  .banner-actions { align-self: stretch; }
  .banner-actions > * { flex: 1 1 100%; text-align: center; }
  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Animaciones ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .contact::before { content: ""; position: absolute; right: -10%; top: -30%; width: 70%; height: 160%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(245,119,0,.34), rgba(245,119,0,0)); animation: glow 7s ease-in-out infinite alternate; }
  .route-line { animation: dash 1.2s linear infinite; }
  .route-start { transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-in-out infinite; }
  .route-pin, .route-dot { animation: bounce 6s ease-out infinite; }
  .route-car { transform: none; offset-path: path("M40 218C130 218 100 56 220 56S310 150 376 70"); offset-rotate: auto; offset-anchor: 0 0; animation: drive 6s ease-in-out infinite; }

  @supports (animation-timeline: view()) {
    .banner-photo { animation: parallax linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .road div { animation: lane linear both; animation-timeline: view(); }
    .services > h2, .card, .about h2, .team figure, .about-text > div, .contact-text > * { animation: rise ease-out both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .card:nth-child(2) { animation-range: entry 12% entry 105%; }
    .card:nth-child(3) { animation-range: entry 24% entry 120%; }
    .contact-text > p { animation-range: entry 20% entry 120%; }
    .contact-text > address { animation-range: entry 40% entry 150%; }
    .card img { aspect-ratio: 16 / 9; animation: window linear both; animation-timeline: view(); }
  }
}
@keyframes parallax { from { translate: 0 0; scale: 1; } to { translate: 0 28%; scale: 1.08; } }
@keyframes rise { from { opacity: 0; translate: 0 70px; } to { opacity: 1; translate: 0 0; } }
@keyframes window { from { object-position: 50% 0%; } to { object-position: 50% 100%; } }
@keyframes lane { from { background-position: 0 0; } to { background-position: 640px 0; } }
@keyframes drive { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 78% { offset-distance: 100%; opacity: 1; } 92% { offset-distance: 100%; opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: -40; } }
@keyframes pulse { 0%, 100% { scale: 1; } 50% { scale: 1.35; } }
@keyframes bounce { 0%, 62%, 100% { translate: 0 0; } 72% { translate: 0 -20px; } 82% { translate: 0 0; } 89% { translate: 0 -8px; } 95% { translate: 0 0; } }
@keyframes glow { from { translate: -12% 8%; scale: .9; } to { translate: 12% -8%; scale: 1.15; } }
