/* ==========================================================================
   Tasty Lab — Portal enrutador
   Mobile first · Vanilla CSS (sin frameworks)
   ========================================================================== */

/* ----------------------------- Fuentes ----------------------------- */
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Marker";
  src: url("../assets/fonts/permanent-marker-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------- Tokens ----------------------------- */
:root {
  --dark: #1e1e1f;
  --dark-2: #171718;
  --orange: #ec681d;
  --orange-soft: #ff7a2f;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --muted-2: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.12);

  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-marker: "Marker", "Space Grotesk", cursive;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.5s;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ----------------------------- Reset ----------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--dark);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
picture { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

h1 { margin: 0; }
p { margin: 0; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: calc(12px + var(--safe-top)); }

:focus-visible {
  outline: 3px solid var(--orange-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ----------------------------- Ambiente de fondo ----------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #2a2a2c 0%, var(--dark) 55%, var(--dark-2) 100%);
}
.ambient__glow {
  position: absolute;
  left: 50%;
  top: -32vmax;
  width: 78vmax;
  height: 78vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(236, 104, 29, 0.22) 0%, rgba(236, 104, 29, 0) 62%);
  filter: blur(6px);
}
.ambient__ring {
  position: absolute;
  border-radius: 50%;
  border: 14vmax solid var(--orange);
  opacity: 0.1;
}
.ambient__ring--left {
  width: 60vmax;
  height: 60vmax;
  bottom: -34vmax;
  left: -30vmax;
}
.ambient__ring--right {
  width: 46vmax;
  height: 46vmax;
  top: 34%;
  right: -26vmax;
  opacity: 0.07;
}

/* ----------------------------- Layout ----------------------------- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(clamp(28px, 7vw, 60px) + var(--safe-top)) clamp(16px, 4vw, 38px)
    calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4.5vw, 40px);
  min-height: 100svh;
}

.shell__main {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4.5vw, 40px);
  flex: 1 1 auto;
}

/* ----------------------------- Hero ----------------------------- */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fade-in 0.7s var(--ease) both;
}
.hero__kicker {
  font-size: clamp(0.68rem, 2.4vw, 0.82rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
  padding-left: 0.42em;
}
.hero__brand { width: 100%; display: flex; justify-content: center; }
.hero__logo {
  width: clamp(210px, 62vw, 400px);
  height: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.5));
}
.hero__tagline {
  font-family: var(--font-marker);
  font-size: clamp(1.35rem, 5.6vw, 2rem);
  line-height: 1.15;
  color: var(--orange-soft);
  transform: rotate(-1.6deg);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.squiggle {
  color: var(--orange);
  width: clamp(96px, 26vw, 150px);
  height: auto;
  opacity: 0.9;
}

/* ----------------------------- Rutas (tarjetas) ----------------------------- */
.routes {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 3.4vw, 22px);
  flex: 1 1 auto;
}

.route {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius);
  min-height: 40vh;
  min-height: 40svh;
  box-shadow: var(--shadow);
  background: #101011;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
}

.route__media,
.route__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.route__media img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform var(--dur) var(--ease);
  will-change: transform;
}

/* Overlay oscuro semitransparente: garantiza contraste del texto blanco */
.route__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(20, 20, 21, 0.45) 0%, rgba(20, 20, 21, 0.18) 34%, rgba(18, 18, 19, 0.82) 78%, rgba(14, 14, 15, 0.94) 100%),
    rgba(20, 20, 21, 0.28);
  transition: background 0.35s var(--ease);
}

.route__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 40vh;
  min-height: 40svh;
  padding: clamp(20px, 5vw, 30px);
  text-align: left;
}

.route__eyebrow {
  font-size: clamp(0.66rem, 2.2vw, 0.76rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--orange-soft);
  font-weight: 600;
}

.route__title {
  font-size: clamp(1.5rem, 6.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
  text-wrap: balance;
}

.route__cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--dark-2);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.35);
  font-weight: 700;
  font-size: clamp(0.92rem, 3.2vw, 1rem);
  box-shadow: 0 10px 26px -10px rgba(236, 104, 29, 0.9);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.route__cta .icon { transition: transform 0.3s var(--ease); }

.route__accent {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease);
}

