/* =====================================================
   FUGIR PARA SUL — Design System & Stylesheet
   =====================================================

   Token naming:
     --color-*    colours
     --font-*     font families
     --text-*     font sizes
     --lh-*       line heights
     --ls-*       letter spacing
     --sp-*       spacing scale
     --radius-*   border radii
     --shadow-*   box shadows
   ===================================================== */

:root {
  /* ---- Colours (derived from Figma usage patterns) ---- */
  --color-bg:         #f6ece3;              /* warm cream — page background     */
  --color-surface:    #ffffff;              /* white — card surfaces             */
  --color-text:       #202020;             /* near-black — primary text         */
  --color-text-muted: rgba(32,32,32,0.70); /* secondary / meta text             */
  --color-cta:        #01756c;             /* teal green — primary CTA button   */
  --color-cta-text:   #ffffff;
  --color-border:     #7d8385;             /* neutral grey — photo frame border */
  --color-ghost:      rgba(32,32,32,0.08); /* ghost button background           */
  --stroke-0:         #b08060;             /* deco-path stroke — warm mid-brown */

  /* ---- Typography ---- */
  --font-display: 'Fraunces', Georgia, serif;   /* headings / display */
  --font-body:    'Figtree', system-ui, sans-serif; /* body / labels  */
  --font-ui:      'DM Sans', system-ui, sans-serif; /* buttons / UI   */

  /* Font sizes (fluid via clamp where appropriate) */
  --text-xs:  0.875rem;  /* 14px — uppercase labels    */
  --text-sm:  1rem;      /* 16px — body copy, btn      */
  --text-md:  1.25rem;   /* 20px — hero tagline / CTA  */
  --text-lg:  2rem;      /* 32px — stat numbers        */
  --text-xl:  2.75rem;   /* 44px — section headings    */

  /* Line heights */
  --lh-tight:  1;
  --lh-normal: 1.5;

  /* Letter spacing */
  --ls-heading: -0.02em;  /* -0.88px at 44px */
  --ls-label:    0.10em;  /*  1.4px at 14px  */

  /* ---- Spacing scale ---- */
  --sp-1:  0.25rem;  /*  4px */
  --sp-2:  0.75rem;  /* 12px */
  --sp-3:  1.5rem;   /* 24px */
  --sp-4:  2rem;     /* 32px */
  --sp-5:  4rem;     /* 64px */
  --sp-6:  5rem;     /* 80px */
  --sp-7:  7.5rem;   /* 120px */

  /* ---- Radii ---- */
  --radius-sm:   4px;
  --radius-card: 16px;
  --radius-pill: 9999px;

  /* ---- Shadows ---- */
  --shadow-photo:
    0px 1px 2px  rgba(32,32,32,0.20),
    0px 8px 16px rgba(32,32,32,0.08);

  /* ---- Layout ---- */
  --page-max: 1280px;
  --nav-h:    5rem;    /* 80px */
}

/* =====================================================
   RESET & BASE
   ===================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  overflow-x: clip;
}

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

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

/* Display heading — Fraunces with variable-font personality */
.heading-xl {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, var(--text-xl));
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  font-variation-settings: 'SOFT' 0, 'WONK' 1; /* gives Fraunces its quirky charm */
  color: var(--color-text);
}

/* Body copy block with consistent paragraph spacing */
.body-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  line-height: var(--lh-normal);
  color: var(--color-text);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--lh-tight);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn:hover  { opacity: 0.85; }
.btn:active { opacity: 0.7; transform: scale(0.98); }

/* Primary — teal pill */
.btn--primary {
  background-color: var(--color-cta);
  color: var(--color-cta-text);
  padding: 0 var(--sp-3);
  height: 3rem;            /* 48px */
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* Hero CTA — larger variant */
.btn--lg {
  font-family: var(--font-body);
  font-size: var(--text-md);
  height: auto;
  padding: 1.25rem 2rem;
}

/* Language toggle — typography only; shape comes from btn--ghost */
.btn--lang {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--color-text);
}

