/**
 * Gone to the Dogs — visual polish layer
 * Builds on styles.css: same palette & structure, more depth, clarity, and accessibility.
 */

/* --- Page background: subtle warmth (replaces flat wash) --- */
body {
  background: linear-gradient(180deg, #fafaf8 0%, #f7f6f2 45%, #fafafa 100%);
  background-attachment: fixed;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    background-attachment: scroll;
  }
}

/* --- Hero: soft gold atmosphere + film grain (motion-safe, desktop only — saves GPU on phones) --- */
@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  .hero::after {
    content: '';
    position: absolute;
    inset: -25%;
    z-index: 1;
    pointer-events: none;
    background:
      radial-gradient(ellipse 70% 48% at 28% 28%, rgba(212, 175, 55, 0.1), transparent 58%),
      radial-gradient(ellipse 55% 45% at 78% 72%, rgba(255, 255, 255, 0.05), transparent 52%);
    animation: gttd-hero-mist 24s ease-in-out infinite alternate;
  }

  @keyframes gttd-hero-mist {
    0% {
      transform: translate(0, 0) scale(1);
      opacity: 0.88;
    }
    100% {
      transform: translate(2.5%, -2%) scale(1.05);
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::after {
    display: none !important;
  }
}

/* Grain only when motion is OK (keeps reduced-motion users clean); skip on narrow viewports for performance */
@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  .hero-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  }
}

/* Hero content: hairline light ring */
.hero-content {
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* --- Nav: crisper when scrolled --- */
.navbar.scrolled {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.1);
  border-bottom-color: rgba(212, 175, 55, 0.14) !important;
}

/* --- Features: intro strip + card accent --- */
.features-intro {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  padding: 0 0.5rem;
}

.section-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.features-lead {
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-muted);
  font-weight: 600;
}

.features .features-intro + .features-grid {
  margin-top: 0;
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-rich), var(--accent-gold), var(--gold-rich));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover::before,
.feature-card:focus-within::before {
  transform: scaleX(1);
}