.route__num {
  position: absolute;
  z-index: 2;
  top: clamp(14px, 4vw, 22px);
  left: clamp(18px, 5vw, 28px);
  font-family: var(--font-marker);
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.route__lock {
  position: absolute;
  z-index: 2;
  top: clamp(52px, 13vw, 60px);
  right: clamp(18px, 5vw, 28px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 10, 11, 0.5);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ----------------------------- Footer ----------------------------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(0.74rem, 2.6vw, 0.84rem);
  color: var(--muted-2);
  letter-spacing: 0.04em;
  padding-top: 4px;
}
.footer__brand { color: var(--white); font-weight: 600; }
.footer__brand sup { font-size: 0.6em; }
.footer__sep { opacity: 0.5; }

/* ----------------------------- Reveal on scroll ----------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ----------------------------- Hover / puntero fino ----------------------------- */
@media (hover: hover) and (pointer: fine) {
  .route:hover .route__media img { transform: scale(1.09); }
  .route:hover .route__scrim {
    background:
      linear-gradient(180deg, rgba(20, 20, 21, 0.5) 0%, rgba(20, 20, 21, 0.2) 30%, rgba(18, 18, 19, 0.86) 76%, rgba(14, 14, 15, 0.96) 100%),
      rgba(20, 20, 21, 0.34);
  }
  .route:hover .route__cta {
    transform: translateY(-2px);
    background: var(--orange-soft);
    box-shadow: 0 16px 34px -12px rgba(236, 104, 29, 1);
  }
  .route:hover .route__cta .icon { transform: translateX(4px); }
  .route:hover .route__accent { transform: scaleX(1); }
  .route:focus-visible .route__cta { background: var(--orange-soft); }
}

/* ----------------------------- Tablet ----------------------------- */
@media (min-width: 700px) {
  .routes { grid-template-columns: repeat(3, 1fr); }
  .route { min-height: 58vh; min-height: 58svh; }
  .route__body { min-height: 58vh; min-height: 58svh; }
  .route__lock { top: clamp(14px, 4vw, 22px); }
}

/* ----------------------------- Desktop amplio ----------------------------- */
@media (min-width: 880px) {
  .hero { gap: 12px; }
  .route { min-height: 62vh; min-height: 62svh; }
  .route__body { min-height: 62vh; min-height: 62svh; padding: 30px; }
  .route__title { font-size: clamp(1.6rem, 2vw, 2rem); }
}

/* ==========================================================================
   Página de estado (mantenimiento mayorista)
   ========================================================================== */
.shell--status { justify-content: center; }

.status {
  justify-content: center;
  gap: clamp(20px, 4.5vw, 34px);
}

.hero--compact { gap: 0; }
.hero--compact .hero__logo { width: clamp(190px, 54vw, 320px); }

.status__card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(26px, 6vw, 48px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(236, 104, 29, 0.18) 0%, rgba(236, 104, 29, 0) 58%),
    rgba(20, 20, 21, 0.72);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.status__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--orange);
}

.status__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto clamp(16px, 4vw, 22px);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(236, 104, 29, 0.5);
  background: rgba(236, 104, 29, 0.14);
  color: var(--orange-soft);
  font-size: clamp(0.68rem, 2.4vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status__title {
  margin: 0 0 clamp(14px, 3.5vw, 18px);
  font-size: clamp(1.55rem, 7vw, 2.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.status__text {
  margin: 0 auto clamp(14px, 3.5vw, 18px);
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 3.5vw, 1.08rem);
  line-height: 1.6;
}

.status__note {
  margin: 0 auto clamp(22px, 5vw, 30px);
  max-width: 44ch;
  color: var(--muted-2);
  font-size: clamp(0.9rem, 3.2vw, 1rem);
  line-height: 1.55;
}

.status__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(0.94rem, 3.3vw, 1rem);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cta .icon { transition: transform 0.3s var(--ease); }

.cta--primary {
  background: var(--dark-2);
  color: #fff;
  border: 1px solid rgba(236, 104, 29, 0.75);
  font-weight: 700;
  box-shadow: 0 12px 30px -12px rgba(236, 104, 29, 0.95);
}

.cta--ghost {
  color: #fff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.status__hint {
  margin: clamp(22px, 5vw, 30px) 0 0;
  padding-top: clamp(18px, 4vw, 24px);
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: clamp(0.8rem, 2.9vw, 0.9rem);
  line-height: 1.55;
}
.status__link {
  color: var(--orange-soft);
  font-weight: 500;
  word-break: break-word;
}

@media (hover: hover) and (pointer: fine) {
  .cta--primary:hover {
    transform: translateY(-2px);
    background: var(--orange-soft);
    box-shadow: 0 18px 38px -14px rgba(236, 104, 29, 1);
  }
  .cta--primary:hover .icon { transform: translateX(4px); }
  .cta--ghost:hover {
    transform: translateY(-2px);
    border-color: rgba(236, 104, 29, 0.6);
    background: rgba(236, 104, 29, 0.12);
  }
}

/* ----------------------------- Preferencias ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .route__media img { transform: none; }
}
