/* ==========================================================
   NAKARY RAMIREZ — REAL ESTATE · MADEIRA ISLAND
   Stylesheet v1.2 — Type fix + unified bottom alignment system
   ========================================================== */

/* ----------- TOKENS / VARIABLES ----------- */
:root {
  /* Color palette */
  --bg:        #F5F5F5;   /* Matches the video AI background to hide the seam */
  --bg-soft:   #ECE5D7;   /* Soft cream — alt sections (Pillars, About, Testimonial) */
  --ink:       #0E0E0E;   /* Black — primary text & elements */
  --ink-soft:  #6B6863;   /* Muted gray-brown — body text */
  --ink-mute:  #A8A39A;   /* Light gray — meta, eyebrows */
  --line:      rgba(14, 14, 14, 0.12);
  --line-soft: rgba(14, 14, 14, 0.06);
  --accent:    #0E2A47;   /* Deep ocean blue — accent (rare use) */

  /* Typography */
  --font-display:    'Bodoni Moda', 'Didot', Georgia, serif;     /* "NAKARY" only */
  --font-script:     'Dancing Script', cursive;                  /* "Ramirez" only */
  --font-editorial:  'Playfair Display', Georgia, serif;         /* taglines, headlines */
  --font-sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w:        1280px;
  --gutter:       clamp(20px, 5vw, 64px);
  --section-pad:  clamp(80px, 12vh, 160px);
}

/* ----------- RESET ----------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ----------- ANIMATABLE INITIAL STATES -----------
   Hidden by JS (will-animate flag) to prevent flash before GSAP runs.
   Once GSAP attaches, it overrides these with animation. */
.js-animate .name-display .letter,
.js-animate .name-script,
.js-animate .hero-rule,
.js-animate .hero-eyebrow,
.js-animate .hero-tagline,
.js-animate .hero-cta .btn,
.js-animate .hero-house,
.js-animate .hero-portrait {
  opacity: 0;
}

/* ============================================================
   UNIFIED VISUAL STAGE
   Single rule for all sections with character + background image.
   Both images are positioned absolutely with bottom: 0 so they
   align at the section's bottom edge — section's color change
   acts as the visual cut.
   ============================================================ */
.visual-stage {
  position: relative;
  height: 90vh;
  min-height: 620px;
  overflow: hidden;          /* clip — images never invade adjacent columns */
}
.visual-stage img,
.visual-stage video {
  position: absolute;
  bottom: 0;                  /* THE rule: pin everything to the bottom */
  object-fit: contain;
  object-position: bottom center;
}
/* Background layer: house / scenery — full height so its box reaches the bottom */
.visual-bg {
  z-index: 1;
  height: 100%;
  width: auto;
}
/* Foreground layer: Nakary — taller, in front */
.visual-fg {
  z-index: 2;
  height: 100%;               /* Full height of stage */
  width: auto;
}

/* ----------- COMMON ----------- */
.section {
  padding: var(--section-pad) var(--gutter);
  position: relative;
  overflow: hidden;
}
/* Sections that contain a visual-stage: remove bottom padding so
   images touch the bottom and the next section's bg color recovers them */
.section--hero,
.section--construction,
.section--about,
.section--testimonial {
  padding-bottom: 0;
}
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 24px;
}
.section-headline {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 28px;
}
.section-headline em {
  font-style: italic;
  font-family: var(--font-editorial);
  color: var(--accent);
}
.section-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 480px;
}
.btn {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 16px 32px;
  border: 0.5px solid var(--ink);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn--secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--bg-soft);
}
.btn--secondary:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Hero CTA group: two buttons side by side */
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px var(--gutter);
  background: rgba(245, 245, 245, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 0.5px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink);
}
.nav-links {
  display: flex;
  gap: 38px;
}
.nav-links a {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--accent); }

/* ============================================================
   01 · HERO
   ============================================================ */
.section--hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--section-pad) + 40px);
}
.hero-grid {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: end; /* hero-text bottom-aligned with visual-stage bottom */
  position: relative;
  z-index: 2;
}
.hero-text {
  z-index: 3;
  position: relative;
  padding-bottom: var(--section-pad);
}

.hero-name {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
  line-height: 0.95;
}
/* "NAKARY" — Bodoni Moda 400, fine and elegant */
.name-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(4.6rem, 9.6vw, 8.4rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 0.9;
  display: inline-block;
   white-space: nowrap;
  /* Each letter wrapped in .letter for stagger animation */
}
.name-display .letter {
  display: inline-block;
  /* Initial state controlled by JS to prevent flash */
}
/* "Ramirez" — Dancing Script, classic signature style, slight inclination */
.name-script {
  font-family: var(--font-script);
  font-size: clamp(3rem, 6.5vw, 5rem);
  font-weight: 400;
  color: var(--ink);
  margin-top: -0.2em;
  margin-left: 0.2em;
  line-height: 1.3;                /* Room for descenders (the tail of the z) */
  display: inline-block;
  padding-bottom: 0.2em;           /* Extra room so "z" tail isn't clipped */
  /* Clip-path animated by JS to simulate handwriting (left to right reveal) */
  clip-path: inset(0 100% 0 0);
}
.hero-rule {
  width: 48px;
  height: 1px;
  background: var(--ink);
  margin: 0 0 16px;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 28px;
}
.hero-tagline {
  font-family: var(--font-editorial);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.25;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 40px;
}
.hero-tagline em {
  font-style: italic;
  color: var(--accent);
}
/* Hero visual: house behind on the right, Nakary in front on the left */
.hero-house {
  right: 0;
  left: auto;
  width: auto;
  height: 100%;
}
.hero-portrait {
  left: 15%;
  right: auto;
  height: 100%;
  width: auto;
}
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  z-index: 6;
}
.scroll-line {
  width: 32px;
  height: 0.5px;
  background: var(--ink-mute);
}

