/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #fbf9f6;
  --bg-tint-1: #f4ece1;
  --bg-tint-2: #f6ebe7;
  --paper:     #ffffff;
  --ink:       #241f1c;
  --ink-soft:  #4a423c;
  --ink-mute:  #8c8178;
  --accent:    #a9714f;
  --accent-2:  #c9a98a;
  --accent-3:  #8a5a3c;
  --line:      rgba(36,31,28,0.13);
  --line-soft: rgba(36,31,28,0.07);

  --footer-bg: #241f1c;
  --footer-ink: #f2ece4;

  --display: 'Bodoni Moda', 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-crearte: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 84px;
  --bg-scrub: var(--bg);
}

/* =============================================================
   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;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg-scrub);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  cursor: default;
  transition: background-color .1s linear;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; text-align: left; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; font-family: var(--display); font-weight: 500; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--paper); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: 1280px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }

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

.section-kicker {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .2em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .9rem;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  color: var(--ink);
  max-width: 20ch;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.9rem;
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .01em;
  border-radius: 2px;
  transition: transform .5s var(--ease-crearte), background-color .4s var(--ease-crearte), color .4s var(--ease-crearte), border-color .4s var(--ease-crearte);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================
   4. Firma de autor — cursor, grain, progress thread, micro-intro
   ============================================================= */
.cursor { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease-crearte); }
.cursor.is-ready { opacity: 1; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); transform: translate3d(-50%,-50%,0); }
.cursor-ring { width: 34px; height: 34px; border: 1px solid var(--ink); mix-blend-mode: normal; opacity: .55; transform: translate3d(-50%,-50%,0); transition: width .25s var(--ease-crearte), height .25s var(--ease-crearte), opacity .25s var(--ease-crearte); }
.cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--accent); opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.grain {
  position: fixed; inset: -10%; z-index: 6; pointer-events: none;
  opacity: .04; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.progress-thread {
  position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 9997; pointer-events: none;
  background: var(--line-soft);
}
.progress-thread span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.micro-intro {
  position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.micro-intro-line {
  width: 0%; height: 1px; background: var(--accent);
}
.micro-intro.is-out { opacity: 0; transition: opacity .4s var(--ease-crearte); }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 500;
  height: var(--nav-h);
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(251,249,246,0);
  transition: background .4s var(--ease-crearte), box-shadow .4s var(--ease-crearte);
}
.nav.is-solid::before {
  background: rgba(251,249,246,.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-logo { font-family: var(--display); font-size: 1.5rem; letter-spacing: .01em; color: var(--ink); }
.brand-dot { color: var(--accent); }
.nav-links { display: none; gap: 2.1rem; }
.nav-links a { font-size: .9rem; color: var(--ink-soft); position: relative; padding-block: .3rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-crearte);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-right .nav-cta { display: none; }

.nav-toggle { list-style: none; cursor: pointer; width: 26px; height: 18px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle span { display: block; height: 1.5px; width: 100%; background: var(--ink); transition: transform .35s var(--ease-crearte), opacity .35s var(--ease-crearte); }
.nav-mobile[open] .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-mobile[open] .nav-toggle span:nth-child(2) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu-panel { display: none; }
.nav-mobile[open] .mobile-menu-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg);
  padding-top: var(--nav-h);
}
.mobile-menu-panel a { font-family: var(--display); font-size: 1.6rem; color: var(--ink); }
.mobile-menu-panel .btn { margin-top: 1rem; }

.nav-portfolio-link { display: none; align-items: center; gap: .4rem; font-size: .8rem; color: var(--ink-mute); }
.nav-portfolio-link svg { width: 16px; height: 16px; }
.nav-portfolio-link:hover { color: var(--accent); }

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

/* =============================================================
   6. Hero — variant 3, parallax de capas por mouse
   ============================================================= */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem);
  background: var(--bg);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
.hero-copy { position: relative; z-index: 2; }
.hero-kicker {
  font-size: .78rem; letter-spacing: .2em; font-weight: 600;
  color: var(--accent); margin-bottom: 1.4rem; text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.6rem, 6.6vw, 4.6rem);
  line-height: .98;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.hero-title-line { display: block; }
.hero-title-em { font-style: italic; color: var(--accent-3); font-weight: 400; }
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 46ch; margin-bottom: 2.2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.hero-trust { font-size: .82rem; color: var(--ink-mute); }

.hero-media { position: relative; z-index: 1; aspect-ratio: 3/4; max-width: 460px; margin-inline: auto; will-change: transform; }
.hero-media-outline {
  position: absolute; inset: 18px -18px -18px 18px;
  border: 1px solid var(--line); border-radius: 2px; z-index: -1;
}
.hero-media-frame { width: 100%; height: 100%; overflow: hidden; border-radius: 2px; }
.hero-media-frame img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.05fr .95fr; }
  .hero-media { margin-inline: 0; max-width: none; }
}

