/* ============================================
   DR TARLE — Custom Styles
   ============================================ */

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

body {
  overflow-x: hidden;
}

/* --- Header --- */
#site-header {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
  background: rgba(30, 25, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15);
}

.nav-link {
  position: relative;
}

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

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

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

#mobile-menu.open .mobile-nav-link {
  animation: fadeUp 0.35s ease forwards;
}

#mobile-menu.open .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }

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

/* --- Hero --- */
.hero-bg {
  will-change: transform;
}

.hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(30, 25, 22, 0.55) 0%,
    rgba(30, 25, 22, 0.70) 50%,
    rgba(30, 25, 22, 0.85) 100%
  );
}

.hero-eyebrow {
  animation: fadeInDown 0.8s ease both;
}

.hero-eyebrow ~ h1 {
  animation: fadeInUp 0.8s ease 0.15s both;
}

.hero-eyebrow ~ p {
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-eyebrow ~ div > a:first-child {
  animation: fadeInUp 0.8s ease 0.45s both;
}

.hero-eyebrow ~ div > a:nth-child(2) {
  animation: fadeInUp 0.8s ease 0.55s both;
}

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

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

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #B85C38;
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 16px rgba(184, 92, 56, 0.3);
}

.btn-primary:hover {
  background: #a34e2f;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(184, 92, 56, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Stagger children */
.card-service {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Scroll Dot --- */
.scroll-dot {
  animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { top: 0; }
  50% { top: calc(100% - 12px); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .card-service {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-eyebrow, .hero-eyebrow ~ h1, .hero-eyebrow ~ p,
  .hero-eyebrow ~ div > a:first-child, .hero-eyebrow ~ div > a:nth-child(2) {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .scroll-dot { animation: none; }
  .animate-pulse { animation: none; }
}

/* --- Mobile Menu Button Animation --- */
.menu-line:nth-child(1) {
  transform-origin: center;
}
.menu-line:nth-child(2) {
  transform-origin: center;
}
.menu-line:nth-child(3) {
  transform-origin: center;
}

body.menu-open .menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
body.menu-open .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.menu-open .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 5 !important;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f5f0ea;
}
::-webkit-scrollbar-thumb {
  background: #d4b896;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #B85C38;
}

/* --- Select dropdown arrow --- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* --- Focus visible --- */
*:focus-visible {
  outline: 2px solid #B85C38;
  outline-offset: 2px;
  border-radius: 4px;
}