/* ============================================================
   02 · PILLARS
   ============================================================ */
.section--pillars {
  background: var(--bg-soft);
  padding-top: 80px;
  padding-bottom: 80px;
}
.pillars-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.pillar-icon {
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
}
.pillar-label {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.pillar-divider {
  width: 0.5px;
  height: 60px;
  background: var(--line);
}

/* ============================================================
   03 · CONSTRUCTION
   ============================================================ */
.construction-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: end;
  position: relative;
  z-index: 2;
}
.construction-text {
  padding-bottom: var(--section-pad);
}
/* Old house behind, Nakary in front — both clamped inside the visual column */
.construction-house {
  left: 0;
  right: auto;
  width: auto;
  height: 100%;
}
.construction-video {
  left: 0;
  right: auto;
  width: auto;
  height: 65%;
  opacity: 0;
  pointer-events: none;
}
.construction-portrait {
  right: 15%;
  left: auto;
  height: 100%;
  width: auto;
}
.construction-helmet {
  position: absolute;
  top: 4%;
  right: 14%;
  width: 100px;
  height: auto;
  object-fit: contain;
  opacity: 0; /* Activated by scroll animation later */
  z-index: 4;
}

/* ============================================================
   04 · ABOUT
   ============================================================ */
.section--about { background: var(--bg-soft); }
.about-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  position: relative;
  z-index: 2;
}
.about-text {
  padding-bottom: var(--section-pad);
}
.stats-row {
  display: flex;
  gap: 48px;
  margin-top: 56px;
  border-top: 0.5px solid var(--line);
  padding-top: 32px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--font-editorial);
  font-size: 38px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.about-portrait {
  left: 50%;
  transform: translateX(-50%);
}

/* ============================================================
   05 · QUICK ACTIONS
   ============================================================ */
.section--actions {
  padding-top: 80px;
  padding-bottom: 80px;
}
.actions-row {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--ink-soft);
  transition: color 0.3s ease, transform 0.3s ease;
}
.action:hover {
  color: var(--accent);
  transform: translateY(-2px);
}
.action-icon {
  width: 32px;
  height: 32px;
}
.action-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
}
.action-divider {
  width: 0.5px;
  height: 56px;
  background: var(--line);
}

/* ============================================================
   06 · TESTIMONIAL
   ============================================================ */
.section--testimonial { background: var(--bg-soft); }
.testimonial-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 48px;
  align-items: end;
  position: relative;
  z-index: 2;
}
.testimonial-image {
  border-radius: 4px;
  overflow: hidden;
  align-self: center;
  margin-bottom: var(--section-pad);
}
.testimonial-image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}
.testimonial-quote {
  text-align: center;
  position: relative;
  padding: 40px 20px;
  align-self: center;
  margin-bottom: var(--section-pad);
}
.quote-mark {
  font-family: var(--font-editorial);
  font-size: 80px;
  line-height: 0.5;
  color: var(--accent);
  display: inline-block;
  vertical-align: top;
}
.quote-mark--end { vertical-align: bottom; }
.testimonial-quote blockquote {
  font-family: var(--font-editorial);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  margin: 16px 0;
  font-style: italic;
}
.testimonial-quote cite {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 28px;
  font-style: normal;
}
.cite-name {
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--ink);
}
.cite-role {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
/* Testimonial portrait: same visual-stage logic */
.testimonial-portrait {
  height: 90vh;
  min-height: 540px;
}
.testimonial-portrait img {
  left: 50%;
  transform: translateX(-50%);
}

/* ============================================================
   07 · FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 80px var(--gutter) 32px;
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
  border-bottom: 0.5px solid rgba(244, 239, 230, 0.15);
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.32em;
}
.footer-tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.5);
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.footer-contact a {
  font-size: 13px;
  color: rgba(244, 239, 230, 0.85);
  transition: color 0.3s ease;
}
.footer-contact a:hover { color: var(--bg); }
.footer-base {
  max-width: var(--max-w);
  margin: 32px auto 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.35);
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px) {
  .hero-grid,
  .construction-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .visual-stage { height: 70vh; min-height: 480px; }
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .testimonial-image img { height: 360px; }
  .testimonial-portrait { height: 60vh; min-height: 420px; }
  .pillars-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .pillar-divider { display: none; }
  .hero-text,
  .construction-text,
  .about-text { padding-bottom: 0; }
  .testimonial-image,
  .testimonial-quote { margin-bottom: 0; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 640px) {
  :root { --section-pad: 80px; }
  .navbar { padding: 16px var(--gutter); }
  .nav-links { display: none; }
  .visual-stage { height: 60vh; min-height: 380px; }
  .actions-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .action-divider { display: none; }
  .stats-row {
    flex-wrap: wrap;
    gap: 28px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-contact { align-items: flex-start; }
}
