/* Section-specific layout. Shared pieces live in components.css. */

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding-top: calc(var(--header-h) + clamp(2.5rem, 0.8rem + 6vw, 6rem));
  padding-bottom: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 4rem 4rem;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 35%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero__layout {
  display: grid;
  gap: clamp(var(--space-7), 2rem + 4vw, var(--space-8));
  align-items: center;
}

.hero__title {
  margin-block: var(--space-5) var(--space-6);
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
}

.hero__title em {
  font-style: normal;
  color: var(--lime-500);
}

.mask-line {
  display: block;
}

.js-motion .mask-line {
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.js-motion .mask-line > span {
  display: inline-block;
  transform: translateY(108%);
  transition: transform 1000ms var(--ease-out);
  transition-delay: calc(120ms + var(--i, 0) * 90ms);
}

.js-motion .hero.is-loaded .mask-line > span {
  transform: none;
}

.js-motion .hero-fade {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 800ms var(--ease-out),
    transform 800ms var(--ease-out);
  transition-delay: var(--d, 400ms);
}

.js-motion .hero.is-loaded .hero-fade {
  opacity: 1;
  transform: none;
}

.hero__lead {
  max-width: 36rem;
  color: var(--fg-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-7);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero__facts li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--lime-500);
}

@media (max-width: 29.99rem) {
  .hero__actions .btn {
    flex: 1 1 100%;
  }
}

@media (min-width: 64rem) {
  .hero {
    min-height: min(100svh, 62rem);
  }

  .hero__layout {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-6);
  }
}

/* ---------- Hero visual: the DEVKO mark as a system ---------- */
.hero-visual {
  container: hero-visual / inline-size;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

.hero-visual__stage {
  position: relative;
  aspect-ratio: 640 / 600;
}

.hero-visual__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-visual__lattice {
  fill: var(--purple-700);
}

.hero-visual__dot {
  fill: var(--lime-500);
  transform-box: fill-box;
  transform-origin: center;
}

.wire {
  fill: none;
  stroke: var(--lime-500);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.junction {
  fill: var(--lime-500);
}

.packet {
  fill: var(--devko-white);
}

.hero-visual__legend {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  fill: var(--ink-300);
}

.hero-visual__caption {
  margin-top: var(--space-4);
  font-size: var(--fs-small);
  color: var(--fg-subtle);
  text-align: center;
}

/* Intro choreography: structure first, then modules, then the connections. */
.js-motion .hero-visual__mark {
  opacity: 0;
  transform: scale(0.94);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 900ms var(--ease-out) 250ms,
    transform 1200ms var(--ease-out) 250ms;
}

.js-motion .hero-visual__dot {
  transform: scale(0);
  transition: transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(650ms + var(--i, 0) * 110ms);
}

.js-motion .wire {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 900ms var(--ease-in-out);
  transition-delay: calc(1000ms + var(--i, 0) * 120ms);
}

.js-motion .hero-node {
  opacity: 0;
  translate: 0 0.75rem;
  transition:
    opacity 700ms var(--ease-out),
    translate 700ms var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
  transition-delay: calc(1450ms + var(--i, 0) * 110ms), calc(1450ms + var(--i, 0) * 110ms), 0ms, 0ms;
}

.js-motion .hero.is-loaded .hero-visual__mark {
  opacity: 1;
  transform: none;
}

.js-motion .hero.is-loaded .hero-visual__dot {
  transform: none;
}

.js-motion .hero.is-loaded .wire {
  stroke-dashoffset: 0;
}

.js-motion .hero.is-loaded .hero-node {
  opacity: 1;
  translate: 0 0;
}

.hero-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 31.25%;
  height: 20%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 2.6cqi 3cqi;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 2.4cqi;
  background: rgb(17 14 27 / 0.94);
  color: var(--devko-white);
  text-decoration: none;
  overflow: hidden;
}

.hero-node:hover {
  border-color: var(--lime-500);
  background: var(--ink-800);
}

.hero-node:focus-visible {
  outline-offset: 2px;
}

.hero-node__index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--ink-400);
}

