/**
 * AK GLOBAL INVEST — Master Stylesheet
 * 
 * Ultra-Premium Design System v2.0
 * Royal Bordo + Brushed Platinum + Cinematic Motion
 * 
 * This file supplements Tailwind with custom animations,
 * glassmorphism effects, fullscreen menu, and brand styling.
 */

/* ═══════════════════════════════════════════════════════════════ */
/* FOUNDATION                                                     */
/* ═══════════════════════════════════════════════════════════════ */

:root {
  --bordo: #6b0f2b;
  --bordo-hover: #8b1a3a;
  --bordo-dark: #4a0a1e;
  --bordo-logo: #440113;
  --platinum: #b8b8c0;
  --platinum-lt: #d4d4dc;
  --silver: #e8e8ee;
  --midnight: #0a0a0f;
  --dark-surface: #1a1a24;
  --snow: #f5f5f7;
  --gold-accent: #c9a96e;
  --font-public: Inter, system-ui, sans-serif;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
}

/* Smooth scrolling & font rendering */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-wrap: anywhere;
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.ak-image-fallback {
  background: #0a0a0f;
  object-fit: cover;
}

input,
select,
textarea,
button {
  font: inherit;
  min-width: 0;
}

main,
section,
article,
aside,
nav,
header,
footer {
  min-width: 0;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold-accent), white 8%);
  outline-offset: 3px;
}

/* Selection color */
::selection {
  background-color: var(--bordo);
  color: #fff;
}

::-moz-selection {
  background-color: var(--bordo);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════ */
/* NAVIGATION — Glassmorphism States                              */
/* ═══════════════════════════════════════════════════════════════ */

.nav-transparent {
  background: transparent;
}

.nav-scrolled {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* Nav link underline animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--bordo);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 70%;
}

/* Scrolled state nav links → bordo underline */
.nav-scrolled .nav-link::after {
  background: var(--bordo);
}

/* Dropdown items hover line */
.dropdown-item {
  position: relative;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--bordo);
  transition: width 0.3s ease;
}

