/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f4efe6;
  --bg-2:      #e8dfd0;
  --paper:     #ffffff;
  --ink:       #1a1a1a;
  --ink-soft:  #2a2a2a;
  --ink-mute:  #6b6b6b;
  --accent:    #b85c3a;
  --accent-2:  #4a5d3a;
  --line:      rgba(26, 26, 26, 0.12);

  --serif: "Fraunces", "Cormorant Garamond", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-crearte: 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);

  --nav-h: 84px;
  --container: 1240px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -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: 500; }
em { font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top .3s var(--ease-crearte);
}
.skip-link:focus { top: 1rem; }

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

.kicker {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-crearte), transform .9s var(--ease-crearte); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
/* No-JS / JS-failed safety: content must never depend on script execution */
.no-js .reveal { opacity: 1; transform: none; }
.no-js .hero-bg { clip-path: none; }
.no-js .manifiesto-figure .clip-wrap { clip-path: none; }
.no-js .micro-intro { display: none; }

/* =============================================================
   4. Nav
   ============================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  transition: background .5s var(--ease-crearte), box-shadow .5s var(--ease-crearte), height .4s var(--ease-crearte);
}
.nav.is-solid {
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
  height: 68px;
}
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.nav-brand em { color: var(--ink); font-style: italic; }
.nav-links { display: none; align-items: center; gap: 2.2rem; }
.nav-link { font-size: .92rem; font-weight: 500; position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-crearte);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right .nav-cta {
  display: none;
}
.nav-right { display: flex; align-items: center; gap: .7rem; }

.nav-portfolio-link {
  display: flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 600; color: var(--ink-mute);
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 100px;
  opacity: .75;
  transition: opacity .3s var(--ease-crearte), border-color .3s var(--ease-crearte), color .3s var(--ease-crearte);
}
.nav-portfolio-link:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.nav-portfolio-link svg { width: 12px; height: 12px; flex-shrink: 0; }
.nav-portfolio-text { display: none; }
@media (min-width: 540px) { .nav-portfolio-text { display: inline; } }

/* Mobile nav — native <details> disclosure, works with zero JS */
.nav-mobile { position: relative; }
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px; padding: .5rem;
  list-style: none; cursor: pointer;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle span { width: 22px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease-crearte), opacity .3s var(--ease-crearte); }
.nav-mobile[open] .nav-toggle span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav-mobile[open] .nav-toggle span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-menu-panel { display: none; }
.nav-mobile[open] .mobile-menu-panel {
  position: fixed; inset: 0; z-index: 490;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
}
.mobile-menu-panel a { font-family: var(--serif); font-size: 2rem; font-style: italic; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-right .nav-cta { display: inline-flex; }
  .nav-mobile { display: none; }
}

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .95rem 1.8rem;
  font-size: .92rem; font-weight: 600;
  border-radius: 100px;
  transition: transform .5s var(--ease-crearte), background .3s var(--ease-crearte), color .3s var(--ease-crearte);
  will-change: transform;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  z-index: 700; pointer-events: none;
}
.progress-bar-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transform-origin: left;
}

/* Custom cursor */
.cursor { display: none; position: fixed; top: 0; left: 0; z-index: 800; pointer-events: none; }
.cursor.is-ready { display: block; }
.cursor-dot { position: fixed; top: 0; left: 0; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; pointer-events: none; z-index: 801; transform: translate(-50%, -50%); }
.cursor-ring {
  position: fixed; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--ink); pointer-events: none; z-index: 800;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width .3s var(--ease-crearte), height .3s var(--ease-crearte), border-color .3s var(--ease-crearte);
}
.cursor-ring.is-hover { width: 64px; height: 64px; background: rgba(184, 92, 58, 0.15); }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot, .cursor-ring { display: none; } }

/* Grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Micro-intro */
.micro-intro {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.micro-intro-line {
  width: 1px; height: 40%;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: center;
}

/* =============================================================
   6. Sections — Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding-top: var(--nav-h);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  clip-path: inset(0% 0% 100% 0%);
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); will-change: transform; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(244,239,230,.15) 0%, rgba(244,239,230,.55) 65%, var(--bg) 100%);
}
.hero-content {
  position: relative;
  width: 100%;
  padding-block: 3rem 4.5rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  max-width: 14ch;
}
.hero-sub {
  max-width: 42ch;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-style: italic;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }

/* =============================================================
   7. Sections — Manifiesto
   ============================================================= */
.manifiesto { padding-block: 7rem; position: relative; }
.manifiesto-grid {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
}
.manifiesto-num {
  font-family: var(--serif); font-style: italic;
  font-size: 5rem; color: var(--accent-2); line-height: 1;
  opacity: .5;
}
.manifiesto-text h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 1.4rem; }
.manifiesto-text p { max-width: 58ch; color: var(--ink-soft); font-size: 1.05rem; }
.manifiesto-sign { margin-top: 1.6rem; font-family: var(--serif); font-style: italic; color: var(--ink-mute); }
.manifiesto-figure {
  position: relative; border-radius: 4px; overflow: visible;
  aspect-ratio: 4 / 5; max-width: 420px;
}
.manifiesto-figure .clip-wrap { width: 100%; height: 100%; overflow: hidden; clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
.manifiesto-figure img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); will-change: transform; }

@media (min-width: 960px) {
  .manifiesto-grid { grid-template-columns: .9fr 1.1fr; align-items: center; gap: 4.5rem; }
  .manifiesto-figure { order: 2; margin-left: auto; }
  .manifiesto-copy { order: 1; }
}

/* =============================================================
   8. Sections — Servicios
   ============================================================= */
.servicios { padding-block: 6rem; }
.servicios-head { max-width: 44ch; margin-bottom: 3.5rem; }
.servicios-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-top: .8rem; }
.servicios-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.2rem;
}
.servicio-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem;
  display: flex; flex-direction: column; gap: .9rem;
  transition: transform .5s var(--ease-crearte), box-shadow .5s var(--ease-crearte), border-color .5s var(--ease-crearte);
}
.servicio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -20px rgba(184, 92, 58, .28);
  border-color: transparent;
}
.servicio-card.is-big { grid-column: span 1; padding: 2.6rem; background: var(--ink); color: var(--bg); }
.servicio-card.is-big .servicio-meta { color: rgba(244,239,230,.6); }
.servicio-card.is-big:hover { box-shadow: 0 24px 56px -20px rgba(0,0,0,.35); }
.servicio-num { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.1rem; }
.servicio-card.is-big .servicio-num { color: var(--accent); }
.servicio-card h3 { font-size: 1.35rem; }
.servicio-card.is-big h3 { font-size: 1.9rem; }
.servicio-card p { color: var(--ink-mute); font-size: .95rem; }
.servicio-card.is-big p { color: rgba(244,239,230,.78); }
.servicio-meta { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mute); margin-top: auto; }

@media (min-width: 720px) { .servicios-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .servicios-grid { grid-template-columns: repeat(3, 1fr); }
  .servicio-card.is-big { grid-column: span 2; grid-row: span 2; }
}

/* =============================================================
   9. Marquee
   ============================================================= */
.marquee-section { padding-block: 2.4rem; border-block: 1px solid var(--line); overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee-section:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--ink-mute);
  padding-inline: 2rem;
  white-space: nowrap;
  display: flex; align-items: center; gap: 2rem;
}
.marquee-item::after { content: "·"; color: var(--accent); font-style: normal; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =============================================================
   10. Galería
   ============================================================= */
.galeria { padding-block: 6rem; }
.galeria-head { max-width: 44ch; margin-bottom: 3rem; }
.galeria-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-top: .8rem; }
.galeria-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.galeria-item { border-radius: 14px; overflow: hidden; aspect-ratio: 1/1; will-change: transform, opacity; }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-crearte); }
.galeria-item:hover img { transform: scale(1.08); }
.galeria-item:nth-child(3n+2) { margin-top: 2.2rem; }

