:root {
  --bg: #f3eee6;
  --surface: #ffffff;
  --sunken: #ece4d5;
  --ink: #1c1a17;
  --text: #1c1a17;
  --muted: #6e675c;
  --accent: #7c5a3d;
  --accent-soft: #ece4d5;
  --border: #ddd2c0;
  --line: #ddd2c0;
  --line-strong: #b8ab95;

  --font-display:
    "Fraunces",
    "Iowan Old Style",
    "Palatino Linotype",
    Georgia,
    serif;
}

/* =====================================================
   RESET
   ===================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

img {
  max-width: 100%;
}

ul {
  margin: 0;
  padding: 0;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.7rem 5vw 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;

  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.nav-links a {
  opacity: 0.82;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;

  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.nav-links a:hover {
  opacity: 1;
  border-color: currentColor;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  margin-top: 0.6rem;
  padding: 0 0 0.2rem;

  background: none;
  border: none;
  border-bottom: 1px solid currentColor;
  border-radius: 0;

  color: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* =====================================================
   HOMEPAGE HERO — PROJECT EXHIBITION
   ===================================================== */

.hero-exhibition {
  position: relative;

  width: 100%;
  min-height: 100vh;
  padding: 0;

  overflow: hidden;
  color: #ffffff;
  background: #000000;
}

.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;

  justify-content: flex-end;

  width: 100%;
  max-width: none;
  padding: 1.7rem 5vw 0;

  color: #ffffff;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  gap: 0;

  width: 100%;
  min-height: 100vh;

  background: #000000;
}

/* =====================================================
   HERO GALLERY
   ===================================================== */

.hero-gallery {
  position: relative;

  width: 100%;
  min-width: 0;
  height: 100vh;
  min-height: 650px;

  overflow: hidden;

  background: #000000;
  border: none;
  outline: none;
  box-shadow: none;
}

.hero-gallery-slide {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    clamp(4.5rem, 8vh, 7rem)
    clamp(2rem, 4vw, 5rem)
    clamp(4rem, 7vh, 6rem);

  overflow: hidden;

  background: #000000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 1.35s ease,
    visibility 1.35s ease;
}

