/* ============================================================
   OW Fontanería, demo site
   Design tokens grounded in the brief: blue/white base (client's
   own palette call), copper drawn from the real brass fittings
   and copper pipe in their work photos. 60/30/10: bg (60) / petrol
   blue (30) / copper (10), WhatsApp green reserved only for chat
   actions so it keeps its own recognition value.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F2F4F5;
  --bg-alt: #E6ECEE;
  --surface: #FFFFFF;
  --text: #12242B;
  --text-muted: #4C6068;
  --primary: #0F4C5C;
  --primary-dark: #092E38;
  --primary-light: #5B8A9A;
  --accent: #B7622B;
  --accent-light: #D68B52;
  --whatsapp: #25D366;
  --whatsapp-dark: #1DA851;
  --border: rgba(15, 76, 92, 0.14);
  --shadow: 0 24px 48px -28px rgba(9, 46, 56, 0.45);
  --shadow-sm: 0 10px 24px -16px rgba(9, 46, 56, 0.35);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0B1A20;
  --bg-alt: #0F232B;
  --surface: #132A32;
  --text: #EAF1F2;
  --text-muted: #9FB6BC;
  --primary: #67A8BC;
  --primary-dark: #3D7E93;
  --primary-light: #8FC2D2;
  --accent: #E0996B;
  --accent-light: #EEB88E;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 10px 24px -14px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.35rem, 4.6vw + 1rem, 3.7rem); }
h2 { font-size: clamp(1.7rem, 2.6vw + 1rem, 2.35rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 58ch; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 900px) {
  .container { padding: 0 2.5rem; }
}

section { padding: 5rem 0; }
@media (max-width: 640px) {
  section { padding: 3.5rem 0; }
}
.section-alt { background: var(--bg-alt); }

.eyebrow-free-heading { max-width: 42ch; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-whatsapp {
  background: var(--whatsapp);
  color: #06210F;
  box-shadow: 0 14px 28px -12px rgba(37, 211, 102, 0.55);
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary); background: var(--surface); }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.02em; }

.main-nav { display: none; align-items: center; gap: 1.9rem; }
.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.96rem;
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--primary); }
@media (min-width: 880px) {
  .main-nav { display: flex; }
}

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.lang-switch { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 0.35rem;
  height: 42px; padding: 0 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 0.85rem; cursor: pointer; color: var(--text);
}
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  min-width: 160px; padding: 0.4rem; display: none; flex-direction: column;
}
.lang-menu.is-open { display: flex; }
.lang-menu a {
  display: flex; justify-content: space-between; text-decoration: none;
  padding: 0.55rem 0.7rem; border-radius: 8px; font-size: 0.92rem; color: var(--text);
}
.lang-menu a:hover { background: var(--bg-alt); }
.lang-menu a[aria-current="true"] { color: var(--primary); font-weight: 600; }

.nav-toggle { display: inline-flex; }
@media (min-width: 880px) { .nav-toggle { display: none; } }

[data-desktop-cta] { display: none !important; }
@media (min-width: 880px) { [data-desktop-cta] { display: inline-flex !important; } }

.mobile-nav {
  position: fixed; inset: 74px 0 0 0; background: var(--bg);
  z-index: 49; transform: translateX(100%); opacity: 1; pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column; padding: 1.5rem;
  box-shadow: -18px 0 40px -20px rgba(0,0,0,0.35);
}
.mobile-nav.is-open { transform: translateX(0); pointer-events: auto; }
.mobile-nav a {
  text-decoration: none; color: var(--text); font-family: var(--font-head);
  font-size: 1.5rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateX(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.mobile-nav.is-open a { opacity: 1; transform: translateX(0); }
.mobile-nav .btn { margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) {
  .mobile-nav, .mobile-nav a { transition: none; }
}

/* Hamburger <-> close morph, driven by aria-expanded */
.nav-toggle .bar { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease; transform-origin: 12px 12px; }
.nav-toggle[aria-expanded="true"] .bar-1 { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar-3 { transform: translateY(-5px) rotate(-45deg); }

/* ---------------- Hero ---------------- */
.hero { padding: 3rem 0 4.5rem; overflow: hidden; }
.hero .container {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 940px) {
  .hero .container { grid-template-columns: 1.15fr 0.85fr; gap: 2rem; }
}

.hero-copy .badge-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.4rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.84rem;
  font-weight: 600; color: var(--text-muted);
}
.pill .star { color: var(--accent); }

