:root {
  --color-bg: #f3efe9;
  --color-surface: #ffffff;
  --color-surface-soft: #f8f4f1;
  --color-primary: #141414;
  --color-primary-soft: #292929;
  --color-text: #1d1d1d;
  --color-muted: #5f5f5f;
  --color-line: #e7ded3;
  --color-accent: #d97706;
  --color-accent-soft: #f2d2a0;
  --shadow-soft: 0 20px 45px rgba(20, 20, 20, 0.08);
  --radius: 18px;
  --radius-large: 28px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: clip;
}

/* Scrollbar delgada en los colores del sitio (progresivo, no afecta función). */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent-soft) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent-soft);
  border-radius: 8px;
  border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

body {
  margin: 0;
  font-family: 'Manrope', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
  padding: 0;
}

.section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.muted-section {
  background: rgba(255, 255, 255, 0.4);
}

.eyebrow {
  margin: 0 0 0.8rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

p {
  color: var(--color-muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 239, 233, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: clamp(64px, 10vh, 80px);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: 1.1rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 0.88rem;
}

.brand-copy small {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

.brand-text {
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  margin: 0.25rem 0 0;
  line-height: 1.2;
  font-weight: 800;
}

.brand-logo {
  height: clamp(36px, 6vw, 40px);
  width: auto;
  max-width: 100%;
  border-radius: 8px;
}

.footer-logo {
  height: 34px;
}

.auth-logo {
  height: 64px;
  width: auto;
  max-width: 100%;
  border-radius: 10px;
}

.owner-logo {
  height: 44px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
}

.main-nav {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 1rem;
  right: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.main-nav.is-open {
  display: flex;
}

.nav-link {
  padding: 0.75rem 1rem;
  min-height: 44px;
  border-radius: 10px;
  color: var(--color-primary-soft);
  font-weight: 600;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--color-surface-soft);
}

.nav-cta {
  background: var(--color-accent);
  color: #fff;
}

/* Contact CTA pulse animation */
@keyframes contactPulse {
  0%, 100% {
    transform: scale(1.02);
  }
  50% {
    transform: scale(1.05);
  }
}

.nav-cta {
  animation: contactPulse 1s ease-in-out infinite;
}

/* Portfolio: borde naranja parpadeante para atraer el clic.
   Solo se anima el color/sombra (nunca el grosor) para no mover el layout. */
.nav-link[href*="portafolio"] {
  border: 2px solid var(--color-accent);
  border-radius: 10px;
  padding: calc(0.75rem - 2px) calc(1rem - 2px);
  animation: portfolioBlink 1.5s ease-in-out infinite;
}

@keyframes portfolioBlink {
  0%,
  100% {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.55);
  }
  50% {
    border-color: rgba(217, 119, 6, 0.15);
    box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
  }
}

/* Hamburger menu - Professional animated transformation */
.menu-toggle {
  position: relative;
  overflow: visible;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  border: 0;
  padding: 0.75rem;
  min-width: 48px;
  min-height: 48px;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.menu-toggle:hover {
  background: rgba(217, 119, 6, 0.08);
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Three bars */
.menu-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              background-color 0.3s ease,
              opacity 0.3s ease,
              width 0.3s ease;
  transform-origin: center center;
  position: relative;
}

/* Subtle glow effect on bars */
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 100%;
  border-radius: 2px;
  background: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-toggle span::before {
  top: -6px;
  box-shadow: 0 0 8px var(--color-accent);
}

.menu-toggle span::after {
  bottom: -6px;
  box-shadow: 0 0 8px var(--color-accent);
}

/* Animated paint stroke background */
.menu-toggle::before,
.menu-toggle::after {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 16px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Main paint stroke - organic blob shape */
.menu-toggle::before {
  inset: -8px;
  background: var(--color-accent);
  opacity: 0.18;
  transform: scale(0.85) rotate(-3deg);
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  animation: paintStrokeBreathe 4s ease-in-out infinite;
}

/* Secondary accent stroke */
.menu-toggle::after {
  inset: -12px;
  background: var(--color-accent-soft);
  opacity: 0.12;
  transform: scale(0.7) rotate(12deg);
  border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
  animation: paintStrokeBreathe 4s ease-in-out infinite reverse;
}

@keyframes paintStrokeBreathe {
  0%, 100% {
    transform: scale(0.85) rotate(-3deg);
    border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
    opacity: 0.18;
  }
  25% {
    transform: scale(0.92) rotate(1deg);
    border-radius: 55% 45% 50% 50% / 50% 50% 45% 55%;
    opacity: 0.22;
  }
  50% {
    transform: scale(0.98) rotate(-1deg);
    border-radius: 50% 50% 45% 55% / 55% 45% 50% 50%;
    opacity: 0.18;
  }
  75% {
    transform: scale(0.92) rotate(2deg);
    border-radius: 45% 55% 50% 50% / 50% 50% 55% 45%;
    opacity: 0.22;
  }
}

/* Hover/Focus - paint stroke expands and becomes visible */
.menu-toggle:hover::before,
.menu-toggle:focus-visible::before {
  opacity: 0.35;
  transform: scale(1.05) rotate(0deg);
  animation-duration: 2s;
}

.menu-toggle:hover::after,
.menu-toggle:focus-visible::after {
  opacity: 0.25;
  transform: scale(1.15) rotate(0deg);
  animation-duration: 2s;
}

/* Open state - paint stroke becomes solid accent */
.menu-toggle[aria-expanded="true"]::before {
  opacity: 0.5;
  transform: scale(1.15) rotate(0deg);
  animation-duration: 1.5s;
  background: var(--color-accent);
}

.menu-toggle[aria-expanded="true"]::after {
  opacity: 0.3;
  transform: scale(1.25) rotate(0deg);
  animation-duration: 1.5s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-cta {
    animation: none;
  }

  .nav-link[href*="portafolio"] {
    animation: none;
    border-color: var(--color-accent);
    box-shadow: none;
  }

  .menu-toggle::before,
  .menu-toggle::after {
    animation: none;
    opacity: 0.15;
  }

  .menu-toggle:hover::before,
  .menu-toggle:focus-visible::before,
  .menu-toggle:hover::after,
  .menu-toggle:focus-visible::after {
    animation: none;
  }

  .menu-toggle[aria-expanded="true"]::before,
  .menu-toggle[aria-expanded="true"]::after {
    animation: none;
  }

  .menu-toggle span {
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, width 0.2s ease;
  }
}

.hero {
  padding-top: clamp(3rem, 6vw, 4rem);
}

.hero-grid,
.split-layout,
.contact-grid,
.footer-grid {
  display: grid;
  gap: 2rem;
}

.hero-copy,
.hero-visual,
.text-stack,
.contact-card {
  position: relative;
}

.lead {
  max-width: 60ch;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
  .cta-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 44px;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 14px 24px rgba(217, 119, 6, 0.2);
}

.btn-secondary {
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.4);
  color: var(--color-primary);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 767px) {
  .hero-points {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
}

.hero-points li {
  color: var(--color-primary-soft);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-line);
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
}

.hero-visual {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 380px;
}

.visual-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  background: linear-gradient(145deg, #1f1f1f, #3a2a1d);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  color: #fff;
  min-height: clamp(140px, 25vw, 180px);
  overflow: hidden;
}

.large-card {
  grid-column: 1 / -1;
  min-height: clamp(200px, 35vw, 250px);
  background: linear-gradient(160deg, rgba(20,20,20,0.9), rgba(121,73,22,0.68));
}

.visual-card .label,
.visual-card span {
  font-size: clamp(0.65rem, 1.2vw, 0.72rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.visual-card strong {
  font-size: clamp(1.1rem, 2vw, 2rem);
  margin-top: 0.5rem;
}

.small-card {
  min-height: clamp(120px, 22vw, 150px);
  background: linear-gradient(135deg, #f9efe3, #f3d7b0);
  color: var(--color-primary);
}

.accent-card {
  min-height: clamp(120px, 22vw, 150px);
  background: linear-gradient(135deg, #d97605, #f6b75d);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-heading.center {
  justify-content: center;
  text-align: center;
}

.section-heading.wrap {
  flex-wrap: wrap;
}

.text-link {
  font-weight: 800;
  color: var(--color-primary);
}

.card-grid {
  display: grid;
  gap: 1.3rem;
}

.three-col {
  grid-template-columns: 1fr;
}

.info-card,
.project-card,
.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.info-card {
  padding: 1.4rem;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-accent);
  font-weight: 800;
  margin-bottom: 1rem;
}

.split-layout {
  align-items: center;
}

.text-stack {
  display: grid;
  gap: 1rem;
}

.project-card {
  overflow: hidden;
}

.project-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-image,
.gallery-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f7f4f1;
  border-radius: 16px 16px 0 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.gallery-item figcaption {
  padding: 0.9rem 1rem 1.1rem;
  color: var(--color-primary);
  font-weight: 700;
}

.placeholder-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(20,20,20,0.08), rgba(217,119,6,0.12));
}

.portfolio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 767px) {
  .portfolio-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
}

.portfolio-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1.1rem;
  border: 1px solid rgba(20,20,20,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  color: var(--color-primary);
  font-weight: 700;
}

.portfolio-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.project-category {
  display: inline-block;
  margin-bottom: 0.7rem;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meta-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-muted);
}

.project-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(20,20,20,0.8), rgba(217,119,6,0.7));
}

