/* ── 1. RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 500;
  background: #FAFAF8;
  color: #111110;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* ── 2. CSS VARIABLES ── */
:root {
  --bg:      #FAFAF8;
  --ink:     #101010;
  --muted:   #d3d1cf;
  --faint:   #CCCCCA;
  --border:  #DDDDD8;
  --dark:    #1A1A18;
  --warm:    #E8E4DC;
  --ocean:   #1A6080;
  --font:    'Bricolage Grotesque', sans-serif;
  --pad-x:   48px;
  --pad-x-m: 24px;
  --nav-h:   72px;
}

/* ── 3. TYPOGRAPHY SCALE ── */
.t-logo    { font-size: 16px;  font-weight: 600; letter-spacing: 0.01em; }
.t-nav     { font-size: 36px;  font-weight: 500; }
.t-hero    { font-size: clamp(48px, 7vw, 88px); font-weight: 500; line-height: 0.93; letter-spacing: -0.025em; }
.t-h2      { font-size: clamp(28px, 3.5vw, 42px); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.t-label   { font-size: 13px;  font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ocean); }
.t-proj    { font-size: 24px;  font-weight: 500; }
.t-meta    { font-size: 13px;  font-weight: 500; color: var(--muted); }
.t-body    { font-size: 14px;  font-weight: 400; line-height: 1.75; color: #555552; }
.t-quote   { font-size: clamp(22px, 2.5vw, 30px); font-weight: 500; font-style: italic; line-height: 1.35; }
.t-stat    { font-size: clamp(40px, 4vw, 56px); font-weight: 500; line-height: 1; }
.t-service { font-size: 17px;  font-weight: 500; }
.t-sm      { font-size: 12px;  font-weight: 500; }

/* ── 4. LAYOUT UTILITIES ── */
.border-b { border-bottom: 0.5px solid var(--border); }
.border-r { border-right:  0.5px solid var(--border); }

/* ── 5. NAVIGATION ── */
.nav-wrapper {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
}
main {
  padding-top: var(--nav-h);
}
.page-home main {
  padding-top: 0;
}
#main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad-x);
  border-bottom: 0.5px solid transparent;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
#main-nav.scrolled {
  background: rgba(250, 250, 248, 0.6);
  border-bottom: 0.5px solid rgba(221, 221, 216, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
}
.logo-svg {
  height: 32px;
  width: auto;
  display: block;
}
.logo-white { display: none; }
.nav-links { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav-links a { color: var(--ink); transition: color 0.2s; }
.nav-links a:hover { color: var(--muted); }
.nav-links a.nav-active { color: var(--ocean); }
.nav-right { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav-hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 2px;
}
.nav-hamburger span { display: block; width: 22px; height: 1px; background: var(--ink); transition: all 0.3s; }
.nav-hamburger.open span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-hamburger.open span:last-child  { transform: translateY(-3px) rotate(-45deg); }

/* Nav sobre hero oscuro — texto blanco antes de hacer scroll */
#main-nav.nav-on-hero:not(.scrolled) .logo-dark  { display: none; }
#main-nav.nav-on-hero:not(.scrolled) .logo-white { display: block; }
#main-nav.nav-on-hero:not(.scrolled) .nav-links a { color: rgba(255,255,255,0.85); }
#main-nav.nav-on-hero:not(.scrolled) .nav-links a:hover { color: rgba(255,255,255,0.5); }
#main-nav.nav-on-hero:not(.scrolled) .lang-btn {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.3);
}
#main-nav.nav-on-hero:not(.scrolled) .lang-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
#main-nav.nav-on-hero:not(.scrolled) .nav-hamburger span { background: #fff; }

/* ── 6. LANGUAGE TOGGLE ── */
.lang-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0.5px solid var(--border);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
  text-transform: none;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ── 7. MOBILE MENU ── */
/* max-height approach: element stays in layout so the transition fires on both open and close */
.mobile-menu {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  overflow: hidden;
  max-height: 0;
  visibility: hidden;
  transition: max-height 0.4s ease, visibility 0s 0.4s;
}
.mobile-menu.open {
  max-height: 400px;
  visibility: visible;
  transition: max-height 0.4s ease, visibility 0s 0s;
}
.mobile-menu a {
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  padding: 18px var(--pad-x-m);
  border-bottom: 0.5px solid var(--border);
  transition: color 0.2s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--muted); }

/* ── 8. HERO ── */
#hero {
  padding: 0 var(--pad-x);
  border-bottom: 0.5px solid var(--border);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