.hero-gallery-slide.active {
  z-index: 2;

  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero-gallery-slide img {
  display: block;

  width: 92%;
  height: 82%;

  object-fit: contain;
  object-position: center;

  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;

  transform: scale(0.985);

  transition:
    transform 6.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 1.35s ease;
}

.hero-gallery-slide.active img {
  transform: scale(1.025);
}

.hero-gallery-project-name {
  position: absolute;
  left: clamp(1.8rem, 4vw, 4rem);
  bottom: clamp(1.6rem, 3vw, 3rem);
  z-index: 4;

  max-width: 60%;

  color: rgba(255, 255, 255, 0.78);
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.hero-gallery-counter {
  position: absolute;
  right: clamp(1.8rem, 3vw, 3rem);
  bottom: clamp(1.6rem, 3vw, 3rem);
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 0.4rem;

  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.hero-gallery-current {
  color: #ffffff;
}

/* =====================================================
   HERO TEXT PANEL
   ===================================================== */

.hero-text-panel {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 0;
  min-height: 100vh;

  padding:
    clamp(7rem, 12vh, 10rem)
    clamp(3rem, 6vw, 7rem)
    clamp(4rem, 8vh, 7rem);

  background: #000000;
  border: none;
  outline: none;
  box-shadow: none;
}

.hero-text-panel .hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;

  width: 100%;
  max-width: 900px;
  margin: 0;
  padding: 0;

  text-align: right;
}

.hero-kicker {
  margin: 0 0 clamp(1.6rem, 3vh, 2.6rem);

  color: rgba(255, 255, 255, 0.74);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.82rem, 1.25vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-exhibition h1 {
  width: 100%;
  max-width: none;
  margin: 0;

  color: #ffffff;
  font-size: clamp(4.5rem, 7.7vw, 9rem);
  font-weight: 400;
  line-height: 0.87;
  letter-spacing: -0.045em;
  text-align: right;
}

.hero-name {
  margin: clamp(2.8rem, 5vh, 4.8rem) 0 0;

  color: rgba(255, 255, 255, 0.96);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.4vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.005em;

  text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.hero-text-panel .btn {
  margin-top: clamp(1.7rem, 3vh, 2.5rem);
  margin-left: auto;

  color: #ffffff;
  font-size: clamp(0.85rem, 1vw, 1rem);
}

/* =====================================================
   DETAIL-PAGE HERO
   ===================================================== */

.hero {
  min-height: 88vh;
  padding: 0 0 4.5rem;

  display: flex;
  flex-direction: column;

  color: #ffffff;
  background-color: var(--ink);

  background-image:
    linear-gradient(
      180deg,
      rgba(20, 17, 14, 0.5) 0%,
      rgba(20, 17, 14, 0.28) 45%,
      rgba(20, 17, 14, 0.8) 100%
    ),
    var(--hero-image, none);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero.hero-compact {
  min-height: auto;
  padding: 0 0 3.2rem;

  background-image:
    linear-gradient(
      180deg,
      rgba(20, 17, 14, 0.72) 0%,
      rgba(20, 17, 14, 0.86) 100%
    ),
    var(--hero-image, none);
}

.hero.hero-exhibition {
  min-height: 100vh;
  padding: 0;

  display: block;

  background: #000000;
  background-image: none;
}

.hero-content {
  width: 100%;
  max-width: 1240px;
  margin: auto auto 0;
  padding: 0 5vw;
}

.hero-compact .hero-content {
  margin: 3.4rem auto 0;
}

.eyebrow {
  margin: 0 0 1rem;

  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
  margin: 0 0 1.2rem;

  font-weight: 400;
  line-height: 1.06;
}

.hero:not(.hero-exhibition) h1 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 5.4vw, 4rem);
}

.hero:not(.hero-exhibition) p {
  max-width: 48ch;

  color: rgba(255, 255, 255, 0.8);
  font-size: 1.02rem;
}

.hero-compact p {
  max-width: 62ch;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  margin-bottom: 1.8rem;

  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.back-link:hover {
  color: #ffffff;
}

/* =====================================================
   GENERAL SECTIONS
   ===================================================== */

.section {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 5.5rem 5vw 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;

  margin-bottom: 2.8rem;
  padding-bottom: 1.4rem;

  border-bottom: 1px solid var(--line-strong);
}

.section-heading .eyebrow {
  margin: 0;
  color: var(--accent);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
}

.intro-grid,
.value-grid {
  display: grid;
  gap: 1.5rem;
}

.intro-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
}

.intro-grid p,
.value-grid p,
.project-info p,
.contact p {
  color: var(--muted);
}

/* =====================================================
   GENERAL PROJECT CARDS
   ===================================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 2.4rem;
}

.project-card {
  position: relative;
  display: block;
}

.project-card.hidden {
  display: none;
}

.project-card::before {
  content: attr(data-category);

  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 2;

  padding: 0.35rem 0.6rem;

  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);

  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-image,
.image-1,
.image-2,
.image-3,
.image-4,
.image-courtyard {
  position: relative;

  aspect-ratio: 4 / 3;
  overflow: hidden;

  background: var(--sunken);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain !important;
}

.project-image img {
  display: block;

  width: 100%;
  height: 100%;
  padding: 1.2rem;

  object-fit: contain;

  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.035);
}

.project-info {
  margin-top: 1.1rem;
  padding: 1rem 0 0;

  border-top: 1px solid var(--line);
}

.project-info h3 {
  margin: 0 0 0.4rem;

  font-size: 1.2rem;
  font-weight: 400;
}

.project-info p {
  display: -webkit-box;

  margin: 0;
  overflow: hidden;

  font-size: 0.92rem;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* =====================================================
   MANUAL FEATURED PROJECTS CAROUSEL
   ===================================================== */

.projects-carousel-section {
  width: 100%;
  max-width: none;

  padding-left: 0;
  padding-right: 0;

  overflow: hidden;
}

.projects-carousel-section > .section-heading,
.projects-carousel-header {
  width: min(90vw, 1500px);
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.projects-carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: -1rem;
  margin-bottom: 2rem;
}

.projects-carousel-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;

  margin: 0;

  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.current-project {
  color: var(--accent);
  font-size: 1.25rem;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;

  border: 1px solid var(--line-strong);
  border-radius: 50%;

  background: transparent;
  color: var(--ink);

  font: inherit;
  font-size: 1.2rem;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.carousel-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.projects-carousel-viewport {
  width: 100%;
  padding: 0 5vw;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  scroll-padding-left: 5vw;
  scroll-padding-right: 5vw;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.projects-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.projects-carousel-track {
  display: flex;
  align-items: stretch;

  width: max-content;
  gap: 3vw;
  padding-right: 5vw;
}

.projects-carousel-track .project-card {
  display: grid;
  grid-template-columns:
    minmax(0, 1.65fr)
    minmax(420px, 0.85fr);

  flex: 0 0 90vw;
  width: 90vw;
  max-width: none;
  min-height: 72vh;

  overflow: hidden;
  background: var(--surface);

  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.projects-carousel-track .project-card::before {
  display: none;
}

.projects-carousel-track .project-image {
  width: 100%;
  height: 72vh;
  min-height: 600px;
  aspect-ratio: auto;

  overflow: hidden;
  background: var(--sunken);
}

.projects-carousel-track .project-image img {
  display: block;

  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(1rem, 2vw, 2rem);

  object-fit: contain;
  object-position: center;

  transition: transform 0.6s ease;
}

.projects-carousel-track .project-card:hover .project-image img {
  transform: scale(1.02);
}

.projects-carousel-track .project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;

  width: 100%;
  min-width: 0;
  margin: 0;
  padding: clamp(2rem, 3.5vw, 4rem);

  overflow: hidden;

  border-top: none;
  border-left: 1px solid var(--line);
}

.projects-carousel-track .project-info h3 {
  width: 100%;
  max-width: 100%;

  margin: 0 0 1.4rem;

  font-size: clamp(2.4rem, 3.6vw, 4.6rem);
  font-weight: 400;
  line-height: 0.98;

  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.projects-carousel-track .project-info > p:not(.project-number) {
  display: block;

  width: 100%;
  max-width: 30ch;
  margin: 0;

  overflow: visible;

  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.75;

  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.projects-carousel-track .project-number {
  order: -1;

  margin: 0 0 1.4rem;

  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

/* =====================================================
   PROJECT DETAIL CAROUSELS
   Fish Market and other internal project pages
   ===================================================== */

.detail-carousel-section {
  overflow: hidden;
}

.detail-carousel {
  width: 100%;
}

.detail-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;

  margin: -1rem 0 2rem;
}

.detail-carousel-counter {
  display: flex;
  align-items: center;
  gap: 0.4rem;

  margin: 0;

  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.detail-carousel-counter span:first-child {
  color: var(--accent);
  font-size: 1.25rem;
}

.detail-carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.detail-carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;

  border: 1px solid var(--line-strong);
  border-radius: 50%;

  background: transparent;
  color: var(--ink);

  font: inherit;
  font-size: 1.2rem;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.detail-carousel-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.detail-carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/*
  El viewport representa exactamente el ancho visible.
  No tiene padding horizontal, para evitar espacio vacío
  antes de la primera imagen.
*/

.detail-carousel-viewport {
  width: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.detail-carousel-viewport::-webkit-scrollbar {
  display: none;
}

/*
  Cada columna ocupa exactamente el ancho del viewport.
  Así la siguiente imagen comienza inmediatamente después
  de la anterior.
*/

.detail-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  align-items: stretch;

  width: 100%;
  gap: 2rem;
}

/* Cada diapositiva */

.detail-carousel-slide {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: min(76vh, 760px);
  min-height: 560px;
  margin: 0;

  overflow: hidden;

  background: var(--sunken);

  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.detail-carousel-slide img {
  display: block;

  width: 100%;
  height: 100%;
  padding: clamp(1rem, 2.5vw, 2.5rem);

  object-fit: contain;
  object-position: center;

  background: transparent;
}

/* Diapositivas de diagramas */

.detail-diagram-slide {
  position: relative;
  padding: 4.5rem 1.5rem 1.5rem;
}

.detail-diagram-slide img {
  width: 100%;
  height: 100%;
  padding: 0;

  object-fit: contain;
  object-position: center;
}

.detail-diagram-slide figcaption {
  position: absolute;
  top: 1.3rem;
  left: 1.5rem;
  z-index: 2;

  margin: 0;

  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}

/* =====================================================
   VALUES
   ===================================================== */

.value-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;

  border-top: 1px solid var(--line-strong);
}

.value-grid > div {
  padding: 2.6rem 2.2rem 2.8rem;
  border-right: 1px solid var(--line);
}

.value-grid > div:last-child {
  border-right: none;
}

.value-grid h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 500;
}

.value-grid p {
  margin: 0;
  font-size: 0.92rem;
}

.value-grid > div:first-child {
  padding-left: 0;
}

.value-grid > div:last-child {
  padding-right: 0;
}

/* =====================================================
   CONTACT AND FOOTER
   ===================================================== */

.contact {
  padding-bottom: 5.5rem;
}

.contact a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
}

.footer {
  margin-top: 5.5rem;
  padding: 1.5rem 1rem;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* =====================================================
   PROJECT DETAIL — STATS
   ===================================================== */

.project-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  margin: 0 0 5.5rem;

  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.project-stats > div {
  padding: 1.5rem 1.4rem 1.5rem 0;
  border-right: 1px solid var(--line);
}

.project-stats > div:last-child {
  border-right: none;
}

.project-stats .stat-value {
  display: block;

  margin-bottom: 0.25rem;

  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
}

.project-stats .stat-label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-description {
  max-width: 68ch;

  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.section > p:not([class]) {
  max-width: 68ch;
  margin-bottom: 2.5rem;

  color: var(--muted);
}

/* =====================================================
   DRAWINGS AND PROJECT IMAGES
   ===================================================== */

.drawings {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.drawing-card {
  padding: 2.6rem 0;

  border-top: 1px solid var(--line);
}

.drawings > .drawing-card:last-child,
.drawings > .drawings-pair:last-child {
  border-bottom: 1px solid var(--line);
}

.drawing-card h3 {
  margin: 0 0 0.3rem;

  font-size: 1.1rem;
  font-weight: 500;
}

.drawing-card .scale-note {
  margin: 0 0 1.3rem;

  color: var(--muted);
  font-size: 0.82rem;
}

.drawing-card img {
  display: block;

  width: 100%;
  height: auto;

  background: var(--sunken);
}

.drawing-card ul {
  list-style: none;

  color: var(--muted);
  font-size: 0.92rem;
  line-height: 2;
}

.drawings-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.6rem;

  padding: 2.6rem 0;

  border-top: 1px solid var(--line);
}

.drawings-pair .drawing-card {
  padding: 0;
  border-top: none;
}

/* =====================================================
   NEXT PROJECT
   ===================================================== */

.next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;

  margin: 2.5rem 0 0;
  padding: 3rem 0;

  border-top: 1px solid var(--line-strong);
}

.next-project p {
  margin: 0;

  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
}

.next-project .btn {
  margin-top: 0;
}

/* =====================================================
   RESPONSIVE — MEDIUM DESKTOP
   ===================================================== */

@media (max-width: 1200px) {
  .hero-split {
    grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  }

  .hero-exhibition h1 {
    font-size: clamp(4rem, 7.4vw, 7rem);
  }

  .projects-carousel-track .project-card {
    grid-template-columns:
      minmax(0, 1.45fr)
      minmax(360px, 0.85fr);
  }

  .projects-carousel-track .project-info h3 {
    font-size: clamp(2.2rem, 3.3vw, 3.8rem);
  }
}

/* =====================================================
   RESPONSIVE — TABLET
   ===================================================== */

@media (max-width: 1000px) {
  .hero-split {
    grid-template-columns: minmax(0, 43%) minmax(0, 57%);
  }

  .hero-gallery-slide {
    padding: 5rem 1.5rem 4rem;
  }

  .hero-gallery-slide img {
    width: 96%;
    height: 80%;
  }

  .hero-text-panel {
    padding: 7rem 4vw 4rem;
  }

  .hero-exhibition h1 {
    font-size: clamp(3.6rem, 7.8vw, 6rem);
  }

  .hero-name {
    font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  }

  .project-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-stats > div:nth-child(2) {
    border-right: none;
  }

  .project-stats > div:nth-child(3),
  .project-stats > div:nth-child(4) {
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
  }

  .drawings-pair {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .value-grid {
    grid-template-columns: 1fr;
  }

  .value-grid > div {
    padding: 1.5rem 0;

    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .value-grid > div:last-child {
    border-bottom: none;
  }

  .projects-carousel-track {
    gap: 2rem;
  }

  .projects-carousel-track .project-card {
    grid-template-columns:
      minmax(0, 1.25fr)
      minmax(320px, 0.9fr);

    min-height: 66vh;
  }

  .projects-carousel-track .project-image {
    height: 66vh;
    min-height: 520px;
  }

  .projects-carousel-track .project-info {
    padding: 2.4rem;
  }

  .projects-carousel-track .project-info h3 {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
  }
}

/* =====================================================
   RESPONSIVE — MOBILE
   ===================================================== */

@media (max-width: 760px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;

    padding: 1.4rem 6vw 0;
  }

  .hero-nav {
    align-items: flex-end;
    padding-top: 1.4rem;
  }

  .nav-links {
    gap: 1.1rem;
  }

  /* Homepage hero */

  .hero-exhibition {
    min-height: auto;
  }

  .hero-split {
    display: flex;
    flex-direction: column;

    min-height: auto;
  }

  .hero-gallery {
    order: 1;

    width: 100%;
    height: 54svh;
    min-height: 410px;
  }

  .hero-gallery-slide {
    padding: 4.8rem 1rem 3.5rem;
  }

  .hero-gallery-slide img {
    width: 96%;
    height: 82%;
  }

  .hero-gallery-project-name {
    left: 6vw;
    bottom: 1.3rem;

    max-width: 65%;
    font-size: 0.62rem;
  }

  .hero-gallery-counter {
    right: 6vw;
    bottom: 1.3rem;
  }

  .hero-text-panel {
    order: 2;

    min-height: 46svh;
    padding: 3rem 6vw 4rem;

    align-items: flex-start;
    justify-content: center;
  }

  .hero-text-panel .hero-content {
    align-items: flex-start;
    text-align: left;
  }

  .hero-kicker {
    margin-bottom: 1.3rem;

    font-size: 0.78rem;
    letter-spacing: 0.16em;
  }

  .hero-exhibition h1 {
    width: 100%;

    font-size: clamp(3.2rem, 16vw, 5rem);
    line-height: 0.88;
    text-align: left;
  }

  .hero-name {
    margin-top: 2rem;

    font-size: clamp(1.55rem, 7vw, 2.25rem);
    text-align: left;
  }

  .hero-text-panel .btn {
    margin-top: 1.5rem;
    margin-left: 0;
  }

  /* General */

  .intro-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3.5rem 6vw 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .project-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Homepage projects carousel */

  .projects-carousel-section > .section-heading,
  .projects-carousel-header {
    width: 88vw;
  }

  .projects-carousel-header {
    margin-top: -0.5rem;
  }

  .carousel-btn {
    width: 42px;
    height: 42px;
  }

  .projects-carousel-viewport {
    padding-left: 6vw;
    padding-right: 6vw;

    scroll-padding-left: 6vw;
    scroll-padding-right: 6vw;
  }

  .projects-carousel-track {
    gap: 5vw;
    padding-right: 6vw;
  }

  .projects-carousel-track .project-card {
    display: flex;
    flex-direction: column;

    flex: 0 0 88vw;
    width: 88vw;
    min-height: auto;
  }

  .projects-carousel-track .project-image {
    width: 100%;
    height: 52vh;
    min-height: 360px;
  }

  .projects-carousel-track .project-image img {
    height: 100%;
    min-height: 0;
    padding: 0.8rem;
  }

  .projects-carousel-track .project-info {
    min-height: 260px;
    padding: 1.8rem;

    border-top: 1px solid var(--line);
    border-left: none;
  }

  .projects-carousel-track .project-info h3 {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1;
  }

  .projects-carousel-track .project-info > p:not(.project-number) {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .projects-carousel-track .project-number {
    margin-bottom: 0.8rem;
  }

  /* Project detail carousels */

  .detail-carousel-header {
    margin-top: -0.5rem;
  }

  .detail-carousel-btn {
    width: 42px;
    height: 42px;
  }

  .detail-carousel-track {
    grid-auto-columns: 100%;
    gap: 1.2rem;
  }

  .detail-carousel-slide {
    width: 100%;
    height: 58vh;
    min-height: 390px;
  }

  .detail-carousel-slide img {
    width: 100%;
    height: 100%;
    padding: 0.8rem;
  }

  .detail-diagram-slide {
    padding: 3.8rem 0.8rem 0.8rem;
  }

  .detail-diagram-slide img {
    padding: 0;
  }

  .detail-diagram-slide figcaption {
    top: 1rem;
    left: 1rem;

    font-size: 1rem;
  }
}

/* =====================================================
   SHORT DESKTOP SCREENS
   ===================================================== */

@media (max-height: 720px) and (min-width: 761px) {
  .hero-gallery-slide {
    padding-top: 4rem;
    padding-bottom: 3.5rem;
  }

  .hero-gallery-slide img {
    height: 78%;
  }

  .hero-text-panel {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .hero-kicker {
    margin-bottom: 1.2rem;
  }

  .hero-name {
    margin-top: 2rem;
  }

  .projects-carousel-track .project-card {
    min-height: 620px;
  }

  .projects-carousel-track .project-image {
    height: 620px;
    min-height: 620px;
  }

  .detail-carousel-slide {
    height: 620px;
    min-height: 520px;
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-gallery-slide,
  .hero-gallery-slide img,
  .project-image img,
  .projects-carousel-viewport,
  .detail-carousel-viewport {
    transition: none;
    scroll-behavior: auto;
  }
}


/* =====================================================
   REVISTA — MAGAZINE PAGE VIEWER
   ===================================================== */

.magazine-viewer {
  max-width: 720px;
  margin: 0 auto;
}

.magazine-stage {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.magazine-page-wrap {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--sunken);
  border: 1px solid var(--line);
  box-shadow: 0 25px 60px rgba(19, 19, 19, 0.12);
}

.magazine-page-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.magazine-arrow {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.magazine-arrow:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.magazine-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.magazine-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.magazine-counter {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: 0;
}

.magazine-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  max-width: 100%;
}

.magazine-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.magazine-thumb:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.magazine-thumb.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

@media (max-width: 640px) {
  .magazine-stage {
    gap: 0.6rem;
  }

  .magazine-arrow {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}

/* =====================================================
   CONTACT — BLACK PANEL
   ===================================================== */

.contact-section {
  width: 100%;
  max-width: 1440px;
  margin: 6rem auto 0;
  padding: 0 5vw;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;

  min-height: 360px;

  background: #000000;
  color: #ffffff;
}

.contact-details,
.contact-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: clamp(2.5rem, 5vw, 5rem);
}

.contact-details {
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-label {
  margin: 0 0 2rem;

  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
}

.contact-links a {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 400;
  line-height: 1.25;

  border-bottom: 1px solid rgba(255, 255, 255, 0.38);

  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}

.contact-links a:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.7);
}

.contact-heading {
  align-items: flex-end;
  text-align: right;
}

.contact-heading h2 {
  max-width: 12ch;
  margin: 0;

  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

/* Mobile */

@media (max-width: 760px) {
  .contact-section {
    margin-top: 4rem;
    padding: 0 6vw;
  }

  .contact-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .contact-details,
  .contact-heading {
    padding: 2.5rem 1.8rem;
  }

  .contact-details {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .contact-heading {
    align-items: flex-start;
    text-align: left;
  }

  .contact-heading h2 {
    max-width: 10ch;
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .contact-links a {
    font-size: clamp(1.15rem, 5.5vw, 1.55rem);
  }
}

/* =====================================================
   STOA OF ATTALOS — ROTATE 180°
   ===================================================== */

.hero-gallery-slide img.stoa-rotated {
  transform: rotate(180deg) scale(0.985);
}

.hero-gallery-slide.active img.stoa-rotated {
  transform: rotate(180deg) scale(1.025);
}

.project-image img.stoa-rotated {
  transform: rotate(180deg);
}

.project-card:hover .project-image img.stoa-rotated {
  transform: rotate(180deg) scale(1.035);
}

.projects-carousel-track .project-card:hover .project-image img.stoa-rotated {
  transform: rotate(180deg) scale(1.02);
}

/* =====================================================
   STOA OF ATTALOS — DETAIL PAGE ROTATION
   ===================================================== */

/*
  Quitamos el fondo original del hero porque una imagen
  aplicada como background-image no se puede rotar directamente.
*/

.hero.stoa-detail-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  background-color: var(--ink);
  background-image: none;
}

/* Imagen del encabezado rotada 180 grados */

.hero.stoa-detail-hero::before {
  content: "";

  position: absolute;
  inset: -8%;
  z-index: -2;

  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  transform: rotate(180deg) scale(1.05);
}

/* Capa oscura encima de la imagen */

.hero.stoa-detail-hero::after {
  content: "";

  position: absolute;
  inset: 0;
  z-index: -1;

  background:
    linear-gradient(
      180deg,
      rgba(20, 17, 14, 0.72) 0%,
      rgba(20, 17, 14, 0.86) 100%
    );
}

/* Mantiene el menú y el contenido por encima del fondo */

.hero.stoa-detail-hero .nav,
.hero.stoa-detail-hero .hero-content {
  position: relative;
  z-index: 2;
}

/* Primera imagen de Project documentation */

.drawing-card img.stoa-documentation-rotated {
  transform: rotate(180deg);
  transform-origin: center;
}

/* =====================================================
   MOBILE — ORDEN, CENTRADO Y SCROLL DE CARRUSELES
   ===================================================== */

@media (max-width: 760px) {
  /* -----------------------------------------------------
     HERO: primero el texto y después las imágenes
     ----------------------------------------------------- */

  .hero-exhibition {
    min-height: auto;
    overflow: visible;
  }

  .hero-split {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: auto;
  }

  /* El título aparece primero */
  .hero-text-panel {
    order: 1;

    width: 100%;
    min-height: auto;

    padding:
      7rem
      6vw
      3rem;

    align-items: flex-start;
    justify-content: center;

    background: #000;
  }

  .hero-text-panel .hero-content {
    width: 100%;
    max-width: none;

    align-items: flex-start;
    text-align: left;
  }

  .hero-kicker {
    margin: 0 0 1.2rem;

    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0.16em;
  }

  .hero-exhibition h1 {
    width: 100%;
    max-width: 10ch;
    margin: 0;

    font-size: clamp(3.2rem, 15vw, 5rem);
    line-height: 0.9;
    text-align: left;
  }

  .hero-name {
    margin-top: 1.8rem;

    font-size: clamp(1.45rem, 6.5vw, 2.1rem);
    line-height: 1.15;
    text-align: left;
  }

  .hero-text-panel .btn {
    margin-top: 1.5rem;
    margin-left: 0;
  }

  /* El carrusel del encabezado aparece después */
  .hero-gallery {
    order: 2;

    width: 100%;
    height: 58svh;
    min-height: 430px;

    overflow: hidden;
    background: #000;
  }

  .hero-gallery-slide {
    padding:
      2.2rem
      6vw
      4.2rem;

    align-items: center;
    justify-content: center;
  }

  .hero-gallery-slide img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;

    padding: 0;

    object-fit: contain;
    object-position: center;

    transform: scale(1);
  }

  .hero-gallery-slide.active img {
    transform: scale(1);
  }

  /* Conserva correctamente la rotación de Stoa */
  .hero-gallery-slide img.stoa-rotated,
  .hero-gallery-slide.active img.stoa-rotated {
    transform: rotate(180deg);
  }

  .hero-gallery-project-name {
    left: 6vw;
    right: auto;
    bottom: 1.35rem;

    max-width: 62%;

    font-size: 0.6rem;
    line-height: 1.35;
  }

  .hero-gallery-counter {
    right: 6vw;
    bottom: 1.35rem;
  }

  /* -----------------------------------------------------
     CARRUSEL DE PROYECTOS
     ----------------------------------------------------- */

  .projects-carousel-section {
    overflow: visible;
  }

  .projects-carousel-section > .section-heading,
  .projects-carousel-header {
    width: 88vw;
    margin-left: auto;
    margin-right: auto;
  }

  /*
    Permite el desplazamiento vertical de la página.
    El valor pan-x anterior bloqueaba el gesto hacia abajo.
  */
  .projects-carousel-viewport {
    width: 100%;

    padding-left: 6vw;
    padding-right: 6vw;

    overflow-x: auto;
    overflow-y: visible;

    scroll-padding-left: 6vw;
    scroll-padding-right: 6vw;
    scroll-snap-type: x mandatory;

    touch-action: auto;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;

    -webkit-overflow-scrolling: touch;
  }

  .projects-carousel-track {
    display: flex;
    align-items: stretch;

    gap: 5vw;
    padding-right: 6vw;
  }

  .projects-carousel-track .project-card {
    display: flex;
    flex-direction: column;

    flex: 0 0 88vw;
    width: 88vw;
    max-width: 88vw;
    min-height: auto;

    overflow: hidden;

    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  /*
    Área de imagen centrada.
    El contain evita que se recorten imágenes verticales
    u horizontales.
  */
  .projects-carousel-track .project-image {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 50svh;
    min-height: 360px;
    max-height: 520px;

    padding: 1rem;

    overflow: hidden;
    background: var(--sunken);
  }

  .projects-carousel-track .project-image img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;

    padding: 0;

    object-fit: contain;
    object-position: center;

    transform: none;
  }

  .projects-carousel-track
    .project-card:hover
    .project-image
    img {
    transform: none;
  }

  /* Rotación de Stoa dentro del carrusel de proyectos */
  .projects-carousel-track
    .project-image
    img.stoa-rotated,
  .projects-carousel-track
    .project-card:hover
    .project-image
    img.stoa-rotated {
    transform: rotate(180deg);
  }

  .projects-carousel-track .project-info {
    width: 100%;
    min-height: 235px;

    padding: 1.7rem 1.5rem 2rem;

    justify-content: flex-start;

    border-top: 1px solid var(--line);
    border-left: none;
  }

  .projects-carousel-track .project-info h3 {
    margin-bottom: 1rem;

    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1;
  }

  .projects-carousel-track
    .project-info
    > p:not(.project-number) {
    max-width: 100%;

    font-size: 0.92rem;
    line-height: 1.6;
  }

  .projects-carousel-track .project-number {
    margin-bottom: 0.8rem;
  }

  /* Botones ligeramente más compactos */
  .carousel-btn {
    width: 42px;
    height: 42px;
  }
}
