/* Rialma Studio — estilos compartidos */

@font-face { font-family: 'Atyp Display Semibold'; src: url('../assets/fonts/AtypDisplay-Semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Atyp Display Medium'; src: url('../assets/fonts/AtypDisplay-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Atyp Text Medium'; src: url('../assets/fonts/AtypText-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Atyp Text Semibold'; src: url('../assets/fonts/AtypText-Semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --color-bg: #fff;
  --color-text: #000;
  --color-666: #636363;
  --color-888: #636363;
  --color-999: #636363;
  --color-bbb: #636363;
  --color-link-hover: #4c5fa8;
  --color-cta-bg: #111;
  --color-cta-bg-hover: #333;
  --color-cta-text: #fff;
  --color-loader: #8fa0e2;
  --color-border: #eee;
  --color-placeholder: #e2e2e0;
  --font-display-semibold: 'Atyp Display Semibold', Helvetica, Arial, sans-serif;
  --font-display-medium: 'Atyp Display Medium', Helvetica, Arial, sans-serif;
  --font-text-medium: 'Atyp Text Medium', Helvetica, Arial, sans-serif;
  --font-text-semibold: 'Atyp Text Semibold', Helvetica, Arial, sans-serif;
}

/* Cross-document page transition: soft crossfade between pages. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 320ms cubic-bezier(0.22,1,0.36,1) both vt-out; }
::view-transition-new(root) { animation: 520ms cubic-bezier(0.22,1,0.36,1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg);
  font-family: var(--font-text-medium);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

a { color: #000; text-decoration: none; }
a:hover { color: var(--color-link-hover); }

:focus-visible {
  outline: 2px solid var(--color-loader);
  outline-offset: 2px;
}
.header-cta:focus-visible { outline-offset: 3px; }

p:empty { display: none; margin: 0; }

/* Safety net: future copy edits (a long title, an unbroken URL) must wrap
   inside these fixed-width text blocks instead of overflowing the layout. */
.project-title h1,
.project-text,
.servicios__text,
.other-projects__meta .name,
.other-projects__meta .blurb {
  overflow-wrap: break-word;
}

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

img, video { max-width: 100%; }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.75s cubic-bezier(0.22,1,0.36,1);
  will-change: clip-path;
}
.loader__bg { position: absolute; inset: 0; background: var(--color-loader); }
.loader__logo-wrap {
  position: absolute; top: 50vh; left: 0; right: 0; height: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; transform: translateY(-50%);
}
.loader__logo { width: clamp(140px, 16vw, 220px); height: auto; position: absolute; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: #fff; padding: 8px 24px;
  width: 100%; transition: background 0.3s;
}
.site-header.site-header--transparent { position: fixed; left: 0; right: 0; background: transparent; }

.header-text {
  font-size: 15px; font-weight: 500; line-height: 1.25; letter-spacing: -0.02em;
  color: #000; white-space: nowrap; transition: color 0.3s;
}

.header-logo-link { display: inline-flex; line-height: 0; }
.header-logo { display: block; height: 37px; width: auto; margin-top: 0px; transition: filter 0.3s; }

.site-header__nav { display: flex; align-items: center; gap: 28px; white-space: nowrap; }

.header-cta {
  background: var(--color-cta-bg); color: var(--color-cta-text);
  font-size: 15px; font-weight: 500; line-height: 1.25; letter-spacing: -0.02em;
  padding: 7px 15px; border-radius: 100px; white-space: nowrap;
  transition: background 0.3s, color 0.3s;
}
.header-cta:hover { background: var(--color-cta-bg-hover); color: var(--color-cta-text); }

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; gap: 8px; }
  .site-header__nav { gap: 12px; }
  .header-text { font-size: 12px; }
  .header-logo { height: 27px; margin-top: 0px; }
  .header-cta { font-size: 12px; padding: 6px 12px; }
  [data-clock] { display: none; }
}

/* ---------- Home: floating counter ---------- */
.work-counter {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 90;
  font-size: 16px; font-weight: 500; line-height: 1; letter-spacing: 0; color: #fff; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.work-counter--left { left: 38px; }
.work-counter--right { right: 38px; }

/* ---------- Home: work sections ---------- */
.work-section { position: relative; width: 100%; background: #fff; padding: 0; }
.work-section__frame { position: relative; width: 100%; height: 100svh; }
.work-section__media { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.work-section__overlay { position: absolute; inset: 0; background: #000; opacity: 0.4; }
.work-section__link { position: absolute; inset: 0; z-index: 5; }
.work-section__content {
  position: absolute; left: 0; right: 0; top: 42%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 0 60px; text-align: center; opacity: 0; filter: blur(14px);
  will-change: opacity, filter;
}
.work-section__chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%);
  color: #fff; font-size: 13px; font-weight: 500; line-height: 1.25; letter-spacing: 0; padding: 5px 12px;
  border-radius: 4px; white-space: nowrap;
}
.work-section__title {
  margin: 0; font-family: var(--font-display-medium);
  font-size: clamp(25px, 6.2svh, 90px); font-weight: 500; line-height: 0.98;
  letter-spacing: -0.03em; color: #fff; max-width: min(90vw, 1500px);
  white-space: normal; text-align: center; text-wrap: balance;
}

@media (max-width: 640px) {
  .work-counter { display: none; }
  .work-section__frame { height: 78svh; }
  .work-section__content { gap: 14px; padding: 0 28px; }
  .work-section__chip { font-size: 12px; padding: 4px 12px; }
  .work-section__title {
    font-size: clamp(22px, 4.2vh, 30px); line-height: 1.02; letter-spacing: -0.02em;
    max-width: 88vw;
  }
  .work-section__title br { display: none; }
}

/* ---------- Home: servicios ---------- */
.servicios { position: relative; background: #fff; width: 100%; padding: 130px 0; }
.servicios__text {
  max-width: 640px; width: 90%; margin: 0 auto; text-align: left;
  font-family: var(--font-text-medium); font-size: 25px; font-weight: 500;
  line-height: 1.1; letter-spacing: -0.015em; color: #000;
}
.servicios__text p { margin: 0; }
.servicios__text p + p { text-indent: 70px; }
.servicios__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%;
  margin: 130px auto 0; padding: 0 18px;
}
.servicios__figure { margin: 0; }
.servicios__figure img {
  display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}

@media (max-width: 640px) {
  .servicios__grid { grid-template-columns: 1fr; }

  .servicios__text {
    width: 100%; max-width: none; padding: 0 24px; margin: 0;
    font-size: 18px; letter-spacing: -0.01em;
  }
  .servicios__text p + p { text-indent: 32px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #fff; padding: 70px 5% 40px; display: flex; flex-direction: column; gap: 60px;
  border-top: 1px solid var(--color-border);
}
.site-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.site-footer__col { display: flex; flex-direction: column; gap: 6px; }
.site-footer__col p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: #000; }
.site-footer__col a { font-size: 13px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: #000; }
.footer-clock { font-size: 13px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: var(--color-666); white-space: nowrap; }
.site-footer__copy { margin: 0; font-size: 12px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: var(--color-999); }

@media (max-width: 640px) {
  .site-footer { padding-top: 50px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .site-footer__col p, .site-footer__col a, .footer-clock { font-size: 12px; }
}

/* ---------- Project: title ---------- */
.project-title { padding: 120px 5% 120px; text-align: center; }
.project-title h1 {
  margin: 0 0 4px; font-family: var(--font-display-semibold);
  font-size: clamp(32px, 5svh, 56px); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; color: #000;
}
.project-title .category { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: #000; }
.project-title .year { margin: 4px 0 0; font-size: 13px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: var(--color-bbb); }

/* ---------- Project: hero ---------- */
.project-hero-wrap { padding: 0 9% 0; }
.project-hero { position: relative; width: 100%; }
.project-hero iframe { display: block; width: 100%; height: 100%; border: 0; }
/* Vertical (9:16) video cropped to fill a 4:5 frame: 16/9 ÷ 5/4 = 142.22% height. */
.project-hero--video { background: #000 var(--poster) center / cover no-repeat; }
.project-hero--video iframe { transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1); }
.project-hero--video.is-pending iframe { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .project-hero--video iframe { transition: none; } }
.project-hero--cover { overflow: hidden; }
.project-hero--cover iframe { position: absolute; left: 0; top: 50%; height: 142.22%; transform: translateY(-50%); }
.project-hero img, .project-hero video { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-hero__duration {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.45);
  padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: #fff;
  pointer-events: none;
}

/* ---------- Project: text blocks ---------- */
.project-text {
  margin-left: 25%; width: 50%;
  font-family: var(--font-text-medium); font-size: 25px; font-weight: 500;
  line-height: 1.1; letter-spacing: -0.015em; color: #000; text-align: left;
  padding: 120px 0 0;
}
.project-text p { margin: 0; }
.project-text p + p { text-indent: 70px; }
.project-text--first { padding-top: 120px; }
.project-text--last { padding-bottom: 70px; }

@media (max-width: 640px) {
  .project-text {
    margin-left: 0; width: 100%; padding-left: 24px; padding-right: 24px;
    padding-top: 60px;
    font-size: 18px; letter-spacing: -0.01em;
  }
  .project-text--first { padding-top: 60px; }
  .project-text--last { padding-bottom: 60px; }
  .project-text p + p { text-indent: 32px; }

  .project-title { padding: 60px 6% 60px; }
}

/* ---------- Project: galleries ---------- */
.gallery-figure { margin: 0; }
.gallery-figure img, .gallery-figure video, .gallery-figure .image-slot {
  display: block; width: 100%; object-fit: cover;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}

.gallery-grid-a1 { padding: 120px 1% 0; display: grid; grid-template-columns: 48% 1fr 32%; align-items: start; }
.gallery-grid-a1 .gallery-figure:nth-child(1) { grid-column: 1; }
.gallery-grid-a1 .gallery-figure:nth-child(2) { grid-column: 3; }
.gallery-grid-a1 img, .gallery-grid-a1 .image-slot { aspect-ratio: 5/8; }
.gallery-grid-a1 .gallery-figure:nth-child(2) img, .gallery-grid-a1 .gallery-figure:nth-child(2) .image-slot { aspect-ratio: 5/7; }

.gallery-grid-square { padding: 120px 18px 0; display: flex; align-items: flex-start; gap: 18px; }
.gallery-grid-square .gallery-figure { flex: 1 1 0; }
.gallery-grid-square img, .gallery-grid-square .image-slot { aspect-ratio: 1/1; }

.gallery-grid-single { padding: 120px 33% 0; }
.gallery-grid-single img, .gallery-grid-single .image-slot { aspect-ratio: 3/4; }

.gallery-mirror-right { padding: 120px 1% 0 33%; display: flex; align-items: flex-start; gap: 1.5%; }
.gallery-mirror-right .gallery-figure { flex: 1 1 0; }
.gallery-mirror-right img, .gallery-mirror-right video, .gallery-mirror-right .image-slot { aspect-ratio: 3/4; }

.gallery-mirror-left { padding: 120px 33% 0 1%; display: flex; align-items: flex-start; gap: 1.5%; }
.gallery-mirror-left .gallery-figure { flex: 1 1 0; }
.gallery-mirror-left img, .gallery-mirror-left .image-slot { aspect-ratio: 3/4; }

.gallery-triple { padding: 120px 8% 0; display: flex; align-items: flex-start; gap: 1.5%; }
.gallery-triple .gallery-figure { flex: 1 1 0; }
.gallery-triple video { aspect-ratio: 2/3; }

.gallery-triple-square { padding: 120px 18px 0; display: flex; align-items: flex-start; gap: 18px; }
.gallery-triple-square .gallery-figure { flex: 1 1 0; }
.gallery-triple-square img { aspect-ratio: 3/4; }

@media (max-width: 640px) {
  .gallery-grid-a1,
  .gallery-grid-square,
  .gallery-grid-single,
  .gallery-mirror-right,
  .gallery-mirror-left,
  .gallery-triple,
  .gallery-triple-square {
    display: flex; flex-direction: column; gap: 32px;
    padding: 60px 16px 0;
  }
  .gallery-grid-a1 .gallery-figure:nth-child(1),
  .gallery-grid-a1 .gallery-figure:nth-child(2) { grid-column: auto; }
  .gallery-grid-a1 img, .gallery-grid-a1 .image-slot,
  .gallery-grid-a1 .gallery-figure:nth-child(2) img, .gallery-grid-a1 .gallery-figure:nth-child(2) .image-slot,
  .gallery-mirror-right img, .gallery-mirror-right video, .gallery-mirror-right .image-slot,
  .gallery-mirror-left img, .gallery-mirror-left .image-slot,
  .gallery-triple video,
  .gallery-triple-square img {
    aspect-ratio: 4/5;
  }
}

/* ---------- Project: image-slot placeholder ---------- */
.image-slot {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-placeholder); color: var(--color-666);
  font-size: 12px; font-weight: 500; text-align: center; padding: 12px;
}

/* ---------- Project: carousel ---------- */
.carousel-wrap { position: relative; padding: 120px 14% 0; }
.carousel-stage { width: 100%; height: 70vh; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.carousel-main {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
.carousel-thumbs { display: flex; justify-content: center; gap: 4px; padding: 14px 20px 0; flex-wrap: wrap; }
.carousel-thumb { height: 40px; width: auto; object-fit: contain; flex: 0 0 auto; cursor: grab; opacity: 0.5; }
.carousel-thumb.is-active { opacity: 1; }
.carousel-thumb-slot { width: 40px; height: 26px; background: var(--color-placeholder); flex: 0 0 auto; }

@media (max-width: 640px) {
  .carousel-wrap { padding: 60px 0 0; }
  .carousel-stage { height: 45vh; }
  .carousel-thumbs { display: none; }
}

/* ---------- Project: otros proyectos ---------- */
.other-projects { padding: 70px 18px 90px; border-top: 1px solid var(--color-border); }
.other-projects__heading { margin: 0 0 34px; }
.other-projects__heading p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: #000; }
.other-projects__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; align-items: start;
}
.other-projects__card { display: flex; flex-direction: column; gap: 16px; color: #000; }
.other-projects__card img, .other-projects__card .image-slot {
  width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
.other-projects__meta { display: flex; flex-direction: column; gap: 8px; }
.other-projects__meta .name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; color: #000; }
.other-projects__meta .blurb { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; color: var(--color-888); }

/* ---------- Nosotros ---------- */
.about {
  min-height: calc(100svh - 65px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 40px; padding: 60px 8%; text-align: center;
}
.about__block { display: flex; flex-direction: column; gap: 14px; }
.about__block p {
  margin: 0; max-width: min(90vw, 1040px);
  font-family: var(--font-text-medium); font-size: 18px; font-weight: 500;
  line-height: 1.5; letter-spacing: -0.01em; color: #000;
}
.about__block p.about__lead { font-family: var(--font-text-semibold); font-weight: 600; }
.about__divider { font-size: 18px; color: var(--color-bbb); }
.about__contact { display: flex; flex-direction: column; gap: 4px; }
.about__contact a {
  font-family: var(--font-text-medium); font-size: 15px; font-weight: 500;
  line-height: 1.25; letter-spacing: -0.01em; color: #000;
}

@media (max-width: 640px) {
  .about { gap: 32px; padding: 50px 24px; }
  .about__block { gap: 12px; }
  .about__block p { font-size: 16px; line-height: 1.45; }
}
