/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #100C09;
  --bg-2:      #17120D;
  --bg-3:      #221A13;
  --cream:     #F3ECDD;
  --cream-2:   #DCCFB8;
  --cream-3:   #8C7C64;
  --accent:    #C1592E;
  --accent-2:  #8F3F1F;
  --stone:     #A9906D;
  --line:      rgba(243,236,221,0.12);

  --serif: "Playfair Display", Georgia, serif;
  --sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@property --mesh-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 600; }
em { font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: var(--cream); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.4rem;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--cream); color: var(--bg);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.9rem;
  font-weight: 600;
}

/* =============================================================
   4. Typography
   ============================================================= */
h2 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
p { color: var(--cream-2); }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background .3s, color .3s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.btn-primary {
  background: var(--accent); color: var(--cream);
}
.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(0,0,0,0.35), 0 10px 22px rgba(193,89,46,0.35);
}
.btn-ghost {
  background: transparent; color: var(--cream);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  transform: translateY(-4px);
  background: rgba(243,236,221,0.06);
  border-color: rgba(243,236,221,0.3);
}
.btn:active { transform: translateY(-1px); transition-duration: .12s; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }

/* Cursor */
.cursor {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  display: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}
.cursor.is-ready { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; will-change: transform; }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px; background: var(--cream); border-radius: 50%; }
.cursor-ring {
  width: 32px; height: 32px; margin: -16px; border: 1px solid var(--cream); border-radius: 50%;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out);
}
.cursor.is-interactive .cursor-ring { width: 48px; height: 48px; margin: -24px; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

/* Reveal */
[data-reveal] {
  opacity: 0; transform: translateY(36px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* Clip reveal for figures — clip-path lives on an inner wrapper so the
   IntersectionObserver (attached to the outer element) always sees a
   non-zero intersection rect. Clipping the observed element itself
   makes some browsers report intersectionRatio 0 permanently. */
[data-reveal-mask] > .figure-mask {
  width: 100%; height: 100%;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease-soft);
}
[data-reveal-mask].is-revealed > .figure-mask { clip-path: inset(0); }

/* Tilt */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft);
}
.has-tilt:hover { transition-duration: .15s; }

/* Split text */
.split-word, .split-line { display: inline-block; }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Splash --- */
.splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: grid; place-items: center;
  pointer-events: auto;
  transition: opacity .9s, clip-path 1.1s;
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-inner { text-align: center; }
.splash-logo { width: min(280px, 60vw); height: auto; margin-inline: auto; }
.splash-line {
  display: block; width: 60px; height: 1px; background: var(--accent);
  margin: 1.2rem auto 0; animation: splashLine 1.6s var(--ease-soft) infinite;
}
@keyframes splashLine { 0%, 100% { width: 20px; opacity: .4; } 50% { width: 70px; opacity: 1; } }

/* --- Nav --- */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  padding-block: 1.3rem;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), padding .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(16,12,9,0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(243,236,221,0.08);
  padding-block: 0.85rem;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-brand { display: flex; align-items: center; }
.brand-logo { height: 48px; width: auto; display: block; transition: height .4s var(--ease-out); }
.nav.is-scrolled .brand-logo { height: 40px; }
.footer .brand-logo { height: 36px; }
.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link { position: relative; padding: 0.25rem 0; font-size: 0.92rem; font-weight: 500; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-link-cta {
  background: var(--accent); color: var(--cream);
  padding: 0.55rem 1.2rem; border-radius: 999px;
}
.nav-link-cta::after { display: none; }
.nav-link-cta:hover { transform: translateY(-2px); }

.lang-switch {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--line); border-radius: 999px;
}
.lang-btn {
  padding: 0.3rem 0.65rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--cream-3); transition: background .3s, color .3s;
}
.lang-btn.is-active { background: var(--accent); color: var(--cream); }
.lang-switch-mobile { margin-top: 0.4rem; }