#hero-quote {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.hero-content {
  text-align: center;
}
.hero-main-phrase {
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
  font-style: italic;
  margin: 0 0 20px 0;
}
.hero-tagline {
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
@media (max-width: 768px) {
  #hero { min-height: 100svh; }
  .hero-main-phrase { font-size: clamp(28px, 6vw, 48px); margin-bottom: 16px; }
  .hero-tagline { font-size: clamp(14px, 3.5vw, 18px); }
}

/* ── 9. TICKER ── */
.ticker {
  padding: 14px var(--pad-x);
  border-bottom: 0.5px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  gap: 48px;
  animation: ticker 20s linear infinite;
}
.ticker-item {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.ticker-item::before { content: '—'; margin-right: 12px; opacity: 0.4; }

/* ── 10. SECTION HEADERS ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--pad-x);
  border-bottom: 0.5px solid var(--border);
}

/* ── 11. PROJECTS ── */
.project {
  border-bottom: 0.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}
.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 140px;
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.06);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s;
  overflow: hidden;
}
.project:hover .project-img { transform: scale(1.015); opacity: 0.9; }

/* Main page: sin línea divisoria entre proyectos */
article.project { border-bottom: none; }

/* 48px side inset on main-page project images (article elements) */
article.project .project-img {
  margin-left: var(--pad-x);
  margin-right: var(--pad-x);
  width: auto;
}

/* nth-of-type targets article elements only, unaffected by the .section-header div sibling */
article.project:nth-of-type(1) .project-img { background: #191917; }
article.project:nth-of-type(2) .project-img { background: #E8E4DC; color: rgba(0,0,0,0.05); }
article.project:nth-of-type(3) .project-img { background: #21201E; }
article.project:nth-of-type(4) .project-img { background: #EDEBE3; color: rgba(0,0,0,0.05); }

/* ── PROJECT SLIDER ── */
.project-slider { position: relative; cursor: pointer; }
.project-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.project-slider .slide.active { opacity: 1; }
.project-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}
.project-slider .slide.active img {
  animation: slideZoom 8s ease-out forwards;
}
@keyframes slideZoom {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}
.slide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.project-slider:hover .slide-overlay { opacity: 0; }
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.2s;
}
.dot.active { background: #fff; }

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px var(--pad-x);
}
.project-name .hash { color: var(--faint); margin-right: 1px; }
.project-meta { display: flex; gap: 24px; align-items: baseline; }
.project-year { color: var(--faint); }

/* ── 12. SERVICES & PROCESS ── */
#servicios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 0.5px solid var(--border);
}
.services-left {
  padding: 72px var(--pad-x);
  border-right: 0.5px solid var(--border);
}
.services-right { padding: 72px var(--pad-x); }

.service-list { margin-top: 32px; }
.service-item {
  padding: 24px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: default;
  transition: padding-left 0.25s;
}
.service-item:hover { padding-left: 8px; }
.service-item:last-child { border-bottom: none; }
.service-name { font-size: 24px; font-weight: 500; color: var(--ink); }
.service-desc { font-size: 15px; font-weight: 400; color: #6b6b68; margin-top: 8px; line-height: 1.65; }

.process-list { margin-top: 32px; display: flex; flex-direction: column; gap: 0; }
.process-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 0.5px solid var(--border);
  align-items: flex-start;
}
.process-item:last-child { border-bottom: none; }
.process-num   { font-size: 17px; font-weight: 500; color: #9b9b97; padding-top: 3px; flex-shrink: 0; min-width: 40px; transition: color 0.2s; }
.process-item:hover .process-num { color: var(--ocean); }
.process-title { font-size: 24px; font-weight: 500; color: var(--ink); }
.process-desc  { font-size: 15px; font-weight: 400; color: #6b6b68; margin-top: 8px; line-height: 1.65; }

/* ── 13. ABOUT / ESTUDIO ── */
#estudio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 0.5px solid var(--border);
}
.about-left {
  padding: 72px var(--pad-x);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.about-right { padding: 72px var(--pad-x); }
.about-quote { margin-top: 28px; }
.stats       { display: flex; gap: 48px; margin-top: 56px; }
.stat-lbl    { font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.about-right .t-label { margin-bottom: 0; }
.about-text  { margin-top: 24px; font-size: 14px; font-weight: 400; line-height: 1.8; color: #555552; }
.about-text p + p { margin-top: 16px; }

/* ── 14. CONTACT CTA ── */
#contacto-cta {
  padding: 88px var(--pad-x);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  position: relative;
  isolation: isolate;
  background-image: url('ocean-hero.webp');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
#contacto-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 0;
}
#contacto-cta > .reveal,
#contacto-cta > .cta-right {
  position: relative;
  z-index: 1;
}
.cta-label { margin-bottom: 20px; color: rgba(255,255,255,0.6); }
.cta-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.cta-title em { font-style: italic; color: rgba(255,255,255,0.4); }
.cta-right { display: flex; flex-direction: column; gap: 16px; align-items: flex-end; flex-shrink: 0; }
.cta-sub   { text-align: right; max-width: 200px; color: rgba(255,255,255,0.6); }
.cta-email {
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  color: #fff;
  border-bottom: 0.5px solid rgba(255,255,255,0.6);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.cta-email:hover { color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.4); }

/* ── 15. FOOTER ── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad-x);
}
.footer-logo { height: 22px; width: auto; display: block; opacity: 0.75; }
.footer-copy { font-size: 12px; font-weight: 400; color: var(--ink); opacity: 0.75; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 12px; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }

/* ── 16. ANIMATIONS ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── 17. RESPONSIVE — TABLET (max 900px) ── */
@media (max-width: 900px) {
  :root { --pad-x: 32px; }

  #servicios, #estudio { grid-template-columns: 1fr; }
  .services-left { border-right: none; border-bottom: 0.5px solid var(--border); padding-bottom: 48px; }
  .about-left    { border-right: none; border-bottom: 0.5px solid var(--border); }

  #contacto-cta  { flex-direction: column; align-items: flex-start; }
  .cta-right     { align-items: flex-start; }
  .cta-sub       { text-align: left; }
}

/* ── 18. RESPONSIVE — MOBILE (max 768px) ── */
@media (max-width: 768px) {
  :root { --pad-x: var(--pad-x-m); --nav-h: 64px; }

  #main-nav { padding: 16px var(--pad-x-m); }
  .nav-links   { display: none; }
  .nav-hamburger { display: flex; }
  .nav-right { margin-left: auto; }

  #hero {
    grid-template-columns: 1fr;
    padding: 56px var(--pad-x-m) 48px;
    min-height: unset;
    gap: 32px;
  }
  .section-header { padding: 14px var(--pad-x-m); }
  .project-foot   { padding: 14px var(--pad-x-m); flex-wrap: wrap; gap: 4px; }
  article.project .project-img { margin-left: var(--pad-x-m); margin-right: var(--pad-x-m); }
  .t-proj         { font-size: 20px; }

  .services-left,
  .services-right,
  .about-left,
  .about-right { padding: 48px var(--pad-x-m); }

  #contacto-cta { padding: 64px var(--pad-x-m); }
  .stats { gap: 28px; }
  footer { flex-direction: column; gap: 16px; text-align: center; padding: 24px var(--pad-x-m); }
  .footer-links { justify-content: center; }
  .ticker { padding: 12px var(--pad-x-m); }
}

/* ── 19. RESPONSIVE — SMALL MOBILE (max 480px) ── */
@media (max-width: 480px) {
  .t-nav { font-size: 20px; }
  .mobile-menu a { font-size: 24px; }
  .project-img   { font-size: 80px; }
}

/* ── 20. PREFERS-REDUCED-MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker-inner { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.visible { opacity: 1; transform: none; }
}

/* ── 21. FLOATING BADGE ── */
#floating-badge {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 180px;
  height: 180px;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: opacity, transform;
}
#floating-badge svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: center center;
  will-change: transform;
}
@media (max-width: 768px) {
  #floating-badge {
    width: 120px;
    height: 120px;
    bottom: 20px;
    right: 20px;
  }
}

