/* ---------- Fonts ----------
   Inter (variable, weights 100–900) served from our own /fonts folder
   instead of Google Fonts: faster (no extra domain) and no visitor data
   sent to a third party. Files from @fontsource-variable/inter 5.3.0,
   SIL Open Font License (fonts/LICENSE-Inter.txt). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght.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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght.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;
}

/* ---------- Reset & base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #000000;
  --text: #191919;
  --accent: #135bd9;
  --gray-dark: #555555;
  --gray: #707070;
  --gray-light: #e8e8e8;
  --bg: #fafafa;
  --white: #ffffff;
  --max-width: 1680px;

  /* Spacing scale: fixed steps for inside components, fluid steps for
     page rhythm, so whitespace grows with the screen instead of the
     layout feeling cramped on wide monitors. */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --gutter: clamp(24px, 5.5vw, 104px);
  --gap: clamp(12px, 1.4vw, 24px);
  /* Header to the first content: the same on every page. */
  --page-top: 24px;
  --section-s: clamp(56px, 6vw, 104px);
  --section: clamp(80px, 9vw, 160px);
  --columns-gap: clamp(40px, 6vw, 120px);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Custom cursor ---------- */
/* !important: no component rule (pointer, grab…) may bring back the system
   cursor next to the dot. */
.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

/* Two layers: .cursor is moved every frame by JS (smoothed position),
   .cursor-dot inside handles the look and its own transitions, so the
   hover/press animations never fight the movement. */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: transform;
}

.cursor.is-visible {
  opacity: 1;
}

.cursor-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  transition:
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.cursor-dot--press {
  width: 12px;
  height: 12px;
}

.cursor-dot--hover {
  width: 10px;
  height: 10px;
  background: transparent;
  border-color: var(--accent);
}

.cursor-dot--hover.cursor-dot--press {
  width: 7px;
  height: 7px;
}

@media (hover: none), (pointer: coarse) {
  .cursor {
    display: none;
  }
}

/* Tap feedback on touch screens (initTapDot): the dot appears filled
   under the finger, opens into a ring like the cursor's hover state,
   and fades out. */