.hero-node__name {
  font-family: var(--font-display);
  font-size: clamp(0.8125rem, 3.4cqi, 1.125rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-node__meta {
  display: none;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--ink-300);
}

@container hero-visual (min-width: 30rem) {
  .hero-node__meta {
    display: block;
  }
}

@container hero-visual (max-width: 26rem) {
  .hero-visual__legend {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .packet {
    display: none;
  }
}

/* ---------- Clients ---------- */
.hero__clients {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  margin-top: clamp(var(--space-7), 1.5rem + 5vw, var(--space-9));
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

/* =========================================================
   Soluciones
   ========================================================= */
.solutions__statement {
  max-width: 24ch;
  margin-top: var(--space-5);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.05rem + 2.9vw, 3.75rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.solutions__statement strong {
  font-weight: 600;
  color: var(--purple-700);
}

.shift-list {
  display: grid;
  margin-block: clamp(var(--space-7), 2rem + 4vw, var(--space-9));
  border-top: 1px solid var(--line-strong);
}

.shift {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line-strong);
}

.shift__label {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.shift__from {
  color: var(--fg-muted);
  font-size: var(--fs-body-lg);
}

.shift__arrow {
  display: none;
  color: var(--purple-700);
}

.shift__to {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 600;
}

@media (min-width: 48rem) {
  .shift {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-6);
  }

  .shift__arrow {
    display: block;
  }
}

.paths {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 56rem) {
  .paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   Productos
   ========================================================= */
.products__layout {
  display: grid;
  gap: var(--space-7);
}

.products__aside {
  display: grid;
  gap: var(--space-6);
  align-content: start;
}

.products__aside .h2 {
  font-size: clamp(2.125rem, 1.35rem + 2.4vw, 3.5rem);
}

.products__panels {
  display: grid;
  gap: clamp(var(--space-5), 1rem + 2vw, var(--space-7));
}

.product-panel {
  scroll-margin-top: calc(var(--header-h) + var(--space-5));
}

.product-panel__visual {
  background:
    radial-gradient(120% 90% at 90% 0%, color-mix(in srgb, var(--product-accent) 30%, transparent), transparent 62%),
    var(--ink-850);
}

.product-panel--invetko {
  --product-accent: var(--accent-invetko-on-dark);
}

.product-panel--dentis {
  --product-accent: var(--accent-dentis);
}

.product-panel--cortina {
  --product-accent: var(--accent-cortina-on-dark);
}

.product-panel--caelum {
  --product-accent: var(--accent-caelum);
}

.product-panel--invetko .mock {
  --mock-accent: var(--accent-invetko);
}

.product-panel--cortina .mock {
  --mock-accent: var(--accent-cortina);
}

.product-index__link[href="#producto-invetko"] {
  --product-accent: var(--accent-invetko-on-dark);
}

.product-index__link[href="#producto-dentis"] {
  --product-accent: var(--accent-dentis);
}

.product-index__link[href="#producto-cortinaeduca"] {
  --product-accent: var(--accent-cortina-on-dark);
}

.product-index__link[href="#producto-caelum"] {
  --product-accent: var(--accent-caelum);
}

@media (min-width: 64rem) {
  .products__layout {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-8);
    align-items: start;
  }

  .products__aside {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
  }
}

/* =========================================================
   A la medida
   ========================================================= */
.custom__layout {
  display: grid;
  gap: clamp(var(--space-7), 2rem + 4vw, var(--space-9));
}

.custom__copy {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.custom__foot {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.custom__foot .btn {
  justify-self: start;
}

.custom__disclaimer {
  font-size: var(--fs-small);
  color: var(--fg-muted);
}

@media (min-width: 64rem) {
  .custom__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

/* =========================================================
   Proceso
   ========================================================= */
.process-section .section-head {
  max-width: 48rem;
}

/* =========================================================
   Nosotros
   ========================================================= */
.about__layout {
  display: grid;
  gap: var(--space-7);
}

.about__intro {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.about__place {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--fg);
}

.about__place .icon {
  color: var(--lime-500);
}

@media (min-width: 64rem) {
  .about__layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-8);
    align-items: start;
  }

  .about__intro {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
  }
}

/* =========================================================
   Contacto
   ========================================================= */
.contact {
  overflow: hidden;
  isolation: isolate;
}

.contact__art {
  --logo-dots: rgb(4 3 3 / 0.05);
  position: absolute;
  z-index: -1;
  left: -8rem;
  bottom: -9rem;
  width: clamp(18rem, 36vw, 34rem);
  color: rgb(4 3 3 / 0.035);
  pointer-events: none;
}

.contact__layout {
  display: grid;
  gap: var(--space-7);
}

.contact__intro {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.contact__title {
  font-size: clamp(2.75rem, 1.4rem + 4.4vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
}

.contact__text {
  font-size: var(--fs-lead);
  color: var(--fg-muted);
  max-width: 30rem;
}

.contact__channels {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.contact__channels a,
.contact__channels span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact__channels a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.3em;
}

.contact__channels a:hover {
  text-decoration-color: currentColor;
}

.contact__card {
  padding: clamp(var(--space-5), 1rem + 2.5vw, var(--space-7));
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 2rem 4rem -2rem rgb(4 3 3 / 0.5);
}

.contact__card-title {
  margin-bottom: var(--space-2);
  font-size: var(--fs-h3);
}

.contact__card-sub {
  margin-bottom: var(--space-6);
  font-size: var(--fs-small);
  color: var(--fg-muted);
}

@media (min-width: 64rem) {
  .contact__layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-8);
    align-items: start;
  }
}

/* Single-column layouts: let the track shrink below its content (e.g. a no-wrap button at 320 px). */
@media (max-width: 63.99rem) {
  .hero__layout,
  .products__layout,
  .custom__layout,
  .about__layout,
  .contact__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
