/* DigitalMedios.cl. Sin librerías: una fuente propia, tokens abajo y nada de estilos en línea (la CSP los bloquea). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  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;
}

:root {
  /* Colores. El cobalto es la barra del logo hecha color; los demás dejan que el trabajo de los clientes tenga protagonismo. */
  --grafito: #131418;
  --tinta: #0b0c0f;
  --papel: #f1f2f5;
  --blanco: #ffffff;
  --cobalto: #2b3af7;
  --cobalto-claro: #98a2ff;
  --cobalto-hover: #4452ff;
  --texto-claro: #eceef3;
  --texto-claro-suave: #a9adbd;
  --texto-oscuro: #14151a;
  --texto-oscuro-suave: #565a6b;
  --linea-clara: #dfe2e8;
  --linea-oscura: rgba(255, 255, 255, 0.14);

  /* Tipografía */
  --fuente: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --fs-base: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --fs-hero: clamp(2.6rem, 1.3rem + 6.6vw, 7rem);
  --fs-h2: clamp(2rem, 1.1rem + 3.2vw, 3.9rem);
  --fs-h2-xl: clamp(2.2rem, 1rem + 4.6vw, 5rem);

  /* Espacio */
  --gutter: clamp(1rem, 4vw, 3rem);
  --ancho: 1240px;
  --seccion: clamp(4.5rem, 3rem + 8vw, 9rem);

  --suave: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--texto-oscuro);
  background: var(--grafito);
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { word-spacing: 0.08em; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { width: min(var(--ancho), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--blanco); color: var(--texto-oscuro);
  padding: 0.7rem 1.1rem; border-radius: 4px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--cobalto-claro); outline-offset: 4px; }
.services :focus-visible, .work :focus-visible { outline-color: var(--cobalto); }

/* ---------- Botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.95rem 1.7rem; border: 0; border-radius: 4px;
  background: var(--cobalto); color: var(--blanco);
  font-weight: 650; font-size: 1.02rem; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--suave);
}
.btn:hover { background: var(--cobalto-hover); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--linea-oscura); color: var(--texto-claro); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); }

.textlink {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 0.35em; text-decoration-color: var(--cobalto-claro);
  transition: text-decoration-color 0.2s;
}
.textlink:hover { text-decoration-color: currentColor; }

/* ---------- Cabecera ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(1rem, 2.4vw, 1.75rem) var(--gutter);
}
.top__logo img { height: clamp(30px, 3.4vw, 40px); width: auto; }
.top__nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.2rem); color: var(--texto-claro); }
.top__nav a { text-decoration: none; font-size: 0.98rem; font-weight: 500; opacity: 0.82; transition: opacity 0.2s; }
.top__nav a:hover { opacity: 1; }
.top__nav .top__mail {
  opacity: 1; padding: 0.6rem 1.15rem; border-radius: 4px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4); font-weight: 600;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.top__nav .top__mail:hover { background: var(--blanco); color: var(--texto-oscuro); box-shadow: none; }

/* ---------- Portada ---------- */
.hero {
  background: var(--grafito); color: var(--texto-claro);
  padding: clamp(8.5rem, 24vh, 13rem) 0 clamp(3.5rem, 8vw, 6.5rem);
}
.hero__in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.6rem); }
.hero__bar {
  width: clamp(10px, 1.5vw, 20px); background: var(--cobalto);
  transform-origin: top; animation: barra 1s var(--suave) 0.1s both;
}
.hero h1 {
  font-size: clamp(2.3rem, 1rem + 5.2vw, 5.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance; max-width: 15em;
  animation: aparece 0.9s var(--suave) 0.25s both;
}
.hero__lead {
  margin-top: clamp(1.4rem, 2.6vw, 2.2rem); max-width: 40rem;
  font-size: clamp(1.08rem, 1rem + 0.5vw, 1.3rem); color: var(--texto-claro-suave);
  animation: aparece 0.9s var(--suave) 0.4s both;
}
.hero__cta {
  margin-top: clamp(1.6rem, 3vw, 2.4rem); display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem;
  animation: aparece 0.9s var(--suave) 0.55s both;
}
@keyframes barra { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes aparece { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Proyectos ---------- */
.work { background: var(--papel); }
.work__dark { margin-top: -1px; box-shadow: 0 -3px 0 0 var(--grafito); background: var(--grafito); color: var(--texto-claro); padding-bottom: clamp(6.5rem, 15vw, 11rem); }
.work__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.work h2 { font-size: var(--fs-h2); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.work__hint { margin-top: 0.7rem; color: var(--texto-claro-suave); }
.arrows { display: flex; gap: 0.6rem; flex-shrink: 0; }
.arrows[hidden] { display: none; }
.arrow {
  display: grid; place-items: center; width: 3.1rem; height: 3.1rem; cursor: pointer;
  background: transparent; border: 0; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--linea-oscura);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.arrow:hover { background: var(--cobalto); box-shadow: none; }

.strip {
  position: relative; z-index: 2; margin-top: calc(-1 * clamp(5.5rem, 13vw, 9.5rem) - 16px);
  display: flex; gap: clamp(0.9rem, 2vw, 1.7rem); align-items: flex-start;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 16px max(var(--gutter), calc((100vw - var(--ancho)) / 2)) clamp(3rem, 6vw, 5rem);
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--ancho)) / 2));
  scrollbar-width: thin; scrollbar-color: var(--cobalto) transparent;
}
.strip > li { flex: 0 0 clamp(205px, 22vw, 285px); scroll-snap-align: start; }
.strip > li:nth-child(even) { margin-top: clamp(1.4rem, 3vw, 2.6rem); }
.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.card img {
  width: 100%; aspect-ratio: 774 / 1032; object-fit: cover; border-radius: 4px; background: var(--grafito);
  box-shadow: 0 1.4rem 2.6rem -1.2rem rgba(10, 11, 16, 0.6);
  transition: transform 0.4s var(--suave), box-shadow 0.4s var(--suave);
}
.card:hover img, .card:focus-visible img { transform: translateY(-8px); box-shadow: 0 2rem 3rem -1.2rem rgba(10, 11, 16, 0.7); }
.card__name { display: block; margin-top: 1rem; font-size: 1.12rem; font-weight: 700; line-height: 1.2; color: var(--texto-oscuro); }
.card__type { display: block; margin-top: 0.2rem; font-size: 0.95rem; color: var(--texto-oscuro-suave); }

