/* =========================================================
   FVFstudio — Carpintería Arquitectónica
   ========================================================= */

:root {
  --bone: #f3efe8;
  --paper: var(--bone); /* Papel retirado por el manual de marca */
  --ink: #1d1b18;
  --ink-soft: rgba(29, 27, 24, 0.7); /* Tinta al 70 % */
  --ink-note: rgba(29, 27, 24, 0.45); /* Tinta al 45 % */
  --line: rgba(29, 27, 24, 0.14);
  --accent: #8a5a3b;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Tonos de madera (placeholders hasta cargar fotos) */
  --oak: linear-gradient(160deg, #cfae84 0%, #b48a5f 55%, #9c7449 100%);
  --oak-light: linear-gradient(160deg, #e3cfb0 0%, #cdb08a 60%, #bb9a70 100%);
  --walnut: linear-gradient(160deg, #7a5640 0%, #5b3e2c 55%, #432c1f 100%);
  --ash: linear-gradient(160deg, #e9e0d0 0%, #d6c7ad 60%, #c3b08f 100%);
  --smoked: linear-gradient(160deg, #4a3c32 0%, #33291f 55%, #221b15 100%);
  --cherry: linear-gradient(160deg, #b77650 0%, #965834 55%, #7a4426 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
em { font-style: italic; }

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

::selection { background: var(--ink); color: var(--bone); }

section[id] { scroll-margin-top: 76px; }

/* ---------- Tipografía base ---------- */
.eyebrow,
.section-index,
.p-num,
.p-cat,
.hero-caption,
.stat dt,
.materials-label,
.contact-list span,
.field label,
.specs dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section-index { margin: 0; font-variant-numeric: tabular-nums; }

.section-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.section-title em, .hero-title em, .contact-title em { color: var(--accent); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
@media (min-width: 900px) {
  .section-head {
    grid-template-columns: 2fr 10fr;
    align-items: end;
  }
  .section-head > .section-index { align-self: start; padding-top: 14px; }
  .section-head > .filters,
  .section-head > .section-note { grid-column: 2; }
}
.section-note { max-width: 46ch; color: var(--ink-soft); margin: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
}
.btn-dark { background: var(--ink); color: var(--bone); }
.btn-dark:hover { background: rgba(29, 27, 24, 0.82); }
.btn-line { border: 1px solid var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bone); }
.btn-light { background: var(--bone); color: var(--ink); }
.btn-light:hover { background: rgba(243, 239, 232, 0.88); }

/* ---------- Placeholders de imagen (madera) ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--oak);
  isolation: isolate;
}
.media::before {
  /* veta de la madera */
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(96deg,
      rgba(29, 27, 24, 0.05) 0 1px,
      transparent 1px 9px,
      rgba(243, 239, 232, 0.04) 9px 10px,
      transparent 10px 23px),
    radial-gradient(ellipse at 30% 20%, rgba(243, 239, 232, 0.18), transparent 60%);
  transform: rotate(-2deg);
  z-index: 0;
}
.media::after {
  content: attr(data-ph);
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(243, 239, 232, 0.7);
  z-index: 0;
}
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 1.2s var(--ease);
}

.tone-oak { background: var(--oak); }
.tone-oak-light { background: var(--oak-light); }
.tone-walnut { background: var(--walnut); }
.tone-ash { background: var(--ash); }
.tone-smoked { background: var(--smoked); }
.tone-cherry { background: var(--cherry); }
.tone-ash.media::after, .tone-oak-light.media::after { color: rgba(29, 27, 24, 0.5); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(243, 239, 232, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.12em;
  line-height: 1;
}
.brand-sub {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.nav { display: flex; align-items: center; gap: 32px; font-size: 14px; }
.nav a { position: relative; }
.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--bone); }

.menu-toggle { display: none; width: 40px; height: 40px; position: relative; }
.menu-toggle span {
  position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 23px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 19.5px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .menu-toggle { display: block; z-index: 2; }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
    padding: 0 var(--gutter);
    background: var(--bone);
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1.1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  /* backdrop-filter crea un contenedor para position:fixed; se quita con el menú abierto */
  body.menu-open .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bone);
  }
  .nav-cta { font-family: var(--sans); font-size: 15px; margin-top: 16px; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(130px, 18vw, 200px); }
.hero-top { display: grid; gap: 28px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.hero-meta {
  display: grid;
  gap: 24px;
  max-width: 560px;
  color: var(--ink-soft);
}
.hero-meta p { margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 1000px) {
  .hero-top { grid-template-columns: 1fr 1fr; align-items: end; }
  .hero-top .eyebrow, .hero-title { grid-column: 1 / -1; }
  .hero-meta { grid-column: 2; justify-self: end; }
}

.hero-figure { margin: clamp(48px, 7vw, 96px) 0 0; }
.hero-figure .media { height: clamp(380px, 72vh, 860px); }
.hero-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.hero-caption span:nth-child(2) { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 14px; }

/* ---------- Intro ---------- */
.intro { padding: clamp(80px, 12vw, 180px) 0; }
.intro-grid { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .intro-grid { grid-template-columns: 2fr 10fr; }
  .intro-grid > .section-index { padding-top: 14px; }
}
.lead {
  font-family: var(--serif);
  text-wrap: pretty;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 24ch;
  margin-bottom: 0;
}
@media (min-width: 900px) { .lead { max-width: 30ch; } }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 24px 16px 0 0; }
.stat dd {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat dd::before { content: "+"; color: var(--accent); }

/* ---------- Proyectos ---------- */
.projects { padding-bottom: clamp(80px, 12vw, 180px); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.3s var(--ease);
}
.filter:hover { border-color: var(--ink); }
.filter.is-active { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(40px, 5vw, 72px) clamp(16px, 2vw, 32px);
}
.project { grid-column: span 12; }
.project.is-hidden { display: none; }

@media (min-width: 760px) {
  .project.size-lg   { grid-column: span 7; }
  .project.size-md   { grid-column: span 5; }
  .project.size-sm   { grid-column: span 5; }
  .project.size-wide { grid-column: span 7; }

  /* ritmo asimétrico tipo portafolio */
  .project:nth-child(2) { margin-top: 18%; }
  .project:nth-child(3) { grid-column: 2 / span 4; }
  .project:nth-child(4) { margin-top: 12%; }
  .project:nth-child(5) { grid-column: 1 / span 5; }
  .project:nth-child(6) { grid-column: 7 / span 6; margin-top: 22%; }
  .project:nth-child(7) { grid-column: 1 / span 4; }
  .project:nth-child(8) { grid-column: 6 / span 7; margin-top: 8%; }

  /* con filtro activo: grilla regular */
  .project-grid.is-filtered .project { grid-column: span 6 !important; margin-top: 0 !important; }
}

.project-link { display: block; width: 100%; text-align: left; }
.project .media { aspect-ratio: 4 / 5; }
.project.size-lg .media, .project.size-wide .media { aspect-ratio: 4 / 3; }
.project-grid.is-filtered .project .media { aspect-ratio: 4 / 3; }

.project-link:hover .media img,
.project-link:focus-visible .media img { transform: scale(1.04); }
.project .media::before { transition: transform 1.2s var(--ease); }
.project-link:hover .media::before { transform: rotate(-2deg) scale(1.05); }

.project-info {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding-top: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.project-info h3 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
}
.project-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* ---------- Servicios ---------- */
.services {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: clamp(80px, 12vw, 180px) 0;
}
.service-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .service-list { grid-template-columns: repeat(3, 1fr); border-top: 0; }
  .service + .service { border-left: 1px solid var(--line); }
}
.service {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .service { padding: 8px clamp(20px, 3vw, 44px) 0; border-bottom: 0; }
  .service:first-child { padding-left: 0; }
}
.service-num {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 13px;
  margin-bottom: 28px;
}
.service h3 {
  font-family: var(--serif);
  font-size: clamp(36px, 3.6vw, 52px);
  line-height: 1;
  margin-bottom: 16px;
}
.service p { color: var(--ink-soft); max-width: 40ch; }
.service ul { list-style: none; margin: 24px 0 0; padding: 0; }
.service li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  display: flex;
  justify-content: space-between;
}
.service li::after { content: "→"; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: all 0.3s var(--ease); }
.service li:hover::after { opacity: 1; transform: none; }

/* ---------- Accesorios ---------- */
.products { padding: clamp(80px, 12vw, 180px) 0; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 40px) clamp(12px, 2vw, 24px);
}
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
.product .media { aspect-ratio: 4 / 5; }
.product:hover .media img { transform: scale(1.04); }
.product-info { padding-top: 14px; }
.product-info h3 { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.product-info span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Estudio ---------- */
.studio { padding: 0 0 clamp(80px, 12vw, 180px); }
.studio-grid { display: grid; gap: 40px; }
@media (min-width: 900px) {
  .studio-grid { grid-template-columns: 6fr 5fr; gap: clamp(40px, 7vw, 120px); align-items: center; }
}
.studio-media .media { aspect-ratio: 4 / 5; }
.studio-copy .section-title { margin: 16px 0 32px; }
.studio-copy > p { color: var(--ink-soft); max-width: 48ch; }

.materials { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.swatches {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 12px;
  font-size: 14px;
}
.swatches li { display: flex; align-items: center; gap: 10px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(29, 27, 24, 0.14);
}

/* ---------- Proceso ---------- */
.process {
  padding: clamp(80px, 12vw, 180px) 0;
  border-top: 1px solid var(--line);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); } }
.step { padding: 28px 0; border-top: 1px solid var(--ink); }
.step-num { font-family: var(--serif); font-size: 20px; color: var(--accent); }
.step h3 { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin: 40px 0 12px; }
@media (max-width: 899px) { .step h3 { margin-top: 12px; } }
.step p { color: var(--ink-soft); margin: 0; font-size: 15px; }

/* ---------- Contacto ---------- */
.contact {
  background: var(--ink);
  color: var(--bone);
  padding: clamp(80px, 12vw, 160px) 0;
}
.contact .section-index,
.contact .contact-list span,
.contact .field label { color: rgba(243, 239, 232, 0.55); }
.contact-grid { display: grid; gap: 56px; }
@media (min-width: 1000px) { .contact-grid { grid-template-columns: 5fr 6fr; gap: clamp(48px, 8vw, 140px); } }
.contact-title {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 16px 0 28px;
}
.contact-title em { color: var(--bone); }
.contact-grid > div > p { color: rgba(243, 239, 232, 0.75); max-width: 40ch; }
.contact-list { list-style: none; margin: 40px 0 0; padding: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(243, 239, 232, 0.15);
  font-size: 15px;
}
.contact-list a:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 4px; }

.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 24px;
  align-self: end;
}
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--bone);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(243, 239, 232, 0.3);
  border-radius: 0;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 52%, calc(100% - 5px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field select option { color: var(--ink); }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-bottom-color: var(--bone); }
