/* Carpintería Cuitiño — tokens */
:root {
  --paper: #f1f1ee;
  --white: #fafaf8;
  --ink: #1f1d1a;
  --graphite: #66625c;
  --rule: #d3d0ca;
  --oak: #b3704d;
  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1440px;
  --wide: "wdth" 125;
  --semi: "wdth" 108;
  --norm: "wdth" 100;
  --head: "Montserrat", "Archivo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: var(--norm);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 4.5rem; gap: 2rem; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 0; white-space: nowrap; }
.brand b, .brand span, .wordmark b, .wordmark span { font-variation-settings: var(--wide); letter-spacing: .04em; font-size: 1.35rem; }
.brand b, .wordmark b { font-weight: 650; }
.brand span, .wordmark span { font-weight: 100; }
.wordmark b, .wordmark span { font-size: 1.1rem; }
.nav { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav a { text-decoration: none; font-size: .98rem; padding: .35rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--oak); }
.menu-btn { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; font-size: .98rem; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 4.5rem; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: .5rem var(--gutter) 1.25rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem 0; font-size: 1.25rem; border-bottom: 1px solid var(--rule); }
  .brand b, .brand span { font-size: 1rem; }
}

/* Type */
h1, h2, h3 { font-family: var(--head); font-weight: 500; margin: 0; letter-spacing: -.01em; }
.display { font-family: var(--head); font-weight: 500; font-size: clamp(2.25rem, 6.4vw, 6rem); line-height: 1.02; letter-spacing: -.03em; }
.h2 { font-family: var(--head); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -.02em; }
.h3 { font-family: var(--head); font-weight: 500; font-size: 1.2rem; line-height: 1.25; letter-spacing: -.01em; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.5; max-width: 34em; }
.muted { color: var(--graphite); }
.prose { max-width: 36em; }
.prose p { margin: 0 0 1em; }

.link { text-decoration: none; border-bottom: 1px solid var(--oak); padding-bottom: 2px; }
.link:hover { color: var(--oak); }

/* Sections */
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); flex-wrap: wrap; }

/* Hero */
.hero-img { width: 100%; height: min(82vh, 56vw); min-height: 22rem; object-fit: cover; background: var(--rule); }
.hero-text { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem 4rem; align-items: end; padding-top: clamp(2rem, 5vw, 4.5rem); }
.hero-text .side { padding-bottom: .6rem; }
.hero-text .side p { margin: 0 0 1.25rem; }
@media (max-width: 860px) { .hero-text { grid-template-columns: 1fr; } }

/* Title block: the caption under every work, like a drawing's title block */
.tb { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; border-top: 1px solid var(--ink); padding-top: .7rem; margin-top: .9rem; }
.tb .t { font-family: var(--head); font-weight: 500; font-size: 1rem; line-height: 1.3; }
.tb .m { color: var(--graphite); font-size: .92rem; text-align: right; }
@media (max-width: 520px) { .tb { grid-template-columns: 1fr; } .tb .m { text-align: left; } }

/* Works grid */
.works { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 2.5vw, 2rem); }
.work { text-decoration: none; display: block; grid-column: span 6; }
.work .ph { overflow: hidden; background: var(--rule); }
.work img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s ease; }
.work:hover img { transform: scale(1.025); }
.works.all .work { grid-column: span 4; }
@media (max-width: 1000px) { .works.all .work { grid-column: span 6; } }
@media (max-width: 700px) {
  .works .work, .works.all .work, .works.featured .work:nth-child(n) { grid-column: 1 / -1; }
  .works.featured .work:nth-child(n) img { aspect-ratio: 4 / 3; }
}
.works.busy { opacity: .55; transition: opacity .2s; }
.skeleton .ph { aspect-ratio: 4 / 3; background: linear-gradient(90deg, var(--rule), #e2e0db, var(--rule)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button { background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .45rem 1rem; cursor: pointer; font-size: .95rem; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Work detail */
.work-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem 4rem; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); align-items: end; }
@media (max-width: 860px) { .work-head { grid-template-columns: 1fr; } }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--ink); }
.facts dt, .facts dd { margin: 0; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--graphite); padding-right: 1.5rem; font-size: .95rem; }
.cover { width: 100%; max-height: 88vh; object-fit: cover; background: var(--rule); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.75rem, 2vw, 1.5rem); margin-top: clamp(.75rem, 2vw, 1.5rem); }
.gallery button { padding: 0; border: 0; background: var(--rule); cursor: zoom-in; display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }
.work-text { padding: clamp(2.5rem, 5vw, 4rem) 0 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--ink); padding-top: 1.25rem; margin-top: clamp(3rem, 6vw, 5rem); }
.pager a { text-decoration: none; }
.pager .next { text-align: right; }
.pager small { display: block; color: var(--graphite); font-size: .88rem; }
.pager span { font-variation-settings: var(--semi); font-size: 1.2rem; }

