/* ── TOKENS ── */
:root {
  --bg:         oklch(0.09 0.018 42);
  --surface:    oklch(0.16 0.022 42);
  --surface-2:  oklch(0.21 0.024 42);
  --primary:    oklch(0.67 0.112 46);
  --accent:     oklch(0.78 0.084 78);
  --ink:        oklch(0.95 0.010 72);
  --muted:      oklch(0.58 0.018 52);
  --dim:        oklch(0.38 0.014 48);
  --border:     oklch(0.20 0.016 42);
  --gap:        clamp(1.25rem, 3vw, 2rem);
  --section-px: clamp(1.5rem, 5vw, 4.5rem);
  --section-py: clamp(4.5rem, 9vw, 8rem);
  --r:          2px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-px);
  transition: background 0.5s ease, border-color 0.5s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: oklch(0.08 0.018 42 / 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--border);
}

.nav-logo {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 400;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  flex-shrink: 0;
}

.nav-center {
  display: flex;
  gap: 2.25rem;
  list-style: none;
}
.nav-center a {
  font-size: 0.78125rem;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.22s;
}
.nav-center a:hover { color: var(--ink); }

.nav-contact {
  font-size: 0.78125rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid oklch(0.67 0.112 46 / 0.38);
  padding: 0.5rem 1.375rem;
  border-radius: var(--r);
  transition: color 0.22s, border-color 0.22s, background 0.22s;
  flex-shrink: 0;
}
.nav-contact:hover {
  background: oklch(0.67 0.112 46 / 0.10);
  border-color: var(--primary);
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  color: var(--ink);
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── HERO ── */
.hero {
  position: relative;
  height: 100dvh;
  min-height: 580px;
  overflow: hidden;
}

.hero-photo {
  position: absolute;
  inset: 0;
}
.hero-photo img { object-position: center 30%; }

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    oklch(0.09 0.018 42 / 0.50) 0%,
    oklch(0.09 0.018 42 / 0.10) 45%,
    oklch(0.09 0.018 42 / 0.70) 75%,
    oklch(0.09 0.018 42 / 0.97) 100%
  );
}

.hero-body {
  position: absolute;
  bottom: clamp(3rem, 8vh, 6rem);
  left: var(--section-px);
  right: var(--section-px);
}

.hero-kicker {
  font-size: 0.71875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.125rem;
}

.hero-headline {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(3.5rem, 9.5vw, 7.75rem);
  line-height: 0.93;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: clamp(1.125rem, 3vw, 2rem);
  text-wrap: balance;
}

.hero-headline i {
  font-style: italic;
  color: var(--accent);
}

.hero-copy {
  max-width: 40ch;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.hero-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r);
  padding: 0.875rem 1.875rem;
  transition: background 0.22s, color 0.22s, border-color 0.22s;
  border: 1px solid transparent;
}
.btn-fill {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}
.btn-fill:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-outline {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-outline:hover {
  color: var(--ink);
  border-color: oklch(0.35 0.018 42);
}

/* ── HERO SCROLL LINE ── */
.hero-line {
  position: absolute;
  bottom: clamp(2rem, 5vh, 3.5rem);
  right: var(--section-px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-line-label {
  font-size: 0.65625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero-line-bar {
  width: 48px;
  height: 1px;
  background: var(--border);
  overflow: hidden;
}
.hero-line-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--primary);
  animation: scan 2.4s ease-in-out 1.6s infinite;
  transform: translateX(-100%);
}
@keyframes scan {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ── HERO ANIMATIONS ── */
/* Only fires when JS adds .ready — content is visible without it */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.ready .hero-kicker   { animation: fadeUp 0.8s ease both 0.30s; }
body.ready .hero-headline { animation: fadeUp 0.9s ease both 0.50s; }
body.ready .hero-copy     { animation: fadeUp 0.8s ease both 0.74s; }
body.ready .hero-ctas     { animation: fadeUp 0.7s ease both 0.98s; }
body.ready .hero-line     { animation: fadeUp 0.7s ease both 1.18s; }

@media (prefers-reduced-motion: reduce) {
  body.ready .hero-kicker, body.ready .hero-headline,
  body.ready .hero-copy,   body.ready .hero-ctas,
  body.ready .hero-line    { animation: none; }
  .hero-line-bar::after    { animation: none; }
}

/* ── GALLERY ── */
#galeria {
  padding: var(--section-py) var(--section-px) clamp(2rem, 4vw, 3rem);
}

.gallery-lead {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.gallery-lead h2 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.gallery-lead h2 em {
  font-style: italic;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 310px 310px 265px;
  gap: 3px;
}

.g-item {
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.g-item.in { opacity: 1; transform: none; }
.g-item img { transition: transform 0.75s ease; }
.g-item:hover img { transform: scale(1.045); }

.g-item:nth-child(1) { grid-column: 1 / 3; grid-row: 1; transition-delay: 0.00s; }
.g-item:nth-child(2) { grid-column: 3;     grid-row: 1 / 3; transition-delay: 0.08s; }
.g-item:nth-child(3) { grid-column: 1;     grid-row: 2; transition-delay: 0.15s; }
.g-item:nth-child(4) { grid-column: 2;     grid-row: 2; transition-delay: 0.22s; }
.g-item:nth-child(5) { grid-column: 1 / 3; grid-row: 3; transition-delay: 0.29s; }
.g-item:nth-child(6) { grid-column: 3;     grid-row: 3; transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  .g-item { opacity: 1 !important; transform: none !important; transition: none !important; }
  .g-item img { transition: none; }
}

/* ── ABOUT ── */
#nosotros {
  padding: var(--section-py) var(--section-px);
}

.about-wrap {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(3rem, 7vw, 6.5rem);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.about-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 580px;
  overflow: hidden;
}
.about-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    oklch(0.67 0.112 46 / 0.10) 0%,
    transparent 55%
  );
  z-index: 1;
  pointer-events: none;
}

.about-text h2 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.125rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin-bottom: 1.75rem;
}