.project-card-one .project-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(19,19,19,0.82), rgba(110,77,25,0.7));
}

.project-card-two .project-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(64,64,64,0.8), rgba(209,140,48,0.7));
}

.project-card-three .project-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(36,36,36,0.8), rgba(159,95,27,0.7));
}

.project-info {
  padding: 1.2rem 1.25rem 1.4rem;
}

.project-info p {
  margin-bottom: 0;
}

.page-hero {
  padding-top: clamp(4rem, 8vw, 5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
}

.narrow {
  max-width: 860px;
}

.contact-grid {
  align-items: start;
}

.contact-card {
  padding: 1.5rem;
}

.map-card {
  margin-top: 1.5rem;
}

.map-frame-wrap {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--color-line);
  margin-top: 1rem;
}

.map-actions {
  margin-top: 1rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.field-row {
  margin-bottom: 1rem;
}

.field-row label {
  display: block;
}

.field-row span {
  display: block;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.field-row input,
.field-row textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface-soft);
  padding: 0.9rem 1rem;
  color: var(--color-text);
}

.field-row input:focus,
.field-row textarea:focus {
  outline: 2px solid rgba(217, 119, 6, 0.18);
  border-color: rgba(217, 119, 6, 0.5);
}

.field-error,
.form-errors {
  color: #8b1e1e;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-errors {
  background: rgba(139, 30, 30, 0.07);
  border: 1px solid rgba(139, 30, 30, 0.15);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.form-success {
  border: 1px solid rgba(17, 128, 84, 0.2);
  background: rgba(17, 128, 84, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
}

.success-label {
  color: #0d7d4a;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.site-footer {
  padding: 2rem 0 0;
  background: #141414;
  color: rgba(255, 255, 255, 0.9);
}

.footer-grid {
  grid-template-columns: 1fr;
  padding-bottom: 1.75rem;
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

.site-footer p,
.site-footer span,
.site-footer li,
.site-footer a {
  color: rgba(255, 255, 255, 0.78);
}

.site-footer a:hover {
  color: var(--color-accent);
}

.site-footer h3 {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.footer-brand {
  margin-bottom: 0.55rem;
}

.footer-tagline {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  max-width: 30ch;
}

.footer-cta {
  min-height: 40px;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }

  .three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr 1.3fr;
    align-items: stretch;
  }

  .split-layout,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-wrap {
    position: relative;
  }

  .menu-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .nav-link {
    padding: 0.75rem 1rem;
  }

  .btn-submit {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
  }

  .footer-brand-col {
    grid-column: auto;
  }

  .three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-grid {
    align-items: stretch;
    grid-template-columns: 1fr 1.4fr;
  }

  .project-card-large {
    grid-column: span 2;
  }

  .analytics-panels {
    grid-template-columns: 1.2fr 1fr;
  }
}

.page-header {
  margin-bottom: 2rem;
}

.owner-dashboard-shell {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(243,239,233,0.3));
}

.owner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card,
.panel-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

.metric-card {
  display: grid;
  gap: 0.5rem;
}

.metric-card.accent {
  background: linear-gradient(135deg, #141414, #47311a);
  color: #fff;
}

.metric-card.accent .metric-label,
.metric-card.accent strong {
  color: #fff;
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  color: var(--color-primary);
}

.analytics-panels {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.modern-panels {
  align-items: start;
}

@media (max-width: 767px) {
  .modern-panels {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .large-card {
    grid-column: auto;
  }

  .owner-inline-form {
    grid-template-columns: 1fr;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.3rem;
  margin: 0;
}

.panel-header span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.device-ring-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 767px) {
  .device-ring-wrap {
    grid-template-columns: 1fr;
    max-width: 200px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-group .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-points {
    flex-direction: column;
  }

  .hero-points li {
    text-align: center;
  }

  .section-heading.wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-links-grid {
    grid-template-columns: 1fr;
  }
}

.ring-chart {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--percent) * 1%), rgba(20,20,20,0.08) 0);
  display: grid;
  place-items: center;
}

.ring-inner {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(20,20,20,0.06);
}

.ring-inner strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.ring-inner span {
  font-size: 0.7rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-list {
  display: grid;
  gap: 0.8rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(20,20,20,0.03);
  border-radius: 12px;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.new {
  background: #d97706;
}

.status-dot.contacted {
  background: #7c5c34;
}

.status-dot.closed {
  background: #1f1f1f;
}

.bar-list {
  display: grid;
  gap: 1rem;
}

.bar-row {
  display: grid;
  gap: 0.45rem;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.08);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-accent), #f1b760);
}

.mini-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mini-table table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  text-align: left;
  font-size: 0.92rem;
}

.mini-table th {
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-links-panel {
  margin-top: 1rem;
}

.admin-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.admin-link-card {
  display: grid;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(20,20,20,0.06), rgba(217,119,6,0.1));
  border: 1px solid rgba(20,20,20,0.06);
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(20,20,20,0.08);
}

.admin-link-card span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.admin-link-card strong {
  font-size: 1.1rem;
  color: var(--color-primary);
}

.owner-auth-section {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 500px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.auth-lead {
  margin-bottom: 1.5rem;
}

.owner-form {
  display: grid;
  gap: 0.75rem;
}

.owner-inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 1rem;
}

.owner-form-block {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.owner-form-block:last-child {
  border-bottom: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form button {
  margin: 0;
}

.danger-button {
  border-color: rgba(139, 30, 30, 0.32);
  color: #7d1d1d;
}

.owner-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.small-container {
  max-width: 800px;
}

.full-width {
  width: 100%;
}

.btn-submit {
  width: 100%;
}

@media (min-width: 768px) {
  .btn-submit {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-grid {
    align-items: center;
  }

  .project-card-large {
    grid-column: span 2;
  }

  .analytics-panels {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Hero image wrapper */
.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(145deg, #1f1f1f, #3a2a1d);
}

.hero-image-wrapper img.hero-image {
  width: 100%;
  height: 100%;
  min-height: clamp(280px, 50vh, 420px);
  object-fit: cover;
  display: block;
}

.hero-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(20,20,20,0.95), transparent);
  color: #fff;
}

.hero-image-caption .label {
  display: block;
  font-size: clamp(0.65rem, 1.2vw, 0.72rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

.hero-image-caption strong {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 700;
}

/* Logo hero variant - full width screen */
.hero-image-wrapper.logo-hero-full {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-wrapper.logo-hero-full img.hero-image {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 24px 48px rgba(20, 20, 20, 0.18));
  transition: transform 0.5s ease, filter 0.5s ease;
}

.hero-image-wrapper.logo-hero-full:hover img.hero-image {
  transform: scale(1.02);
  filter: drop-shadow(0 32px 64px rgba(217, 119, 6, 0.3));
}

/* Logo hero variant - large card size (kept for other uses) */
.hero-image-wrapper.logo-hero-large {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.03), rgba(217, 119, 6, 0.05));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-large);
  overflow: hidden;
  border: 1px solid var(--color-line);
  aspect-ratio: 16 / 10;
  min-height: clamp(240px, 40vw, 380px);
  max-height: clamp(320px, 50vw, 480px);
}

.hero-image-wrapper.logo-hero-large img.hero-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(20, 20, 20, 0.15));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.hero-image-wrapper.logo-hero-large:hover img.hero-image {
  transform: scale(1.02);
  filter: drop-shadow(0 24px 48px rgba(217, 119, 6, 0.25));
}

/* Project image collage for Muebles y Closets */
.project-image-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: #f7f4f1;
}

.project-image-collage .collage-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .project-image-collage {
    grid-template-columns: 1fr;
    aspect-ratio: 8 / 3;
  }
}

