/* Mobile layout and touch controls. */
html { scroll-padding-top: 88px; }
:focus-visible { outline: 3px solid #9b703c; outline-offset: 4px; }
@media (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; }
  body { margin: 0; }
  main, section, .grid > *, .flex > * { min-width: 0; }
  img, video, iframe { max-width: 100%; }
  [data-testid="hero-section"] { padding-top: 100px !important; padding-bottom: 40px !important; }
  [data-testid="hero-heading"] { font-size: clamp(34px, 9.5vw, 50px) !important; line-height: 1.1 !important; overflow-wrap: break-word; }
  [data-testid="hero-heading"] .font-accent { font-size: clamp(38px, 11vw, 56px) !important; line-height: 1.12 !important; }
  [data-testid="hero-subtext"] { font-size: 16px !important; line-height: 1.65 !important; }
  [data-testid="hero-section"] .grid-cols-3 { gap: 12px; }
  [data-testid="hero-section"] a[data-testid^="hero-"] { min-height: 48px; padding: 14px 20px !important; justify-content: center; }
  [data-testid="mobile-menu-toggle"] { min-width: 48px; min-height: 48px; display: grid; place-items: center; }
  [data-testid="mobile-menu"] { max-height: calc(100dvh - 100px); overscroll-behavior: contain; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  [data-testid="mobile-menu"] a { min-height: 48px; }
  [data-testid="pricing-section"], [data-testid="gallery-section"], [data-testid="location-section"], [data-testid="testimonials-section"] { padding-top: 44px !important; padding-bottom: 44px !important; }
  [data-testid^="pricing-card-"] { padding: 24px 20px !important; border-radius: 24px !important; }
  [data-testid^="pricing-cta-"], .codex-room-toggle { min-height: 48px !important; width: 100%; font-size: 16px !important; touch-action: manipulation; }
  [data-testid="inquiry-form"] input, [data-testid="inquiry-form"] select, [data-testid="inquiry-form"] textarea { font-size: 16px !important; min-height: 48px !important; }
  [data-testid="inquiry-submit-btn"] { min-height: 52px; }
  [data-testid="floating-actions"] { bottom: max(12px, env(safe-area-inset-bottom)) !important; right: 12px !important; }
  [data-testid="floating-actions"] a { min-height: 48px; min-width: 48px; }
  [data-testid="site-footer"] { padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
  dialog.codex-room-modal { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px); overscroll-behavior: contain; border-radius: 20px; }
  dialog.codex-room-modal .codex-room-panel { padding: 14px; }
  dialog.codex-room-modal .codex-room-panel__top { position: sticky; top: -14px; z-index: 5; background: #faf9f6; padding: 10px 0; }
  dialog.codex-room-modal .codex-room-panel__close { min-height: 48px; }
  dialog.codex-room-modal .codex-room-panel__video { max-height: 52dvh; object-fit: contain; }
  [data-testid="inquiry-form"], [data-testid="inquiry-submit-btn"] { animation: none !important; }
}
@media (max-width: 380px) {
  [data-testid="hero-section"] a[data-testid^="hero-"] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Smooth anchor navigation and gentle mobile reveals. */
@media (prefers-reduced-motion: no-preference) {
 html { scroll-behavior: smooth; }
 @media (max-width:767px) {
  .codex-scroll-reveal:not(.codex-reveal-visible) { transform:translateY(18px); }
  .codex-scroll-reveal { transition-duration:650ms,750ms; }
 }
}

#sky-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #ac793e, #e6c786, #bd8c48);
  box-shadow: 0 1px 6px rgba(189,140,72,.35);
}
@media (prefers-reduced-motion: no-preference) {
  dialog.codex-room-modal[open] {
    animation: sky-popup-open 280ms cubic-bezier(.22,1,.36,1) both;
  }
  dialog.codex-room-modal[open]::backdrop {
    animation: sky-backdrop-open 220ms ease-out both;
  }
}
@keyframes sky-popup-open {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sky-backdrop-open {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .sky-photo-reveal { opacity: .4; transform: scale(1.055); transition: transform 1100ms cubic-bezier(.22,1,.36,1), opacity 800ms ease; }
  .sky-photo-reveal.sky-scroll-detail-visible { opacity: 1; transform: scale(1); }
  .sky-heading-reveal { opacity: .25; transform: translateY(14px); transition: opacity 700ms ease, transform 850ms cubic-bezier(.22,1,.36,1); }
  .sky-heading-reveal.sky-scroll-detail-visible { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sky-photo-reveal, .sky-heading-reveal { opacity: 1 !important; transform: none !important; }
}
