/* Kollrich Partners */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f4ee;
  --ink: #1c1a17;
  --muted: #5c564e;
  --rule: #dcd6cc;
  --accent: #a3402a;
  --accent-dark: #86331f;
  --surface: #fffdf9;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 20px;
  --max: 1320px;
  --header-h: 60px;
  --shrink: 10px;
  --section-space: clamp(4.5rem, 10vw, 9rem);

  /* Una sola curva para todo el movimiento de la página */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
    --header-h: 72px;
    --shrink: 16px;
  }
}

@media (min-width: 1200px) {
  :root {
    --gutter: 60px;
  }
}

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

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

/* Destino de los enlaces internos: deja sitio a la cabecera fija. */
.section[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
  }
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: var(--gutter);
  z-index: 20;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 1.75rem;
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }

  .grid > .side {
    grid-column: 1 / span 4;
  }

  .grid > .main {
    grid-column: 5 / -1;
  }
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
}

/* Fondo y borde en una capa aparte: así solo se animan transform y opacity.
   Sin JavaScript queda siempre visible y a altura completa. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.js .site-header::before {
  opacity: 0;
}

.js .site-header.is-scrolled::before {
  opacity: 1;
  transform: translateY(calc(var(--shrink) * -1));
}

.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.js .site-header.is-scrolled .wrap {
  transform: translateY(calc(var(--shrink) / -2));
}

.wordmark {
  display: inline-block;
  transform-origin: left center;
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 500;
  font-variation-settings: "opsz" 24;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.js .site-header.is-scrolled .wordmark {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: no-preference) {
  .js .site-header::before,
  .js .site-header .wrap,
  .js .wordmark {
    transition: transform 500ms var(--ease), opacity 500ms var(--ease);
  }
}

@media (min-width: 768px) {
  .wordmark {
    font-size: 1.5rem;
  }
}

main {
  padding-top: var(--header-h);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 400ms var(--ease), color 400ms var(--ease),
      border-color 400ms var(--ease), transform 400ms var(--ease);
  }

  @media (hover: hover) {
    .button:hover {
      transform: translateY(-2px);
    }
  }

  /* Respuesta al tocar: breve */
  .button:active {
    transform: scale(0.97);
    transition-duration: 120ms;
  }
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.button--primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button--small {
  min-height: 2.5rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.9375rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero */

.hero {
  padding-block: clamp(3.5rem, 11vw, 9.5rem) var(--section-space);
}

.hero h1 {
  max-width: 11.5em;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 8.6vw, 8.25rem);
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  line-height: 0.98;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.hero .lede {
  max-width: 30ch;
  margin-top: clamp(1.75rem, 4vw, 3rem);
  color: var(--ink);
  font-size: clamp(1.1875rem, 1.9vw, 1.5rem);
  line-height: 1.45;
}

.hero .actions {
  margin-top: 2.25rem;
}

.hero-body {
  display: grid;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.hero-body .lede {
  margin-top: 0;
}

.hero-body .actions {
  margin-top: 2.25rem;
}

/* Escritorio: el texto arranca en el mismo borde que el titular, a ancho de
   lectura, con los botones justo debajo. Una sola columna. */
@media (min-width: 1024px) {
  .hero-body {
    margin-top: clamp(1.75rem, 4vw, 3rem);
  }

  .hero-copy {
    max-width: 34rem;
  }

  .hero-copy .lede {
    max-width: none;
  }
}

/* Sections */

.section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--rule);
}

.section h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 400;
  font-variation-settings: "opsz" 48;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section .intro {
  max-width: 36ch;
  font-size: clamp(1.1875rem, 1.9vw, 1.5rem);
  line-height: 1.45;
}

/* Criterio: enlace de texto bajo el párrafo */

.criterion-link {
  margin-top: 1.5rem;
  font-weight: 600;
}

/* Lo que hacemos: tres tarjetas, cada una un solo enlace */

.cards {
  display: grid;
  gap: 24px;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.cards > li {
  display: flex;
}

.card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}

.card:focus-visible {
  border-radius: 14px;
}

.card-tag {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.card h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.card p {
  color: var(--muted);
  line-height: 1.6;
}

/* "Ver →" al pie, con el mismo subrayado que crece de los enlaces .u */
.card-more {
  position: relative;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 600;
}

.card-more::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.15em;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.35);
  transform-origin: left center;
}

.card:hover .card-more::after,
.card:focus-visible .card-more::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: no-preference) {
  .card-more::after {
    transition: transform 500ms var(--ease);
  }
}

.also {
  max-width: 62ch;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 1rem;
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cómo funciona */

.steps {
  display: grid;
  gap: 2.25rem;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: baseline;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  font-family: var(--serif);
  font-size: 2.75rem;
  font-variation-settings: "opsz" 72;
  line-height: 1;
  color: var(--accent);
}

.steps p {
  max-width: 34ch;
  font-size: clamp(1.1875rem, 1.9vw, 1.5rem);
  line-height: 1.4;
}

@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
  }

  .steps > li {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 1.25rem;
  }

  .steps > li::before {
    font-size: 4.5rem;
  }

  .steps p {
    font-size: 1.25rem;
  }
}

/* El caso */