/* Ghost — semi-transparent circle, icon-only */
.btn--ghost {
  background-color: var(--color-ghost);
  border-radius: var(--radius-pill);
  width: 3rem;
  height: 3rem;
  padding: 0;
  flex-shrink: 0;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.nav--opaque {
  background-color: var(--color-bg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.nav__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.nav--scrolled .nav__logo {
  opacity: 1;
  pointer-events: auto;
}
.nav__logo-symbol   { width: 40px;  height: 40px; }
.nav__logo-wordmark { height: 16px; width: auto; }

/* =====================================================
   HERO
   ===================================================== */

/* Clips photos vertically at 800px and horizontally at the viewport
   edge — wider than the 1280px hero, so photos show in cream margins */
.hero-outer {
  position: relative;
  z-index: auto;
  overflow: visible; /* body handles horizontal clip; photos bleed in all directions */
}

.hero {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* no overflow: hidden — photos can bleed into viewport margins */
}

/* Warm radial glow — the large circle behind everything */
.hero__circle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  z-index: -1; /* paints above page bg but below normal-flow elements (manifesto card) */
}

/* ---- Central content ---- */
.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Logo → tagline gap: 24px (Figma: logo bottom=366, tagline top=390) */
  gap: 24px;
  margin-top: 110px;
  text-align: center;
  padding: 0 var(--sp-3);
}

.hero__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Symbol → lettering gap: 24px (Figma: symbol height=120, lettering y=144) */
  gap: 24px;
}
.hero__logo-symbol   { width: 120px; height: 120px; }
.hero__logo-wordmark { width: 371px; max-width: 80vw; height: auto; }

.hero__tagline {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  line-height: var(--lh-tight);
}

/* Tagline → CTA gap: 40px (Figma: tagline bottom=410, CTA top=450) */
.hero__content .btn {
  margin-top: 16px; /* 24px base gap + 16px = 40px total */
}

/* ---- Stats row ---- */
/* Figma: numbers frame y=638 in 800px hero (includes 80px nav), pinned absolutely */
.hero__stats {
  position: absolute;
  top: 558px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4.5rem;
  white-space: nowrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--lh-tight);
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
  color: var(--color-text);
}

.stat__label {
  font-size: var(--text-sm);
  line-height: var(--lh-tight);
  color: var(--color-text);
}

.stat__stars {
  display: flex;
  gap: 2px;
}
.stat__stars img { width: 16px; height: 16px; }

/* ---- Scattered polaroid photos (desktop only) ---- */
.hero__photos {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  z-index: 10; /* float above the manifesto card on desktop */
}

/* ---- Photo frame border — color-burn blend overlaid on all picture frames ---- */
.hero__photo::after,
.gallery__photo::after,
.about__portrait::after,
.hero__polaroid::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 0.8px solid var(--color-border);
  border-radius: inherit;
  mix-blend-mode: color-burn;
  pointer-events: none;
  z-index: 2;
}