/* ---------- Servicios ---------- */
.services { background: var(--blanco); padding: var(--seccion) 0; border-top: 1px solid var(--linea-clara); }
.services h2 { font-size: var(--fs-h2); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.cols { margin-top: clamp(2.5rem, 6vw, 4.5rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 4rem); }
.col { border-left: clamp(5px, 0.7vw, 8px) solid var(--cobalto); padding-left: clamp(1.1rem, 2vw, 1.8rem); }
.col h3 { display: flex; align-items: flex-end; min-height: 2.2em; font-size: clamp(1.7rem, 0.9rem + 2vw, 2.6rem); font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.col > p { margin-top: 0.9rem; color: var(--texto-oscuro-suave); max-width: 28rem; }
.col > p a { color: var(--texto-oscuro); font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.col ul { margin-top: 1.6rem; }
.col li { padding: 0.75rem 0; border-top: 1px solid var(--linea-clara); font-weight: 550; }
.col li:last-child { border-bottom: 1px solid var(--linea-clara); }

/* ---------- Nosotros ---------- */
.about { position: relative; overflow: hidden; background: var(--cobalto); color: var(--blanco); padding: var(--seccion) 0; }
.about::before {
  content: "</>"; position: absolute; right: 0.02em; bottom: -0.2em; margin: 0; z-index: 0; pointer-events: none; user-select: none;
  font-size: clamp(7rem, 20vw, 19rem); font-weight: 800; line-height: 0.8; letter-spacing: -0.04em; color: rgba(255, 255, 255, 0.11);
}
.about__in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.about h2 { font-size: var(--fs-h2-xl); font-weight: 800; line-height: 0.96; letter-spacing: -0.012em; text-wrap: balance; }
.about__text p { max-width: 30rem; }
.about__text p + p { margin-top: 1.1rem; font-weight: 650; }

/* ---------- Contacto ---------- */
.contact { background: var(--grafito); color: var(--texto-claro); padding: var(--seccion) 0 clamp(3.5rem, 7vw, 6rem); }
.contact h2 { font-size: var(--fs-h2); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.contact__lead { margin-top: 1rem; max-width: 42rem; color: var(--texto-claro-suave); }
.contact__mail {
  display: inline-block; margin-top: clamp(1.6rem, 4vw, 3rem); max-width: 100%;
  font-size: clamp(1.3rem, 0.2rem + 5.4vw, 4.8rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.012em; color: var(--blanco); overflow-wrap: anywhere;
  text-decoration: underline; text-decoration-skip-ink: none; text-decoration-thickness: clamp(3px, 0.5vw, 7px); text-underline-offset: 0.14em; text-decoration-color: var(--cobalto);
  transition: text-decoration-color 0.25s, color 0.25s;
}
.contact__mail:hover { color: var(--cobalto-claro); text-decoration-color: var(--cobalto-claro); }

.foot { background: var(--grafito); color: var(--texto-claro-suave); padding-bottom: 2.5rem; }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.8rem; border-top: 1px solid var(--linea-oscura); }
.foot__logo { height: 28px; width: auto; }
.foot p { font-size: 0.95rem; }

/* ---------- Ventana del proyecto (popup) ---------- */
dialog {
  width: min(1080px, 100vw - 2rem); max-width: none; max-height: calc(100dvh - 2rem); margin: auto;
  padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--grafito); color: var(--texto-claro);
}
dialog[open] { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); animation: abre 0.32s var(--suave); }
dialog::backdrop { background: rgba(8, 9, 12, 0.8); backdrop-filter: blur(5px); }
dialog[open]::backdrop { animation: fondo 0.32s ease-out; }
@keyframes abre { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fondo { from { opacity: 0; } to { opacity: 1; } }
.visor__shot { overflow-y: auto; max-height: calc(100dvh - 2rem); background: var(--tinta); scrollbar-width: thin; }
.visor__shot img { width: 100%; height: auto; }
.visor__info { position: relative; display: flex; flex-direction: column; padding: clamp(1.6rem, 4vw, 3rem); }
.visor__close {
  position: absolute; top: 1rem; right: 1rem; display: grid; place-items: center; width: 2.8rem; height: 2.8rem;
  background: transparent; border: 0; border-radius: 4px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--linea-oscura);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.visor__close:hover { background: var(--cobalto); box-shadow: none; }
.visor__pos { color: var(--texto-claro-suave); font-size: 0.95rem; }
.visor__info h3 { margin-top: 0.6rem; padding-right: 3rem; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.visor__texto { margin-top: 1.2rem; color: var(--texto-claro); max-width: 26rem; }
.visor__tipo { margin-top: 1.1rem; align-self: flex-start; padding: 0.55rem 1rem; border-radius: 4px; background: rgba(152, 162, 255, 0.16); color: var(--cobalto-claro); font-size: 0.92rem; font-weight: 600; }
.visor__nav { margin-top: auto; padding-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ---------- Ilustraciones de servicios ---------- */
.icon { display: block; width: clamp(84px, 9vw, 120px); height: auto; margin-bottom: 1.4rem; overflow: visible; }
.i-back, .i-bar { fill: var(--cobalto); }
.i-win, .i-bubble { fill: var(--blanco); stroke: var(--texto-oscuro); stroke-width: 3; stroke-linejoin: round; }
.i-line { fill: none; stroke: var(--texto-oscuro); stroke-width: 3; stroke-linecap: square; stroke-linejoin: round; }
.i-soft { fill: #dde1ff; }
.i-dot { fill: var(--texto-oscuro); }
.i-cursor { fill: var(--texto-oscuro); stroke: var(--blanco); stroke-width: 2.5; stroke-linejoin: round; }
.i-trend { fill: none; stroke: var(--texto-oscuro); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

.about a { font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 1040px) {
  .cols { grid-template-columns: 1fr; gap: 2.8rem; }
  .col h3 { min-height: 0; }
}
@media (max-width: 900px) {
  .top__nav a:not(.top__mail) { display: none; }
  .about__in { grid-template-columns: 1fr; align-items: start; }
  dialog[open] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 52dvh) auto; overflow-y: auto; }
  .visor__shot { max-height: 52dvh; }
}
@media (max-width: 560px) {
  .arrows { display: none; }
  .work__head { align-items: flex-start; }
  .hero__in { gap: 0.9rem; }
}

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