/* Hero Collage - Clean 2x2 grid. El padding encoge las tarjetas para que
   la cuerda respire en los espacios; hero-visual recorta la deriva. */
.hero-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 380px;
  padding: 18px;
  perspective: 1200px;
  position: relative;
}

.collage-card {
  position: relative;
  z-index: 2;
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-surface);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.collage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(20, 20, 20, 0.12);
}

/* Brillo premium que sigue el cursor (posición vía --glare-x/--glare-y desde JS). */
.collage-card[data-index]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.28),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.collage-card[data-index]:hover::after {
  opacity: 1;
}

/* Cuerda naranja que enlaza las tarjetas (en los espacios laterales, detrás de las tarjetas). */
.collage-rope {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.rope-line {
  stroke: var(--color-accent);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
  opacity: 0.9;
  stroke-dasharray: 12 9;
  animation: ropeFlow 1.1s linear infinite;
}

.rope-glow {
  stroke: var(--color-accent);
  stroke-width: 8;
  stroke-linecap: round;
  fill: none;
  opacity: 0.22;
}

.rope-knot {
  fill: var(--color-accent);
  stroke: #fff;
  stroke-width: 1.5;
}

@keyframes ropeFlow {
  to {
    stroke-dashoffset: -21;
  }
}

/* Sin hover (táctil): sin brillo seguidor. */
@media (hover: none) {
  .collage-card[data-index]::after {
    display: none;
  }
}

.collage-card[data-fixed] {
  z-index: 1;
}

.collage-card--feature {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.03), rgba(217, 119, 6, 0.05));
  border: 1px solid var(--color-line);
}