.nav-burger {
  display: grid; place-items: center; gap: 5px;
  width: 42px; height: 42px;
}
@media (min-width: 960px) { .nav-burger { display: none; } }
.nav-burger span { width: 22px; height: 1.5px; background: var(--cream); transition: transform .3s, opacity .3s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg); color: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .65s var(--ease-soft);
}
.nav-mobile[aria-hidden="false"] { clip-path: inset(0); }
.nav-mobile a { font-family: var(--serif); font-size: 1.6rem; }
@media (min-width: 960px) { .nav-mobile { display: none; } }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: clip;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
@keyframes ambientZoom {
  0%, 100% { transform: scale(1.05) translate3d(0, 0, 0); }
  50%      { transform: scale(1.14) translate3d(-1%, -1%, 0); }
}
.hero-bg img.ambient-on { animation: ambientZoom 30s ease-in-out infinite; }
.hero-bg-tint {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,12,9,0.55) 0%, rgba(16,12,9,0.55) 40%, rgba(16,12,9,0.92) 100%);
}
.hero-grain {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; opacity: 0.14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
.hero-inner { padding-block: 8rem 4rem; max-width: 780px; }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.02;
  max-width: 16ch;
}
.hero-sub { font-size: 1.12rem; max-width: 46ch; margin-top: 1.4rem; }

/* --- Stats --- */
.stats { padding-block: 3.5rem; border-bottom: 1px solid var(--line); }
.stats-grid {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 2rem; text-align: center;
}
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-value { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--accent); display: block; }
.stat-label { color: var(--cream-3); font-size: 0.85rem; letter-spacing: 0.02em; }

/* --- Manifesto --- */
.manifesto { padding-block: clamp(4rem, 10vw, 8rem); }
.manifesto-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) { .manifesto-grid { grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 4.5rem; } }
.manifesto-figure { border-radius: 18px; overflow: hidden; aspect-ratio: 4/5; }
.manifesto-figure img { width: 100%; height: 100%; object-fit: cover; }
.figure-mask { display: block; }
@media (min-width: 960px) { .manifesto-figure { aspect-ratio: 3/4; } }
.manifesto-text h2 { margin-bottom: 1.3rem; }
.manifesto-text p { margin-bottom: 1rem; max-width: 56ch; }
.manifesto-pillars {
  display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.6rem;
  margin-top: 2.4rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
@media (min-width: 640px) { .manifesto-pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar-num { display: block; font-family: var(--serif); color: var(--stone); font-size: 0.95rem; margin-bottom: 0.4rem; }
.pillar h3 { font-size: 1.05rem; }
.pillar p { font-size: 0.92rem; }

/* --- Showcase (services, pinned horizontal) --- */
.showcase { padding-block: clamp(4rem, 10vw, 7rem) 3rem; background: var(--bg-2); }
.showcase-head { margin-bottom: 2.4rem; }
.showcase-track-wrap { overflow: hidden; }
.showcase-track {
  display: flex; flex-wrap: nowrap; gap: 1.4rem;
  padding-inline: 1.4rem;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x proximity;
  padding-bottom: 1rem;
}
@media (min-width: 1024px) { .showcase-track { overflow-x: visible; } }
.showcase.is-pinned .showcase-track { will-change: transform; }
.service-card {
  flex: 0 0 auto; width: min(340px, 82vw);
  scroll-snap-align: start;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.3rem;
}
.service-img { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; margin-bottom: 1.1rem; }
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-soft), filter .55s; }
.service-card:hover .service-img img {
  transform: scale(1.1);
  filter: saturate(1.15) brightness(1.03);
}
.service-card:hover {
  box-shadow: 0 40px 80px -20px rgba(193,89,46,0.28), 0 0 0 1px rgba(193,89,46,0.2);
}
.service-card h3 { font-size: 1.1rem; }
.service-card p { font-size: 0.92rem; }
.showcase-note { margin-top: 2rem; color: var(--cream-3); font-size: 0.9rem; }
.showcase-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* --- Process --- */
.process { padding-block: clamp(4rem, 10vw, 8rem); }
.process-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) { .process-grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 4.5rem; } }
.process-figure { border-radius: 18px; overflow: hidden; aspect-ratio: 16/11; }
.process-figure img { width: 100%; height: 100%; object-fit: cover; }
.steps-list { list-style: none; margin-top: 2rem; display: flex; flex-direction: column; gap: 1.8rem; }
.step { display: flex; gap: 1.3rem; align-items: flex-start; }
.step-num { font-family: var(--serif); font-size: 1.4rem; color: var(--accent); flex: 0 0 auto; min-width: 2.4ch; }
.step h3 { font-size: 1.1rem; }
.step p { font-size: 0.95rem; }

