/* LINQ by Raghava — Core Custom Styles & Design System */

:root {
  --color-light: #F7F4EF;
  --color-dune: #1A1918;
  --color-coffee: #2F201B;
  --color-pearl: #F3EFEA;
  --color-oslo: #8C827A;
}

/* Core Utility Tokens for Instant Rendering (FCP < 1.0s) */
.bg-light {
  background-color: #F7F4EF !important;
}

.bg-dune {
  background-color: #1A1918 !important;
}

.bg-coffee {
  background-color: #2F201B !important;
}

.bg-pearl {
  background-color: #F3EFEA !important;
}

.text-light {
  color: #F7F4EF !important;
}

.text-dune {
  color: #1A1918 !important;
}

.text-coffee {
  color: #2F201B !important;
}

.text-pearl {
  color: #F3EFEA !important;
}

/* Zero-FOUC Instant Layout & Modal Paint Rules */
header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  background-color: transparent !important;
  background: transparent !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

#mobile-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 9998 !important;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease !important;
}

#mobile-menu.visible,
#mobile-menu.translate-y-0 {
  transform: translateY(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#onload-lead-modal,
#amenities-lead-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease !important;
}

#onload-lead-modal.visible,
#amenities-lead-modal.visible,
#onload-lead-modal.opacity-100,
#amenities-lead-modal.opacity-100 {
  opacity: 1 !important;
  visibility: visible !important;
}

#entry-disclaimer-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: opacity 0.4s ease, visibility 0.4s ease !important;
}

#entry-disclaimer-modal.pointer-events-none {
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Custom Local Font: The Seasons (Digits 0-9 fall back to Poppins via unicode-range) */
@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-reg.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-bd.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-lt.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-it.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-bdit.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../The-Seasons/Demo_Fonts/Fontspring-DEMO-theseasons-ltit.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-FFFF;
}

.font-heading {
  font-family: 'The Seasons', 'Poppins', system-ui, sans-serif !important;
}

.font-body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif !important;
}

/* Critical Hero Section Layout & GPU Hardware Acceleration */
#hero-section {
  position: relative;
  height: 100vh;
  background-color: #1A1918;
  overflow: hidden;
}

#hero-text {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  text-align: center;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#hero-building {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#hero-bg,
#hero-logo-overlay {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Global Footer Background */
footer,
.bg-footer {
  background-color: #2F201B !important;
}

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

html {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background-color: var(--color-light);
  color: var(--color-dune);
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
}

/* Hide scrollbar for clean mobile nav scrolling */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  /* macOS renders synthetic-weight text heavily without this. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
  font-family: 'The Seasons', 'Poppins', system-ui, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-light);
}

::-webkit-scrollbar-thumb {
  background: var(--color-coffee);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-dune);
}

/* Lenis Smooth Scroll Styles */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Navigation Modal Transition */
#nav-modal {
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#nav-modal.open {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Accordion Transition */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
  opacity: 0;
}

.accordion-content.active {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease;
}

/* Utility Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Fullscreen Navigation Modal Open State */
#nav-modal {
  z-index: 9999 !important;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#nav-modal.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Sticky Section Stacking System — Desktop Only (>=768px) */
@media (min-width: 768px) {
  .sticky-card-section {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    will-change: transform;
  }
}

/* Mobile Responsive Flow (<768px) — Natural scroll without content cutoff */
@media (max-width: 767px) {
  .sticky-card-section {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-top: 5.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  /* Exception: Hero section on mobile must always remain 100vh / 100dvh full viewport height */
  #hero-section.sticky-card-section,
  #hero-section {
    position: relative !important;
    top: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #hero-bg-video-wrapper {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
  }
}

.sticky-card-section.bg-light {
  background-color: #F7F4EF !important;
}

.sticky-card-section.bg-dune {
  background-color: #1A1918 !important;
}

.sticky-card-section.bg-coffee {
  background-color: #2F201B !important;
}

/* Header Hero & Scroll Visibility States */
#site-header,
header {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease, color 0.3s ease, background-color 0.3s ease !important;
  will-change: transform, opacity;
}