/* Shared photo frame style */
.hero__photo {
  position: absolute;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
  will-change: transform;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Positions mirror Figma coordinates (1280px canvas) */
/* Positions use Figma bounding-box coordinates (1280px canvas).
   Photos that extend beyond 0 or 1280px are intentionally partially
   off-screen at 1280px; at wider viewports they show more fully. */
.hero__photo--tl {
  width: 340px; height: 255px;
  left: -15px;  top: -56px;
  transform: rotate(-10deg);
}
.hero__photo--tr {
  width: 250px; height: 333px;
  right: -54px; top: 20px;
  transform: rotate(15deg);
}
.hero__photo--ml {
  width: 240px; height: 160px;
  left: -53px;  top: 305px;
  transform: rotate(4deg);
}
.hero__photo--mr {
  width: 214px; height: 160px;
  right: 161px; top: 610px;
  transform: rotate(6deg);
}
.hero__photo--bl {
  width: 230px; height: 301px;
  left: 85px;   top: 435px;
  transform: rotate(-15deg);
}
.hero__photo--br {
  width: 340px; height: 255px;
  right: -3px;  top: 339px;
  transform: rotate(-4deg);
}

/* ---- Hero polaroid pair (mobile/tablet only, hidden on desktop) ---- */
.hero__polaroids { display: none; }

.hero__polaroid {
  position: absolute;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
}
.hero__polaroid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__polaroid--back  { width: 190px; height: 128px; left: 0;  top: 0;    transform: rotate(-6deg); }
.hero__polaroid--front { width: 190px; height: 128px; right: 0; bottom: 0; transform: rotate(5deg); }

/* =====================================================
   SECTION WRAPPER
   ===================================================== */

.section {
  max-width: var(--page-max);
  margin: 0 auto;
}

/* =====================================================
   CARD — shared by Manifesto and About sections
   ===================================================== */

.card {
  /* Figma: white with subtle warm gradient overlay at bottom */
  background-image:
    linear-gradient(180deg, rgba(246,236,227,0) 30%, rgba(246,236,227,0.2) 100%),
    linear-gradient(90deg, #fff 0%, #fff 100%);
  border-radius: var(--radius-card);
  /* 24px outer gutter creates the floating-card look */
  margin: 0 var(--sp-3);
}

/* =====================================================
   MANIFESTO SECTION
   ===================================================== */

.section--manifesto {
  padding: var(--sp-4) 0;
  margin-top: -160px;
}

.section--manifesto .card {
  /* Figma: px-[340px] inside 1280px = deep centred column */
  padding: var(--sp-7) clamp(var(--sp-3), 26%, 340px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* =====================================================
   PROPERTIES SECTION
   ===================================================== */

.section--properties {
  position: relative;
  padding-bottom: var(--sp-5);
}

/* Decorative route path: faint centred line running through all properties */
.deco-path {
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 524px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Horizontal fade — makes the section edges bleed softly into the page bg */
.section--properties::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--color-bg)           0%,
    rgba(246,236,227,0)      20%,
    rgba(246,236,227,0)      80%,
    var(--color-bg)          100%
  );
  pointer-events: none;
  z-index: 2; /* above deco-path, below content */
}

/* Property article — two-column flex */
.property {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--sp-5);                    /* 64px gap */
  padding: var(--sp-7) var(--sp-7);    /* 120px all sides on desktop */
}

/* Even properties: gallery on right, so reverse direction */
.property--img-right { flex-direction: row-reverse; }

.property--pad-top-lg  { padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
.property--pad-top-sm  { padding-top: var(--sp-5); padding-bottom: var(--sp-5); }

/* Property text column */
.property__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0; /* prevent flex overflow */
}

.property__info .btn {
  align-self: flex-start;
}

.property__header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.property__location {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: var(--lh-normal);
}

.property__title-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.property__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-normal);
}

/* =====================================================
   GALLERY — CSS Grid, large photo + 2 stacked
   ===================================================== */

.gallery {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.5rem;
  width: 480px;
  height: 380px;
  flex-shrink: 0;
}

.gallery__photo {
  position: relative;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
}

.gallery__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__photo--1 {
  grid-column: 1;
  grid-row: 1 / 3;
}

.gallery__photo--2 { grid-column: 2; grid-row: 1; }
.gallery__photo--3 { grid-column: 2; grid-row: 2; }

/* Mirrored (properties 2 & 4): large photo on right, same proportions as default */
.gallery--mirrored { grid-template-columns: 2fr 3fr; }
.gallery--mirrored .gallery__photo--1 { grid-column: 2; grid-row: 1 / 3; }
.gallery--mirrored .gallery__photo--2 { grid-column: 1; grid-row: 1; }
.gallery--mirrored .gallery__photo--3 { grid-column: 1; grid-row: 2; }

/* =====================================================
   ABOUT SECTION
   ===================================================== */

.section--about {
  padding-bottom: var(--sp-3);
}

/* About card: portraits absolutely positioned on left, text on right */
.card--about {
  position: relative;
  padding: var(--sp-6) 200px var(--sp-6) 480px; /* leave room for portraits */
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 320px;
}