/* =============================================================
   7. Historia — variant 4, reveal diagonal de imagen
   ============================================================= */
.historia { padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg); }
.historia-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.historia-media {
  aspect-ratio: 4/5; overflow: hidden; border-radius: 2px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.historia-media img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.historia-copy { max-width: 52ch; }
.historia-copy p { color: var(--ink-soft); margin-bottom: 1.1rem; }
.historia-copy p:last-child { margin-bottom: 0; }

@media (min-width: 860px) {
  .historia-grid { grid-template-columns: .85fr 1.15fr; }
}

/* =============================================================
   8. Servicios — variant 5, acordeón horizontal
   ============================================================= */
.servicios { padding-block: clamp(4rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); background: var(--bg); }
.servicios-head { margin-bottom: clamp(2rem, 5vw, 3rem); }

.servicios-accordion {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.servicio-col {
  position: relative;
  display: flex; align-items: flex-end;
  min-height: 84px;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  color: var(--ink);
}
.servicio-col-bg { position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity .6s var(--ease-crearte); }
.servicio-col-bg img { width: 100%; height: 130%; object-fit: cover; will-change: transform; }
.servicio-col-tint { position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(36,31,28,.72), rgba(36,31,28,.12) 55%, rgba(36,31,28,0)); opacity: 0; transition: opacity .6s var(--ease-crearte); }
.servicio-col-num { position: relative; z-index: 2; font-family: var(--display); font-size: 1.1rem; color: var(--accent); margin-right: 1rem; }
.servicio-col-title { position: relative; z-index: 2; font-family: var(--display); font-size: 1.3rem; white-space: nowrap; }
.servicio-col-body { position: relative; z-index: 2; max-width: 0; overflow: hidden; opacity: 0; transition: max-width .6s var(--ease-crearte), opacity .4s var(--ease-crearte); }
.servicio-col-desc { display: block; padding-left: 1.6rem; font-size: .95rem; line-height: 1.5; }

.servicio-col.is-open { color: var(--paper); }
.servicio-col.is-open .servicio-col-bg,
.servicio-col.is-open .servicio-col-tint { opacity: 1; }
.servicio-col.is-open .servicio-col-num { color: var(--accent-2); }
.servicio-col.is-open .servicio-col-body { max-width: 480px; opacity: 1; }

@media (min-width: 860px) {
  .servicios-accordion { flex-direction: row; height: 420px; border-top: 0; }
  .servicio-col {
    flex: 1; height: 100%; min-height: 0;
    border-bottom: 0; border-right: 1px solid var(--line);
    align-items: flex-end;
    transition: flex .7s var(--ease-crearte);
    padding: 2rem 1.4rem;
  }
  .servicio-col:last-child { border-right: 0; }
  .servicio-col-title { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; transition: writing-mode 0s, transform .5s var(--ease-crearte); }
  .servicio-col.is-open { flex: 3.4; }
  .servicio-col.is-open .servicio-col-title { writing-mode: horizontal-tb; transform: none; }
  .servicio-col-num { display: block; margin-right: 0; margin-bottom: 1rem; }
  .servicio-col.is-open .servicio-col-num { margin-bottom: .6rem; }
  .servicio-col-body { max-width: 0; }
  .servicio-col.is-open .servicio-col-body { max-width: 340px; }
}

/* =============================================================
   9. Galería — variant 3, grid + lightbox match-cut
   ============================================================= */
.galeria { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 8vw, 6rem); background: var(--bg); }
.galeria-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

.galeria-grid { display: grid; gap: .9rem; grid-template-columns: repeat(2, 1fr); }
.galeria-item { position: relative; display: block; overflow: hidden; border-radius: 2px; cursor: pointer; }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-crearte); will-change: transform; }
.galeria-item:hover img { transform: scale(1.05); }
.galeria-item-cap {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 1;
  font-size: .82rem; color: var(--paper); letter-spacing: .02em;
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s var(--ease-crearte), transform .4s var(--ease-crearte);
}
.galeria-item::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(0deg, rgba(36,31,28,.55), transparent 55%);
  opacity: 0; transition: opacity .4s var(--ease-crearte);
}
.galeria-item:hover::after, .galeria-item:focus-visible::after { opacity: 1; }
.galeria-item:hover .galeria-item-cap, .galeria-item:focus-visible .galeria-item-cap { opacity: 1; transform: translateY(0); }

