/* =============================================
   Haven & Code — Global Stylesheet v2
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Curated natural palette — inspired by waaark / qedgroup / ashortjourney ── */
  --cream:         #F0EDE6;          /* warm parchment ivory */
  --cream-dark:    #E5E0D6;          /* deeper stone */
  --white:         #FAFAF7;          /* off-white, never pure white */
  --ink:           #161C19;          /* deep forest near-black */
  --ink-soft:      #2A332E;          /* softer dark for body text */
  --brown:         #3D4840;          /* muted dark green-grey */
  --primary:       #3D6B52;          /* warm moss green — distinctive, human */
  --primary-dark:  #2E5140;          /* deeper moss */
  --primary-pale:  #EAF2EC;          /* very pale green tint */
  --amber:         #B8893A;          /* rich ochre/gold accent */
  --amber-pale:    #F5EDD8;          /* pale gold tint */
  --sage:          #5C8A75;          /* lighter sage for variety */
  --sage-pale:     #E8F2EE;          /* pale sage tint */
  --sky:           #3B6EAA;          /* muted slate blue */
  --sky-pale:      #E8EFF8;          /* pale blue tint */
  --mid:           #6B7570;          /* warm grey for body copy */
  --border:        #DDD8CE;          /* warm stone border */
  --border-dark:   #C8C2B5;          /* darker warm border */

  /* Typography */
  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-ui:      'Inter', sans-serif;

  /* Spacing */
  --section-pad:  6rem 0;
  --container:    1180px;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-lg:    24px;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(22,28,25,.07);
  --shadow-md:   0 4px 20px rgba(22,28,25,.1);
  --shadow-lg:   0 12px 48px rgba(22,28,25,.14);
  --shadow-warm: 0 8px 32px rgba(61,107,82,.22);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* =============================================
   TYPOGRAPHY
   ============================================= */

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.005em;
  color: var(--ink);
}

.lead {
  font-size: clamp(.975rem, 1.4vw, 1.1rem);
  line-height: 1.75;
  color: var(--mid);
  font-weight: 400;
}

.label {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
}

/* =============================================
   LAYOUT
   ============================================= */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: var(--section-pad); }

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2.5px;
  background: linear-gradient(90deg, var(--primary), var(--amber));
  transform-origin: left;
  transform: scaleX(0);
  z-index: 2000;
  transition: transform .05s linear;
  pointer-events: none;
}

/* =============================================
   NAVIGATION  —  Premium with animated underlines
   ============================================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}

.nav.scrolled {
  background: rgba(245,242,234,.98);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 rgba(22,28,25,.08), 0 4px 20px rgba(22,28,25,.06);
}

.nav.transparent { background: transparent; }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.3rem 1.5rem;
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .2s, transform .2s;
}
.nav__logo:hover { opacity: .85; transform: scale(1.02); }

/* Image logo — Haven & Code brand mark */
.nav__logo-img {
  height: 83px;
  width: auto;
  display: block;
  border-radius: 6px;
  transition: opacity .2s, transform .2s;
}
.nav__logo:hover .nav__logo-img { opacity: .88; transform: scale(1.02); }

/* Legacy mark (kept as fallback) */
.nav__logo-mark {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .2s;
  box-shadow: 0 2px 8px rgba(61,107,82,.3);
}
.nav__logo-mark svg { width: 17px; height: 17px; }
.nav__logo:hover .nav__logo-mark { background: var(--primary-dark); transform: scale(1.06); }

.nav__logo-text {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -.01em;
  transition: color .25s;
}
.nav.transparent .nav__logo-text { color: white; }
/* Interior pages — nav starts at top over dark hero, text must be white */
.nav.page-nav:not(.scrolled) .nav__links a { color: rgba(255,255,255,.85); }
.nav.page-nav:not(.scrolled) .nav__links a:hover { color: white; background: rgba(255,255,255,.1); }
.nav.page-nav:not(.scrolled) .nav__links a.active { color: white; }
.nav.page-nav:not(.scrolled) .nav__logo-text { color: white; }
.nav.page-nav:not(.scrolled) .nav__hamburger span { background: white; }

/* Desktop Links */
.nav__links {
  display: flex;
  align-items: center;
  gap: .15rem;
  list-style: none;
}

.nav__link-item { position: relative; }

.nav__links a {
  font-family: var(--font-ui);
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: .55rem .9rem;
  border-radius: 8px;
  display: block;
  transition: color .18s, background .18s, transform .18s cubic-bezier(.16,1,.3,1);
  position: relative;
}

/* Animated underline on hover */
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 3px; left: .9rem; right: .9rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--amber));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.16,1,.3,1);
}

.nav__links a:hover { color: var(--ink); background: rgba(22,28,25,.05); }
.nav__links a:hover::after,
.nav__links a.active::after { transform: scaleX(1); }
.nav__links a.active { color: var(--ink); font-weight: 600; }

.nav.transparent .nav__links a { color: rgba(255,255,255,.8); }
.nav.transparent .nav__links a:hover { color: white; background: rgba(255,255,255,.1); }
.nav.transparent .nav__links a.active { color: white; }
.nav.transparent .nav__links a::after { background: linear-gradient(90deg, white, rgba(255,255,255,.7)); }