@media (min-width: 720px) { .galeria-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   11. Testimonios
   ============================================================= */
.testimonios { padding-block: 7rem; background: var(--bg-2); position: relative; }
.testimonios-head { max-width: 44ch; margin-bottom: 4rem; }
.testimonios-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-top: .8rem; }
.testimonios-board { display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
.testimonio-note {
  background: var(--paper);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: 0 18px 40px -22px rgba(26,26,26,.25);
  position: relative;
}
.testimonio-note::before {
  content: "“";
  font-family: var(--serif); font-style: italic;
  font-size: 3.4rem; color: var(--accent); opacity: .35;
  position: absolute; top: .6rem; left: 1.2rem; line-height: 1;
}
.testimonio-note p { font-family: var(--serif); font-size: 1.15rem; font-style: italic; margin-top: 1.6rem; color: var(--ink-soft); }
.testimonio-person { display: flex; align-items: center; gap: .8rem; margin-top: 1.4rem; }
.testimonio-person img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.testimonio-person .name { font-weight: 600; font-size: .92rem; }
.testimonio-person .role { font-size: .8rem; color: var(--ink-mute); }

.testimonio-note:nth-child(1) { transform: rotate(-1.6deg); }
.testimonio-note:nth-child(2) { transform: rotate(1deg); }
.testimonio-note:nth-child(3) { transform: rotate(-.8deg); }
.testimonio-note:nth-child(4) { transform: rotate(1.4deg); }

@media (min-width: 720px) { .testimonios-board { grid-template-columns: repeat(2, 1fr); } }

/* =============================================================
   12. CTA final + Contacto
   ============================================================= */
.cta-final { padding-block: 7rem; text-align: center; }
.cta-final h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 16ch; margin-inline: auto; }
.cta-final p { max-width: 46ch; margin: 1.4rem auto 2.4rem; color: var(--ink-soft); }
.btn-magnetic {
  display: inline-flex; padding: 1.2rem 2.6rem; border-radius: 100px;
  background: var(--ink); color: var(--bg); font-weight: 600;
  will-change: transform;
}

.contacto { padding-block: 5rem 7rem; }
.contacto-grid { display: grid; gap: 3rem; grid-template-columns: 1fr; }
.contacto-info h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.contacto-info dl { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.4rem; }
.contacto-info dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mute); }
.contacto-info dd { font-size: 1rem; }

.form-field { position: relative; margin-bottom: 1.3rem; }
.form-field input, .form-field textarea {
  width: 100%; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-family: var(--sans); font-size: .95rem;
  transition: border-color .3s var(--ease-crearte);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); outline: none; }
.form-field textarea { min-height: 120px; resize: vertical; }
.contact-form .btn-primary { width: 100%; justify-content: center; margin-top: .5rem; }
.form-success { display: none; text-align: center; padding: 2rem; }
.form-success.is-visible { display: block; }
.form-success svg { width: 36px; height: 36px; color: var(--accent-2); margin-inline: auto 1rem; }

@media (min-width: 960px) { .contacto-grid { grid-template-columns: .8fr 1.2fr; gap: 5rem; } }

/* =============================================================
   13. Footer
   ============================================================= */
.footer {
  background: var(--ink); color: var(--bg);
  padding-block: 3.5rem 2rem;
}
.footer-top { display: flex; flex-direction: column; gap: 2.4rem; padding-bottom: 2.4rem; border-bottom: 1px solid rgba(244,239,230,.14); }
.footer-brand { font-family: var(--serif); font-size: 1.6rem; font-style: italic; }
.footer-cols { display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
.footer-col h4 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(244,239,230,.55); margin-bottom: .8rem; }
.footer-col a, .footer-col p { display: block; font-size: .92rem; color: rgba(244,239,230,.9); margin-bottom: .4rem; }
.footer-bottom { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; justify-content: space-between; padding-top: 1.6rem; }
.footer-legal { font-size: .78rem; color: rgba(244,239,230,.5); }

.credit-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 500;
  color: rgba(244,239,230,.85);
  padding: .5rem .9rem; border: 1px solid rgba(244,239,230,.22); border-radius: 100px;
}
.credit-badge svg { width: 12px; height: 12px; transition: transform .35s var(--ease-crearte); }
.credit-badge:hover { border-color: var(--accent); color: var(--bg); }
.credit-badge:hover svg { transform: translate(3px, -3px); }

@media (min-width: 720px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .footer-bottom { flex-direction: row; align-items: center; } }

/* =============================================================
   14. Responsive base
   ============================================================= */
@media (min-width: 540px) { .hero-title { max-width: 16ch; } }
@media (min-width: 1280px) { .container { padding-inline: 3rem; } }

/* =============================================================
   15. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: 60s; }
  .micro-intro { display: none; }
}