.about-text p {
  color: var(--muted);
  max-width: 50ch;
  margin-bottom: 1.125rem;
  line-height: 1.72;
}

.about-text p strong {
  color: var(--ink);
  font-weight: 400;
}

.about-sig {
  margin-top: 2.25rem;
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
  letter-spacing: 0.01em;
}

/* ── SERVICES ── */
#servicios {
  background: var(--surface);
  padding: var(--section-py) var(--section-px);
}

.svc-wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.svc-wrap h2 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.125rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.svc-list { list-style: none; }

.svc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.875rem 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.svc-item:first-child { border-top: 1px solid var(--border); }
.svc-item.in { opacity: 1; transform: none; }

.svc-item:nth-child(1) { transition-delay: 0.00s; }
.svc-item:nth-child(2) { transition-delay: 0.09s; }
.svc-item:nth-child(3) { transition-delay: 0.18s; }
.svc-item:nth-child(4) { transition-delay: 0.27s; }

.svc-main { flex: 1; }

.svc-name {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(1.25rem, 2.5vw, 1.875rem);
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.svc-desc {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.55;
}

.svc-arr {
  color: var(--primary);
  font-size: 1.25rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.22s, transform 0.22s;
  flex-shrink: 0;
}
.svc-item:hover .svc-arr {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .svc-item { opacity: 1 !important; transform: none !important; transition: none !important; }
  .svc-arr { transition: none; }
}

/* ── CONTACT ── */
#contacto {
  padding: var(--section-py) var(--section-px);
}

.cta-wrap {
  max-width: 700px;
  margin: 0 auto;
}

.cta-wrap h2 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.125rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin-bottom: 0.875rem;
}

.cta-sub {
  color: var(--muted);
  margin-bottom: clamp(2rem, 4.5vw, 3.25rem);
  max-width: 48ch;
}

.form {
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.71875rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  padding: 0.8125rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.22s, background 0.22s;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23756658' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.field select option {
  background: var(--surface);
  color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: var(--surface-2);
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--dim);
}

/* ── FOOTER ── */
footer {
  padding: 2.5rem var(--section-px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.foot-name {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 300;
  font-size: 0.9375rem;
  color: var(--muted);
}

.foot-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}
.foot-links a {
  font-size: 0.8125rem;
  color: var(--dim);
  transition: color 0.22s;
}
.foot-links a:hover { color: var(--muted); }

.foot-cr {
  font-size: 0.71875rem;
  color: var(--dim);
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 250px 250px 250px 210px;
    gap: 2px;
  }
  .g-item:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .g-item:nth-child(2) { grid-column: 1;     grid-row: 2; }
  .g-item:nth-child(3) { grid-column: 2;     grid-row: 2; }
  .g-item:nth-child(4) { grid-column: 1 / 3; grid-row: 3; }
  .g-item:nth-child(5) { grid-column: 1;     grid-row: 4; }
  .g-item:nth-child(6) { grid-column: 2;     grid-row: 4; }

  .about-wrap { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 4 / 3; max-height: 380px; }

  .nav-center { display: none; }
  .nav-contact { display: none; }
  .nav-burger { display: flex; }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 2px;
  }
  .g-item {
    grid-column: 1 !important;
    grid-row: auto !important;
    aspect-ratio: 4 / 3;
    height: auto;
  }
  .form-row { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: flex-start; }
  .hero-headline { font-size: clamp(2.75rem, 14vw, 4rem); }
}