.tap-dot {
  position: fixed;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  animation: tap-dot 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tap-dot {
  0% {
    transform: scale(0.5);
    opacity: 0.95;
  }
  35% {
    background-color: transparent;
    opacity: 0.9;
  }
  100% {
    transform: scale(2.6);
    background-color: transparent;
    opacity: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Once the page has scrolled, the header that slides back in carries
   the page background (slightly see-through, blurred) and a hairline,
   so it never reads on top of the content beneath it. */
.site-header.header--scrolled {
  background: rgba(250, 250, 250, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header.header--hidden {
  transform: translateY(-100%);
}

/* Pages without a full-bleed hero need the header's own height reserved
   as top padding, or its content starts underneath the (transparent,
   but still clickable) fixed header. Pages with .project-hero skip this
   — the header floats over the hero image on purpose. */
body {
  padding-top: 146px;
}

body.has-hero {
  padding-top: 0;
}

@media (max-width: 800px) {
  body {
    padding-top: 90px;
  }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 146px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-full {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.logo-full .logo-full-dark {
  fill: var(--black);
}

.logo-full .logo-full-dot {
  fill: var(--accent);
}

.logo:hover {
  text-decoration: none;
}

@media (max-width: 800px) {
  .logo-full {
    height: 36px;
  }
}

.nav-desktop ul {
  display: flex;
  gap: 36px;
}

.nav-desktop a {
  font-size: 15.7px;
  font-weight: 400;
  position: relative;
  padding-bottom: 4px;
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--black);
}

.nav-desktop a.active::after {
  width: 100%;
  height: 2px;
  bottom: -4px;
  background: var(--accent);
}

/* With JS: one blue line for the whole menu (initNavIndicator) that slides in
   from the section you came from; the static line above stays as the
   fallback without JS. */
.nav-desktop ul {
  position: relative;
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
}

.nav-indicator.is-ready {
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

.has-nav-indicator a.active::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-indicator.is-ready {
    transition: none;
  }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--black);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 146px 0 0 0;
  background: var(--bg);
  z-index: 99;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-mobile.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-mobile ul {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--gutter);
  gap: 32px;
}

.nav-mobile a {
  font-size: 24px;
  font-weight: 500;
}

.nav-mobile a.active {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 9px;
}

@media (max-width: 800px) {
  .site-header .container {
    height: 90px;
  }
  .nav-mobile {
    inset: 90px 0 0 0;
  }
  .nav-desktop {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-mobile {
    display: block;
  }
}

/* ---------- Hero ---------- */
/* The projects follow right after the intro: close enough to read as the
   page's main content, so more of the first cards show on the first screen. */
.hero {
  padding: var(--page-top) 0 var(--space-5);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--columns-gap);
  align-items: start;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .hero {
    padding-bottom: var(--section-s);
  }
}

.hero h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero .services-tag {
  margin-top: var(--space-3);
  font-size: 15.7px;
  color: var(--gray);
}

.hero .lead-col {
  padding-top: 8px;
}

.hero p.lead {
  font-size: 18px;
  color: var(--text);
  /* Avoids a short last line next to the big title. */
  text-wrap: pretty;
}

/* ---------- Section heading ---------- */
.section-heading {
  padding: var(--page-top) 0 var(--space-5);
}

.section-heading h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Project grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  padding-bottom: var(--section);
}

@media (max-width: 700px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: block;
  cursor: pointer;
}

.project-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.project-card:hover .project-thumb img,
.project-card.is-centered .project-thumb img {
  filter: brightness(0.9);
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.project-card:hover .project-thumb::after,
.project-card.is-centered .project-thumb::after {
  background: rgba(0, 0, 0, 0.12);
}

.project-thumb > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.project-sub {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.project-card:hover .project-thumb > span,
.project-card.is-centered .project-thumb > span,
.project-card:hover .project-sub,
.project-card.is-centered .project-sub {
  opacity: 1;
}

/* Medal of a project (prize, contest, recognition): top-left corner, shown
   with the name on hover (or on the centered row without a mouse). Real
   text, so search engines and AI read it. */
.project-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.project-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.project-badge-item::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.project-card:hover .project-badge,
.project-card.is-centered .project-badge {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .project-badge {
    transform: none;
  }
}

/* ---------- Services page ---------- */
/* Three services side by side, like a catalog: title, photo, text and what
   each one includes. */
.services-grid {
  padding: 24px 0 0; /* same as Estudio: titles close to the header */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 3.5vw, 64px);
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-5);
  }
}

/* The one-line ribbon must not widen the card. */
.service-card {
  min-width: 0;
}

.service-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.service-thumb picture {
  display: block;
  width: 100%;
  height: 100%;
}

.service-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-thumb span {
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 20px;
}

.service-card h2 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.service-card p {
  color: var(--gray-dark);
}

/* What each service includes: gray text separated by dots, running as a
   one-line ribbon at a slow pace. The list is written twice so the loop has
   no gap; the speed is set per card in js/script.js (initTicker). */
.service-card p.service-includes {
  margin-top: var(--space-2);
  font-size: 15px;
  color: var(--gray);
}

.ticker {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.ticker-track {
  flex: none;
  display: flex;
  animation: ticker var(--ticker-dur, 30s) linear infinite;
}

.ticker .sep {
  padding: 0 0.6em;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker {
  to {
    transform: translateX(-100%);
  }
}

/* Without motion: the plain list, wrapping on several lines. */
@media (prefers-reduced-motion: reduce) {
  .ticker {
    display: block;
    white-space: normal;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .ticker-track {
    display: inline;
    animation: none;
  }

  .ticker-track[aria-hidden] {
    display: none;
  }

  .ticker-track > span:not(.sep) {
    white-space: nowrap;
  }

  .ticker-track > .sep:last-child {
    display: none;
  }
}

/* Short line of each service: only in the phone rows below. */
.service-short {
  display: none;
}

.service-link {
  color: inherit;
}

/* Phones and small tablets: the three services at once, as rows with a
   small 4:5 photo, the name and one line. The whole row opens the
   service page (the title link stretches over it). */
@media (max-width: 900px) {
  .services-grid {
    row-gap: 0;
    border-top: 1px solid var(--gray-light);
  }

  .service-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-areas:
      "photo title arrow"
      "photo short arrow";
    column-gap: var(--space-2);
    align-content: center;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
  }

  .service-card h2 {
    grid-area: title;
    align-self: end;
    margin: 0;
    font-size: 17px;
  }

  .service-card .service-thumb {
    grid-area: photo;
    margin: 0;
  }

  .service-card p.service-short {
    grid-area: short;
    align-self: start;
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--gray-dark);
  }

  .service-card > p:not(.service-short) {
    display: none;
  }

  .service-card::after {
    content: "→";
    grid-area: arrow;
    font-size: 16px;
    color: var(--gray);
  }

  .service-link::after {
    content: "";
    position: absolute;
    inset: 0;
  }
}

/* Call to action right under the cards, before the FAQ. */
.services-cta {
  padding: var(--space-5) 0 var(--section);
  text-align: center;
}

/* Invitation to write at the end of the home and of each project. */
.page-cta {
  padding: var(--section-s) 0;
  text-align: center;
}

/* Home: the grid already ends with a section of space. */
.projects + .page-cta {
  padding: 0 0 var(--space-4);
}

.faq-heading {
  padding-top: 0;
  padding-bottom: var(--space-3);
}

/* Visible only to screen readers and search engines. */
.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;
}

.faq-heading h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.faq-list {
  padding: 0 0 var(--space-4);
  display: grid;
}

.faq-item {
  border-top: 1px solid var(--gray-light);
  padding: 28px 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--gray-light);
}

.faq-item summary {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--gray);
  flex: none;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-item p {
  color: var(--gray-dark);
  max-width: 640px;
  margin-top: var(--space-2);
}

.cta-block {
  border-top: 1px solid var(--gray-light);
  border-bottom: 1px solid var(--gray-light);
  padding: var(--section) 0;
  text-align: center;
}

.cta-text {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.btn {
  display: inline-block;
  padding: 13px 30px;
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.75;
}

/* ---------- Studio page ---------- */
/* As on estudiopunto.com (Squarespace), measured at 1440px: the
   founders' photo on the left half (slightly taller than wide), their
   names with a small LinkedIn link under it, and on the right "¡Hola!"
   and the text, both starting at the top of the photo. It closes on
   the brand line set large, ending in the blue dot of the logo. */
.about {
  /* Bottom room for the names under the photo, kept short so the closing
     line shows on a laptop's first screen. */
  /* Below: 12px to the names, their line, then 48px of air before the
     closing statement (kept so it still shows on a laptop's first screen). */
  padding: 24px 0 84px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(22, minmax(0, 1fr));
  column-gap: 11px;
  align-items: stretch;
}

/* The photo grows to the height of the text beside it. */
.about-photo {
  grid-column: 1 / 12;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.about-photo-frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--gray-light);
}

.about-photo-frame picture,
.about-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-founders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 11px;
  margin-top: 12px;
}

.founder {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding-right: 11px;
}

/* Once placed by script, each name sits centred under its person. */
.about-founders.is-placed {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: block;
}

/* Name with its LinkedIn logo beside it, centred under the person. */
.about-founders.is-placed .founder {
  position: absolute;
  top: 0;
  /* Centre the name itself: half of gap + logo (8 + 15px) to the right. */
  transform: translateX(calc(-50% + 11.5px));
  white-space: nowrap;
  padding-right: 0;
}

.founder-name {
  font-size: 16px;
  color: var(--black);
}

.founder a {
  display: inline-flex;
  padding: 6px;
  margin: -6px;
  /* LinkedIn's own blue, not the brand accent. */
  color: #0a66c2;
  transition: color 0.2s ease;
}

.founder a svg {
  width: 15px;
  height: 15px;
}

.founder a:hover {
  color: #004182;
}

.about-text {
  grid-column: 13 / 23;
}

.about-text h1 {
  font-size: clamp(34px, 3.65vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--black);
  margin-bottom: 14px;
}

.about-text p {
  font-size: 16px;
  line-height: 1.4;
  color: var(--black);
}

.about-text p + p {
  margin-top: var(--space-2);
}

/* Greeting above the heading: the h1 carries what the page is about. */
.about-text h1.about-lead {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

.about-text .about-hello {
  font-size: 18px;
  color: var(--gray-dark);
  margin-bottom: var(--space-1);
}

/* Second voice: history and process, in grey below the main statement. */
.about-text-more {
  margin-top: 32px;
}

.about-text .about-text-more p {
  color: var(--gray-dark);
}

@media (max-width: 500px) {
  /* The two people stand close: each name leans outward from its person. */
  .founder-name {
    font-size: 15px;
  }

  .about-founders.is-placed .founder:first-child {
    transform: translateX(-72%);
  }

  .about-founders.is-placed .founder:last-child {
    transform: translateX(-28%);
  }
}

@media (max-width: 900px) {
  /* Phones: 40px from the names to the text, 64px to the closing. */
  .about {
    padding-bottom: var(--space-5);
  }

  .about-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-4);
  }

  .about-photo,
  .about-text {
    grid-column: 1 / -1;
  }

  .about-photo-frame {
    flex: none;
    aspect-ratio: 3 / 2;
  }

  .about-founders.is-placed {
    position: relative;
    top: auto;
    height: 30px;
  }

  .about-text p,
  .about-text h1.about-lead {
    font-size: 15px;
  }
}