.side-text {
  max-width: 30ch;
  margin-top: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.5;
}

.side .actions {
  margin-top: 1.75rem;
}

.case-tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.case-meta {
  max-width: 44ch;
  color: var(--muted);
}

.case-shots {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.shots-phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  max-width: 700px;
}

.shots-screens {
  display: grid;
  gap: 2.5rem;
}

.case-meta + .case-meta {
  margin-top: 1rem;
}

/* Tres teléfonos: en columnas desde 640 px; en móvil, una fila que se desliza
   para que cada captura se lea a buen tamaño. */
.shots-phones--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
}

@media (max-width: 639px) {
  .shots-phones--3 {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }

  .shots-phones--3 .shot {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  background: var(--rule);
}

.shot--phone img {
  border-radius: 18px;
}

.shot--screen img {
  border-radius: 8px;
}

.shot figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

@media (min-width: 1024px) {
  .shots-phones {
    gap: 24px;
  }
}

/* Captura de computadora ampliada */

.zoom {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

.zoom:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

html.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(28, 26, 23, 0.96);
  color: var(--paper);
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox__body {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 4rem 1.25rem 1.5rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.lightbox__fig {
  margin: auto;
}

.lightbox__fig img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 2.5rem), var(--lb-w));
  max-height: calc(100vh - 10rem);
  max-height: calc(100dvh - 10rem);
  border: 1px solid rgba(247, 244, 238, 0.3);
  border-radius: 8px;
}

.lightbox__fig figcaption {
  max-width: 60ch;
  margin-top: 0.75rem;
  color: rgba(247, 244, 238, 0.85);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid rgba(247, 244, 238, 0.6);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* En pantallas angostas la captura se ve a tamaño real y se desliza,
   para que el texto se lea. */
@media (max-width: 899px) {
  .lightbox__fig img {
    max-width: none;
    max-height: none;
    width: var(--lb-w);
  }

  .lightbox__fig figcaption {
    position: sticky;
    left: 0;
    max-width: calc(100vw - 2.5rem);
  }
}

/* Títulos fijos: solo los dos casos y "Preguntas", y solo en escritorio.
   En móvil y tablet todo va en una columna, sin nada fijo. */
@media (min-width: 1024px) {
  .sticky-grid {
    align-items: start;
  }

  .sticky-side {
    position: sticky;
    top: calc(72px + 2rem);
  }
}

.story {
  max-width: 46ch;
}

/* Preguntas */

.faq {
  border-bottom: 1px solid var(--rule);
}

.faq details {
  border-top: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  content: "+" / "";
  flex: none;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details.is-closing summary::after {
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .faq summary::after {
    transition: transform 400ms var(--ease);
  }
}

.faq h3 {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2vw, 1.625rem);
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.faq-a p {
  max-width: 56ch;
  padding-bottom: 1.5rem;
  color: var(--muted);
}

/* Pruébalo, Para quién, Hablemos */

.main > .actions {
  margin-top: 2rem;
}

.statement {
  max-width: 22ch;
  font-family: var(--serif);
  font-size: clamp(1.875rem, 4.2vw, 3.5rem);
  font-weight: 400;
  font-variation-settings: "opsz" 60;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.contact {
  display: grid;
  gap: 2.5rem;
}

.contact dt {
  margin-bottom: 0.625rem;
  color: var(--muted);
  font-size: 1rem;
}

.contact .big-link {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  font-variation-settings: "opsz" 48;
  line-height: 1.1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* El teléfono es un enlace tel:, pero se ve igual que el texto */
.contact a.big-link:not(.u) {
  display: block;
  width: fit-content;
  text-decoration: none;
}

.contact .actions {
  margin-top: 1.5rem;
}

.contact .note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1rem;
}

/* Legal pages and 404 */

main.page {
  padding-top: calc(var(--header-h) + clamp(3.5rem, 9vw, 7.5rem));
  padding-bottom: var(--section-space);
}

.page .grid {
  row-gap: 2.5rem;
}

.page h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  line-height: 1;
  letter-spacing: -0.028em;
}

.prose {
  max-width: 62ch;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.5em;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul {
  padding-left: 1.25em;
  list-style: disc;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd + dt {
  margin-top: 0.75rem;
}

@media (min-width: 600px) {
  .facts {
    grid-template-columns: 9rem minmax(0, 1fr);
  }

  .facts dd + dt {
    margin-top: 0;
  }
}

.updated {
  color: var(--muted);
  font-size: 1rem;
}

/* Footer */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer ul {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--ink);
}

/* Enlaces con subrayado que crece al pasar el mouse o con el teclado */

.u {
  position: relative;
  text-decoration: none;
}

.u::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.15em;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.35);
  transform-origin: left center;
}

.u:hover::after,
.u:focus-visible::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: no-preference) {
  .u::after {
    transition: transform 500ms var(--ease);
  }
}

/* Estado inicial de las animaciones de entrada (assets/site.js).
   La clase js-motion solo existe si el usuario no pidió reducir el movimiento
   y Motion cargó bien; si no, todo se ve desde el principio. */

.js-motion .shot,
.js-motion [data-reveal],
.js-motion [data-stagger] > * {
  opacity: 0;
}

p,
dd {
  text-wrap: pretty;
}
