/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #0a1626;
  --bg-2:      #0e1e34;
  --bg-3:      #142a47;
  --cream:     #f3ecdd;
  --cream-2:   #d9cdb0;
  --muted:     #93a0b3;

  --paper:     #faf8f4;
  --paper-2:   #f1ece1;
  --ink:       #12213b;
  --ink-mute:  #5b6b83;
  --line-light: rgba(18,33,59,0.12);

  --gold:      #c9a227;
  --gold-2:    #e8c96a;
  --green:     #5c7a4b;
  --green-2:   #3f5735;
  --line:      rgba(214,225,245,0.14);

  --serif:  "Fraunces", "Georgia", serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:   "JetBrains Mono", "IBM Plex Mono", monospace;

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

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@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(--cream);
  -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; }
ul { list-style: none; padding: 0; }
::selection { background: var(--gold); color: var(--bg); }
.icon { width: 1em; height: 1em; flex-shrink: 0; }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--cream); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 720px) { .container { padding-inline: 2.5rem; } }

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--gold-2);
  display: inline-block;
}
.kicker-center { justify-content: center; }
.kicker-center::before { display: none; }
.kicker-center::after {
  content: ""; width: 22px; height: 1px; background: var(--gold-2); display: inline-block;
}

.section { position: relative; padding-block: clamp(4rem, 9vw, 7.5rem); }
.section-light { background: var(--paper); color: var(--ink); }
.section-light .kicker { color: #a3801f; }
.section-light .kicker::before,
.section-light .kicker::after { background: #a3801f; }
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: 0.9rem; }
.section-title-white { color: #ffffff; margin-top: 0; }
.section-head .kicker { margin-bottom: 0; }
.section-head p { color: var(--cream-2); margin-top: 1rem; font-size: 1.05rem; }
.section-light .section-head p { color: var(--ink-mute); }
.section-head-center { max-width: 620px; margin-inline: auto; text-align: center; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section-head-center h2 { margin-top: 0.9rem; }
.section-head-center p { margin-top: 1rem; font-size: 1.05rem; color: var(--ink-mute); }

[data-reveal] {
  opacity: 0; transform: translateY(32px);
  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; }

/* =============================================================
   4. Typography components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  padding: 0.95rem 1.7rem;
  font-family: var(--sans); font-weight: 700; font-size: 0.86rem;
  letter-spacing: 0.03em; text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background .3s, color .3s;
  white-space: nowrap;
}
.btn .icon { width: 1.05em; height: 1.05em; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(0,0,0,0.35), 0 8px 18px rgba(201,162,39,0.22); }
.btn:active { transform: translateY(-1px); transition-duration: .12s; }

.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--gold-2); color: var(--gold-2); box-shadow: none; }
.btn-ghost-light { background: transparent; color: var(--ink); border: 1px solid var(--line-light); box-shadow: none; }
.btn-ghost-light:hover { border-color: var(--gold); color: #a3801f; box-shadow: none; }

.btn-huge {
  padding: 1.4rem 2.6rem;
  font-size: 1rem;
}

.card-link {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em;
  color: #a3801f;
  margin-top: 1.3rem;
}
.card-link .icon { transition: transform .35s var(--ease-out); }
.service-card-light:hover .card-link .icon { transform: translateX(4px); }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  padding-block: 0.85rem;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
  transition: padding .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav.is-scrolled {
  padding-block: 0.55rem;
  background: rgba(10,22,38,0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand img { width: 38px; height: 38px; }
.brand-lockup { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; color: var(--cream); }
.brand-sub {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-2);
}
.nav-links { display: none; align-items: center; gap: 1.9rem; font-size: 0.78rem; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; padding-block: 0.3rem; color: var(--muted);
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--gold-2);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--cream); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-actions .btn { padding: 0.65rem 1.25rem; font-size: 0.74rem; }

.nav-burger {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px;
}
@media (min-width: 960px) { .nav-burger { display: none; } }
.nav-burger span { position: relative; width: 18px; height: 1.5px; background: var(--cream); display: block; }
.nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--cream);
  transition: transform .3s var(--ease-out);
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }

.nav-mobile {
  position: fixed; inset: 0; z-index: 95;
  background: var(--bg);
  display: grid; place-items: center;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile[data-open="true"] { clip-path: inset(0); }
.nav-mobile ul { display: flex; flex-direction: column; gap: 1.6rem; text-align: center; }
.nav-mobile a { font-family: var(--serif); font-size: 1.9rem; }
.nav-mobile-close {
  position: absolute; top: 1.3rem; right: 1.5rem;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  display: grid; place-items: center; font-size: 1.4rem;
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  padding-top: 7rem;
  padding-bottom: 4rem;
  isolation: isolate;
  overflow: clip;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
@media (min-width: 960px) {
  .hero { background: linear-gradient(90deg, var(--bg) 0%, var(--bg-2) 34%, #eef1f5 64%, #ffffff 100%); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  z-index: 1;
}

.hero-copy { max-width: 620px; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.6rem); }
.hero-title-logo {
  display: inline-block;
  height: 1.23em; width: auto;
  vertical-align: -0.2em;
  margin-right: 0.02em;
}
.brand-logo-inline {
  display: inline-block;
  height: 0.82em; width: auto;
  vertical-align: -0.1em;
  margin-right: 0.02em;
}
.hero-title .brandword { display: block; color: var(--cream); font-size: 0.6em; margin-top: 0.15em; }
.hero-tagline {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  color: var(--gold-2);
  margin-top: 1rem;
}
.hero-sub {
  margin-top: 1.4rem;
  max-width: 54ch;
  color: #ffffff;
  font-size: 1.05rem;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }

.hero-visual {
  position: relative;
  margin-top: 2.5rem;
  height: 280px;
  border-radius: 20px;
  overflow: hidden;
}
@media (min-width: 640px) { .hero-visual { height: 380px; } }
@media (min-width: 960px) {
  .hero-visual {
    position: absolute; z-index: 0;
    top: 0; right: 0; bottom: 0;
    width: 38%; height: auto;
    margin-top: 0;
    border-radius: 0;
  }
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; }
.hero-photo-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg-2) 0%, rgba(14,30,52,0.55) 12%, rgba(14,30,52,0.12) 26%, transparent 42%),
    linear-gradient(270deg, #ffffff 0%, rgba(255,255,255,0.5) 6%, transparent 16%);
  pointer-events: none;
}

/* =============================================================
   7. CTA banner ("¿No estás seguro...")
   ============================================================= */
.cta-banner {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  text-align: center;
  border-block: 1px solid var(--line-light);
  background: var(--paper);
}
.cta-banner .container { display: flex; flex-direction: column; align-items: center; gap: 1.8rem; }
.cta-question {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  max-width: 22ch;
  color: var(--ink);
}
.cta-banner .btn-huge { position: relative; }

/* =============================================================
   8. Services (light section)
   ============================================================= */
.services-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card-light {
  --rx: 0deg; --ry: 0deg;
  position: relative;
  padding: 2.1rem 1.8rem;
  background: #ffffff;
  border: 1px solid var(--line-light);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(18,33,59,0.02);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft), box-shadow .4s, border-color .4s;
}
.service-card-light:hover {
  transition-duration: .15s;
  border-color: rgba(201,162,39,0.35);
  box-shadow: 0 30px 60px -28px rgba(18,33,59,0.35);
}
.card-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(201,162,39,0.1);
  color: #a3801f;
  font-size: 1.4rem;
  transform: translateZ(30px);
}
.service-card-light h3 {
  font-size: 1.12rem; margin-top: 1.1rem; margin-bottom: 0.6rem;
  color: var(--ink);
  transform: translateZ(30px);
}
.service-card-light p { color: var(--ink-mute); font-size: 0.94rem; transform: translateZ(20px); text-align: justify; text-align-last: left; hyphens: auto; }

/* =============================================================
   9. Pillars
   ============================================================= */
.pillars {
  display: grid; gap: 2.2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.pillar h3 { font-size: 1.18rem; color: var(--gold-2); margin-bottom: 0.7rem; }
.pillar p { color: #ffffff; font-size: 0.98rem; text-align: justify; text-align-last: left; hyphens: auto; }


/* =============================================================
   11. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--line); padding-block: 3rem; background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.15rem; }
.footer-brand-sub { color: var(--muted); font-size: 0.7em; }
.footer-tagline { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; max-width: 34ch; }
.footer-col h4 { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.95rem; }
.footer-col a:hover { color: var(--gold-2); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; }

/* =============================================================
   12. Contact page
   ============================================================= */
.contact-hero { padding-top: 9rem; padding-bottom: 2rem; }
.contact-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); max-width: 18ch; }
.contact-hero p { color: var(--cream-2); margin-top: 1.1rem; max-width: 56ch; font-size: 1.05rem; }

.contact-wrap {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
  padding-bottom: 6rem;
}
@media (min-width: 900px) { .contact-wrap { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.contact-form { position: relative; }
.field { position: relative; margin-bottom: 1.3rem; }
.field label {
  display: block; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.5rem;
}
.field input, .field textarea {
  width: 100%; padding: 0.9rem 1rem;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  color: var(--cream); font: inherit;
  transition: border-color .3s, box-shadow .3s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}
.field textarea { min-height: 130px; resize: vertical; }

.cta-submit {
  position: relative; overflow: hidden;
  margin-top: 0.4rem;
}
.cta-submit .label, .cta-submit .spinner, .cta-submit .check {
  display: grid; place-items: center;
}
.cta-submit .spinner, .cta-submit .check { position: absolute; inset: 0; opacity: 0; }
.contact-form.is-sending .cta-submit .label { opacity: 0; }
.contact-form.is-sending .cta-submit .spinner { opacity: 1; }
.cta-submit .spinner::after {
  content: ""; width: 18px; height: 18px;
  border: 2px solid rgba(10,22,38,0.3); border-top-color: var(--bg);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-note { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }
.form-note a { color: var(--gold-2); }
.form-note a:hover { text-decoration: underline; }

.contact-success {
  display: none;
  padding: 2.4rem; border: 1px solid rgba(92,122,75,0.4); border-radius: 16px;
  background: rgba(92,122,75,0.08);
}
.contact-success.is-visible { display: block; }
.contact-success h3 { color: var(--green); font-size: 1.3rem; margin-bottom: 0.6rem; }
.contact-success p { color: var(--cream-2); }

.contact-error {
  display: none;
  margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 10px;
  background: rgba(180,70,50,0.12); border: 1px solid rgba(180,70,50,0.35);
  color: #e8c9c0; font-size: 0.92rem;
}
.contact-error.is-visible { display: block; }

.contact-side { border-left: 1px solid var(--line); padding-left: 0; }
@media (min-width: 900px) { .contact-side { padding-left: 2.5rem; } }
.contact-side h3 { font-size: 1.05rem; color: var(--gold-2); margin-bottom: 0.8rem; }
.contact-side p { color: #ffffff; font-size: 0.96rem; margin-bottom: 1.6rem; }

/* =============================================================
   13. Responsive
   ============================================================= */
@media (min-width: 540px)  { .hero-actions { flex-wrap: nowrap; } }

/* =============================================================
   14. Reduced motion — only intrusive effects
   ============================================================= */

/* =============================================================
   15. View transitions (multi-page)
   ============================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(root) { animation-name: fadeOutUp; }
::view-transition-new(root) { animation-name: fadeInUp; }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-10px); } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(10px); } }