/* Closing: the line people remember and the call to write. */
/* The footer brings its own top space, so the last block keeps little. */
.about-statement {
  padding: 0 0 var(--space-4);
}

.about-statement-grid {
  display: grid;
  grid-template-columns: repeat(22, minmax(0, 1fr));
  column-gap: 11px;
  align-items: end;
}

.about-statement-line {
  grid-column: 1 / 15;
  font-size: clamp(30px, 3.2vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--black);
  text-wrap: balance;
}

/* The blue dot of the logo closing a headline (home and Estudio). */
.brand-dot {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin-left: 0.06em;
  border-radius: 50%;
  background: var(--accent);
}

.about-statement-side {
  grid-column: 16 / 23;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  /* Lift the button so its bottom meets the baseline of the last line. */
  margin-bottom: 8px;
}

.about-statement-side p {
  font-size: 16px;
  line-height: 1.4;
  color: var(--black);
}

@media (max-width: 767px) {
  .about-statement-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-4);
  }

  .about-statement-line,
  .about-statement-side {
    grid-column: 1 / -1;
  }

  .about-statement-side p {
    font-size: 15px;
  }
}

/* ---------- Contact page ----------
   Left: the headline with the blue dot, what happens after writing and the
   email. Right: the form in a white box. On phones the form comes right
   after the headline (people open Contacto to write) and the rest follows. */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  grid-template-areas:
    "intro form"
    "more form";
  grid-template-rows: auto 1fr;
  column-gap: var(--columns-gap);
  padding: 8px 0 var(--space-4);
  align-items: start;
}

.contact-intro {
  grid-area: intro;
}

.contact-more {
  grid-area: more;
}

.contact-form,
.form-sent {
  grid-area: form;
}