.hero h1 { max-width: 15ch; }
.hero .lede { margin-bottom: 1.8rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-visual { display: flex; justify-content: center; }
.phone-frame {
  position: relative;
  width: min(280px, 74vw);
  aspect-ratio: 9 / 18.5;
  background: var(--primary-dark);
  border-radius: 2.6rem;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.phone-frame::before {
  content: "";
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 7px; border-radius: 999px; background: rgba(255,255,255,0.18);
  z-index: 2;
}
.phone-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 2.1rem; overflow: hidden; background: var(--primary-dark);
}
.phone-screen video, .phone-screen img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
}
.phone-chip {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  background: rgba(8, 20, 24, 0.72); backdrop-filter: blur(6px);
  color: #fff; padding: 0.5rem 0.75rem; border-radius: 12px;
  font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem;
}
.phone-chip svg { width: 14px; height: 14px; color: var(--whatsapp); }

/* ---------------- Services ---------------- */
.service-grid {
  display: grid; gap: 1.25rem; margin-top: 2.6rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.7rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); border-color: var(--primary-light); }
.service-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
[data-theme="dark"] .service-icon { color: var(--primary-light); }
.service-icon svg { width: 24px; height: 24px; }
.service-card h3 { margin-bottom: 0.4rem; }
.service-card p { color: var(--text-muted); font-size: 0.97rem; margin: 0; }

/* ---------------- Featured transformation ---------------- */
.transform-section .container {
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 900px) {
  .transform-section .container { grid-template-columns: 0.95fr 1.05fr; }
}
.transform-figure {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.transform-figure img { width: 100%; }
.transform-text .lede { margin-bottom: 1.4rem; }

/* ---------------- Trust + craft video ---------------- */
.trust-section .container {
  display: grid; gap: 2.8rem; align-items: center;
}
@media (min-width: 900px) {
  .trust-section .container { grid-template-columns: 1fr 1fr; }
}
.trust-list { list-style: none; margin: 1.8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.trust-list li { display: flex; gap: 0.85rem; align-items: flex-start; }
.trust-check {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent); display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.trust-check svg { width: 15px; height: 15px; }
.craft-video {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  aspect-ratio: 4 / 3; background: var(--primary-dark);
}
.craft-video video, .craft-video img { width: 100%; height: 100%; object-fit: cover; }
.craft-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(6,16,19,0.75), transparent);
  color: #fff; padding: 1.4rem 1.1rem 0.9rem; font-size: 0.9rem; font-weight: 500;
}

/* ---------------- Gallery ---------------- */
.gallery-grid {
  display: grid; gap: 0.85rem; margin-top: 2.6rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 4 / 3; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(6,16,19,0.78), transparent);
  color: #fff; font-size: 0.8rem; font-weight: 500;
  padding: 1.6rem 0.7rem 0.55rem; opacity: 0; transition: opacity 0.25s ease;
}
.gallery-item:hover figcaption, .gallery-item:focus-within figcaption { opacity: 1; }
.gallery-item:focus-visible { outline-offset: 2px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(4, 12, 15, 0.92);
  z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(94vw, 1100px); max-height: 86vh; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  width: 46px; height: 46px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-caption { position: absolute; bottom: 1.4rem; left: 0; right: 0; text-align: center; color: #fff; font-size: 0.9rem; }

/* ---------------- Contact / location ---------------- */
.contact-section .container {
  display: grid; gap: 2.5rem;
}
@media (min-width: 900px) {
  .contact-section .container { grid-template-columns: 0.9fr 1.1fr; }
}
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm);
}
.contact-row { display: flex; gap: 0.9rem; margin-bottom: 1.3rem; align-items: flex-start; }
.contact-row:last-child { margin-bottom: 0; }
.contact-row .ic { flex: none; width: 22px; height: 22px; color: var(--primary); margin-top: 3px; }
[data-theme="dark"] .contact-row .ic { color: var(--primary-light); }
.contact-row a { text-decoration: none; color: var(--text); font-weight: 500; }
.contact-row a:hover { color: var(--primary); }
.contact-row span { color: var(--text-muted); }
.map-embed {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); min-height: 320px;
}
.map-embed iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* ---------------- Footer ---------------- */
.site-footer { padding: 3rem 0 2.2rem; border-top: 1px solid var(--border); }
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.6rem;
  margin-bottom: 1.8rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-head); font-weight: 700; text-decoration: none; }
.footer-brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--text-muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--primary); }
.footer-credit { font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 1.4rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
.footer-credit a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- WhatsApp FAB ---------------- */
.wa-fab {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60;
  width: 60px; height: 60px; border-radius: 999px; background: var(--whatsapp);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 16px 30px -10px rgba(6, 40, 20, 0.55);
  animation: wa-pulse 2.6s ease-in-out infinite;
}
.wa-fab svg { width: 30px; height: 30px; color: #06210F; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 16px 30px -10px rgba(6, 40, 20, 0.55), 0 0 0 0 rgba(37,211,102,0.55); }
  50% { box-shadow: 0 16px 30px -10px rgba(6, 40, 20, 0.55), 0 0 0 10px rgba(37,211,102,0); }
}
@media (prefers-reduced-motion: reduce) { .wa-fab { animation: none; } }

/* ---------------- Scroll reveal (single orchestrated pattern) ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
