/* ============================================================
   SHOSTY DESIGN SYSTEM — shosty.css
   Version: 1.0 | March 2026
   Source of truth: brand/Shosty_Brand_Reference.md
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Primary palette */
  --desert:     #EBCFA7;
  --muesli:     #AB8C61;
  --xanadu:     #708D81;
  --mint:       #66FF99;
  --black:      #000000;
  --white:      #FFFFFF;

  /* Extended / neutrals */
  --sand-lt:    #F8F1E8;
  --sand-mid:   #F2E5D0;
  --xanadu-lt:  #EDF3F1;
  --muted:      #666666;
  --dark-grey:  #333333;
  --border:     #E0D5C5;

  /* Data visualisation */
  --neg:        #C0392B;
  --neg-lt:     #FDECEA;
  --pos:        #27AE60;
  --pos-lt:     #E8F8EF;

  /* Typography */
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing (4px base) */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 80px;

  /* Layout */
  --max-w:  1280px;
  --radius: 8px;

  /* Transitions */
  --ease:   0.2s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  color: var(--dark-grey);
  background: var(--white);
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--muesli); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--dark-grey); }

/* ── Typography Scale ── */
.display, h1, h2, h3, h4 { font-family: var(--font); color: var(--black); }

.display {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: 36px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 28px; font-weight: 600; line-height: 1.25; }
h3 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 18px; font-weight: 600; line-height: 1.35; }

p { margin-bottom: var(--sp-md); max-width: 680px; }
p:last-child { margin-bottom: 0; }

.body-sm { font-size: 14px; line-height: 1.5; }
.ui-label { font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.04em; }

.section-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muesli);
  margin-bottom: var(--sp-sm);
}

.caption {
  font-size: 11px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.text-muted { color: var(--muted); }
.text-muesli { color: var(--muesli); }
.text-xanadu { color: var(--xanadu); }
.text-white { color: var(--white); }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: var(--sp-3xl) 0;
}

.section--sand { background: var(--sand-lt); }
.section--dark { background: var(--black); color: var(--white); }
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--white); }
.section--dark p { color: var(--desert); }
.section--xanadu-lt { background: var(--xanadu-lt); }

/* Grid */
.grid { display: grid; gap: var(--sp-xl); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Flexbox utilities */
.flex { display: flex; }
.flex--between { justify-content: space-between; }
.flex--center { align-items: center; }
.flex--col { flex-direction: column; }
.flex--gap-sm { gap: var(--sp-sm); }
.flex--gap-md { gap: var(--sp-md); }
.flex--gap-lg { gap: var(--sp-lg); }
.flex--gap-xl { gap: var(--sp-xl); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); filter: brightness(0.9); }
.btn:active { transform: translateY(0); filter: brightness(0.85); }
.btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* Primary — Muesli bg */
.btn--primary { background: var(--muesli); color: var(--white); border-color: var(--muesli); }
.btn--primary:hover { color: var(--white); }

/* Secondary — outlined */
.btn--secondary { background: var(--white); color: var(--muesli); border-color: var(--muesli); }
.btn--secondary:hover { background: var(--sand-lt); color: var(--muesli); }

/* Dark */
.btn--dark { background: var(--black); color: var(--white); border-color: var(--black); }
.btn--dark:hover { color: var(--white); }

/* Mint (sparingly) */
.btn--mint { background: var(--mint); color: var(--black); border-color: var(--mint); }

/* Ghost / tertiary */
.btn--ghost {
  background: transparent;
  color: var(--muesli);
  border-color: transparent;
  padding: 12px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn--ghost:hover { color: var(--dark-grey); transform: none; filter: none; }

/* Sizes */
.btn--sm { padding: 8px 18px; font-size: 12px; font-weight: 500; }
.btn--lg { padding: 16px 36px; font-size: 16px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--ease);
}

.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.card__accent { border-top: 3px solid var(--muesli); }
.card__accent--xanadu { border-top-color: var(--xanadu); }
.card__accent--mint { border-top-color: var(--mint); }

.card__body { padding: var(--sp-lg); }
.card__img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
}

.badge--offplan { background: var(--muesli); color: var(--white); }
.badge--resale { background: var(--xanadu); color: var(--white); }
.badge--rental { background: var(--desert); color: var(--dark-grey); }
.badge--pos { background: var(--pos-lt); color: var(--pos); }
.badge--neg { background: var(--neg-lt); color: var(--neg); }

/* ── KPI Card ── */
.kpi {
  text-align: center;
  padding: var(--sp-lg);
}

.kpi__value {
  font-size: 36px;
  font-weight: 700;
  color: var(--muesli);
  line-height: 1.1;
}

.kpi__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: var(--sp-xs);
}

/* ── Forms ── */
.form-group { margin-bottom: var(--sp-md); }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-grey);
  margin-bottom: var(--sp-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--dark-grey);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--muesli);
}

.form-input::placeholder { color: #aaa; }
.form-textarea { resize: vertical; min-height: 120px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ── Navigation ── */
.nav {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
}

.nav__logo img { height: 32px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  list-style: none;
}

.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--ease);
}

.nav__link:hover,
.nav__link--active { color: var(--white); border-bottom-color: var(--muesli); }

.nav__cta { margin-left: var(--sp-md); }

/* Mobile hamburger */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-sm);
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: all var(--ease);
}

/* ── Footer ── */
.footer { background: var(--sand-lt); padding: var(--sp-3xl) 0 var(--sp-xl); }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-xl);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.footer__heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: var(--sp-md);
}

.footer__links { list-style: none; }