.contact-title {
  font-size: clamp(30px, 3.2vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.contact-steps {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  border-top: 1px solid var(--gray-light);
}

.contact-steps li {
  display: flex;
  gap: var(--space-2);
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
  font-size: 14px;
  color: var(--gray-dark);
}

.contact-steps span {
  flex: none;
  padding-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.contact-direct {
  margin-top: var(--space-5);
}

.contact-label {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--gray);
}

.contact-direct a {
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.contact-form {
  display: grid;
  gap: 22px;
  padding: clamp(28px, 2.8vw, 44px);
  background: var(--white);
  border: 1px solid #dedede;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 48px -12px rgba(0, 0, 0, 0.1);
}

.contact-form[hidden] {
  display: none;
}

/* What they need: several options can be picked, none is required.
   js/script.js joins the picked ones into the hidden "servicios" field. */
.contact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-chips legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 15px;
  color: var(--text);
}

.contact-chips legend em,
.contact-field label em {
  font-style: normal;
  color: var(--gray);
}

.contact-chips legend em::before {
  content: "· ";
}

/* Every row of options fills the width, so no option is ever left alone
   at the end of a short row; «Otro» and «No lo sé» always travel together. */
.contact-chips label {
  position: relative;
  flex: 1 1 auto;
}

.contact-chips-pair {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
}

.contact-chips input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.contact-chips span {
  display: block;
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
  border: 1px solid #dcdcdc;
  font-size: 13px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.contact-chips label:hover span {
  border-color: var(--black);
}

.contact-chips input:checked + span {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.contact-chips input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Nombre · Correo · Teléfono side by side while the form is wide. */
.contact-row-3 {
  grid-template-columns: 1fr 1.25fr 1fr;
}

@media (max-width: 1100px) and (min-width: 901px) {
  .contact-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .contact-row-3 > :first-child {
    grid-column: 1 / -1;
  }
}

.contact-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dcdcdc;
  border-radius: 0;
  background: var(--bg);
  font: inherit;
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

.contact-field textarea::placeholder {
  color: #a3a3a3;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--black);
  background: var(--white);
}

/* Optional attachment: a drop zone. Dragging a file over it lights it up;
   clicking it opens the file picker. */
.contact-file {
  display: grid;
  gap: 8px;
}

.contact-file-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  width: fit-content;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.contact-file-title::-webkit-details-marker {
  display: none;
}

.contact-file-title::before {
  content: "+";
  width: 10px;
  font-weight: 500;
}

.contact-file[open] .contact-file-title::before {
  content: "−";
}

.contact-file-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-file-title em {
  font-style: normal;
  font-size: 13px;
  color: var(--gray);
}

.contact-field .contact-drop {
  position: relative;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 16px;
  border: 1px dashed #c4c4c4;
  text-align: center;
  font-size: 14px;
  color: var(--gray-dark);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-drop u {
  text-underline-offset: 3px;
  color: var(--text);
}

.contact-drop:hover,
.contact-drop.is-over {
  border-color: var(--accent);
  background: rgba(19, 91, 217, 0.04);
}

.contact-drop.has-file {
  border-style: solid;
}

.contact-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.contact-file-input:focus-visible + .contact-drop-text {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.contact-file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.contact-file-name:empty {
  display: none;
}

.contact-file .field-error {
  margin-top: 0;
}

.contact-submit {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding-top: 22px;
  border-top: 1px solid var(--gray-light);
}

/* Same black-bordered button as the other calls to action, filled black.
   Scoped to the form so it wins over the general .project-link rules. */
.contact-form .contact-send {
  width: 100%;
  justify-content: center;
  padding-top: 18px;
  padding-bottom: 18px;
  font-size: 16px;
  gap: var(--space-2);
  background: var(--black);
  color: var(--white);
  font-family: inherit;
}

.contact-form .contact-send:hover {
  background: var(--white);
  color: var(--black);
}

.contact-form .contact-send:hover svg {
  transform: translateX(3px);
}

.contact-form .contact-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.contact-submit .form-note {
  font-size: 13px;
  text-align: center;
  color: var(--gray);
}

.contact-submit .form-note strong {
  font-weight: 500;
  color: var(--text);
}

.contact-submit .form-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Field messages: the studio's blue dot and plain text, the field's line
   turning blue. Same look for the message when sending fails. */
.contact-field input[aria-invalid="true"],
.contact-field textarea[aria-invalid="true"] {
  border-color: var(--accent);
}

.field-error,
.contact-form .form-error {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.contact-form .form-error {
  margin-top: 0;
  font-size: 14px;
}

.contact-form .form-error[hidden] {
  display: none;
}

.field-error::before,
.contact-form .form-error::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}

/* When sending fails: the field shakes briefly and its blue dot pulses. */
.is-nudged {
  animation: nudge 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.is-nudged .field-error::before,
.form-error.is-nudged::before {
  animation: dot-pulse 0.9s ease-out;
}

@keyframes nudge {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(19, 91, 217, 0.45); }
  100% { box-shadow: 0 0 0 8px rgba(19, 91, 217, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .is-nudged,
  .is-nudged .field-error::before,
  .form-error.is-nudged::before {
    animation: none;
  }
}

/* Thanks, in the form's place once it is sent. */
.form-sent {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding: clamp(24px, 3vw, 48px);
  background: var(--white);
  border: 1px solid var(--gray-light);
  color: var(--gray-dark);
}

.form-sent-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--black);
}

@media (min-width: 901px) and (max-height: 860px) {
  .contact-form {
    gap: 18px;
    padding: 32px 36px;
  }

  .contact-field label,
  .contact-chips legend {
    margin-bottom: 6px;
  }

  .contact-field input,
  .contact-field textarea {
    padding: 10px 12px;
  }

  .contact-field textarea {
    min-height: 88px;
  }

  .contact-submit {
    padding-top: 18px;
  }

  .contact-form .contact-send {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (max-width: 900px) {
  .contact {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "form"
      "more";
    row-gap: var(--space-4);
  }

  .contact-steps {
    margin-top: var(--space-2);
  }

  .contact-direct {
    margin-top: var(--space-4);
  }
}

@media (max-width: 600px) {
  .contact-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .contact-form,
  .form-sent {
    padding: var(--space-3) 20px;
  }
}

.form-error a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-sent[hidden] {
  display: none;
}

.form-sent:focus {
  outline: none;
}

/* Privacy policy over the Contact page: a white panel on a dimmed page,
   the same quiet type as privacidad.html, scrolling inside. */
.privacy-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--gray-light);
  background: var(--white);
  color: var(--text);
  overflow: hidden;
}

.privacy-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: privacy-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.privacy-dialog::backdrop {
  background: rgba(17, 17, 17, 0.35);
}

.privacy-body {
  overflow-y: auto;
  padding: clamp(28px, 4vw, 48px);
}

.privacy-body h1 {
  padding-right: 40px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.privacy-body .legal-updated {
  margin: 4px 0 var(--space-3);
  font-size: 12px;
  color: var(--gray);
}

.privacy-body h2 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: 14px;
  font-weight: 600;
}

.privacy-body p,
.privacy-body li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-dark);
}

.privacy-body p + p {
  margin-top: var(--space-1);
}

.privacy-body ul {
  margin-top: var(--space-1);
  padding-left: 1.2em;
  list-style: disc;
}

.privacy-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--white);
  color: var(--black);
}

.privacy-close svg {
  width: 14px;
  height: 14px;
}

.privacy-close:hover {
  color: var(--accent);
}

@keyframes privacy-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .privacy-dialog[open] {
    animation: none;
  }
}

/* ---------- Service pages (servicios/*.html) ----------
   What opens when a service card is tapped: the card's photo, same 4:5
   proportion, grown on the left; the text on the right with its sections.
   The photo stays put while scrolling. Tapping anywhere outside the text
   goes back to Servicios (initServiceBack). */
.svc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--columns-gap);
  align-items: start;
  padding: var(--page-top) 0 var(--space-4);
}