/* CTA pill */
.nav__cta {
  background: var(--primary) !important;
  color: white !important;
  padding: .55rem 1.25rem !important;
  border-radius: 100px !important;
  font-size: .85rem !important;
  font-weight: 600 !important;
  transition: background .2s, transform .18s cubic-bezier(.16,1,.3,1), box-shadow .2s !important;
  letter-spacing: .01em !important;
  box-shadow: 0 2px 10px rgba(61,107,82,.28) !important;
}
.nav__cta::after { display: none !important; }
.nav__cta::before { display: none !important; }
.nav__cta:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(61,107,82,.38) !important;
  color: white !important;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.nav__hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: all .28s cubic-bezier(.16,1,.3,1);
}
.nav.transparent .nav__hamburger span { background: white; }

/* Mobile nav */
.nav__mobile {
  display: none;
  position: fixed; inset: 0;
  background: var(--white); z-index: 999;
  padding: 1.5rem 1.5rem 2rem;
  flex-direction: column;
  animation: slideInMobile .3s cubic-bezier(.16,1,.3,1);
}
@keyframes slideInMobile {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.nav__mobile.open { display: flex; }
/* Mobile nav logo */
.nav__mobile .nav__logo-img { height: 48px; }

.nav__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.nav__mobile-close {
  background: none; border: none;
  font-size: 1.6rem; cursor: pointer;
  color: var(--ink); line-height: 1;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background .2s;
}
.nav__mobile-close:hover { background: var(--cream); }

.nav__mobile-links {
  list-style: none;
  display: flex; flex-direction: column;
  gap: .15rem; flex: 1;
}
.nav__mobile-links a {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  padding: 1rem .5rem;
  border-bottom: 1px solid var(--border);
  transition: color .18s, padding-left .18s;
}
.nav__mobile-links a::after {
  content: '→';
  font-size: 1rem;
  color: var(--mid);
  transition: transform .18s, color .18s;
}
.nav__mobile-links a:hover { color: var(--primary); padding-left: .4rem; }
.nav__mobile-links a:hover::after { color: var(--primary); transform: translateX(4px); }

.nav__mobile-cta { margin-top: 1.75rem; }

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-ui);
  font-size: .9rem; font-weight: 600;
  border-radius: 100px;
  padding: .72rem 1.6rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
  line-height: 1;
  letter-spacing: .01em;
}

.btn--primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(61,107,82,.3); }

.btn--secondary { background: transparent; color: var(--ink); border-color: var(--border-dark); }
.btn--secondary:hover { background: var(--ink); color: white; border-color: var(--ink); transform: translateY(-1px); }

.btn--white { background: var(--white); color: var(--primary); border-color: var(--white); }
.btn--white:hover { background: var(--cream); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn--outline-white { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.4); backdrop-filter: blur(4px); }
.btn--outline-white:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.7); }

.btn--whatsapp { background: #25D366; color: white; border-color: #25D366; }
.btn--whatsapp:hover { background: #1fba5a; border-color: #1fba5a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,211,102,.28); }

.btn--lg { font-size: 1rem; padding: .88rem 2rem; }
.btn--sm { font-size: .78rem; padding: .45rem 1rem; }

/* =============================================
   CARDS
   ============================================= */

.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* =============================================
   SECTION HEADER
   ============================================= */

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header .label { display: inline-block; margin-bottom: .6rem; }
.section-header .display-lg { margin-bottom: .9rem; }
.section-header .lead { max-width: 580px; margin: 0 auto; }

/* =============================================
   PAGE HERO (interior pages)
   ============================================= */

.page-hero {
  background: var(--ink);
  padding: 9rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 70% 0%, rgba(61,107,82,.28) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(184,137,58,.1) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero__label { margin-bottom: .85rem; }
.page-hero__label .label { color: var(--amber); }

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: white;
  margin-bottom: 1.15rem;
  max-width: 760px;
  letter-spacing: -.02em;
}

.page-hero p {
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
  color: rgba(255,255,255,.6);
  max-width: 580px;
  line-height: 1.72;
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
  background: var(--ink);
  color: rgba(255,255,255,.6);
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand-name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  margin-bottom: .4rem;
}

.footer__tagline {
  font-size: .85rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  color: rgba(255,255,255,.45);
}

.footer__social { display: flex; gap: .6rem; }
.footer__social a {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6);
  transition: background .2s, color .2s;
  font-size: .82rem;
}
.footer__social a:hover { background: var(--primary); color: white; }

.footer__col-title {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: .9rem;
}

.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.footer__col ul a { font-size: .87rem; color: rgba(255,255,255,.58); transition: color .2s; }
.footer__col ul a:hover { color: white; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer__bottom p { font-size: .8rem; color: rgba(255,255,255,.3); }

.footer__bottom-links { display: flex; gap: 1.5rem; }
.footer__bottom-links a { font-size: .8rem; color: rgba(255,255,255,.3); transition: color .2s; }
.footer__bottom-links a:hover { color: rgba(255,255,255,.65); }

/* =============================================
   UTILITIES
   ============================================= */

.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-muted { color: var(--mid); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

.bg-cream { background: var(--cream); }
.bg-cream-dark { background: var(--cream-dark); }
.bg-ink { background: var(--ink); }

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }
.reveal-delay-5 { transition-delay: .5s; }

/* Ensure no-JS fallback and fast-loading pages show content */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --section-pad: 4rem 0; }
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  /* Logo bigger on mobile — fits within the existing header height */
  .nav__logo-img { height: 48px; }
}

@media (max-width: 480px) {
  .btn--lg { padding: .82rem 1.6rem; font-size: .92rem; }
}