/* ── 22. PROJECT LISTING CARDS AS LINKS ── */
a.project {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* Alternating grid: full → two halves → full → … */
.projects-listing {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* No border between listing cards */
.projects-listing > a.project {
  border-bottom: none;
}

/* All items: 18px top/bottom → 36px total vertical gap between photos */
.projects-listing > a.project {
  display: grid;
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Full-width: 48px horizontal, 18px vertical */
.projects-listing > a.project:nth-child(3n+1) {
  grid-column: 1 / -1;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* Half-width: 48px outer, 18px inner (18+18 = 36px gap between photos) */
.projects-listing > a.project:nth-child(3n+2) {
  padding-left: var(--pad-x);
  padding-right: 18px;
}
.projects-listing > a.project:nth-child(3n+3) {
  padding-left: 18px;
  padding-right: var(--pad-x);
}

/* Cancel scale/opacity hover from main page — photos stay fixed */
.projects-listing > a.project:hover .project-img {
  transform: none;
  opacity: 1;
}

/* Stack image and name in the same grid cell */
.projects-listing .project-img {
  grid-area: 1 / 1;
  position: relative;
}

/* Scrim: transparent at rest, darkens on hover to reveal name */
.projects-listing .project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.4s ease;
  pointer-events: none;
}
.projects-listing > a.project:hover .project-img::after {
  background: rgba(0,0,0,0.45);
}

/* Name: hidden at rest, fades in on hover */
.projects-listing .project-foot {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: center;
  justify-self: center;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.projects-listing > a.project:hover .project-foot {
  opacity: 1;
}
.projects-listing .project-name {
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  font-size: clamp(20px, 2.5vw, 32px);
}
.projects-listing .project-name .hash {
  color: rgba(255,255,255,0.5);
}
.projects-listing .project-meta {
  display: none;
}

@media (max-width: 768px) {
  .projects-listing {
    grid-template-columns: 1fr;
  }
  .projects-listing > a.project {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .projects-listing > a.project:nth-child(3n+1),
  .projects-listing > a.project:nth-child(3n+2),
  .projects-listing > a.project:nth-child(3n+3) {
    padding-left: var(--pad-x-m);
    padding-right: var(--pad-x-m);
  }
  /* On touch: always show name */
  .projects-listing .project-foot {
    opacity: 1;
  }
  .projects-listing .project-img::after {
    background: rgba(0,0,0,0.35);
  }
}

.project-ver-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ocean);
  letter-spacing: 0.05em;
  transition: letter-spacing 0.2s;
  white-space: nowrap;
}
.project-ver-link:hover { letter-spacing: 0.12em; }

/* ── 23. PROJECT DETAIL PAGES ── */
.project-breadcrumb {
  padding: 20px var(--pad-x);
  border-bottom: 0.5px solid var(--border);
}
.back-link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }

.project-detail-header {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 0;
  padding: 64px var(--pad-x);
  align-items: start;
}
.project-detail-categories {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.project-detail-title {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--ink);
}
.project-detail-year {
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.1em;
  margin-top: 16px;
}
.project-detail-desc {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.7;
  color: #555552;
}
.project-detail-desc p + p { margin-top: 16px; }

.desc-toggle {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 0.5px solid var(--ink);
  padding: 0 0 2px 0;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.desc-toggle:hover { opacity: 0.5; }
.desc-toggle.is-open { display: none; }

.desc-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.desc-more.open { grid-template-rows: 1fr; }
.desc-more-inner {
  overflow: hidden;
  padding-top: 24px;
}
.desc-more-inner p + p { margin-top: 16px; }

.project-credits { margin-top: 40px; }
.credit-item {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 16px;
  line-height: 1.5;
}
.credit-item:first-child { border-top: 0.5px solid var(--border); }
.credit-label {
  font-weight: 500;
  color: var(--ink);
}
.credit-label::after { content: ':  '; }
.credit-value {
  font-weight: 400;
  color: var(--ink);
}

.desc-close {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  padding: 0;
  transition: opacity 0.2s;
}
.desc-close:hover { opacity: 0.5; }
.desc-close-x {
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
}

/* Hero: 48px horizontal, 18px vertical — mismo sistema que listing */
.project-detail-hero {
  padding: 18px var(--pad-x);
}
.project-detail-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Galería 2 columnas: misma lógica de padding que el listing */
.project-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.project-gallery-grid .gallery-item {
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 18px;
}
.project-gallery-grid .gallery-item:nth-child(odd) {
  padding-left: var(--pad-x);
  padding-right: 18px;
}
.project-gallery-grid .gallery-item:nth-child(even) {
  padding-left: 18px;
  padding-right: var(--pad-x);
}
.project-gallery-grid .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-gallery-grid .gallery-item:hover img { transform: scale(1.04); }

/* Foto full-width: mismo padding que hero */
.project-gallery-full {
  padding: 18px var(--pad-x);
}
.project-gallery-full img {
  width: 100%;
  height: auto;
  display: block;
}

.project-next-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px var(--pad-x);
  border-bottom: 0.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.project-next-nav:hover { background: var(--warm); }
.project-next-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-next-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 8px;
}
.project-next-arrow {
  font-size: 32px;
  color: var(--muted);
}

/* Project detail responsive */
@media (max-width: 768px) {
  .project-detail-header {
    grid-template-columns: 1fr;
    padding: 40px var(--pad-x-m);
    gap: 32px;
  }
  .project-detail-hero { padding: 12px var(--pad-x-m); }
  .project-detail-hero img { aspect-ratio: auto; object-fit: initial; height: auto; }
  .project-gallery-full  { padding: 12px var(--pad-x-m); }
  .project-gallery-grid  { grid-template-columns: 1fr; }
  .project-gallery-grid .gallery-item { padding: 12px var(--pad-x-m) !important; }
  .project-next-nav { padding: 32px var(--pad-x-m); flex-direction: column; align-items: flex-start; gap: 16px; }
}