.footer__links li { margin-bottom: var(--sp-sm); }

.footer__links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--ease);
}

.footer__links a:hover { color: var(--muesli); }

.footer__bottom {
  max-width: var(--max-w);
  margin: var(--sp-xl) auto 0;
  padding: var(--sp-lg) 28px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__legal { font-size: 11px; color: var(--muted); }

/* ── Hero ── */
.hero {
  background: var(--black);
  color: var(--white);
  padding: var(--sp-3xl) 0;
}

.hero h1, .hero .display { color: var(--white); }
.hero p { color: var(--desert); max-width: 600px; }

.hero__actions {
  display: flex;
  gap: var(--sp-md);
  margin-top: var(--sp-xl);
}

/* ── Article / Insights ── */
.article { max-width: 720px; margin: 0 auto; }
.article h2 { margin-top: var(--sp-xl); margin-bottom: var(--sp-md); }
.article h3 { margin-top: var(--sp-lg); margin-bottom: var(--sp-sm); }
.article ul, .article ol { margin-bottom: var(--sp-md); padding-left: var(--sp-lg); }
.article li { margin-bottom: var(--sp-sm); }

.article__meta {
  display: flex;
  gap: var(--sp-md);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--sp-xl);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin-bottom: var(--sp-lg); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--sand-lt);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:hover { background: var(--sand-lt); }

/* ── Listings Grid ── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl);
}

.listing-card__price {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: var(--sp-xs);
}

.listing-card__specs {
  display: flex;
  gap: var(--sp-md);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--sp-sm);
}

.listing-card__location {
  font-size: 13px;
  color: var(--muted);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  padding: var(--sp-lg);
  background: var(--sand-lt);
  border-radius: var(--radius);
  margin-bottom: var(--sp-xl);
}

.filter-bar .form-select {
  width: auto;
  min-width: 160px;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }

/* ── Responsive ── */

/* Tablet: 768–1024px */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: var(--sp-2xl) 0; }
  .container { padding: 0 var(--sp-md); }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  .display { font-size: 32px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }

  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: 1fr; }

  .listings-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }

  .nav__links { display: none; }
  .nav__toggle { display: block; }

  .hero__actions { flex-direction: column; }

  .filter-bar { flex-direction: column; }
  .filter-bar .form-select { width: 100%; }

  .footer__bottom { flex-direction: column; gap: var(--sp-sm); text-align: center; }
}

/* Mobile menu open state */
.nav--open .nav__links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--black);
  padding: var(--sp-lg) 28px var(--sp-xl);
  gap: var(--sp-md);
}

/* ============================================================
   UX POLISH — Animations, transitions & micro-interactions
   ============================================================ */

/* ── Scroll-reveal: DISABLED ──
   Animations were causing content to stay invisible due to
   IntersectionObserver timing issues. Content visibility > fancy effects.
   TODO: Re-enable with a simpler, more robust approach later.
   ─────────────────────────────────────────────────────────── */
.reveal,
.reveal.visible,
.reveal-stagger > *,
.reveal-stagger.visible > * {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Enhanced card interactions ── */
.card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.card:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Card image zoom on hover */
.card__img-wrap {
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card__img-wrap img {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card__img-wrap img {
  transform: scale(1.04);
}

/* ── Enhanced buttons ── */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  filter: none;
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.btn--primary:hover {
  background: #9a7d55;
  border-color: #9a7d55;
  color: var(--white);
}

/* Button shimmer effect */
.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}
.btn--primary:hover::after {
  left: 100%;
}

/* ── Hero enhancements ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 var(--sp-3xl);
}

/* Subtle gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  pointer-events: none;
}

/* Decorative accent line */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--muesli);
  border-radius: 2px;
}

/* ── Nav enhancements ── */
.nav {
  transition: background 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(0,0,0,0.92);
}
.nav--scrolled {
  box-shadow: 0 1px 12px rgba(0,0,0,0.2);
}

.nav__link {
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--muesli);
  transition: width 0.25s ease;
}
.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}
.nav__link:hover,
.nav__link--active {
  border-bottom-color: transparent;
}

/* ── KPI counter animation ── */
.kpi__value {
  transition: color 0.3s ease;
}
.kpi:hover .kpi__value {
  color: var(--xanadu);
}

/* ── Badge pulse for "Live" badges ── */
.badge--live {
  position: relative;
}
.badge--live::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8px;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateY(-50%) scale(1.4); }
}

/* ── Section dividers ── */
.section--sand::before,
.section--xanadu-lt::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--muesli);
  margin: 0 auto var(--sp-xl);
  border-radius: 1px;
}

/* ── Form input focus ring ── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--muesli);
  box-shadow: 0 0 0 3px rgba(171, 140, 97, 0.15);
}

/* ── Smooth image loading ── */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img.loaded {
  opacity: 1;
}

/* ── Listing card specifics ── */
.listing-card__price {
  transition: color 0.2s ease;
}
.card:hover .listing-card__price {
  color: var(--muesli);
}

/* ── Footer link underline animation ── */
.footer__links a {
  position: relative;
}
.footer__links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--muesli);
  transition: width 0.25s ease;
}
.footer__links a:hover::after {
  width: 100%;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 72px;
  left: 0;
  height: 2px;
  background: var(--muesli);
  z-index: 999;
  transition: width 0.1s linear;
}

/* ── Image gallery / lightbox ── */
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  max-height: 440px;
}
.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}
.gallery__img:first-child {
  grid-row: 1 / -1;
}
.gallery:hover .gallery__img {
  filter: brightness(0.92);
}
.gallery__more {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 16px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}