/* Same 4:5 as the card; its height follows the screen so it is seen whole. */
.svc-photo {
  position: relative;
  display: block;
  height: clamp(420px, calc(100vh - 220px), 760px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--gray-light);
}

.svc-photo picture,
.svc-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Two more photos of the service sit on top of the first and fade in and
   out in turn (initServicePhotos). The first one never moves, so the card
   transition from Servicios always lands on it. */
.svc-photo .svc-slide,
.service-thumb .svc-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.svc-photo .svc-slide.is-on,
.service-thumb .svc-slide.is-on {
  opacity: 1;
}

/* On click the card snaps back to its first photo, so the transition to
   the service page starts from the same picture it lands on. */
.service-thumb.is-leaving .svc-slide {
  transition: none;
}

/* The moving «includes» ribbon must not widen the column. */
.svc-text {
  min-width: 0;
}

.svc-back {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: 14px;
  color: var(--gray-dark);
}

.svc-back:hover {
  color: var(--accent);
}

.svc-title {
  font-size: clamp(30px, 3.2vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.svc-title span {
  display: inline-block;
}

.svc-lead {
  margin-top: var(--space-3);
  font-size: 18px;
  color: var(--gray-dark);
  max-width: 56ch;
}

.svc-text h2 {
  margin-top: var(--space-5);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.svc-text h3 {
  margin-top: var(--space-3);
  font-size: 16px;
  font-weight: 600;
}

.svc-text h3 + p {
  margin-top: var(--space-1);
  color: var(--gray-dark);
  max-width: 60ch;
}

.svc-text h2 + .svc-includes,
.svc-text h2 + .svc-projects {
  margin-top: var(--space-2);
}

.svc-includes {
  font-size: 15px;
  color: var(--gray);
}

.svc-projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--gray-light);
}

.svc-projects li {
  display: grid;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-light);
}

.svc-projects a {
  width: fit-content;
  font-weight: 600;
}

.svc-projects a:hover {
  color: var(--accent);
}

.svc-projects span {
  font-size: 15px;
  color: var(--gray-dark);
}

.svc-cta {
  margin-top: var(--space-5);
}

@media (max-width: 900px) {
  .svc {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-4);
  }

  .svc-photo {
    width: 100%;
    height: auto;
  }

  .svc-lead {
    font-size: 16px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--section-s) 0 clamp(40px, 4vw, 64px);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------- Legal page (privacidad.html) ----------
   Deliberately quiet: small type, muted color, narrow column, so it
   reads as fine print rather than a feature of the site. */
.legal {
  max-width: 600px;
  padding: var(--page-top) 0 var(--section);
}

.legal h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

.legal .legal-updated {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: var(--space-4);
}

.legal h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: var(--space-4) 0 var(--space-1);
}

.legal p,
.legal li {
  font-size: 14px;
  color: var(--gray-dark);
  line-height: 1.7;
}

.legal p + p {
  margin-top: var(--space-1);
}

.legal ul {
  list-style: disc;
  padding-left: 1.2em;
  margin-top: var(--space-1);
}

.legal li + li {
  margin-top: 4px;
}

.legal strong {
  font-weight: 500;
}

.legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-note {
  font-size: 13px;
  color: var(--gray);
}

.form-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Spam trap ----------
   Field hidden from people (off-screen, skipped by keyboard and screen
   readers) that bots filling every input will complete. */
.form-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.social-links {
  display: flex;
  gap: 24px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
}

.social-links svg {
  width: 20px;
  height: 20px;
}

.footer-info {
  margin-top: var(--space-2);
  font-size: 13px;
  color: var(--gray-dark);
  text-align: center;
}

.footer-info a {
  transition: color 0.2s ease;
}

.footer-info a:hover {
  color: var(--accent);
}

/* ---------- Mobile type scale ---------- */
@media screen and (max-width: 640px) {
  .section-heading h2,
  .cta-block h2 {
    font-size: 22px;
  }

  .hero p.lead {
    font-size: 15px;
  }
}

/* ---------- Project detail page ---------- */
/* Opening of a project, measured against estudiopunto.com (Squarespace)
   at 1280, 1440 and 1920px: a full-bleed photo that scales with the
   page width (+ room for the floating header), then the title sitting
   right under it, on the same grid as the galleries. */
.project-hero {
  width: 100%;
  height: calc(min(1800px, 94vw) * 0.301 + 263px);
  background: var(--gray-light);
  overflow: hidden;
}

.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-hero .g-item {
  width: 100%;
  height: 100%;
}

@media (max-width: 700px) {
  .project-hero {
    height: 75vw;
  }
}

/* Intro block (project and each sub-project): 22 columns, the same as
   the text width of the 24-column gallery grid.
   Row 1: title (cols 1–13) and tagline (right-aligned, cols 14–22).
   Row 2: spec table (cols 1–8) and description (cols 11–22). */
.project-info {
  padding: clamp(16px, 1.4vw, 28px) 0 var(--section-s);
}