.about__content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Portrait cluster — single landscape polaroid */
.about__portraits {
  position: absolute;
  left: 113px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about__portrait {
  width: 300px;
  height: 200px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
  transform: rotate(4deg);
  flex-shrink: 0;
}
.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

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

.footer {
  max-width: var(--page-max);
  margin: 0 auto;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5.5rem; /* 88px */
  padding: 0 var(--sp-4);
}

.footer__copy {
  font-size: var(--text-xs);
  line-height: var(--lh-normal);
  white-space: nowrap;
}

/* =====================================================
   RESPONSIVE — mobile-first overrides
   ===================================================== */

/* ---- Small / Mobile (< 640px) ---- */
@media (max-width: 639px) {


  /* Hero */
  .hero { min-height: auto; padding-bottom: var(--sp-4); }
  .hero__photos { display: none; }
  .hero__content { margin-top: var(--sp-4); }
  .hero__logo-symbol   { width: 80px; height: 80px; }
  .hero__logo-wordmark { width: 240px; }
  .hero__tagline { font-size: var(--text-sm); }
  .hero__stats {
    position: static;
    transform: none;
    margin-top: var(--sp-4);
    gap: var(--sp-4);
  }
  .hero__polaroids {
    display: block;
    position: relative;
    z-index: 2;
    width: 300px;
    height: 180px;
    margin-top: 6rem;
    flex-shrink: 0;
  }

  /* Cards */
  .section--manifesto { margin-top: -80px; padding-top: 0; padding-bottom: var(--sp-4); }
  .section--manifesto .card { padding: 96px var(--sp-3) var(--sp-6); }

  /* Properties: stack vertically */
  .property,
  .property--img-right {
    flex-direction: column;
    padding: var(--sp-5) var(--sp-3);
    gap: var(--sp-3);
  }

  /* Gallery: photos first, full width */
  .property .gallery { order: -1; }
  .gallery { width: 100%; height: 220px; }

  /* About card: portraits float above card, card slides up under them */
  .card--about {
    margin-top: 140px;
    padding: 136px var(--sp-3) var(--sp-4);
  }
  .section--about { padding-bottom: var(--sp-4); }
  .about__portraits {
    top: -140px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Footer */
  .footer__copy { font-size: 0.75rem; }
}

/* ---- Medium / Tablet (640px – 1023px) ---- */
@media (min-width: 640px) and (max-width: 1023px) {

  /* Hero: hide scattered photos */
  .hero__photos { display: none; }
  .hero { min-height: auto; padding-bottom: var(--sp-4); }
  .hero__content { margin-top: var(--sp-6); }
  .section--manifesto { margin-top: -90px; padding-top: 0; }
  .hero__logo-symbol   { width: 100px; height: 100px; }
  .hero__logo-wordmark { width: 300px; }
  .hero__stats {
    position: static;
    transform: none;
    margin-top: var(--sp-4);
  }
  .hero__polaroids {
    display: block;
    position: relative;
    z-index: 2;
    width: 340px;
    height: 200px;
    margin-top: 6rem;
    flex-shrink: 0;
  }
  .section--manifesto .card { padding: 106px var(--sp-4) var(--sp-6); }
  .section--manifesto { padding-bottom: var(--sp-4); }

  /* Properties: stack on tablet */
  .property,
  .property--img-right {
    flex-direction: column;
    padding: var(--sp-5) var(--sp-4);
    gap: var(--sp-3);
  }

  /* Gallery: full width at tablet */
  .gallery { width: 100%; height: 300px; }

  /* About card: portraits float above card, card slides up under them */
  .card--about {
    margin-top: 140px;
    padding: 136px var(--sp-4) var(--sp-4);
  }
  .section--about { padding-bottom: var(--sp-4); }
  .about__portraits {
    top: -140px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ---- Large / Desktop (≥ 1024px) ---- */
@media (min-width: 1024px) {
  /* Everything shows as designed */
  .hero__photos { display: block; }
  .deco-path    { display: block; }

  /* Restore about card side-by-side */
  .card--about {
    margin-top: 0;
    padding: var(--sp-6) 200px var(--sp-6) 480px;
  }
  .about__portraits {
    top: 50%;
    left: 113px;
    transform: translateY(-50%);
  }
}
