/* ===== Antomancha SL — estilos ===== */
:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --sunk: #efebe6;
  --text: #241f1d;
  --muted: #645c58;
  --primary: #8b2219;      /* rojo del logo */
  --primary-dark: #6b1912;
  --primary-tint: #f4e7e4;
  --grey: #6e6e6e;         /* gris del logo */
  --line: #e2ddd7;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(36, 20, 16, .05), 0 12px 28px -12px rgba(36, 20, 16, .18);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --max: 1180px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-color: #c9bfb7 var(--bg); }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--primary);
}
::selection { background: var(--primary); color: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
h3 { font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.container { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* ----- Botones ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--primary); color: #fff; font: 600 1rem/1 var(--font-body);
  border: 1.5px solid var(--primary); cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-outline { background: transparent; color: var(--text); border-color: #c9c1ba; }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45em; font-weight: 600; color: var(--primary);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  padding-bottom: 2px; transition: background-size 240ms var(--ease-out);
}
.link-arrow .ico { transition: transform 200ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
  .btn-outline:hover { background: var(--text); border-color: var(--text); color: #fff; }
  .btn-light:hover { background: var(--primary-tint); border-color: var(--primary-tint); }
  .btn-ghost:hover { background: #fff; border-color: #fff; color: var(--primary); }
  .link-arrow:hover { background-size: 100% 1.5px; }
  .link-arrow:hover .ico { transform: translateX(3px); }
}

/* ----- Cabecera ----- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo img { height: 56px; width: auto; }
.nav { display: flex; gap: 32px; align-items: center; }
.nav a { font-weight: 500; color: var(--muted); transition: color 180ms ease; }
.nav a:hover { color: var(--text); }
.nav-tel {
  display: inline-flex; align-items: center; gap: .5em;
  color: var(--primary) !important; font-weight: 600 !important;
  padding: 10px 16px; border-radius: 999px; background: var(--primary-tint);
}
.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform 220ms var(--ease-out), opacity 150ms ease;
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { content: ""; left: 0; top: -7px; }
.nav-toggle span::after { content: ""; left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ----- Portada ----- */
.hero { padding: 72px 0 96px; }
.hero .container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); letter-spacing: -0.03em; margin-bottom: 24px; }
.hero h1 em { color: var(--primary); font-style: italic; }
.hero-text > p { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-photo { position: relative; }
.hero-photo img {
  width: 100%; aspect-ratio: 16 / 10.5; object-fit: cover; object-position: 72% center;
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.hero-badge {
  position: absolute; left: -28px; bottom: 28px; background: #fff; border-radius: 14px;
  padding: 16px 20px; box-shadow: var(--shadow); display: grid; gap: 2px; line-height: 1.3;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.hero-badge b { color: var(--text); font-weight: 600; }
.hero-badge span { display: inline-flex; align-items: center; gap: .4em; color: var(--primary); font-size: .92rem; font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  .hero-badge:hover { transform: translateY(-2px); }
}

/* Entrada de la portada: una sola vez, al cargar */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * , .hero-photo { animation: enter 700ms var(--ease-out) both; }
  .hero-text > :nth-child(2) { animation-delay: 70ms; }
  .hero-text > :nth-child(3) { animation-delay: 140ms; }
  .hero-photo { animation-name: enter-photo; animation-duration: 900ms; animation-delay: 100ms; }
  .hero-badge { animation: enter 600ms var(--ease-out) 450ms both; }
}
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes enter-photo { from { opacity: 0; transform: scale(.98); filter: blur(6px); } }

/* ----- Secciones ----- */
section { padding: 104px 0; }
h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); margin-bottom: 16px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

/* Servicios: lista editorial en lugar de tarjetas */
.services { background: var(--surface); border-block: 1px solid var(--line); }
.services-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 72px; align-items: start; }
.services-intro { position: sticky; top: 128px; }
.services-intro p { color: var(--muted); margin-bottom: 28px; max-width: 34ch; }
.service-list { list-style: none; border-top: 1px solid var(--line); }
.service-list li {
  display: grid; grid-template-columns: 52px 1fr; gap: 20px; align-items: start;
  padding: 26px 8px; border-bottom: 1px solid var(--line);
}
.service-ico {
  width: 44px; height: 44px; padding: 10px; border-radius: 12px;
  background: var(--primary-tint); color: var(--primary);
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.service-list h3 { font-size: 1.2rem; margin-bottom: 6px; }
.service-list p { color: var(--muted); max-width: 58ch; }

/* ----- Nuestros trabajos ----- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter {
  font: 500 .92rem/1 var(--font-body); cursor: pointer; min-height: 40px;
  padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted);
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out);
}
.filter:active { transform: scale(0.97); }
.filter.active { background: var(--text); border-color: var(--text); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .filter:not(.active):hover { color: var(--text); border-color: #c9c1ba; }
}

.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.work {
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer;
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}
.work-img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--sunk); }
.work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .work:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .work:hover .work-img img { transform: scale(1.03); }
}
.work-placeholder {
  width: 100%; height: 100%; display: grid; place-content: center; gap: 10px; text-align: center;
  color: #9b928c; font-size: .9rem;
  background: repeating-linear-gradient(135deg, #f0ece7 0 14px, #ebe6e0 14px 28px);
}
.work-placeholder svg { width: 32px; height: 32px; margin-inline: auto; fill: none; stroke: currentColor; stroke-width: 1.5; }
.work-body { padding: 18px 20px 22px; }
.work-tag {
  display: inline-block; font-size: .78rem; font-weight: 600;
  color: var(--primary); background: var(--primary-tint); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.work h3 { font-size: 1.08rem; margin-bottom: 2px; }
.work-place { color: var(--muted); font-size: .9rem; }
.works-empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 40px 0; }

/* Visor de fotos */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(16, 12, 11, .9);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s 200ms;
}
.lightbox.open { opacity: 1; visibility: visible; transition: opacity 260ms var(--ease-out); }
.lightbox figure { max-width: 1000px; width: 100%; color: #fff; }
.lightbox img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: var(--radius); }
.lightbox figcaption { margin-top: 14px; }
.lightbox figcaption strong { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; display: block; }
.lightbox figcaption span { color: #d3cbc5; font-size: .95rem; }
.lightbox-close {
  position: absolute; top: 14px; right: 18px; width: 48px; height: 48px; background: none; border: 0;
  color: #fff; font-size: 2.2rem; cursor: pointer; line-height: 1;
}

/* ----- Cómo trabajamos ----- */
.about { background: var(--surface); border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: start; }
.about-text p { color: var(--muted); max-width: 46ch; }
.about-text p + p { margin-top: 16px; }
.about-photo { margin-top: 32px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); }
.steps { list-style: none; counter-reset: paso; display: grid; gap: 0; border-top: 1px solid var(--line); }
.steps li {
  counter-increment: paso; display: grid; grid-template-columns: 56px 1fr; column-gap: 16px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(paso); grid-row: span 2;
  font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--primary);
}
.steps h3 { font-size: 1.15rem; margin-bottom: 4px; }
.steps p { color: var(--muted); }

/* ----- Llamada a la acción ----- */
.cta-box {
  background: var(--primary); color: #fff; border-radius: 24px; padding: 72px 32px; text-align: center;
}
.cta-box h2 { margin-bottom: 12px; }
.cta-box p { color: #f3dcd8; margin: 0 auto 32px; max-width: 46ch; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ----- Página de contacto ----- */
.page-hero { padding: 80px 0 40px; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.03em; margin-bottom: 14px; }
.page-hero p { color: var(--muted); max-width: 52ch; font-size: 1.12rem; }
@media (prefers-reduced-motion: no-preference) {
  .page-hero .container > * { animation: enter 700ms var(--ease-out) both; }
  .page-hero .container > :nth-child(2) { animation-delay: 70ms; }
}

.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: start; }
.info-list { list-style: none; border-top: 1px solid var(--line); }
.info-list li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.info-list .service-ico { width: 40px; height: 40px; padding: 9px; }
.info-list h3 { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.info-list p, .info-list a { font-size: 1.08rem; }
.info-list a { color: var(--text); transition: color 180ms ease; }
.info-list a:hover { color: var(--primary); }

.form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px; display: grid; gap: 18px;
}
.form h2 { font-size: 1.7rem; margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field textarea {
  font: inherit; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 34, 25, .14);
}
.field textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: .88rem; color: var(--muted); }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn:disabled { opacity: .7; cursor: progress; transform: none; }
.form-status {
  font-size: .95rem; color: #8a1c12; background: #fbeeec; border: 1px solid #f1cfc9;
  padding: 12px 14px; border-radius: var(--radius);
}
.form-status a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.form-done { text-align: center; justify-items: center; padding: 56px 36px; }
.form-done:focus { outline: none; }
.form-done p { color: var(--muted); max-width: 40ch; }
.form-done a { color: var(--primary); font-weight: 600; }
.done-ico {
  width: 56px; height: 56px; color: var(--primary);
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-reduced-motion: no-preference) {
  .form-done:not([hidden]) { animation: enter 500ms var(--ease-out) both; }
}