.project-info .container {
  display: grid;
  grid-template-columns: repeat(22, minmax(0, 1fr));
  column-gap: 11px;
  align-items: start;
}

.project-title,
.project-copy {
  display: contents;
}

.project-title h1,
.project-title h2 {
  grid-column: 1 / 14;
  grid-row: 1;
  font-size: clamp(30px, calc(1.8vw + 26.6px), 64px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--black);
}

.project-tagline {
  grid-column: 14 / 23;
  grid-row: 1;
  font-size: 18px;
  line-height: 1.4;
  color: var(--black);
  text-align: right;
}

.spec-table {
  grid-column: 1 / 9;
  grid-row: 2;
  margin-top: 104px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 7px 0;
  border-bottom: 1px solid var(--black);
  font-size: 16px;
  line-height: 1.4;
  color: var(--black);
}

.spec-row .label {
  font-weight: 700;
}

.spec-row .value {
  text-align: right;
}

.project-description {
  grid-column: 11 / 23;
  grid-row: 2;
  margin-top: clamp(40px, 3.2vw, 64px);
}

.project-description p {
  font-size: 16px;
  line-height: 1.4;
  color: var(--black);
}

.project-description p + p {
  margin-top: 1.1em;
}

.project-description p:first-child {
  text-align: justify;
}

/* Phone: title and tagline share the first row (tagline small, on the
   right), then the spec table and the description full width. */