/* --- Section titles: slightly richer underline --- */
.section-title::after {
  width: 88px;
  background: linear-gradient(90deg, var(--gold-rich), var(--accent-gold), var(--gold-rich));
  height: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* --- Services: image draw attention softly --- */
.service-image img {
  transform: scale(1.001);
}

.service-card:hover .service-image img {
  transform: scale(1.05);
}

/* --- Pricing tabs: defined “rail” --- */
.pricing-tabs {
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
}

.tab-btn.active {
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* --- Gallery: focus for keyboard --- */
.gallery-item:focus {
  outline: none;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

/* --- Footer: lift from page (gold bar stays from styles.css) --- */
.footer {
  box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.35);
}

/* --- Back to top: clearer affordance --- */
.back-to-top.visible {
  box-shadow: var(--shadow-md);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* --- Primary CTAs: keyboard focus --- */
.btn:focus-visible,
.nav-link:focus-visible,
.tab-btn:focus-visible {
  outline: 3px solid rgba(212, 175, 55, 0.65);
  outline-offset: 3px;
}

a:focus-visible {
  border-radius: 2px;
}

/* --- Smoother text rendering on dark hero buttons --- */
.hero .btn {
  -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   Motion system — scroll reveal, hero load, buttons, links, mobile, a11y
   All key motion is gated behind prefers-reduced-motion: no-preference
   ============================================================================= */

@media (prefers-reduced-motion: no-preference) {
  body:not(.loaded) .hero-title,
  body:not(.loaded) .hero-subtitle,
  body:not(.loaded) .hero-tagline,
  body:not(.loaded) .hero-description,
  body:not(.loaded) .hero-buttons,
  body:not(.loaded) .hero-trust,
  body:not(.loaded) .hero-logo-card {
    opacity: 0;
    transform: translateY(22px);
  }

  /* Nav: settles from top on first paint */
  .navbar {
    animation: gttd-nav-enter 0.65s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1)) both;
    will-change: transform, opacity;
  }

  @keyframes gttd-nav-enter {
    from {
      opacity: 0;
      transform: translateY(-14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Hero headline-first stagger (150ms tiers) */
  body.loaded .hero-subtitle {
    animation: gttd-hero-rise 0.72s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-title {
    animation: gttd-hero-rise 0.75s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 150ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-tagline {
    animation: gttd-hero-rise 0.72s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 300ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-description {
    animation: gttd-hero-rise 0.75s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 450ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-buttons {
    animation: gttd-hero-rise 0.75s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 600ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-trust {
    animation: gttd-hero-rise 0.72s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 750ms;
    will-change: opacity, transform;
  }

  body.loaded .hero-logo-card {
    animation: gttd-hero-rise 0.85s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 450ms;
    will-change: opacity, transform;
  }

  @keyframes gttd-hero-rise {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Buttons: shimmer sweep */
  .hero .btn-primary::after,
  .hero .btn-secondary::after {
    content: '';
    position: absolute;
    inset: 0;
    left: -120%;
    width: 80%;
    background: linear-gradient(
      105deg,
      transparent 0%,
      rgba(255, 255, 255, 0.45) 42%,
      transparent 72%
    );
    transform: skewX(-18deg);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: inherit;
  }

  .hero .btn-secondary::after {
    background: linear-gradient(
      105deg,
      transparent 0%,
      rgba(255, 255, 255, 0.28) 45%,
      transparent 75%
    );
  }

  .hero .btn-primary:hover::after,
  .hero .btn-secondary:hover::after {
    opacity: 1;
    transform: skewX(-18deg) translateX(320%);
  }

  .booking-button-container .btn-primary,
  .btn-email.btn-primary {
    overflow: hidden;
  }

  .booking-button-container .btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    left: -100%;
    width: 55%;
    background: linear-gradient(
      105deg,
      transparent,
      rgba(212, 175, 55, 0.35),
      transparent
    );
    transform: skewX(-14deg);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: inherit;
  }

  .booking-button-container .btn-primary:hover::after {
    opacity: 1;
    transform: skewX(-14deg) translateX(380%);
  }

}

@media (prefers-reduced-motion: reduce) {
  .navbar,
  .hero-title,
  .hero-subtitle,
  .hero-tagline,
  .hero-description,
  .hero-buttons,
  .hero-trust,
  .hero-logo-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-overlay {
    transform: none !important;
  }
}

/* Scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .gttd-reveal {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    transition:
      opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: calc(var(--gttd-i, 0) * 72ms);
    will-change: opacity, transform;
  }

  .gttd-reveal.gttd-inview {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .section-title,
  .section-subtitle {
    transition-delay: 0ms;
  }

  .section-header.gttd-reveal {
    transition-delay: 0ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gttd-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Links: underline draws from left */
@media (prefers-reduced-motion: no-preference) {
  .contact-card a:not(.btn),
  .footer-section ul li a,
  .datcog-app-link {
    position: relative;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .contact-card a:not(.btn):hover,
  .footer-section ul li a:hover,
  .datcog-app-link:hover {
    background-size: 100% 2px;
  }

  .contact-card a:not(.btn)::after,
  .footer-section ul li a::after {
    display: none;
  }
}

/* DatCog link keeps visible underline cue + animation layer */
.datcog-app-link {
  text-underline-offset: 3px;
}

/* Icons micro-motion */
@media (prefers-reduced-motion: no-preference) {
  .feature-card:hover .feature-icon,
  .extra-card:hover .extra-icon,
  .contact-card:hover .contact-icon {
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .feature-card:hover .feature-icon {
    transform: scale(1.08) rotate(-4deg);
  }

  .extra-card:hover .extra-icon {
    transform: scale(1.08) rotate(5deg);
  }

  .contact-card:hover .contact-icon {
    transform: scale(1.06);
  }

  .info-button:hover {
    transform: scale(1.08) rotate(-8deg);
  }
}

/* Info button focus as “toggle” substitute */
.info-button {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile menu overlay + drawer polish */
@media (max-width: 768px) {
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 998;
    animation: gttd-overlay-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
    pointer-events: auto;
  }

  @keyframes gttd-overlay-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .nav-menu {
    position: fixed;
    z-index: 999;
    left: -100%;
    top: 90px;
    padding-top: 1rem;
    padding-bottom: 2rem;
    min-height: calc(100dvh - 90px);
    width: min(100%, 420px);
    max-width: 100%;
    text-align: left;
    align-items: stretch;
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.18);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition:
      left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-8px);
    opacity: 0.98;
    background: rgba(255, 255, 255, 0.98);
  }

  .nav-menu.active {
    left: 0;
    transform: translateX(0);
    opacity: 1;
  }

  body:has(.notification-banner:not(.hidden)) .nav-menu {
    top: 150px;
    min-height: calc(100dvh - 150px);
  }

  .nav-link {
    padding: 1rem 1.5rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .nav-link.btn-book {
    margin: 0.75rem 1rem 1rem;
    justify-content: center;
    border-radius: var(--radius-full);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  body.nav-open::after {
    animation: none;
    opacity: 1;
  }

  .nav-menu {
    transition: none;
    transform: none;
  }
}

/* Breakpoints: fluid grids & type */
@media (max-width: 320px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: min(1240px, 92vw);
  }

  .section-subtitle,
  .about-description {
    max-width: min(var(--content-max-ch), 70ch);
  }
}

/* Tab buttons: larger touch targets on narrow screens */
@media (max-width: 480px) {
  .tab-btn {
    min-height: 44px;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

/* Sticky pricing tabs scroll shadow hint */
@media (prefers-reduced-motion: no-preference) {
  .pricing-tabs {
    border-radius: var(--radius-md);
  }
}

/* Reduce decorative hero mist when user prefers reduced motion (inherits from earlier rules) */

@media (prefers-reduced-motion: reduce) {
  .progress-step--current .progress-marker {
    animation: none !important;
    box-shadow: none;
  }
}