#site-header.header-hidden,
header.header-hidden {
  transform: translateY(-100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#site-header.header-visible,
header.header-visible {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Light Theme Header (Active over light background sections) */
#site-header.header-theme-light,
header.header-theme-light {
  color: #1A1918 !important;
}

#site-header.header-theme-light img,
header.header-theme-light img {
  filter: brightness(0) !important;
  -webkit-filter: brightness(0) !important;
}

#site-header.header-theme-light nav a,
header.header-theme-light nav a {
  color: #1A1918 !important;
}

#site-header.header-theme-light nav a:hover,
header.header-theme-light nav a:hover {
  color: #F3EFEA !important;
  background-color: #1A1918 !important;
}

#site-header.header-theme-light #menu-btn span,
header.header-theme-light #menu-btn span {
  background-color: #1A1918 !important;
}

#site-header.header-theme-light a span,
header.header-theme-light a span {
  background-color: rgba(26, 25, 24, 0.3) !important;
}

/* Amenities Page Black Opacity Header Rule (Only on amenities.html) */
body:has(#amenities-split-section) #site-header,
#site-header.amenities-page-header,
header.amenities-page-header {
  background-color: rgba(26, 25, 24, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Dark Theme Header (Active over dark background sections, e.g. Hero, Footer) */
#site-header.header-theme-dark,
header.header-theme-dark {
  color: #F3EFEA !important;
}

#site-header.header-theme-dark img,
header.header-theme-dark img {
  filter: brightness(0) invert(1) !important;
  -webkit-filter: brightness(0) invert(1) !important;
}

#site-header.header-theme-dark nav a,
header.header-theme-dark nav a {
  color: #F3EFEA !important;
}

#site-header.header-theme-dark nav a:hover,
header.header-theme-dark nav a:hover {
  color: #1A1918 !important;
  background-color: #F3EFEA !important;
}

#site-header.header-theme-dark #menu-btn span,
header.header-theme-dark #menu-btn span {
  background-color: #F3EFEA !important;
}

#site-header.header-theme-dark a span,
header.header-theme-dark a span {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Mobile Menu Drawer Theme Transitions (< 768px) */
@media (max-width: 767px) {
  #mobile-menu {
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease, background-color 0.3s ease, color 0.3s ease !important;
  }

  #mobile-menu.menu-theme-light {
    background-color: rgba(247, 244, 239, 0.96) !important;
    color: #1A1918 !important;
    border-color: rgba(26, 25, 24, 0.1) !important;
  }

  #mobile-menu.menu-theme-light nav a {
    color: #1A1918 !important;
    border-color: rgba(26, 25, 24, 0.08) !important;
  }

  #mobile-menu.menu-theme-light nav a:hover {
    color: #F3EFEA !important;
    background-color: #1A1918 !important;
  }

  #mobile-menu.menu-theme-dark {
    background-color: rgba(26, 25, 24, 0.96) !important;
    color: #F3EFEA !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  #mobile-menu.menu-theme-dark nav a {
    color: #F3EFEA !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }

  #mobile-menu.menu-theme-dark nav a:hover {
    color: #1A1918 !important;
    background-color: #F3EFEA !important;
  }
}

/* Landlord Share Flats Highlighted Red Badge */
.landlord-badge {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.landlord-badge:hover {
  background-color: #b91c1c !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.6) !important;
  transform: scale(1.04) !important;
}

/* Mobile Native 100dvh CSS Scroll-Snap Deck (< 768px) */
@media (max-width: 767px) {

  /* Red Landlord Share Flats Badge Highlight on Mobile */
  .landlord-badge {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.5) !important;
  }

  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: none !important;
    scroll-snap-type: none !important;
    touch-action: none !important;
  }

  main[data-scroll-container] {
    height: auto !important;
    overflow: visible !important;
  }

  #hero-section,
  #about-everhorizon,
  #about-linq,
  #about-nest,
  #about-celestia,
  #video-section,
  #amenities,
  #location,
  #contact,
  #footer-section,
  .sticky-card-section {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
  }


  /* Mobile page swipes are controlled by main.js. Keep horizontal sliders and
     form/modal interactions native so they remain usable. */
  #amenities-track,
  .no-scrollbar,
  #mobile-menu,
  #mobile-menu *,
  #onload-lead-modal,
  #onload-lead-modal *,
  #amenities-modal,
  #amenities-modal *,
  #amenities-lead-modal,
  #amenities-lead-modal *,
  input,
  textarea,
  select,
  button,
  a {
    touch-action: auto !important;
  }

  /* Section Padding & Flex Adjustments for 100dvh Mobile Slides */
  .sticky-card-section {
    padding-top: 4.75rem !important;
    padding-bottom: 1.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Slide Headings Scaling */
  .sticky-card-section h2,
  .sticky-card-section h3 {
    font-size: clamp(1.3rem, 5.5vw, 1.85rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
  }

  /* Subheadings & Section Tags */
  .sticky-card-section .text-oslo {
    font-size: 0.65rem !important;
    letter-spacing: 0.16em !important;
    margin-bottom: 0.25rem !important;
  }

  /* Paragraph Text Scaling */
  .sticky-card-section p {
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    margin-bottom: 0.5rem !important;
  }

  /* Slide Image Card Heights for 100dvh Fit (Videos Untouched) */
  #about-linq img,
  #about-nest img,
  #about-celestia img,
  #amenities-preview-img img {
    max-height: 30vh !important;
    object-fit: cover !important;
    border-radius: 1rem !important;
  }

  #about-nest .w-full.md\:w-\[48\%\],
  #about-celestia .w-full.md\:w-\[48\%\] {
    height: 30vh !important;
    max-height: 30vh !important;
  }

  #location .location-map-card {
    height: 32vh !important;
    max-height: 32vh !important;
  }
}