@media (max-width: 767px) {
  .project-info {
    padding-top: 40px;
  }

  .project-info .container {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .project-title h1,
  .project-title h2 {
    grid-column: 1 / 5;
    font-size: 30px;
  }

  .project-tagline {
    grid-column: 5 / 9;
    font-size: 12px;
  }

  .spec-table {
    grid-column: 1 / 9;
    margin-top: 40px;
  }

  .spec-row {
    font-size: 15px;
  }

  .project-description {
    grid-column: 1 / 9;
    grid-row: 3;
    margin-top: 32px;
  }

  .project-description p {
    font-size: 15px;
  }
}

.project-gallery {
  padding: 0 0 var(--section);
}

.g-item {
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-item span {
  font-size: 13px;
  color: var(--gray);
}

/* ---------- Mosaic size vocabulary ----------
   Reusable classes instead of position-based rules, so any new photo
   can be dropped in later just by picking one of these. Vertical-leaning
   by default (g-h is the only horizontal option, meant to be used
   sparingly as an accent). Mobile uses aspect-ratio to size each item
   in the single-column stack; desktop overrides with an explicit
   grid span so the mosaic can pack them densely. */
.g-item.g-v-s {
  aspect-ratio: 3 / 4;
}
.g-item.g-v-m {
  aspect-ratio: 2 / 3;
}
.g-item.g-v-l {
  aspect-ratio: 3 / 5;
}
.g-item.g-v-xl {
  aspect-ratio: 1 / 2;
}
.g-item.g-h {
  aspect-ratio: 16 / 9;
}

/* Clusters: 2-3 related photos (a sequence, or the same product/format)
   kept together as one mosaic cell instead of scattered — the tight
   internal gap and shared aspect ratio read as "these belong together"
   even inside the otherwise irregular layout. */
.g-cluster {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  background: none;
}
.g-cluster .g-sub {
  flex: 1;
  min-height: 0;
  background: var(--gray-light);
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Row variant: a small "contact sheet" strip — 3 same-format shots
   side by side, for when the link between photos is "same product,
   same session" rather than "step 1, step 2, step 3". */
.g-cluster-row {
  flex-direction: row;
}
.g-cluster-row .g-sub {
  aspect-ratio: 1 / 1;
}

.project-gallery > .g-item + .g-item {
  margin-top: 28px;
}

/* Desktop/tablet: packed mosaic — the browser's "dense" grid algorithm
   fills gaps automatically, so we only need to define very different
   sizes per item (some tiny detail shots, some large hero-ish crops)
   and a generous gutter. That size contrast plus dense packing is what
   produces the irregular, hand-curated look instead of a tidy grid.

   grid-auto-rows is set to 1px so each item's row-span equals its exact
   pixel height. Row gap must stay at 0: with rows this fine, a nonzero
   row-gap gets inserted between every single 1px track *inside* a
   spanning item too, inflating it hugely. Vertical breathing room comes
   from margin-bottom on the item instead, which only applies once. */
@media (min-width: 701px) {
  .project-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 1px;
    grid-auto-flow: dense;
    column-gap: 32px;
    row-gap: 0;
  }

  .project-gallery > .g-item + .g-item {
    margin-top: 0;
  }

  .project-gallery .g-item {
    margin-bottom: 32px;
  }

  .g-item.g-v-s,
  .g-item.g-v-m,
  .g-item.g-v-l,
  .g-item.g-v-xl,
  .g-item.g-h {
    aspect-ratio: auto;
  }

  .g-item.g-v-s {
    grid-column: span 3;
    grid-row: span 260;
  }
  .g-item.g-v-m {
    grid-column: span 3;
    grid-row: span 380;
  }
  .g-item.g-v-l {
    grid-column: span 4;
    grid-row: span 480;
  }
  .g-item.g-v-xl {
    grid-column: span 4;
    grid-row: span 560;
  }
  .g-item.g-h {
    grid-column: span 7;
    grid-row: span 220;
  }

  .g-cluster .g-sub {
    aspect-ratio: auto;
  }
}

/* ---------- Free-form gallery canvas (output of editor.html) ----------
   Photos are placed by hand at exact pixel coordinates on a fixed-width
   "design canvas" (matches --max-width). Rather than trying to reflow
   that hand-placed composition at every screen size, the whole canvas
   scales down as one unit — proportions and relationships between
   photos stay exactly as arranged. gallery-scale.js sets the scale. */
.gallery-canvas-scale {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: var(--section);
}

/* Centered with left:50% + a negative margin equal to half the design
   width, not margin:auto — when the canvas is wider than its container
   (true on virtually every real screen, since it's always 1680px pre-
   scale), CSS spec says auto margins get ignored and the overflow all
   lands on one side. This trick centers regardless of that. */
.gallery-canvas {
  position: absolute;
  left: 50%;
  width: var(--max-width);
  margin-left: calc(var(--max-width) / -2);
  transform-origin: 50% 0%;
}

.gallery-canvas .g-item {
  position: absolute;
  overflow: hidden;
}

.gallery-canvas .g-item img,
.gallery-canvas .g-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-canvas .g-item iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.gallery-canvas .g-item.g-text {
  background: var(--bg);
  container-type: inline-size;
  /* Undo the generic .g-item's flex/center: a flex item with content
     taller than the fixed box gets an automatic min-height based on its
     content (since overflow is visible), so align-items:center then
     centers that oversized box and clips it top AND bottom — the text
     appears to start mid-paragraph. Plain block layout clips from the
     top only, like a normal overflowing box should. */
  display: block;
}

/* Font size scales with the block's own width via a container query
   unit — make the box bigger to get a heading, smaller for body copy.
   No separate "heading/paragraph" toggle needed. */
.gallery-canvas .g-item.g-text .text-inner {
  padding: 14px;
  font-size: clamp(14px, 5.2cqw, 60px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.gallery-canvas .g-item.g-text .text-inner a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Freeform text pages (Inicio, Servicios, Estudio, Contacto) opt into
   this with the .freeform class. Free positioning only makes sense as
   a scaled-unit on a photo mosaic; for paragraphs of text, scaling the
   whole desktop layout down to phone width makes it unreadably small.
   Below 700px, abandon the canvas entirely and stack blocks as normal
   full-width flow, in the order they were placed (top-to-bottom,
   left-to-right) — gallery-scale.js skips its scale math in this case. */
@media (max-width: 700px) {
  .gallery-canvas.freeform {
    position: static !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    margin-left: 0 !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: var(--space-5) var(--gutter);
  }

  .gallery-canvas.freeform .g-item {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    z-index: auto !important;
  }

  .gallery-canvas.freeform .g-item img,
  .gallery-canvas.freeform .g-item video {
    height: auto;
  }

  .gallery-canvas.freeform .g-item.g-youtube {
    aspect-ratio: 16 / 9;
  }

  .gallery-canvas.freeform .g-item .dims,
  .gallery-canvas.freeform .g-item .resize-handle,
  .gallery-canvas.freeform .g-item .delete-btn,
  .gallery-canvas.freeform .g-item .drag-handle {
    display: none;
  }
}

/* ---------- Project gallery: 24-column grid (.ep-gallery) ----------
   Recreates the Squarespace "Fluid Engine" collage: photos sit on a fine
   hidden grid, deliberately offset from each other, so the result looks
   loose but every edge still lines up with something.

   Geometry (mirrors Squarespace, measured at 1440px):
   - 22 columns span exactly the text width of .container; one extra
     "bleed" column on each side lets a photo poke out past the text edge.
     Grid lines run 1..25: line 2 = text left edge, line 24 = text right edge.
   - Fixed gaps: 11px between columns, 8px between rows.
   - Row height = 0.643 x column width, so the whole collage scales as one.

   Each item sets its desktop position with --d, written as
   "row-start / col-start / row-end / col-end", plus its mobile column
   span (--mc), mobile order (--mo) and proportion (--ar). The gallery
   sets --rows to its total height in rows. */
.ep-gallery-wrap {
  container-type: inline-size;
}

.ep-gallery {
  --gx: 11px;
  --gy: 8px;
  --col: calc((100cqw - 21 * var(--gx)) / 22);
  --row: calc(var(--col) * 0.643);
  display: grid;
  grid-template-columns: repeat(24, var(--col));
  grid-template-rows: repeat(var(--rows, 20), var(--row));
  column-gap: var(--gx);
  row-gap: var(--gy);
  margin-inline: calc(-1 * (var(--col) + var(--gx)));
}

.ep-gallery > * {
  grid-area: var(--d);
  margin: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ep-gallery picture,
.project-hero picture,
.project-thumb picture {
  display: block;
  width: 100%;
  height: 100%;
}

.ep-gallery img,
.ep-gallery video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-gallery iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Grey placeholder used until the real photo is in place. */
.ep-ph {
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--gray);
}

/* Placeholder label: what goes there (the photo's alt text) and its
   original size, so blocks can be checked before the photos arrive. */
.ep-ph {
  flex-direction: column;
}

.ep-ph small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.ep-ph--video {
  background: #dedede;
}

.project-hero > .ep-ph {
  width: 100%;
  height: 100%;
}

/* Small caption placed on the grid like any other item. */
/* YouTube: a still with a play button; the player (youtube-nocookie)
   only loads when pressed, so nothing is fetched from YouTube before. */
.ep-yt {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--black);
  cursor: pointer;
}

.ep-yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.ep-yt:hover img {
  opacity: 0.85;
}

.ep-yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ep-yt-play::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 21px;
  border-style: solid;
  border-width: 11px 0 11px 17px;
  border-color: transparent transparent transparent var(--white);
}

.ep-yt:hover .ep-yt-play {
  transform: scale(1.08);
}

.ep-yt iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Flush right with the block above it, like Squarespace's credits. */
.ep-gallery .ep-caption {
  text-align: right;
  font-size: 13px;
  color: var(--gray-dark);
  line-height: 1.4;
  overflow: visible;
}

.ep-gallery .ep-caption--mini {
  font-size: 10px;
}

/* Mobile: an 8-column grid whose rows grow with each photo's own
   proportion (--ar), so nothing can overlap. Items follow Squarespace's
   mobile order (--mo) and column span (--mc): most go full width, pairs
   sit side by side (1 / 5 and 5 / 9), and a few narrower ones are
   centered (2 / 8, 3 / 7) to keep some rhythm. */
@media (max-width: 700px) {
  .ep-gallery {
    --col: calc((100cqw - 7 * var(--gx)) / 8);
    grid-template-columns: repeat(8, var(--col));
    grid-template-rows: none;
    grid-auto-rows: auto;
    row-gap: var(--gx);
    margin-inline: 0;
  }

  .ep-gallery > * {
    grid-area: auto;
    grid-column: var(--mc, 1 / -1);
    order: var(--mo, 0);
    aspect-ratio: var(--ar, 4 / 3);
  }

  .ep-gallery > .ep-caption {
    grid-column: 1 / -1;
    aspect-ratio: auto;
  }
}

/* Spacing around galleries and the extra intro blocks of sub-projects
   (e.g. Urutoys → NightWolf, BisonRage…), which reuse .project-info. */
.ep-gallery-section {
  padding-bottom: var(--section-s);
}

.project-info--sub {
  padding-top: var(--section-s);
}

/* A page made only of sub-projects (Identidad de Marca) opens with the
   first one right under the photo, like any other project. */
.sr-only + .project-info--sub {
  padding-top: clamp(16px, 1.4vw, 28px);
}

@media (max-width: 767px) {
  .sr-only + .project-info--sub {
    padding-top: 40px;
  }
}

.project-nav {
  border-top: 1px solid var(--gray-light);
  padding: var(--space-4) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* End of a project: a quiet link back to all of them, and the next
   project named large on the right, so the visit can keep going. */
.project-nav {
  align-items: flex-end;
}

.project-nav-all {
  font-size: 16px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.project-nav-all:hover {
  color: var(--accent);
}

.project-nav-next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.project-nav-next span {
  font-size: 14px;
  color: var(--gray-dark);
}

.project-nav-next strong {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: clamp(24px, 2.6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
  transition: color 0.2s ease;
}

.project-nav-next svg {
  width: 0.7em;
  height: 0.7em;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-nav-next:hover strong {
  color: var(--accent);
}

.project-nav-next:hover svg {
  transform: translateX(4px);
}

@media (max-width: 600px) {
  .project-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--space-4);
  }

  .project-nav-next {
    align-items: flex-start;
    text-align: left;
  }
}

/* ---------- Slide carousel (.ep-carousel) ----------
   For projects told as a sequence of 4:5 slides (Proyecto Palmera):
   a horizontal track that snaps slide by slide, with the next slide
   peeking in at the edge. Below it, the position (01–03 / 16), a thin
   bar that works like a scrollbar, and the arrows. Mouse users can
   also drag it; fingers swipe it natively. */
.ep-carousel-section {
  padding-bottom: var(--section-s);
}

.ep-carousel-track {
  --per: 3.4;
  --gaps: 3;
  --gap: 11px;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
  cursor: grab;
  user-select: none;
}

.ep-carousel-track::-webkit-scrollbar {
  display: none;
}

.ep-carousel-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.ep-carousel-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.ep-slide {
  flex: 0 0 calc((100% - var(--gaps) * var(--gap)) / var(--per));
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--gray-light);
  scroll-snap-align: start;
}

/* The end of the track is a stop too, or the last slide could never be
   seen whole once the next one stops peeking in. */
.ep-slide:last-child {
  scroll-snap-align: end;
}

.ep-slide picture,
.ep-slide img,
.ep-slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ep-carousel-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.ep-carousel-count {
  min-width: 7.5em;
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--black);
}

.ep-carousel-count span {
  color: var(--gray);
}

.ep-carousel-progress {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--gray-light);
  overflow: hidden;
}

.ep-carousel-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 25%;
  background: var(--black);
  transition: transform 0.15s linear;
}