.dropdown-item:hover::before {
  width: 3px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* FULLSCREEN OVERLAY MENU                                        */
/* ═══════════════════════════════════════════════════════════════ */

/* Menu link entrance stagger animation */
.menu-link {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-visible .menu-link {
  opacity: 1;
  transform: translateY(0);
}

.menu-visible .menu-link:nth-child(1) {
  transition-delay: 0.15s;
}
.menu-visible .menu-link:nth-child(2) {
  transition-delay: 0.22s;
}
.menu-visible .menu-link:nth-child(3) {
  transition-delay: 0.29s;
}
.menu-visible .menu-link:nth-child(4) {
  transition-delay: 0.36s;
}
.menu-visible .menu-link:nth-child(5) {
  transition-delay: 0.43s;
}
.menu-visible .menu-link:nth-child(6) {
  transition-delay: 0.5s;
}

/* Menu photo cards entrance (Bugatti-style) */
.menu-photo {
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-visible .menu-photo {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.menu-visible .menu-photo:nth-child(1) {
  transition-delay: 0.3s;
}
.menu-visible .menu-photo:nth-child(2) {
  transition-delay: 0.4s;
}
.menu-visible .menu-photo:nth-child(3) {
  transition-delay: 0.5s;
}

/* Menu contact info entrance */
.menu-contact {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity 0.5s ease 0.5s,
    transform 0.5s ease 0.5s;
}

.menu-visible .menu-contact {
  opacity: 1;
  transform: translateX(0);
}

/* Hamburger → X morphing */
.menu-line {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: center;
}

/* ═══════════════════════════════════════════════════════════════ */
/* HERO SECTION                                                   */
/* ═══════════════════════════════════════════════════════════════ */

/* Hero search bar select styling */
#hero select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

#hero select option {
  background: #1a1a24;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════ */
/* ANIMATIONS — Entrance & Scroll-triggered                       */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes kenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.08);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse-bordo {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(107, 15, 43, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(107, 15, 43, 0);
  }
}

@keyframes bordo-line-glow {
  0%,
  100% {
    opacity: 0.4;
    box-shadow:
      0 0 8px rgba(155, 40, 71, 0),
      0 0 20px rgba(155, 40, 71, 0);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 8px rgba(155, 40, 71, 0.3),
      0 0 20px rgba(155, 40, 71, 0.15);
  }
}

@keyframes bordo-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-bordo-line {
  animation: bordo-line-glow 3s ease-in-out infinite;
}

.bordo-line-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(155, 40, 71, 0.1) 20%,
    rgba(155, 40, 71, 0.6) 40%,
    rgba(155, 40, 71, 1) 50%,
    rgba(155, 40, 71, 0.6) 60%,
    rgba(155, 40, 71, 0.1) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation:
    bordo-shimmer 4s ease-in-out infinite,
    bordo-line-glow 3s ease-in-out infinite;
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}
.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-fade-in-down {
  animation: fadeInDown 0.6s ease forwards;
}
.animate-ken-burns {
  animation: kenBurns 25s ease infinite alternate;
}
.animate-float {
  animation: float 4s ease-in-out infinite;
}
.animate-scale-in {
  animation: scaleIn 0.5s ease forwards;
}
.animate-pulse-bordo {
  animation: pulse-bordo 2s ease infinite;
}

/* GSAP trigger states */
[data-gsap] {
  opacity: 0;
  transform: translateY(40px);
}

[data-gsap].gsap-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════ */
/* LISTING CARDS                                                  */
/* ═══════════════════════════════════════════════════════════════ */

/* Premium card hover effect */
article.group:hover {
  transform: translateY(-8px);
}

/* Image lazy load fade-in */
img[loading='lazy'] {
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════════ */
/* GLASSMORPHISM UTILITIES                                        */
/* ═══════════════════════════════════════════════════════════════ */

.glass {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(10, 10, 15, 0.75);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════ */
/* TYPOGRAPHY UTILITIES                                           */
/* ═══════════════════════════════════════════════════════════════ */

.heading-luxury {
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.08;
}

.font-serif,
.font-display {
  letter-spacing: 0 !important;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

.font-serif.font-bold.text-bordo,
.font-serif.font-semibold.text-bordo,
.text-bordo.font-serif.font-bold,
.text-bordo.font-serif.font-semibold,
[class*='text-bordo'].font-serif.font-bold,
[class*='text-bordo'].font-serif.font-semibold {
  font-family: var(--font-public, Inter, system-ui, sans-serif) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0 !important;
}

.text-gradient-bordo {
  background: linear-gradient(135deg, var(--bordo) 0%, var(--bordo-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Contrast normalization: keep the quiet-luxury tone without letting text disappear. */
.text-platinum {
  color: #7d828f !important;
}

.bg-midnight .text-platinum,
.bg-dark-surface .text-platinum,
[class*='bg-midnight'] .text-platinum,
[class*='bg-dark-surface'] .text-platinum {
  color: rgba(255, 255, 255, 0.68) !important;
}

.text-white\/15 { color: rgba(255, 255, 255, 0.34) !important; }
.text-white\/20 { color: rgba(255, 255, 255, 0.44) !important; }
.text-white\/25 { color: rgba(255, 255, 255, 0.50) !important; }
.text-white\/30 { color: rgba(255, 255, 255, 0.56) !important; }
.text-white\/35 { color: rgba(255, 255, 255, 0.62) !important; }
.text-white\/40 { color: rgba(255, 255, 255, 0.66) !important; }
.text-white\/45 { color: rgba(255, 255, 255, 0.70) !important; }
.text-white\/50 { color: rgba(255, 255, 255, 0.74) !important; }
.text-white\/55 { color: rgba(255, 255, 255, 0.76) !important; }
.text-white\/60 { color: rgba(255, 255, 255, 0.80) !important; }

.text-midnight\/20 { color: rgba(10, 10, 15, 0.48) !important; }
.text-midnight\/25 { color: rgba(10, 10, 15, 0.52) !important; }
.text-midnight\/30 { color: rgba(10, 10, 15, 0.58) !important; }
.text-midnight\/35 { color: rgba(10, 10, 15, 0.62) !important; }
.text-midnight\/40 { color: rgba(10, 10, 15, 0.66) !important; }
.text-midnight\/45 { color: rgba(10, 10, 15, 0.70) !important; }
.text-midnight\/50 { color: rgba(10, 10, 15, 0.74) !important; }
.text-midnight\/55 { color: rgba(10, 10, 15, 0.76) !important; }
.text-midnight\/60 { color: rgba(10, 10, 15, 0.80) !important; }

/* ═══════════════════════════════════════════════════════════════ */
/* BUTTONS                                                        */
/* ═══════════════════════════════════════════════════════════════ */

.btn-bordo {
  background: var(--bordo);
  color: #fff;
  transition: all 0.3s ease;
}

.btn-bordo:hover {
  background: var(--bordo-hover);
  box-shadow: 0 12px 40px rgba(107, 15, 43, 0.3);
  transform: translateY(-2px);
}

/* Outline version */
.btn-bordo-outline {
  background: transparent;
  color: var(--bordo);
  border: 2px solid var(--bordo);
  transition: all 0.4s ease;
}

.btn-bordo-outline:hover {
  background: var(--bordo);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(107, 15, 43, 0.2);
}

/* ═══════════════════════════════════════════════════════════════ */
/* BORDO THEME ACCENT ELEMENTS                                    */
/* ═══════════════════════════════════════════════════════════════ */

/* Bordo decorative top bar on sections */
.section-accent-top {
  position: relative;
}

.section-accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--bordo), transparent);
}

/* Bordo hover card */
.card-bordo-hover {
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-bordo-hover:hover {
  border-color: rgba(107, 15, 43, 0.15);
  box-shadow: 0 20px 60px rgba(107, 15, 43, 0.08);
}

/* Separator with bordo dot */
.separator-dot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.separator-dot::before,
.separator-dot::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--silver));
}

.separator-dot::after {
  background: linear-gradient(90deg, var(--silver), transparent);
}

/* ═══════════════════════════════════════════════════════════════ */
/* SCROLLBAR                                                      */
/* ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--platinum);
  border-radius: 3px;
}

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

/* ═══════════════════════════════════════════════════════════════ */
/* MOBILE REFINEMENTS                                             */
/* ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  [data-gsap] {
    opacity: 1 !important;
    transform: none !important;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .container,
  [class*='max-w-7xl'],
  [class*='max-w-6xl'],
  [class*='max-w-5xl'],
  [class*='max-w-4xl'] {
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p,
  a,
  span,
  button {
    overflow-wrap: anywhere;
  }

  .nav-scrolled {
    background: rgba(255, 255, 255, 0.95);
  }

  /* Mobile menu text stagger */
  .mobile-nav-link {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
  }

  .mobile-nav-link:nth-child(1) {
    animation-delay: 0.1s;
  }
  .mobile-nav-link:nth-child(2) {
    animation-delay: 0.15s;
  }
  .mobile-nav-link:nth-child(3) {
    animation-delay: 0.2s;
  }
  .mobile-nav-link:nth-child(4) {
    animation-delay: 0.25s;
  }
  .mobile-nav-link:nth-child(5) {
    animation-delay: 0.3s;
  }
  .mobile-nav-link:nth-child(6) {
    animation-delay: 0.35s;
  }
  .mobile-nav-link:nth-child(7) {
    animation-delay: 0.4s;
  }
  .mobile-nav-link:nth-child(8) {
    animation-delay: 0.45s;
  }

  /* Smaller hero title on mobile */
  #hero h1 span {
    letter-spacing: 0.02em !important;
  }
}

/* Small screens hero search tweaks */
@media (max-width: 1024px) {
  #hero .absolute.bottom-0 {
    position: relative;
    margin-top: -60px;
  }
}

@media (max-width: 640px) {
  #hero .absolute.bottom-0 {
    margin-top: -40px;
  }
}

/* Safe area for iPhone notch */
@supports (padding: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  header {
    padding-top: env(safe-area-inset-top);
  }
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.mobile-action-dock {
  transform: translateZ(0);
}

.mobile-dock-item {
  min-height: 54px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-dock-item:active {
  transform: scale(0.97);
}

.mobile-dock-primary {
  background: var(--bordo);
  color: #fff;
}

.mobile-dock-item:not(.mobile-dock-primary):hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

@media (max-width: 1023px) {
  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  #wa-widget {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-action-dock {
    left: .75rem;
    right: .75rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .mobile-dock-item {
    min-height: 50px;
    font-size: 9px;
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Marquee performance */
.showcase-marquee {
  will-change: transform;
}

/* Hide scrollbar utility */
.scrollbar-hide {
  -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
@supports (scrollbar-width: none) {
  .scrollbar-hide {
    scrollbar-width: none;
  }
}

/* ═══════════════════════════════════════════════════════════════ */
/* PRINT STYLES                                                   */
/* ═══════════════════════════════════════════════════════════════ */

@media print {
  header,
  footer,
  .fixed {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  a {
    text-decoration: underline;
  }
}