/* Lightbox */
dialog.lb { border: 0; padding: 0; background: #1b1a18; color: var(--white); width: 100vw; height: 100vh; max-width: none; max-height: none; }
dialog.lb::backdrop { background: #1b1a18; }
.lb-inner { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb img { max-width: calc(100vw - 2rem); max-height: calc(100vh - 6rem); object-fit: contain; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--gutter); font-size: .95rem; }
.lb-bar button, .lb-close { background: none; border: 0; color: inherit; cursor: pointer; padding: .5rem .25rem; }
.lb-close { position: absolute; top: .75rem; right: var(--gutter); }

/* Workshop band */
.band { background: var(--ink); color: var(--paper); }
.band .muted { color: #a9a49c; }
.band .link { border-bottom-color: #c39a72; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.25rem 1fr; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, currentColor 25%, transparent); }
.steps li::before { content: counter(s); font-variation-settings: var(--wide); font-weight: 600; }
.steps b { display: block; font-weight: 550; font-variation-settings: var(--semi); }
.duo { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(.75rem, 2vw, 1.5rem); }
.duo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.duo img:last-child { aspect-ratio: 3 / 4; }

/* Pieces */
.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: clamp(2rem, 4vw, 3rem) clamp(1rem, 2.5vw, 2rem); }
.piece { text-decoration: none; }
.piece img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--rule); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(2rem, 6vw, 6rem); }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.info { margin: 2rem 0 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--ink); }
.info dt, .info dd { margin: 0; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.info dt { color: var(--graphite); padding-right: 1.5rem; }
.info a { text-decoration: none; }
form.f { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.25rem; }
.fld { display: flex; flex-direction: column; gap: .35rem; grid-column: 1 / -1; }
.fld.half { grid-column: span 1; }
@media (max-width: 600px) { .fld.half { grid-column: 1 / -1; } }
.fld label { font-size: .95rem; }
.fld .req { color: var(--oak); margin-left: .15rem; }
.fld input, .fld select, .fld textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--white); border: 1px solid var(--rule); border-radius: 2px; padding: .75rem .85rem; width: 100%; }
.fld textarea { min-height: 9rem; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.fld .help { font-size: .88rem; color: var(--graphite); margin: 0; }
.fld .err { font-size: .9rem; color: #9b2c1e; margin: 0; min-height: 0; }
.fld [aria-invalid="true"] { border-color: #9b2c1e; }
.form-err { grid-column: 1 / -1; color: #9b2c1e; margin: 0; }
.btn { grid-column: 1 / -1; justify-self: start; background: var(--ink); color: var(--paper); border: 0; padding: .95rem 1.6rem; font-size: 1rem; cursor: pointer; border-radius: 2px; }
.btn:hover { background: var(--oak); }
.btn[disabled] { opacity: .6; cursor: progress; }
.thanks { border-top: 1px solid var(--ink); padding-top: 1.25rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 3rem 0 2.5rem; margin-top: clamp(4rem, 9vw, 8rem); font-size: .95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.site-footer p { margin: 0 0 .3rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

.empty { border-top: 1px solid var(--ink); padding-top: 1rem; color: var(--graphite); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* Menú: ícono de tres líneas en todos los tamaños */
.site-header .wrap { position: relative; }
.menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 2.75rem; height: 2.75rem; padding: .6rem; margin-right: -.6rem; background: none; border: 0; cursor: pointer; }
.menu-btn span { display: block; height: 1.5px; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav { position: absolute; top: 4.5rem; right: var(--gutter); left: auto; width: min(22rem, calc(100vw - 2 * var(--gutter))); flex-direction: column; gap: 0; background: var(--paper); border: 1px solid var(--rule); border-top: 0; padding: .5rem 1.5rem 1.25rem; display: none; }
.nav.open { display: flex; }
.nav a { padding: .8rem 0; font-size: 1.25rem; font-weight: 300; border-bottom: 1px solid var(--rule); }
.nav a:last-child { border-bottom: 0; }
.nav a[aria-current="page"] { color: var(--oak); border-bottom-color: var(--rule); }
.nav a:last-child[aria-current="page"] { border-bottom: 0; }
@media (max-width: 760px) { .nav { left: 0; right: 0; width: auto; border-left: 0; border-right: 0; padding: .5rem var(--gutter) 1.25rem; } }

/* Texto general más liviano */
body { font-weight: 300; }
.tb .t, .pager span { font-weight: 400; }

/* Logotipo Cuitiño (serif con viruta) + descriptor fino */
.brand, .wordmark { display: flex; align-items: flex-end; gap: .85rem; white-space: nowrap; }
.brand .logo { height: 2.3rem; width: auto; display: block; }
.wordmark .logo { height: 1.9rem; width: auto; display: block; }
.brand span, .wordmark span { font-variation-settings: var(--wide); font-size: .74rem; font-weight: 200; letter-spacing: .24em; line-height: 1; padding-bottom: .2rem; color: var(--ink); }
.wordmark { margin: 0 0 .7rem; }
@media (max-width: 760px) { .brand .logo { height: 1.95rem; } .brand span { font-size: .64rem; letter-spacing: .2em; gap: .6rem; } }

/* Logotipo v2 */
.brand .logo { height: 3.5rem; }
.wordmark .logo { height: 2.9rem; }
@media (max-width: 760px) { .brand .logo { height: 3rem; } }

/* Alinear CARPINTERÍA a la línea base de Cuitiño */
.brand span, .wordmark span { padding-bottom: 0; transform: translateY(calc(.198em - .0665rem)); }
.wordmark span { transform: translateY(calc(.198em - .055rem)); }
@media (max-width: 760px) { .brand span { transform: translateY(calc(.198em - .057rem)); } }

/* Hero con video: título blanco que aparece con fundido */
.hero-media { position: relative; overflow: hidden; background: var(--ink); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.hero-video.on { opacity: 1; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,18,15,.62) 0%, rgba(20,18,15,.12) 55%, rgba(20,18,15,.28) 100%); pointer-events: none; }
.hero-title { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: clamp(1.75rem, 5vw, 4rem); color: #fff; opacity: 0; animation: heroIn 2.4s ease .6s forwards; }
.hero-title .display { color: #fff; max-width: 15ch; font-size: clamp(2.1rem, 5.6vw, 5.25rem); text-shadow: 0 1px 24px rgba(0,0,0,.25); }
@keyframes heroIn { from { opacity: 0; } to { opacity: 1; } }
.hero-text > .display { margin: 0; }
@media (prefers-reduced-motion: reduce) { .hero-title { opacity: 1; } .hero-video { display: none; } }

/* Título del hero: Ultra Light + grosor normal */
.hero-title .display { max-width: 16ch; }
.hero-title .thin { font-weight: 200; }
.hero-title .strong { font-weight: 500; display: block; }
.hero-media.has-video .hero-img { visibility: hidden; }

/* Título arriba a la izquierda, más chico */
.hero-title { top: 0; bottom: auto; padding-top: clamp(1.5rem, 3.5vw, 3rem); padding-bottom: 0; }
.hero-title .display { max-width: 20ch; font-size: clamp(1.5rem, 3.1vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em; }
.hero-shade { background: linear-gradient(to bottom, rgba(20,18,15,.58) 0%, rgba(20,18,15,.2) 38%, rgba(20,18,15,.05) 100%); }

/* Títulos en dos pesos: Ultra Light + normal */
.thin { font-weight: 200; }
.strong { font-weight: 500; }


/* Crédito de diseño */
.credit { margin: 0; padding: 0 1rem 1.25rem; text-align: center; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: .68rem; letter-spacing: .02em; color: var(--muted, #8a837b); }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.credit .n-light { font-weight: 300; }
.credit .n-bold { font-weight: 700; }


/* Bucle continuo: fundido cruzado del final al primer fotograma */
.hero-video { transition: opacity 1s linear; }

/* Logo 2026-11: descriptor en cobre oscuro, peso 300, alineado a la base del wordmark */
.brand span, .wordmark span { color: var(--oak); font-weight: 300; transform: translateY(calc(.198em - .0665rem - .13rem)); }
.wordmark span { transform: translateY(calc(.198em - .055rem - .11rem)); }
@media (max-width: 760px) { .brand span { transform: translateY(calc(.198em - .057rem - .11rem)); } }
.wordmark { margin-bottom: 1.1rem; }

/* Descriptor condensado a juego con el wordmark; textos en cobre oscuro (contraste >= 4.5:1), lineas en cobre exacto */
:root { --oak-text: #94583a; }
.brand span, .wordmark span { color: var(--oak-text); font-variation-settings: "wdth" 75; font-weight: 400; letter-spacing: .16em; font-size: .86rem; }
.nav a[aria-current="page"] { color: var(--oak-text); }
.fld .req { color: var(--oak-text); }
@media (max-width: 760px) { .brand span { font-size: .74rem; letter-spacing: .14em; } }
.brand span { transform: translateY(calc(.198em - .0665rem - .23rem)); }
@media (max-width: 760px) { .brand span { transform: translateY(calc(.198em - .057rem - .03rem)); } }


/* Hero vertical solo en móvil */
@media (max-width: 760px) {
  .hero-img { height: auto; min-height: 0; aspect-ratio: 4 / 5; max-height: 82svh; }
  .hero-video { object-position: 50% 50%; }
}

.gallery video { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; background: var(--rule); }