/* --- Featured project --- */
.featured { padding-block: clamp(4rem, 10vw, 7rem); background: var(--bg-2); }
.featured > .container { margin-bottom: 2rem; }
.featured-figure { border-radius: 18px; overflow: hidden; aspect-ratio: 16/9; }
.featured-figure img { width: 100%; height: 100%; object-fit: cover; }
.featured-caption { margin-top: 1.4rem; color: var(--cream-3); font-size: 0.95rem; max-width: 62ch; }

/* --- Testimonials --- */
.testimonials { padding-block: clamp(4rem, 10vw, 7rem); }
.testimonials h2 { margin-bottom: 2.4rem; }
.testimonials-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.6rem; }
@media (min-width: 860px) { .testimonials-grid { grid-template-columns: repeat(3, 1fr); } }
.testimonial {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.8rem;
}
.testimonial p { font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--cream); margin-bottom: 1.2rem; }
.testimonial footer { font-size: 0.85rem; color: var(--cream-3); }
.testimonial footer strong { color: var(--cream-2); }

/* --- CTA / Quote form --- */
.cta-quote { padding-block: clamp(4rem, 10vw, 8rem); background: var(--bg-2); border-top: 1px solid var(--line); }
.cta-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) { .cta-grid { grid-template-columns: 1fr 1.1fr; gap: 4.5rem; } }
.cta-text p { max-width: 44ch; }
.cta-contact-list { list-style: none; margin-top: 1.8rem; display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.95rem; }
.cta-contact-list a { color: var(--accent); }
.cta-contact-list strong { color: var(--cream-2); font-weight: 600; }

.cta-form-wrap { position: relative; }
.cta-form { display: flex; flex-direction: column; gap: 1.2rem; transition: opacity .55s var(--ease-out), transform .55s var(--ease-soft); }
.cta-form.is-sent { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.field { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; padding: 1.3rem 1rem 0.55rem; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--cream); border-radius: 10px;
  font-family: var(--sans); font-size: 1rem;
  transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field label {
  position: absolute; left: 1rem; top: 1.05rem;
  pointer-events: none; transition: all .25s var(--ease-out);
  color: var(--cream-3); font-size: 0.98rem;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: 0.35rem; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.field select { color: var(--cream); }
.field select:invalid { color: var(--cream-3); }
.field:has(select) label {
  top: 0.35rem; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.cta-submit { position: relative; margin-top: 0.4rem; overflow: hidden; }
.cta-form-label { transition: opacity .2s; }
.cta-form-spinner, .cta-form-check {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; pointer-events: none;
}
.cta-form.is-sending .cta-form-label { opacity: 0; }
.cta-form.is-sending .cta-form-spinner { opacity: 1; }
.cta-form-spinner::after {
  content: ""; width: 18px; height: 18px;
  border: 1.5px solid rgba(243,236,221,0.3); border-top-color: var(--cream);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta-form-check path {
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .55s var(--ease-out);
}
.cta-success {
  position: absolute; left: 50%; top: 40%;
  transform: translate(-50%, -40%);
  opacity: 0; pointer-events: none; text-align: center; width: 100%;
  transition: opacity .8s var(--ease-out) .25s, transform .9s var(--ease-soft) .25s;
}
.cta-success.is-visible { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.cta-success h3 { color: var(--accent); margin-bottom: 0.6rem; }

/* --- Footer --- */
.footer { padding-block: 2.5rem; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  font-size: 0.85rem; color: var(--cream-3);
}
.footer-inner a[href="creditos.html"] { text-decoration: underline; text-underline-offset: 3px; }

/* =============================================================
   7. Effects (misc keyframes already inline above)
   ============================================================= */

/* =============================================================
   8. Responsive tweaks (mobile-first covered above; large desktop)
   ============================================================= */
@media (min-width: 1600px) {
  .container { max-width: 1360px; }
}

/* =============================================================
   9. Reduced-motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg img.ambient-on { animation: none; }
  .splash-line { animation: none; }
}