.collage-card--project {
  display: flex;
  align-items: stretch;
}

.collage-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.collage-image-wrapper img.collage-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s ease;
}

.collage-card:hover .collage-image-wrapper img.collage-image {
  filter: brightness(1.04);
}

/* Ken Burns cinematográfico: zoom/paneo lento y continuo, solo opacity/transform (GPU). */
.collage-card[data-index] .collage-image {
  will-change: transform;
  animation-duration: 24s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.collage-card[data-index="0"] .collage-image {
  animation-name: kbZoomIn;
  transform-origin: 40% 60%;
}

.collage-card[data-index="1"] .collage-image {
  animation-name: kbZoomOut;
  transform-origin: 60% 40%;
}

.collage-card[data-index="2"] .collage-image {
  animation-name: kbPanLeft;
  transform-origin: 50% 50%;
}

.collage-card[data-index="3"] .collage-image {
  animation-name: kbPanRight;
  transform-origin: 50% 50%;
}

@keyframes kbZoomIn {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.14) translate(-2%, 1.5%);
  }
}

@keyframes kbZoomOut {
  from {
    transform: scale(1.16) translate(2%, -1.5%);
  }
  to {
    transform: scale(1.02) translate(0, 0);
  }
}

@keyframes kbPanLeft {
  from {
    transform: scale(1.1) translate(3%, 0);
  }
  to {
    transform: scale(1.1) translate(-3%, 0);
  }
}