.field textarea::placeholder { color: rgba(243, 239, 232, 0.35); }
.field.has-error input,
.field.has-error textarea { border-bottom-color: var(--bone); border-bottom-width: 2px; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.form-status { margin: 0; font-size: 14px; color: rgba(243, 239, 232, 0.75); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(243, 239, 232, 0.6);
  border-top: 1px solid rgba(243, 239, 232, 0.12);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.footer-inner p { margin: 0; }
.site-footer .brand-mark { color: var(--bone); font-size: 24px; }
.back-top:hover { color: var(--bone); }

/* ---------- Animación de entrada ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =========================================================
   PÁGINA DE PROYECTO
   ========================================================= */
.btn-ghost { border: 1px solid rgba(243, 239, 232, 0.35); color: var(--bone); }
.btn-ghost:hover { border-color: var(--bone); }

.case-hero { padding-top: clamp(120px, 15vw, 180px); }
.crumbs {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.crumbs a { border-bottom: 1px solid var(--line); }
.crumbs a:hover { color: var(--ink); border-color: var(--ink); }
.crumbs span { margin: 0 6px; }
.case-title {
  font-family: var(--serif);
  font-size: clamp(64px, 13vw, 210px);
  line-height: 0.88;
  letter-spacing: -0.03em;
}
.case-intro {
  display: grid;
  gap: 24px;
  margin-top: clamp(28px, 4vw, 48px);
}
@media (min-width: 900px) {
  .case-intro { grid-template-columns: 7fr 3fr; align-items: end; gap: 48px; }
}
.case-lead {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.15;
  max-width: 32ch;
  margin: 0;
}
.case-lead em { color: var(--accent); }
.case-place { margin: 0; font-size: 14px; color: var(--ink-soft); }
@media (min-width: 900px) { .case-place { text-align: right; } }

.case-cover { margin: clamp(40px, 6vw, 80px) 0 0; }
.case-cover img { width: 100%; height: clamp(360px, 78vh, 920px); object-fit: cover; }

.case-sheet { padding: clamp(40px, 6vw, 72px) 0; }
.sheet {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 clamp(16px, 3vw, 40px);
  margin: 0;
}
@media (min-width: 900px) { .sheet { grid-template-columns: repeat(4, 1fr); } }
.sheet div { padding: 16px 0 20px; border-top: 1px solid var(--line); }
.sheet dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.sheet dd { margin: 0; font-size: 15px; line-height: 1.45; }

.case-block { padding: clamp(72px, 10vw, 150px) 0; }
.case-block.tinted { background: var(--paper); }
.case-text {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
@media (min-width: 900px) {
  .case-text { grid-template-columns: 2fr 10fr; }
  .case-text > .section-index { padding-top: 14px; }
}
.case-h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.4vw, 80px);
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.case-cols { display: grid; gap: 0 clamp(24px, 4vw, 56px); color: var(--ink-soft); }
@media (min-width: 900px) { .case-cols { grid-template-columns: 1fr 1fr; } }
.case-p { color: var(--ink-soft); max-width: 60ch; }

.pieces {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}
@media (min-width: 900px) { .pieces { grid-template-columns: repeat(3, 1fr); } }
.pieces li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.pieces li::before { content: "—"; color: var(--accent); margin-right: 10px; }

/* Galerías */
.gallery {
  display: grid;
  gap: clamp(12px, 2vw, 28px);
  margin-bottom: clamp(12px, 2vw, 28px);
}
.gallery.g-2 { grid-template-columns: 1fr 1fr; }
.gallery.g-3 { grid-template-columns: 1fr 1fr; }
.gallery.g-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) {
  .gallery.g-3 { grid-template-columns: repeat(3, 1fr); }
  .gallery.g-4 { grid-template-columns: repeat(4, 1fr); }
  .gallery.g-2 { gap: clamp(24px, 5vw, 96px); padding-left: 8%; padding-right: 8%; }
  .gallery .offset { margin-top: 18%; }
}
@media (max-width: 759px) {
  .gallery.g-3 > figure:nth-child(3):last-child { grid-column: 1 / -1; }
}
.gallery figure { margin: 0; }
.gallery a { display: block; overflow: hidden; background: var(--paper); cursor: zoom-in; }
.gallery img {
  width: 100%;
  height: auto;
  transition: transform 1.2s var(--ease), opacity 0.4s var(--ease);
}
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption {
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 10px;
  max-width: 44ch;
}
.case-cover a { display: block; cursor: zoom-in; }

.chapter {
  display: grid;
  gap: 8px 40px;
  margin-top: clamp(56px, 8vw, 112px);
  margin-bottom: clamp(24px, 3vw, 40px);
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
@media (min-width: 900px) { .chapter { grid-template-columns: 5fr 7fr; align-items: baseline; } }
.chapter-title {
  font-family: var(--serif);
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.chapter-title span {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
}
.chapter-note { margin: 0; color: var(--ink-soft); max-width: 56ch; }

/* Línea de tiempo */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 32px;
}
@media (min-width: 900px) { .timeline { grid-template-columns: repeat(3, 1fr); gap: 0; } }
.timeline li { padding-right: clamp(0px, 2vw, 32px); }
.tl-weeks {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.tl-bar {
  display: block;
  height: 6px;
  margin: 14px 0 24px;
  background: var(--ink);
  border-radius: 3px;
  transform-origin: left;
}
.timeline li:nth-child(2) .tl-bar { background: var(--ink-soft); }
.timeline li:nth-child(3) .tl-bar { background: var(--ink); }
@media (min-width: 900px) {
  .tl-bar { border-radius: 0; }
  .timeline li:first-child .tl-bar { border-radius: 3px 0 0 3px; }
  .timeline li:last-child .tl-bar { border-radius: 0 3px 3px 0; }
  .timeline li { padding-right: 0; }
  .timeline h3, .timeline p { padding-right: clamp(16px, 2vw, 32px); }
}
.timeline h3 { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-bottom: 10px; }
.timeline p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* Materiales */
.mat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0 clamp(16px, 3vw, 40px);
}
@media (min-width: 700px) { .mat-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .mat-list { grid-template-columns: repeat(5, 1fr); } }
.mat-list li { padding: 24px 0; border-top: 1px solid var(--line); }
.mat-list .swatch { display: block; width: 44px; height: 44px; margin-bottom: 20px; }
.mat-list h3 { font-family: var(--serif); font-size: 26px; line-height: 1.1; margin-bottom: 8px; }
.mat-list p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.credits { margin-top: clamp(72px, 10vw, 140px); }

/* Cierre */
.case-next {
  background: var(--ink);
  color: var(--bone);
  padding: clamp(80px, 11vw, 150px) 0;
}
.case-next .section-index { color: rgba(243, 239, 232, 0.55); }
.case-next-inner { display: grid; gap: 40px; }
@media (min-width: 900px) { .case-next-inner { grid-template-columns: 1fr auto; align-items: end; } }
.case-next-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Visor de imágenes */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(29, 27, 24, 0.96);
  color: var(--bone);
}
.lightbox[open] { display: grid; place-items: center; animation: modalIn 0.4s var(--ease); }
.lightbox::backdrop { background: transparent; }
.lightbox img {
  max-width: calc(100vw - 2 * var(--gutter) - 120px);
  max-height: calc(100vh - 140px);
  object-fit: contain;
}
@media (max-width: 760px) { .lightbox img { max-width: calc(100vw - 2 * var(--gutter)); } }
.lb-caption {
  position: absolute;
  left: var(--gutter);
  right: 120px;
  bottom: 24px;
  margin: 0;
  font-size: 14px;
  color: rgba(243, 239, 232, 0.8);
}
.lb-count {
  position: absolute;
  right: var(--gutter);
  bottom: 24px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(243, 239, 232, 0.55);
  font-variant-numeric: tabular-nums;
}
.lb-btn {
  position: absolute;
  color: var(--bone);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-radius: 999px;
  transition: background 0.3s var(--ease);
}
.lb-btn:hover { background: rgba(243, 239, 232, 0.1); }
.lb-close { top: 18px; right: var(--gutter); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 22px; }
.lb-prev { left: calc(var(--gutter) - 12px); }
.lb-next { right: calc(var(--gutter) - 12px); }
@media (max-width: 760px) {
  .lb-prev, .lb-next { top: auto; bottom: 64px; transform: none; }
}
body.lb-open { overflow: hidden; }

/* Tarjeta del inicio que enlaza a una página de proyecto */
.project-link .p-more {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.media.has-photo::before, .media.has-photo::after { display: none; }
a.media { display: block; }
.hero-link img { transition: transform 1.6s var(--ease); }
.hero-link:hover img { transform: scale(1.02); }
.hero-caption a { border-bottom: 1px solid var(--line); transition: border-color 0.3s var(--ease); }
.hero-caption a:hover { border-color: var(--ink); }
.next-link { transition: color 0.3s var(--ease); }
.next-link em { display: inline-block; transition: transform 0.4s var(--ease); }
.next-link:hover { color: var(--bone); }
.next-link:hover em { transform: translateX(10px); }

/* ---------- Logos FVFstudio ---------- */
.brand-logo {
  height: 30px;
  width: auto;
}
@media (max-width: 480px) { .brand-logo { height: 24px; } }
.footer-logo {
  height: 64px;
  width: auto;
}

/* =========================================================
   CELULAR Y PANTALLAS TÁCTILES
   ========================================================= */
/* Alturas con la barra del navegador móvil descontada */
@supports (height: 100svh) {
  .hero-figure .media { height: clamp(380px, 72svh, 860px); }
  .case-cover img { height: clamp(360px, 78svh, 920px); }
}
.lightbox { height: 100dvh; }
.lightbox img { max-height: calc(100dvh - 150px); }

/* Áreas seguras (notch / barra de inicio) */
.site-header { padding-top: env(safe-area-inset-top); }
.footer-inner { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.lb-caption, .lb-count { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Títulos largos nunca desbordan */
.case-title, .section-title, .contact-title, .hero-title { overflow-wrap: break-word; text-wrap: balance; }
.case-lead, .case-cols p { text-wrap: pretty; }

/* Galería: nuevas variantes */
.gallery.narrow { grid-template-columns: 1fr; }
@media (min-width: 760px) { .gallery.narrow { width: 60%; margin-left: auto; margin-right: auto; } }
.gallery.wide { grid-template-columns: 1fr; }

/* Materiales en una lista corta */
.case-mats { margin: clamp(56px, 8vw, 112px) 0 0; }
.case-h3 { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1; margin-bottom: 20px; }
.mat-inline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 clamp(24px, 4vw, 56px); }
@media (min-width: 700px) { .mat-inline { grid-template-columns: 1fr 1fr; } }
.mat-inline li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
.mat-inline strong { font-weight: 500; color: var(--ink); margin-right: 6px; }
.mat-inline strong::after { content: " —"; color: var(--accent); }

/* Menú móvil: se puede desplazar en teléfonos en horizontal */
@media (max-width: 960px) {
  .nav { overflow-y: auto; padding-top: 96px; padding-bottom: 40px; justify-content: flex-start; }
}
@media (max-width: 960px) and (min-height: 600px) {
  .nav { justify-content: center; padding-top: 0; }
}

/* Botones y filtros con área de toque cómoda */
.filter { min-height: 40px; }
.menu-toggle { width: 44px; height: 44px; margin-right: -8px; }
.menu-toggle span { left: 11px; right: 11px; }
.menu-toggle span:first-child { top: 18px; }
.menu-toggle span:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] span:first-child,
.menu-toggle[aria-expanded="true"] span:last-child { top: 21.5px; }

/* Sin efectos de hover que se quedan pegados al tocar */
@media (hover: none) {
  .project-link:hover .media img, .product:hover .media img, .gallery a:hover img, .hero-link:hover img { transform: none; }
  .project-link:hover .media::before { transform: rotate(-2deg); }
  .service li::after { display: none; }
}

@media (max-width: 759px) {
  .hero { padding-top: 112px; }
  .hero-figure { margin-top: 40px; }
  .intro, .services, .products, .process, .contact { padding-top: 72px; padding-bottom: 72px; }
  .projects, .studio { padding-bottom: 72px; }
  .section-head { margin-bottom: 32px; gap: 16px; }

  /* Filtros en una fila deslizable */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }

  .project-grid { row-gap: 40px; }
  .project .media, .project.size-lg .media, .project.size-wide .media { aspect-ratio: 4 / 5; }
  .project-info { grid-template-columns: auto 1fr; gap: 4px 14px; }
  .project-info .p-cat { grid-column: 2; }

  .product-grid { gap: 24px 12px; }
  .product-info h3 { font-size: 21px; }
  .product-info span { font-size: 12px; display: block; line-height: 1.4; margin-top: 2px; }

  .contact-list li { grid-template-columns: 92px 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Página de proyecto */
  .case-hero { padding-top: 104px; }
  .case-title { font-size: clamp(48px, 14vw, 72px); }
  .case-cover { margin-top: 32px; }
  .case-cover img { height: auto; aspect-ratio: 4 / 5; max-height: 82svh; }
  .case-sheet { padding: 28px 0 8px; }
  .sheet div { padding: 12px 0 14px; }
  .sheet dd { font-size: 14px; }
  .case-block { padding: 48px 0 72px; }
  .case-text { margin-bottom: 32px; }
  .case-h2 { font-size: 40px; }
  .pieces { grid-template-columns: 1fr; }
  .pieces li { font-size: 14px; padding: 10px 0; }
  .gallery { gap: 10px; margin-bottom: 10px; }
  .gallery figcaption { font-size: 12px; padding-top: 6px; line-height: 1.4; }
  .case-next { padding: 72px 0; }
  .case-next .contact-title { font-size: 52px; }
  .case-next-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Visor: botones grandes y abajo, al alcance del pulgar */
  .lb-btn { min-width: 48px; min-height: 48px; }
  .lb-prev, .lb-next { bottom: calc(56px + env(safe-area-inset-bottom)); }
  .lb-caption { right: 90px; font-size: 13px; }
}
.product a.media { cursor: zoom-in; }
@media (max-width: 759px) {
  .contact-list a, .back-top { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* Cifras reales: dos datos, sin el "+" */
.stats-2 { margin-top: clamp(48px, 7vw, 96px); grid-template-columns: repeat(2, 1fr); max-width: 760px; }
.stats-2 .stat dd::before { content: none; }

/* Mobiliario y accesorios: 3 columnas en escritorio, 2 en celular; cada pieza con su carrusel */
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 899px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; } }

.pcar-track {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pcar-track::-webkit-scrollbar { display: none; }
.pcar-track > a { position: relative; flex: 0 0 100%; scroll-snap-align: start; cursor: zoom-in; overflow: hidden; }
.pcar-dots {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.pcar-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(243, 239, 232, 0.5); box-shadow: 0 0 0 1px rgba(29, 27, 24, 0.14); transition: background 0.3s var(--ease), transform 0.3s var(--ease); }
.pcar-dots span.is-on { background: var(--bone); transform: scale(1.25); }
.pcar-btn {
  position: absolute; top: 50%; z-index: 2;
  width: 36px; height: 36px; margin-top: -18px;
  border-radius: 50%;
  background: rgba(243, 239, 232, 0.9);
  color: var(--ink);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.pcar-prev { left: 10px; }
.pcar-next { right: 10px; }
.product:hover .pcar-btn, .pcar-btn:focus-visible { opacity: 1; }
.pcar-btn:hover { background: var(--bone); }
.pcar-btn[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .pcar-btn { display: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.stats-2 .stat { display: flex; flex-direction: column; justify-content: space-between; }

/* ---------- Accesibilidad: salto al contenido y foco visible ---------- */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  padding: 10px 16px;
  background: var(--ink); color: var(--bone);
  font-size: 14px;
}
.skip-link:focus { top: 12px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.contact a:focus-visible, .contact button:focus-visible, .site-footer a:focus-visible { outline-color: var(--bone); }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px;
  border-radius: 26px;
  background: var(--ink); color: var(--bone);
  border: 1px solid rgba(243, 239, 232, 0.28);
  box-shadow: 0 8px 28px rgba(29, 27, 24, 0.22);
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.wa-float svg { width: 22px; height: 22px; flex: none; }
.wa-float:hover { background: rgba(29, 27, 24, 0.82); transform: translateY(-2px); }
@media (max-width: 640px) {
  .wa-float { width: 52px; padding: 0; }
  .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
body.menu-open .wa-float, body.lb-open .wa-float { display: none; }
.site-footer { padding-bottom: 72px; }
@media (min-width: 641px) { .site-footer { padding-bottom: 0; } }
.field-note { display: block; margin-top: 6px; font-size: 12px; color: rgba(243, 239, 232, 0.55); }
.field.has-error select { border-bottom-color: var(--bone); border-bottom-width: 2px; }
