/* Global Styles & Variables */
:root {
  /* Brand Colors from PRD */
  --primary: #1E3A6E;
  --primary-dark: #142B52;
  --primary-light: #2A5298;
  --secondary: #F0A830;
  --secondary-light: #F7C35A;
  --secondary-dark: #D4911A;

  /* Backgrounds */
  --bg-light: #F8F7F4;
  --bg-dark: #0F2040;
  --bg-white: #FFFFFF;

  /* Text Colors */
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-on-primary: #FFFFFF;
  --text-on-secondary: #1E3A6E;

  /* UI Tokens */
  --border: #E4E4E4;
  --success: #2A7D4F;
  --error: #DC3545;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 16px 40px rgba(26, 26, 26, 0.12);

  /* Spacing */
  --container-max: 1240px;
  --gap: 24px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utility Section Spacing */
.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Creative Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  overflow: hidden;
  pointer-events: auto;
}

/* Split Doors styling */
.preloader__door {
  flex: 1;
  background-color: #0F2040;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  height: 100%;
}

.preloader__door--left {
  transform-origin: left center;
}

.preloader__door--right {
  transform-origin: right center;
}

/* Split open animation triggers */
.preloader.fade-out .preloader__door--left {
  transform: translateX(-100%);
}

.preloader.fade-out .preloader__door--right {
  transform: translateX(100%);
}

/* Centered content */
.preloader__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  text-align: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out .preloader__content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Horizon foundation line */
.preloader__horizon {
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  animation: growHorizon 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  position: relative;
  margin-bottom: 24px;
}

@keyframes growHorizon {
  to {
    width: 240px;
  }
}

/* Structural Pillars rising from horizon */
.preloader__structure {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.preloader__pillar {
  width: 4px;
  height: 0;
  background-color: var(--secondary);
  border-radius: 2px;
}

.preloader__pillar--1 {
  animation: risePillar1 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

.preloader__pillar--2 {
  animation: risePillar2 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
}

.preloader__pillar--3 {
  animation: risePillar3 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s forwards;
}

@keyframes risePillar1 {
  from { height: 0; }
  to { height: 35px; }
}

@keyframes risePillar2 {
  from { height: 0; }
  to { height: 50px; }
}

@keyframes risePillar3 {
  from { height: 0; }
  to { height: 35px; }
}

/* Brand text slide up */
.preloader__text-wrap {
  overflow: hidden;
  height: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preloader__brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 26px;
  color: white;
  letter-spacing: 8px;
  transform: translateY(100%);
  animation: slideUpBrand 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.2s forwards;
}

@keyframes slideUpBrand {
  to {
    transform: translateY(0);
  }
}

/* Ensure preloader container goes away completely after transition */
.preloader.fade-out {
  pointer-events: none;
  visibility: hidden;
  transition-delay: 0.8s; /* wait for door slide animation */
}

/* Luxury Text Shimmer Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0F2040;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__container {
  text-align: center;
  width: 90%;
  max-width: 400px;
}

/* Outlined text stroke drawing */
.shimmer-text {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawText 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawText {
  to {
    stroke-dashoffset: 0;
  }
}

/* Architectural line drawing */
.shimmer-line {
  stroke-dasharray: 250;
  stroke-dashoffset: 250;
  animation: drawLine 0.8s ease-in-out 0.5s forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Fill text with gold shimmer after drawing */
.shimmer-text-fill {
  opacity: 0;
  pointer-events: none;
  animation: fadeInFilled 0.5s ease-in 0.7s forwards;
}

@keyframes fadeInFilled {
  to {
    opacity: 1;
  }
}

.preloader__subtext-luxury {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #B4C6E7;
  letter-spacing: 12px;
  text-transform: uppercase;
  margin-top: 5px;
  opacity: 0;
  animation: fadeInSubtext 0.5s ease-out 0.9s forwards;
  padding-left: 12px;
}

@keyframes fadeInSubtext {
  to {
    opacity: 0.8;
  }
}
/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: 2px solid var(--secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 998;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--secondary);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(240, 168, 48, 0.35);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 80px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