@keyframes kbPanRight {
  from {
    transform: scale(1.1) translate(-3%, 1%);
  }
  to {
    transform: scale(1.1) translate(3%, -1%);
  }
}

/* Pausa manual (botón) o automática: congela el Ken Burns. */
.hero-collage.is-paused .collage-image {
  animation-play-state: paused;
}

.collage-card--feature .collage-image-wrapper img.collage-image {
  object-fit: contain;
  padding: 1.5rem;
  max-width: 100%;
  max-height: 100%;
}

.collage-card[data-index] {
  opacity: 1;
}

/* Entrada escalonada al cargar la página. */
.hero-collage .collage-card[data-index] {
  animation: collageLoad 0.9s ease backwards;
}

.hero-collage .collage-card[data-index]:nth-child(2) {
  animation-delay: 0.12s;
}

.hero-collage .collage-card[data-index]:nth-child(3) {
  animation-delay: 0.24s;
}

.hero-collage .collage-card[data-index]:nth-child(4) {
  animation-delay: 0.36s;
}

@keyframes collageLoad {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.collage-card[data-index].collage-card--exiting {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.collage-card[data-index].collage-card--entering {
  animation: collageEnter 0.7s ease-out;
}

@keyframes collageEnter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Botón pausar/reanudar (WCAG 2.2.2: todo movimiento automático debe poder pausarse). */
.hero-visual {
  position: relative;
  overflow: hidden;
}

.collage-pause {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.collage-pause:hover {
  background: rgba(20, 20, 20, 0.8);
  transform: scale(1.05);
}

.collage-pause:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.collage-pause svg {
  width: 15px;
  height: 15px;
  display: block;
}

.collage-pause .icon-play {
  display: none;
}

.collage-pause[aria-pressed="true"] .icon-play {
  display: block;
}

.collage-pause[aria-pressed="true"] .icon-pause {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-collage .collage-card[data-index] {
    animation: none;
  }

  .collage-card[data-index] .collage-image {
    animation: none;
    transform: none;
  }

  .collage-card[data-index].collage-card--entering {
    animation: none;
  }

  .collage-card[data-index]::after {
    display: none;
  }

  .collage-rope {
    display: none;
  }

  .collage-pause {
    display: none;
  }
}

@media (max-width: 1023px) {
  .hero-collage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    min-height: 360px;
  }

  .collage-card--feature {
    grid-column: 1 / span 2;
    grid-row: 1;
    min-height: 180px;
  }

  .collage-card--project:nth-of-type(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .collage-card--project:nth-of-type(2) {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 767px) {
  .hero-collage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
    gap: 8px;
    padding: 10px;
  }

  .collage-card--feature {
    grid-column: 1 / span 2;
    grid-row: 1;
    aspect-ratio: 16 / 9;
    min-height: 140px;
  }

  .collage-card--project {
    aspect-ratio: 4 / 3;
  }
}

/* SVG Icons */
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-accent);
  font-weight: 800;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.card-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.icon-carpentry svg { stroke: var(--color-accent); }
.icon-furniture svg { stroke: var(--color-accent); }
.icon-finish svg { stroke: var(--color-accent); }
.icon-kitchen svg { stroke: var(--color-accent); }
.icon-closet svg { stroke: var(--color-accent); }
.icon-door svg { stroke: var(--color-accent); }
.icon-remodel svg { stroke: var(--color-accent); }
.icon-finish-deco svg { stroke: var(--color-accent); }
.icon-custom svg { stroke: var(--color-accent); }

.icon-attention svg { stroke: var(--color-accent); }
.icon-quality svg { stroke: var(--color-accent); }
.icon-responsibility svg { stroke: var(--color-accent); }

/* About value cards */
.value-card .card-icon {
  background: rgba(217, 119, 6, 0.12);
}

@media (max-width: 767px) {
  .hero-visual {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .large-card {
    grid-column: auto;
  }

  .hero-image-wrapper img.hero-image {
    min-height: clamp(200px, 40vh, 300px);
  }

  .hero-image-wrapper.logo-hero-large {
    aspect-ratio: 4 / 3;
    min-height: clamp(200px, 35vw, 280px);
    max-height: clamp(260px, 45vw, 340px);
  }

  .hero-image-wrapper.logo-hero-large img.hero-image {
    max-height: 100%;
    min-height: 100%;
  }

  .hero-image-wrapper.logo-hero-full {
    border-radius: 12px;
    height: auto;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-image-wrapper.logo-hero-full img.hero-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    border-radius: 12px;
  }
}

/* ------------------------------------------------------------------
   Page loader global
   Indicador de carga para navegación y envío de formularios.
   Se activa desde static/js/main.js añadiendo .is-active.
   ------------------------------------------------------------------ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(circle at 50% 42%,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(243, 239, 233, 0.98) 62%,
      var(--color-bg) 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loader__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
}

.page-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--color-line);
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent-soft);
  animation: loaderSpin 0.9s linear infinite;
}

.page-loader__ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px dashed rgba(217, 119, 6, 0.28);
  animation: loaderSpin 3.2s linear infinite reverse;
}

.page-loader__logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  animation: loaderPulse 1.8s ease-in-out infinite;
}

.page-loader__text {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.page-loader__dots i {
  font-style: normal;
  animation: loaderDot 1.2s ease-in-out infinite;
}

.page-loader__dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.page-loader__dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderPulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes loaderDot {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader__ring,
  .page-loader__ring::after,
  .page-loader__logo,
  .page-loader__dots i {
    animation: none;
  }

  .page-loader__ring::after {
    display: none;
  }
}