.ep-carousel-nav {
  display: flex;
  gap: var(--space-1);
}

.ep-carousel-nav button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--black);
  border-radius: 50%;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.ep-carousel-nav button:hover:not(:disabled) {
  background: var(--black);
  color: var(--white);
}

.ep-carousel-nav button:disabled {
  opacity: 0.2;
  cursor: default;
}

.ep-carousel-nav svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1024px) {
  .ep-carousel-track {
    --per: 2.3;
    --gaps: 2;
  }
}

@media (max-width: 700px) {
  .ep-carousel-track {
    --per: 1.18;
    --gaps: 1;
    --gap: 8px;
  }

  .ep-carousel-bar {
    gap: var(--space-2);
  }

  .ep-carousel-count {
    min-width: 4.5em;
    font-size: 15px;
  }

  .ep-carousel-nav button {
    width: 40px;
    height: 40px;
  }
}

/* External links of a project (its own site, the post…), under the spec
   table: square outlined buttons like the table's black rules, the arrow
   leaning out on hover. */
.project-links {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.project-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 13px 16px;
  border: 1px solid var(--black);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--black);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.project-link svg {
  flex: none;
  width: 14px;
  height: 14px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-link:hover {
  background: var(--black);
  color: var(--white);
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

/* Call to action at the top of the home: same button as the project links,
   sized to its text, with an arrow that slides sideways (internal link). */
.hero-cta {
  display: inline-flex;
  flex: none;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

@media (max-width: 767px) {
  .project-links {
    flex-direction: column;
  }

  .project-link {
    font-size: 15px;
  }
}
