/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:          #f0ebe3;
  --bg-2:        #e6dfd5;
  --bg-3:        #ded7cc;
  --bg-photo:    #d8d0c6;   /* hero photo-loading fallback */
  --paper:       #faf7f2;
  --ink:         #1c1814;
  --ink-soft:    #2e2620;
  --ink-mute:    #7a6e65;
  --ink-dim:     #a09489;
  --accent:      #8B5E3C;
  --accent-2:    #C49A6C;
  --line:        rgba(28, 24, 20, 0.13);
  --line-soft:   rgba(28, 24, 20, 0.07);

  --serif:       'Cormorant Garamond', 'Georgia', serif;
  --sans:        'Inter', system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter:      clamp(1.25rem, 5vw, 4rem);
  --max-w:       1200px;
  --nav-h:       72px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* anchor offset for fixed nav (replaces JS smooth-scroll) */
  overflow-x: clip;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg { 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 { text-wrap: balance; }
::selection { background: var(--accent); color: var(--paper); }

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--paper);
  z-index: 9999; font-size: .875rem; letter-spacing: 0.05em;
}
.skip-link:focus { top: 1rem; }

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
} /* safety — gotcha A.4.5 */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }

/* =============================================================
   4. Typography
   ============================================================= */
.t-kicker {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
  z-index: -1;
}
.btn:hover::after { transform: scaleX(1); }
.btn:hover { color: var(--paper); border-color: var(--ink); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary::after { background: var(--accent); }
.btn-primary:hover { color: var(--paper); border-color: var(--accent); }

.btn-ghost {
  color: var(--ink-mute);
  border-color: var(--line);
}
.btn-ghost::after { background: var(--bg-3); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

/* Hairline divider */

/* =============================================================
   6. Sections
   ============================================================= */

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding-inline: var(--gutter);
  transition: background 0.4s var(--ease-soft), box-shadow 0.4s var(--ease-soft);
}
.nav.is-solid {
  background: rgba(240, 235, 227, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-right: auto;
}
.nav-monogram {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  /* keep the mark legible over the hero photo (nav is transparent at top) */
  filter: drop-shadow(0 1px 10px rgba(240,235,227,0.7));
}
.nav-monogram::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 2px;
  background: var(--ink);
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  /* legibility over the photo */
  text-shadow: 0 1px 14px rgba(240,235,227,0.7);
}
.nav-links {
  display: none;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}
.nav-links a {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(240,235,227,0.6);
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--accent); }
.nav-hamburger {
  width: 24px;
  height: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.35s;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.nav-mobile.is-open {
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile a {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.nav-mobile a:hover { color: var(--accent); }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-hamburger { display: none; }
}

/* --- HERO --- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  /* slightly darker than --paper so the photo panel is distinguishable */
  background: var(--bg-photo);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  /* Zoom to fill — subject is centered in a large neutral canvas.
     Anchor the zoom to the left so he sits left and touches top/bottom/left. */
  --hero-par: 0%; /* parallax offset, set from main.js */
  transform: scale(2.2) translate3d(0, var(--hero-par), 0);
  transform-origin: 78% 30%;
  /* Slightly warm the tone so the photo edge is visible against the page */
  filter: saturate(0.9) contrast(1.08) brightness(0.96);
  display: block;
}

/* Fade from photo to paper on the right so text is readable */
.hero-overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    transparent 35%,
    rgba(240,235,227,0.75) 62%,
    rgba(240,235,227,0.97) 80%
  );
  z-index: 1;
}

/* Content on the right half, vertically centered */
.hero-content {
  position: absolute;
  right: 0;
  top: 0;
  width: 46%;
  height: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 4vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
  padding-top: calc(var(--nav-h) + 2rem);
}

/* --- CONTACTO --- */
.contacto {
  padding: clamp(5rem, 12vw, 10rem) 0;
  background: var(--bg);
}
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}
.contacto-left-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* --- FOOTER --- */
.footer {
  padding: 3rem 0;
  background: var(--ink);
  color: var(--paper);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.footer-monogram {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(250,247,242,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.footer-monogram::after {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 50%;
  width: 1px;
  background: rgba(250,247,242,0.3);
}
.footer-name {
  font-family: var(--serif);
  font-size: .85rem;
  letter-spacing: 0.1em;
  color: rgba(250,247,242,0.7);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
}
.footer-links a {
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250,247,242,0.4);
  transition: color 0.25s;
}
.footer-links a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(250,247,242,0.08);
}
.footer-copy {
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: 0.1em;
  color: rgba(250,247,242,0.3);
}
.footer-credits {
  font-family: var(--serif);
  font-style: italic;
  font-size: .7rem;
  color: rgba(250,247,242,0.2);
}
.footer-credits a {
  color: rgba(250,247,242,0.3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- CUSTOM CURSOR --- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity .25s var(--ease-out);
  will-change: transform;
}
.cursor-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin: -2.5px 0 0 -2.5px;
  transition: opacity .25s var(--ease-out), transform .1s var(--ease-out);
}
.cursor-ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  margin: -14px 0 0 -14px;
  transition: opacity .25s var(--ease-out), transform .2s var(--ease-out), width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out);
}
.cursor-dot.is-ready,
.cursor-ring.is-ready { opacity: 1; }
.cursor-ring.is-hover {
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-color: var(--accent-2);
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* =============================================================
   7. Effects & Animations
   ============================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.hero-content > * {
  animation: fadeIn 0.9s var(--ease-out) both;
}

/* =============================================================
   8. Responsive
   ============================================================= */

@media (min-width: 720px) {
  .contacto-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   9. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-content > * { animation: none !important; opacity: 1; transform: none; }
}