.galeria-item-a { grid-column: span 2; aspect-ratio: 16/10; }
.galeria-item-b { aspect-ratio: 3/4; }
.galeria-item-c { aspect-ratio: 3/4; }
.galeria-item-d { aspect-ratio: 1/1; }
.galeria-item-e { grid-column: span 2; aspect-ratio: 16/9; }

@media (min-width: 720px) {
  .galeria-grid { grid-template-columns: repeat(4, 1fr); }
  .galeria-item-a { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .galeria-item-b { grid-column: span 2; aspect-ratio: 16/9; }
  .galeria-item-c { grid-column: span 2; aspect-ratio: 16/9; }
  .galeria-item-d { grid-column: span 2; aspect-ratio: 16/9; }
  .galeria-item-e { grid-column: span 4; aspect-ratio: 21/9; }
}

.lightbox {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(20,17,15,.94);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { max-width: 1100px; width: 100%; }
.lightbox-figure img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 2px; view-transition-name: none; }
.lightbox-figure figcaption { margin-top: 1rem; color: var(--footer-ink); font-family: var(--display); font-size: 1.2rem; text-align: center; }
.lightbox-close {
  position: absolute; top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(242,236,228,.3);
  display: flex; align-items: center; justify-content: center; color: var(--footer-ink);
  transition: border-color .3s var(--ease-crearte), transform .3s var(--ease-crearte);
}
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-close:hover { border-color: var(--accent-2); transform: rotate(90deg); }

::view-transition-old(gallery-hero), ::view-transition-new(gallery-hero) { animation-duration: .5s; }

/* =============================================================
   10. Testimonios — variant 3, texto resaltado tipo karaoke
   ============================================================= */
.testimonios { padding-block: clamp(4rem, 9vw, 7rem); background: var(--bg); }
.testi-list { display: flex; flex-direction: column; gap: clamp(2.5rem, 6vw, 4.5rem); max-width: 780px; }
.testi-quote { will-change: transform; }
.testi-quote p {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.4;
  color: var(--line);
  margin-bottom: 1.2rem;
}
.testi-quote .word { color: var(--line); transition: color .05s linear; }
.testi-quote .word.is-lit { color: var(--ink-soft); }
.testi-quote cite { font-style: normal; font-size: .9rem; color: var(--ink-mute); }
.testi-quote cite span { color: var(--ink-mute); }

/* =============================================================
   11. CTA — variant 6, botón con trazo SVG
   ============================================================= */
.cta { position: relative; padding-block: clamp(4rem, 10vw, 8rem); background: var(--bg); text-align: center; }
.cta-inner { max-width: 640px; margin-inline: auto; }
.cta-title { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.2rem; }
.cta-sub { color: var(--ink-soft); max-width: 46ch; margin-inline: auto; margin-bottom: 2.6rem; }

.btn-draw {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 1.15rem 2.6rem; font-family: var(--sans); font-size: .95rem; font-weight: 600;
  color: var(--ink); letter-spacing: .01em;
}
.btn-draw-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.btn-draw-svg rect { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.btn-draw span { position: relative; z-index: 1; }
.btn-draw:hover { color: var(--accent-3); }

.cta-alt { margin-top: 1.6rem; font-size: .88rem; color: var(--ink-mute); }
.cta-alt a { color: var(--accent); border-bottom: 1px solid var(--line); }

/* =============================================================
   12. Footer
   ============================================================= */
.footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: clamp(3rem, 6vw, 4.5rem) 1.75rem; }
.footer-grid { display: grid; gap: 2.4rem; margin-bottom: 2.5rem; }
.footer-logo { font-family: var(--display); font-size: 1.7rem; margin-bottom: .6rem; }
.footer-tag { color: rgba(242,236,228,.7); max-width: 32ch; }
.footer-contact p { margin-bottom: .55rem; color: rgba(242,236,228,.85); }
.footer-contact a:hover { color: var(--accent-2); }
.footer-nav { display: flex; flex-direction: column; gap: .6rem; }
.footer-nav a { color: rgba(242,236,228,.85); }
.footer-nav a:hover { color: var(--accent-2); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding-top: 1.75rem; border-top: 1px solid rgba(242,236,228,.14);
  font-size: .82rem; color: rgba(242,236,228,.55);
}
.footer-credit { display: inline-flex; align-items: center; gap: .3rem; color: rgba(242,236,228,.7); }
.footer-credit span { display: inline-block; transition: transform .35s var(--ease-crearte); }
.footer-credit:hover span { transform: translate(2px, -2px); }
.footer-credit:hover { color: var(--accent-2); }

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}

/* =============================================================
   13. Reveal system
   ============================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-crearte), transform .9s var(--ease-crearte); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =============================================================
   14. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .micro-intro { display: none; }
  .servicio-col, .servicio-col-bg, .servicio-col-tint, .servicio-col-body { transition-duration: .01s; }
}
