/* =============================================
   Kern's Penthouse — Custom Styles
   Classic & Elegant · Emerald + Cream
   ============================================= */

/* ---------- Base / Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
}

::selection {
  background: rgba(26, 58, 42, 0.2);
  color: #1a3a2a;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f5f0e8;
}
::-webkit-scrollbar-thumb {
  background: #a5d6a7;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #81c784;
}

/* ---------- Navbar ---------- */
#navbar {
  background: transparent;
  transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
  background: rgba(20, 45, 32, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(245, 240, 232, 0.08);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #f5f0e8;
  transition: width 0.3s ease;
}

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

/* ---------- Hero Animations ---------- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroImageFade {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-badge {
  animation: heroFadeUp 0.8s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-badge,
h1,
p,
.hero-image {
  animation: heroFadeUp 0.8s ease forwards;
}

h1 {
  animation-delay: 0.35s;
  opacity: 0;
}

.hero-image {
  animation: heroImageFade 1s ease forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

/* ---------- Reveal Animations (below fold) ---------- */
.reveal-section {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-badge,
  h1,
  p,
  .hero-image {
    animation: none;
    opacity: 1;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Mobile Menu ---------- */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* ---------- Mobile Menu Toggle ---------- */
#menu-toggle.active #bar-top {
  transform: translateY(4px) rotate(45deg);
}
#menu-toggle.active #bar-mid {
  opacity: 0;
  transform: scaleX(0);
}
#menu-toggle.active #bar-bot {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.5rem;
}

/* ---------- Form ---------- */
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(226, 213, 196, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(226, 213, 196, 0.08);
}

/* ---------- Button focus ---------- */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #f5f0e8;
  outline-offset: 2px;
}

/* ---------- Image aspect ratios ---------- */
img {
  max-width: 100%;
  height: auto;
}

/* ---------- Subtle pattern for cream sections ---------- */
.bg-cream-50,
.bg-cream-100 {
  background-color: #f5f0e8;
}

/* ---------- Transition polish ---------- */
a, button {
  transition: all 0.3s ease;
}

/* ---------- Print ---------- */
@media print {
  #navbar, #menu-toggle, #mobile-menu {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
}