/* Desktop Sticky Card Stacking (>= 768px) */
@media (min-width: 768px) {

  #hero-section,
  #about-everhorizon,
  #about-linq,
  #about-nest,
  #about-celestia,
  #video-section,
  #amenities,
  #location,
  #contact,
  #footer-section,
  .sticky-card-section {
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

#site-header.header-theme-light .landlord-badge,
header.header-theme-light .landlord-badge {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* Mobile Modal Scrolling Optimization */
#amenities-modal-card,
#amenities-lead-card,
#onload-lead-card {
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Hero Video Switching System */
@media (min-width: 768px) {
  #hero-video-desktop {
    display: block !important;
  }

  #hero-video-mobile {
    display: none !important;
  }
}

@media (max-width: 767px) {
  #hero-video-desktop {
    display: none !important;
  }

  #hero-video-mobile {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}

/* Ensure Footer Logos are Crisp Pure White */
footer img,
#footer-section img {
  filter: brightness(0) invert(1) !important;
  -webkit-filter: brightness(0) invert(1) !important;
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

footer img:hover,
#footer-section img:hover {
  opacity: 1;
}



/* Image Motion Effects & Micro-Animations */
@keyframes kenBurnsMotion {
  0% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1.04) translateY(-6px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

.animate-kenburns {
  animation: kenBurnsMotion 14s ease-in-out infinite;
}

@keyframes floatGentle {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-7px);
  }
}

.animate-float-gentle {
  animation: floatGentle 6s ease-in-out infinite;
}

/* Image Card Hover & Depth Parallax Styling */
.img-motion-card,
.story-gallery-img,
.location-map-card {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.img-motion-card img,
.story-gallery-img img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.img-motion-card:hover img,
.story-gallery-img:hover img {
  transform: scale(1.06) translateY(-4px) !important;
}


/* =====================================================================
   macOS / Safari Optimizations
   ===================================================================== */

/* Kill Safari's elastic rubber-band on the desktop full-page deck. Every
   step is a programmatic scroll, so an overscroll bounce only exposes the
   page background and desynchronises the section the controller thinks is
   active. */
@media (min-width: 768px) {

  html,
  body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
  }
}

/* Safari keeps painting the blurred backdrop of an element it has moved
   off-screen, which leaves a translucent band across the top of the hero
   while the header is hidden. Dropping the filter with the header removes
   the artifact and the compositing cost. */
#site-header.header-hidden,
header.header-hidden {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Retina: Safari resamples brightness/invert filtered logos on every
   composite unless they are promoted once. */
#site-header img,
header img,
footer img,
#footer-section img {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Safari has no `scrollbar-width`; the WebKit pseudo-elements above cover
   it, but overlay scrollbars on macOS still reserve a gutter inside
   scrollable modal cards unless this is explicit. */
#amenities-modal-card,
#amenities-lead-card,
#onload-lead-card {
  overscroll-behavior: contain;
}

/* Respect the macOS "Reduce motion" accessibility setting. */
@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  .animate-kenburns,
  .animate-float-gentle,
  .animate-fade-in {
    animation: none !important;
  }

  .img-motion-card:hover img,
  .story-gallery-img:hover img {
    transform: none !important;
  }
}
