/* =====================================================================
   Luis Flores — Estilos
   Tokens definidos en :root según BRAND.md. Mobile-first.
   ===================================================================== */

:root {
  /* --- Colores --- */
  --bg: #faf6ef;
  --surface: #fffdf8;
  --surface-2: #f0e9dc;
  --ink: #2a2520;
  --ink-2: #5a5249;
  --ink-3: #8b8378;
  --accent: #a85432;
  --accent-hover: #8a4226;
  --accent-soft: #f4d9c4;
  --gold: #c8965a;
  --rule: #e3dccc;
  --shadow: rgba(42, 37, 32, 0.08);
  --shadow-strong: rgba(42, 37, 32, 0.16);

  /* --- Tipografía --- */
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* --- Escala tipográfica --- */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.75rem;

  /* --- Espaciado --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* --- Layout --- */
  --max-width: 1120px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 400ms ease-out;
}

/* =====================================================================
   Reset + base
   ===================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 500;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

p {
  margin: 0 0 var(--space-4);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--ink);
  color: var(--surface);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--surface);
}

/* =====================================================================
   Utilities
   ===================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.section {
  padding: var(--space-8) 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-7);
}

.section-head .eyebrow {
  margin-bottom: var(--space-3);
}

.section-lead {
  font-size: var(--text-lg);
  color: var(--ink-2);
}

/* =====================================================================
   Botones
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
  cursor: pointer;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--surface);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--surface);
  border-color: var(--surface);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--ink);
}

.btn-lg {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-6);
  min-height: 52px;
}

/* Cuando los botones están en contexto claro (no hero) */
.section .btn-secondary {
  color: var(--ink);
  border-color: var(--ink);
}

.section .btn-secondary:hover {
  background: var(--ink);
  color: var(--surface);
}

/* =====================================================================
   Header / Nav
   ===================================================================== */

.site-header {
  position: sticky;
  top: 0;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  z-index: 50;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-2);
  padding: var(--space-2) 0;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links .nav-cta {
  background: var(--accent);
  color: var(--surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
}

.nav-links .nav-cta:hover {
  background: var(--accent-hover);
  color: var(--surface);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Mobile menu open state */
.nav-links.is-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: var(--space-6) var(--space-5);
  gap: var(--space-5);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 12px 24px var(--shadow);
}

.nav-links.is-open a {
  font-size: var(--text-lg);
  color: var(--ink);
}

/* =====================================================================
   Hero
   ===================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: var(--surface);
  overflow: hidden;
  padding-top: 64px; /* header height */
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(42, 37, 32, 0.92) 0%,
    rgba(42, 37, 32, 0.65) 50%,
    rgba(42, 37, 32, 0.5) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-9);
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 500;
  margin-bottom: var(--space-4);
  color: var(--surface);
}

.hero-tagline {
  font-size: var(--text-lg);
  color: var(--accent-soft);
  max-width: 540px;
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* =====================================================================
   Placeholder para imágenes que aún no llegan
   ===================================================================== */

.hero-placeholder,
.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a2f25 0%, #5a4a3a 50%, #2a2520 100%);
  color: rgba(255, 253, 248, 0.35);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: italic;
  letter-spacing: 0.04em;
}

.hero-placeholder {
  min-height: 100vh;
  /* Hide the placeholder label text visually — the gradient is enough
     context for sighted users, and the aria-hidden="true" wrapper means
     screen readers skip it. Real photos will replace this entirely. */
  font-size: 0;
  letter-spacing: 0;
}

.photo-placeholder {
  min-height: 320px;
  border-radius: var(--radius-md);
}

/* =====================================================================
   Sobre mí
   ===================================================================== */

.about {
  background: var(--surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}

.about-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow);
}

.about-text {
  max-width: 560px;
}

.about-text h2 {
  margin-bottom: var(--space-5);
}

.about-text p {
  color: var(--ink-2);
  font-size: var(--text-lg);
}

.about-bullets {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-3);
}

.about-bullets li {
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

.about-bullets strong {
  color: var(--ink);
  font-weight: 500;
}

/* =====================================================================
   Servicios
   ===================================================================== */

.services {
  background: var(--bg);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.service-card {
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-strong);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.service-card h3 {
  margin-bottom: var(--space-2);
}

.service-card p {
  color: var(--ink-2);
  margin: 0;
}

/* =====================================================================
   Trabajos / Carrusel
   ===================================================================== */

.work {
  background: var(--surface);
}

.carousel {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel-track {
  display: flex;
  transition: transform var(--transition-slow);
}

.carousel-slide {
  flex: 0 0 100%;
  background: var(--bg);
}

.carousel-photo {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.carousel-caption {
  padding: var(--space-5);
  text-align: center;
}

.carousel-caption h3 {
  margin-bottom: var(--space-2);
}

.carousel-caption p {
  color: var(--ink-3);
  margin: 0;
  font-size: var(--text-sm);
}

.carousel-arrow {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 253, 248, 0.95);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px var(--shadow);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.carousel-arrow:hover {
  background: var(--surface);
  color: var(--accent);
}

.carousel-prev {
  left: var(--space-3);
}

.carousel-next {
  right: var(--space-3);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 0;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.carousel-dot:hover {
  background: var(--ink-3);
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.2);
}

/* =====================================================================
   En números
   ===================================================================== */

.numbers {
  background: var(--surface-2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-4);
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.stat-rule {
  width: 40px;
  height: 2px;
  background: var(--ink-3);
  margin: var(--space-3) 0;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--ink-2);
  font-weight: 500;
}

/* =====================================================================
   Contacto
   ===================================================================== */

.contact {
  background: var(--ink);
  color: var(--surface);
}

.contact .eyebrow {
  color: var(--gold);
}

.contact h2 {
  color: var(--surface);
}

.contact-inner {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-lead {
  font-size: var(--text-lg);
  color: var(--accent-soft);
  margin-bottom: var(--space-6);
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-6);
}

.contact-meta {
  font-size: var(--text-sm);
  color: var(--ink-3);
  margin: 0;
}

/* =====================================================================
   Footer
   ===================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--ink-3);
  border-top: 1px solid rgba(255, 253, 248, 0.08);
  padding: var(--space-5) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: center;
  font-size: var(--text-sm);
}

.footer-inner p {
  margin: 0;
}

.footer-meta {
  color: var(--ink-3);
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (min-width: 640px) {
  :root {
    --text-3xl: 2.25rem;
    --text-4xl: 3.25rem;
    --text-5xl: 4.5rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    gap: var(--space-7) var(--space-5);
  }

  .contact-actions {
    flex-direction: row;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-9) 0;
  }

  .about-grid {
    grid-template-columns: 5fr 6fr;
    gap: var(--space-8);
  }

  .about-photo {
    aspect-ratio: 4 / 5;
  }
}

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

  .nav-links {
    display: flex;
  }

  .hero {
    min-height: calc(100vh - 64px);
    align-items: center;
  }

  .hero-content {
    padding-bottom: 0;
    max-width: 720px;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  :root {
    --text-5xl: 5rem;
  }
}

/* =====================================================================
   Reduced motion
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}