:root {
  color-scheme: light;
  --paper: #f8f8f5;
  --ink: #222321;
  --quiet: #515650;
  --line: #cdcec6;
  --accent: #3b5142;
  --gutter: clamp(1.125rem, 4.05vw, 4.5rem);
  --gap: clamp(1rem, 2.3vw, 2.5rem);
  --max: 108rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, p, figure, dl { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: #d7ded2; color: var(--ink); }

.wrap { width: min(100%, var(--max)); padding-inline: var(--gutter); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 4; transform: translateY(-150%); padding: .75rem; background: #fff; }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 5.35rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand img { width: 2rem; height: 2rem; }
.brand span { font-size: clamp(1.18rem, 2.1vw, 1.59rem); letter-spacing: -.065em; }
.site-nav { display: flex; gap: clamp(1rem, 3.3vw, 3.75rem); }
.site-nav a { position: relative; display: flex; align-items: center; min-height: 2.75rem; text-decoration: none; font-size: .94rem; }
.site-nav a::after { position: absolute; content: ""; inset: auto 0 .43rem; border-bottom: 1px solid currentColor; opacity: 0; }
.site-nav a[aria-current]::after, .site-nav a:hover::after { opacity: 1; }

.page-title { font-size: clamp(3rem, 7.2vw, 8.1rem); font-weight: 400; letter-spacing: -.079em; line-height: .98; text-wrap: balance; }
.section-title { font-size: clamp(1.55rem, 2.7vw, 2.6rem); line-height: 1.1; letter-spacing: -.05em; font-weight: 400; }
.detail-meta, .image-note, .micro { font-size: .875rem; line-height: 1.5; color: var(--quiet); }
.text-link { width: fit-content; display: inline-flex; align-items: center; min-height: 2.75rem; text-underline-offset: .4em; text-decoration-thickness: 1px; }
.text-link:hover { color: var(--accent); text-decoration-thickness: 2px; }
.icon-button { display: grid; place-items: center; appearance: none; border: 1px solid transparent; background: var(--paper); min-width: 2.875rem; min-height: 2.875rem; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.icon-button:hover { background: #e1e4da; }
.icon-button .chevron { display: block; width: .58rem; height: .58rem; border-right: 1.5px solid; border-top: 1.5px solid; transform: translateX(-2px) rotate(45deg); }
.icon-button .chevron.back { transform: translateX(2px) rotate(-135deg); }

.home { padding-block: clamp(1.125rem, 2.4vw, 2.75rem) clamp(3rem, 8vw, 8rem); }

.index, .studio, .contact { padding-block: clamp(2.4rem, 6vw, 6rem) clamp(3.8rem, 8vw, 8rem); }

.project { padding-block: clamp(1.5rem, 3.6vw, 3.8rem) clamp(4rem, 7vw, 7rem); }
.project-path { display: flex; gap: .65rem; align-items: center; margin-bottom: clamp(1rem, 3vw, 3rem); }
.project-path .text-link { min-height: 2.25rem; }
.project-head { align-items: end; margin-bottom: clamp(1.2rem, 3vw, 2.8rem); }
.project-head h1 { grid-column: 1 / 10; }
.project-head > div { grid-column: 10 / 13; }
.project-head > div > p + p { margin-top: .3rem; }
.section-nav { display: flex; flex-wrap: wrap; column-gap: clamp(1rem, 3vw, 3rem); border-block: 1px solid var(--line); margin-bottom: var(--gap); }
.section-nav a { display: inline-flex; align-items: center; min-height: 2.85rem; text-decoration: none; font-size: .94rem; }
.section-nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .35em; }
.project-image { display: block; overflow: hidden; background: #d0d4c9; }
.project-image img { width: 100%; height: clamp(25rem, 63svh, 47rem); object-fit: cover; object-position: 50% 53%; }
.feature-figure figcaption { margin-top: .6rem; }

.project-intro { padding-top: clamp(3rem, 6vw, 6.5rem); align-items: start; }
.project-intro > section:first-child { grid-column: 1 / 6; }
.project-intro > section:last-child { grid-column: 7 / 13; }
.prose .section-title, .technical .section-title { margin-bottom: clamp(1.1rem, 2vw, 1.8rem); }
.prose > p { font-size: clamp(1rem, 1.36vw, 1.25rem); line-height: 1.62; }
.prose > p + p { margin-top: 1rem; }
.technical dl { border-top: 1px solid var(--line); }
.technical dl > div { display: grid; grid-template-columns: minmax(7.75rem, 2fr) 3fr; gap: .65rem; border-bottom: 1px solid var(--line); padding: .67rem 0; font-size: .94rem; line-height: 1.4; }
.technical dt { color: var(--quiet); }
.technical dd { margin: 0; }
.project-block { border-top: 1px solid var(--line); margin-top: clamp(3.25rem, 7vw, 7.25rem); padding-top: clamp(1.1rem, 2.5vw, 2.3rem); }
.project-block > h2 { margin-bottom: clamp(1.2rem, 2.8vw, 2.6rem); }
.gallery-heading { margin-bottom: clamp(1.2rem, 2.8vw, 2.6rem); }
.gallery-heading .image-note { margin-top: .55rem; }
.project [id] { scroll-margin-top: 1.25rem; }

.gallery-tile a { position: relative; display: block; overflow: hidden; }
.gallery-tile img { width: 100%; height: auto; transition: transform .35s ease; }
.gallery-tile a > span { position: absolute; right: .5rem; bottom: .5rem; display: grid; place-items: center; width: 2.55rem; height: 2.55rem; background: var(--paper); font-size: 1.35rem; line-height: 1; }
.gallery-tile figcaption { padding-top: .55rem; }
.film { align-items: start; }
.film > div { grid-column: 1 / 5; }
.film h2 { margin-bottom: .8rem; }
.film video { grid-column: 5 / 11; display: block; width: min(100%, 32rem); height: auto; aspect-ratio: 720 / 902; background: #252925; }
.project-end { border-top: 1px solid var(--line); margin-top: clamp(3.25rem, 6vw, 6rem); padding-top: .8rem; }

.viewer {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; color: var(--paper); background: #181b18;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: #181b18; }
body:has(.viewer[open]) { overflow: hidden; }
.viewer-top, .viewer-bottom { display: flex; align-items: center; gap: 1rem; padding: .65rem clamp(.85rem, 3vw, 3.5rem); }
.viewer-top { justify-content: space-between; }
.viewer-top p, .viewer-bottom p { font-size: .9rem; }
.viewer-media { min-height: 0; display: grid; place-items: center; padding-inline: clamp(.65rem, 3vw, 3.5rem); }
.viewer-media img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-bottom p { margin-right: auto; }
.viewer-bottom > div { display: flex; gap: 1px; }
.viewer .icon-button { color: var(--ink); }
.viewer button:focus-visible { outline-color: var(--paper); }

.studio-head, .contact-head { align-items: start; margin-bottom: clamp(2rem, 5vw, 5rem); }
.studio-head h1, .contact-head h1 { grid-column: 1 / 5; }
.studio-head > .studio-intro { grid-column: 6 / 13; }
.studio-intro > .text-link { margin-top: .85rem; font-size: 1.05rem; font-weight: 600; }
.lede { font-size: clamp(1.55rem, 3.25vw, 3.7rem); letter-spacing: -.046em; line-height: 1.15; max-width: 26ch; }
.studio-body { align-items: start; }
.studio-team { grid-column: 1 / 6; }
.studio-side { grid-column: 7 / 13; }
.studio-body .section-title { margin-bottom: clamp(.8rem, 2vw, 1.65rem); }
.studio-team-list, .studio-history, .studio-projects { list-style: none; margin: 0; padding: 0; }
.studio-bio, .studio-milestone { border-top: 1px solid var(--line); padding-block: 1rem; }
.studio-bio h3, .studio-milestone h3 { font-size: clamp(1.14rem, 1.6vw, 1.48rem); font-weight: 400; letter-spacing: -.025em; }
.studio-bio h3 { text-transform: lowercase; }
.studio-bio .detail-meta { margin-top: .12rem; }
.bio-description, .studio-milestone > p:not(.micro) { margin-top: .35rem; line-height: 1.5; max-width: 48ch; }
.studio-milestone time { font-variant-numeric: tabular-nums; }
.studio-projects { margin-top: .5rem; font-size: .94rem; line-height: 1.6; }
.studio-projects a { text-underline-offset: .22em; }
.studio-side figure { width: min(100%, 26rem); margin-top: clamp(1rem, 3vw, 2.75rem); }
.studio-body figure img { width: 100%; height: auto; }
.studio-body figcaption { padding-top: .55rem; }
.contact-data h2 { font-size: .94rem; font-weight: 400; color: var(--quiet); }
.contact-head > .contact-data { grid-column: 6 / 13; }
.contact-data { font-style: normal; }
.contact-data section { border-top: 1px solid var(--line); padding-block: 1.05rem 1.5rem; }
.contact-data h2 { margin-bottom: .75rem; }
.contact-data p, .contact-data a { font-size: clamp(1.1rem, 2.05vw, 2rem); line-height: 1.32; letter-spacing: -.04em; overflow-wrap: anywhere; }
.contact-data a { text-decoration-thickness: 1px; text-underline-offset: .25em; }
.contact-data a:hover { color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 5.1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; column-gap: 1rem; padding-block: .8rem; }
.footer-inner a { text-underline-offset: .3em; }

@media (max-width: 64rem) {
  .project-head h1 { grid-column-end: 10; }
  .project-head > div { grid-column: 10 / 13; }
  .project-image img { height: clamp(23rem, 52svh, 38rem); }
  .project-intro > section:first-child { grid-column-end: 7; }
}

@media (max-width: 42rem) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .header-inner { min-height: auto; display: block; padding-top: .8rem; }
  .brand { min-height: 2.3rem; }
  .brand img { width: 1.6rem; height: 1.6rem; }
  .site-nav { gap: 1.5rem; }
  .site-nav a { min-height: 2.75rem; font-size: .9rem; }
  .site-nav a::after { bottom: .15rem; }
  .project-head h1, .project-head > div, .project-intro > section:first-child, .project-intro > section:last-child,
  .film > div, .film video, .studio-head h1, .studio-head > .studio-intro, .contact-head h1,
  .studio-team, .studio-side, .contact-head > .contact-data { grid-column: 1 / -1; }
  .project-head { gap: .6rem; }
  .project-head > div { display: flex; gap: .42rem 1rem; flex-wrap: wrap; }
  .project-head > div > p + p { margin: 0; }
  .project-image img { height: auto; aspect-ratio: 1.25; }
  .section-nav { column-gap: 1.15rem; }
  .section-nav a { min-height: 2.7rem; font-size: .9rem; }
  .project-intro { row-gap: 2.25rem; }
  .studio-head, .contact-head { row-gap: 1.5rem; }
  .studio-body { row-gap: 2.5rem; }
  .studio-body figure { max-width: 75%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portfolio-title {
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--gap);
  padding-bottom: clamp(1.3rem, 3.2vw, 3.25rem);
}

.portfolio-grid {
  display: grid;
  gap: var(--gap);
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: clamp(1.6rem, 4vw, 4rem);
}
.portfolio-grid.home-selection { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.portfolio-card > a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-image {
  background: #dde0d7;
  overflow: hidden;
  aspect-ratio: 1.48;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.portfolio-card > a:hover .card-image img { transform: scale(1.025); }
.card-caption { padding-top: clamp(.75rem, 1.3vw, 1.2rem); }
.card-caption h3 {
  font-size: clamp(1.38rem, 2.2vw, 2.54rem);
  font-weight: 400;
  letter-spacing: -.052em;
  line-height: 1.05;
  margin-block: .2rem .38rem;
}
.portfolio-card > a:hover h3 { color: var(--accent); }


.portfolio-section {
  border-top: 1px solid var(--line);
  margin-top: clamp(2.8rem, 6.5vw, 6.5rem);
  padding-top: clamp(.6rem, 1.7vw, 1.6rem);
}
.portfolio-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  min-height: 2.8rem;
  margin-bottom: clamp(.8rem, 2vw, 2rem);
}
.portfolio-links { display: flex; flex-wrap: wrap; column-gap: clamp(.75rem, 1.8vw, 1.65rem); font-size: .94rem; }
.index > .portfolio-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.text-card > a { border-top: 1px solid var(--line); padding-bottom: 1rem; }
.project-brief .project-intro { padding-top: 1.3rem; border-top: 1px solid var(--line); }
.project-intro > .technical:only-child { grid-column: 1 / 8; }

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.case-gallery a { background: #e8e9e3; }
.case-gallery img { aspect-ratio: 1.5; object-fit: contain; }

@media (max-width: 64rem) {
  .portfolio-grid, .portfolio-grid.home-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 42rem) {
  .portfolio-grid, .portfolio-grid.home-selection, .case-gallery {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(1.4rem, 5vw, 2.4rem);
  }
  .project-intro > .technical:only-child { grid-column: 1 / -1; }
}

.card-location, .project-location {
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  color: var(--accent);
  line-height: 1.4;
}
.project-location { margin-bottom: .45rem; }
.project-head > .project-name { grid-column: 1 / 9; }
.project-head > .project-overview { grid-column: 9 / 13; }
.project-name .page-title {
  font-size: clamp(2.25rem, 4.55vw, 5.35rem);
  letter-spacing: -.058em;
  text-wrap: initial;
}

.cover-carousel {
  --cover-unit: 1vh;
  --cover-height: clamp(15rem, calc(42 * var(--cover-unit)), 38rem);
  position: relative;
}
@supports (height: 1svh) {
  .cover-carousel { --cover-unit: 1svh; }
}
.cover-stage {
  touch-action: pan-y pinch-zoom;
  overflow: hidden;
}
.cover-track {
  --cover-gap: clamp(.35rem, .8vw, .85rem);
  --cover-visible: 3;
  --cover-column: calc((100% - var(--cover-gap) - var(--cover-gap)) / 3);
  display: flex;
  gap: var(--cover-gap);
}
.cover-slide {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 0 0 var(--cover-column);
  min-width: 0;
}
.cover-slide img {
  width: 100%;
  height: var(--cover-height);
  background: #dde0d7;
  object-fit: cover;
  object-position: center 52%;
  border-radius: .65rem;
}
.cover-slide[data-project="ascensor-errenteria"] img {
  object-fit: contain;
  background: var(--paper);
}
.cover-slide:focus-visible { outline-offset: -3px; }
.cover-caption {
  display: block;
  padding-top: .5rem;
  font-size: clamp(.875rem, 1vw, 1rem);
  line-height: 1.4;
}
.cover-place { color: var(--quiet); }

.cover-toggle {
  appearance: none;
  position: absolute;
  top: calc(var(--cover-height) - 3.45rem);
  right: .7rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: .4rem;
  background: rgb(248 248 245 / 87%);
  color: var(--ink);
  cursor: pointer;
}
.cover-toggle:hover { background: var(--paper); }
.cover-toggle span {
  width: .63rem;
  height: .82rem;
  border-inline: 2px solid currentColor;
}
.cover-toggle[data-paused] span {
  width: 0;
  height: 0;
  border: .43rem solid transparent;
  border-left: .65rem solid currentColor;
  border-right-width: 0;
  margin-left: .18rem;
}
.home-projects:first-of-type { margin-top: clamp(.9rem, 2vw, 1.65rem); }
.home-projects .portfolio-heading { margin-bottom: clamp(.65rem, 1.2vw, 1.1rem); }
.home-selection .card-image { aspect-ratio: 1.95; }
.home-selection .card-location { font-size: clamp(.85rem, 1.08vw, 1rem); }

.portfolio-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.portfolio-title .text-link { flex: none; }
.archive-groups { border-top: 1px solid var(--line); }
.archive-index h1 { margin-bottom: var(--gap); }
.archive-group { border-bottom: 1px solid var(--line); }
.archive-group summary {
  padding-block: .94rem;
  font-size: clamp(1.06rem, 1.5vw, 1.45rem);
  cursor: pointer;
}
.archive-group summary:hover { color: var(--accent); }
.archive-list { list-style: none; margin: 0; padding: 0 0 1rem; }
.archive-list li {
  display: grid;
  grid-template-columns: 8rem 1fr minmax(9rem, 24%);
  gap: 1rem;
  padding-block: .55rem;
  font-size: .94rem;
  line-height: 1.4;
}
.archive-list li + li { border-top: 1px solid #e1e1db; }
.archive-year, .archive-place { color: var(--quiet); }
.archive-list a { text-underline-offset: .23em; }

@media (max-width: 42rem) {
  .project-head > .project-name, .project-head > .project-overview { grid-column: 1 / -1; display: block; }
  .project-head .project-overview > p + p { margin-top: .3rem; }
  .portfolio-title { flex-wrap: wrap; gap: .25rem 1rem; }
  .archive-list li { grid-template-columns: 5.9rem 1fr; gap: .2rem .7rem; }
  .archive-list .archive-place { grid-column: 2; }
}

@media (max-width: 64rem) {
  .cover-track {
    --cover-visible: 2;
    --cover-column: calc((100% - var(--cover-gap)) / 2);
  }
}

@media (max-width: 42rem) {
  .cover-carousel {
    --cover-height: clamp(11rem, calc(33 * var(--cover-unit)), 19rem);
  }
  .cover-track { --cover-visible: 1; --cover-column: 100%; }
  .portfolio-grid.home-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-selection .card-image { aspect-ratio: 1.62; }
  .home-selection .card-caption h3 { font-size: clamp(1.13rem, 4.8vw, 1.55rem); }
  .home-selection .detail-meta { font-size: .78rem; }
}

.archive-project .project-block {
  margin-top: 0;
  padding-top: var(--gap);
}
.archive-project .gallery-tile {
  max-width: 100%;
}
.archive-project .case-gallery {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  max-width: 72rem;
}
.archive-project .case-gallery img {
  aspect-ratio: 1.48;
  max-height: 24rem;
}
.project-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 1rem;
}

@media (min-width: 42.01rem) and (max-height: 52rem) {
  .cover-carousel {
    --cover-height: clamp(13rem, calc(38 * var(--cover-unit)), 38rem);
  }
}

.work-filter { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.work-filter select { padding: .45rem; color: inherit; background: transparent; font: inherit; border: 1px solid var(--line); }
.work-filter[hidden], .portfolio-card[hidden] { display: none; }
@media (min-width: 64.01rem) { .portfolio-grid.home-selection { grid-template-columns: repeat(3,minmax(0,1fr)); } }

.home-more-links { flex-direction: column; align-items: flex-start; gap: .65rem; }

@media (min-width: 64.01rem) { #proyectos-en-desarrollo .home-selection { grid-template-columns: repeat(4,minmax(0,1fr)); } }