.map-wrap {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); aspect-ratio: 16 / 7; min-height: 320px;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-consent {
  height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center;
  padding: 32px 20px; background: var(--sunk);
}
.map-consent .map-note { color: var(--muted); font-size: .92rem; max-width: 46ch; }
.map-consent a:not(.btn) { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.map-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.check a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.footer-copy a { color: #b9b0aa; }

/* ----- Páginas legales ----- */
.legal { padding-top: 24px; }
.legal .container { max-width: 760px; }
.legal h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; margin-top: 8px; display: grid; gap: 6px; }
.legal a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .95rem; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table th { width: 34%; color: var(--text); font-weight: 600; }
.legal-table td { color: var(--muted); }

/* ----- Pie ----- */
.footer { background: #1f1b1a; color: #b9b0aa; padding: 56px 0 40px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-logo { height: 52px; width: auto; background: #fff; border-radius: 10px; padding: 6px 10px; }
.footer a { color: #fff; transition: color 180ms ease; }
.footer a:hover { color: #f0b3a8; }
.footer-copy { grid-column: 1 / -1; border-top: 1px solid #39322f; padding-top: 24px; margin-top: 8px; color: #8c837e; font-size: .88rem; }

/* ----- Barra de llamada (solo móvil) ----- */
.call-bar { display: none; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .works-grid { grid-template-columns: 1fr 1fr; }
  .services-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .services-intro { position: static; }
}
@media (max-width: 860px) {
  .hero .container, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding: 48px 0 72px; }
  .hero-badge { left: 14px; bottom: 14px; }
  .logo img { height: 46px; }
  .header .container { height: 68px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - 68px); height: calc(100dvh - 68px);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 12px 20px 32px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s 240ms;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms ease, transform 240ms var(--ease-out); }
  .nav a { padding: 16px 4px; font-size: 1.25rem; border-bottom: 1px solid var(--line); color: var(--text); }
  .nav-tel { margin-top: 16px; justify-content: center; border-bottom: 0 !important; }
  section { padding: 72px 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .call-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .call-bar .btn { padding: 0 12px; }
  body { padding-bottom: 72px; }
}
@media (max-width: 560px) {
  .works-grid, .form-row { grid-template-columns: 1fr; }
  .form { padding: 24px; }
  .map-wrap { aspect-ratio: auto; height: 340px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .cta-box { padding: 56px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}
