/* ========== BASE ========== */
*, *::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: #C1666B;
  color: #FDFCFA;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FAF7F4;
}

::-webkit-scrollbar-thumb {
  background: #D4C0A8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #C1666B;
}

/* ========== HEADER ========== */
#site-header {
  background: transparent;
  transition: background 0.5s ease, box-shadow 0.5s ease, padding 0.5s ease;
}

#site-header.scrolled {
  background: rgba(250, 247, 244, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(44, 40, 37, 0.06);
}

/* ========== MOBILE MENU ========== */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

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

.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s 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; }

/* Menu icon animation */
#menu-icon.open #bar-top {
  transform: translateY(4px) rotate(45deg);
}

#menu-icon.open #bar-mid {
  opacity: 0;
  transform: scaleX(0);
}

#menu-icon.open #bar-bot {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.5rem;
}

/* ========== REVEAL ANIMATIONS ========== */
/* Content is visible by default — JS adds animated state for progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal-up,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal-up.revealed,
  .reveal-left.revealed,
  .reveal-right.revealed {
    opacity: 1;
    transform: none;
  }

  /* Default visible state — JS may add a class to trigger animation */
  .reveal-up.js-reveal,
  .reveal-left.js-reveal,
  .reveal-right.js-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ========== MENU HOVER ========== */
.menu-item-line {
  flex: 1;
  margin: 0 0.75rem;
  height: 1px;
  background-color: #E2D5C4;
  transition: background-color 0.3s ease;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
  .font-display {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .font-display {
    font-size: clamp(2.5rem, 6vw, 4rem);
  }
}

/* ========== FOCUS ========== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #C1666B;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ========== LOADING ========== */
.js-loading .reveal-up,
.js-loading .reveal-left,
.js-loading .reveal-right {
  opacity: 1;
  transform: none;
}
