/* =========================================================
   Alcon Roofing Repair & Cleaning — global styles
   Base resets + keyframes are carried over from the design's
   <helmet>. Everything below the "RESPONSIVE" banner is added
   to make the inline-styled design behave on small screens.
   ========================================================= */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 0; background: #090C10; }
::selection { background: #1E6FE0; color: #fff; }
input, select, textarea, button { font-family: inherit; }
select option { background: #11161C; color: #fff; }
details summary::-webkit-details-marker { display: none; }
a { text-decoration: none; }

@keyframes kenburns { from { transform: scale(1.03); } to { transform: scale(1.16) translate(-1.4%, -1.1%); } }
@keyframes marquee  { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes floaty   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes glowpulse{ 0%,100% { opacity: 0.55; } 50% { opacity: 0.9; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   HERO 3D — keep the WebGL canvas from "blowing out" the grid
   track on narrow screens. A grid item defaults to min-width:auto,
   so the canvas's intrinsic pixel width (~670px) forces the hero
   column wider than a phone screen — which pushed the 3D model
   off-screen and shifted the absolutely-positioned "Scroll" cue
   (left:50%) off-center. min-width:0 lets the track size to the
   viewport instead; hero3d.js's ResizeObserver then fits the
   canvas to it.
   ========================================================= */
.hero-grid > *, .impact-grid > * { min-width: 0; }
#hero3d, #impact3d { width: 100%; max-width: 100%; overflow: hidden; }
#hero3d canvas, #impact3d canvas { max-width: 100%; display: block; }

/* =========================================================
   MOBILE NAVIGATION (added — not in original design)
   ========================================================= */

/* Hamburger button — hidden on desktop, shown < 860px */
.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Slide-down mobile menu panel */
.mobile-menu {
  position: fixed;
  top: 78px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(9,12,16,0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  padding: 14px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s ease, opacity .3s ease, visibility .3s ease;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-menu a.m-link {
  color: rgba(255,255,255,0.82);
  font-size: 17px;
  font-weight: 600;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu a.m-link:last-of-type { border-bottom: none; }
.mobile-menu .m-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
.mobile-menu .m-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #CE2029;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(206,32,41,0.4);
}

/* =========================================================
   RESPONSIVE — override inline styles where the fixed
   desktop layout would break on tablet / phone.
   ========================================================= */

/* Hero: collapse the two-column grid */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding-top: 120px !important;
  }
  /* width:100% is required: a grid item with `margin: 0 auto` otherwise shrinks to
     its content width, and since #hero3d is width:100% (no intrinsic size) the column
     collapses to 0 and the 3D canvas never gets built on phones. */
  .hero-3dwrap { width: 100%; max-width: 520px; margin: 0 auto !important; }
  #hero3d { margin-right: 0 !important; height: clamp(340px, 70vw, 480px) !important; }
}

/* Header: swap desktop links for the hamburger menu */
@media (max-width: 860px) {
  .nav-links { display: none !important; }
  .nav-lang  { display: none !important; }
  .nav-hamburger { display: flex !important; }
  /* with the desktop links gone, push the call button + hamburger to the right */
  .nav-call { margin-left: auto !important; }
}

/* Very small phones: trim the call button to its icon */
@media (max-width: 520px) {
  .nav-call-text { display: none !important; }
  .nav-call { padding: 11px !important; }
}

/* Keep generous section rhythm from feeling cramped on phones */
@media (max-width: 600px) {
  .hero-cta { width: 100%; }
  .hero-cta > a { flex: 1; justify-content: center; }
}

/* =========================================================
   ACCESSIBILITY & 2026 ADDITIONS
   (focus visibility, skip link, honeypot, mobile repaint)
   ========================================================= */

/* Skip-to-content link — only visible when focused (keyboard users) */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 1000;
  background: #CE2029;
  color: #fff;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* Visible keyboard focus on every interactive control (WCAG 2.4.7 / 2.4.11).
   !important is required to override the inline `outline: none` on the form fields. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #5FA0FF !important;
  outline-offset: 2px;
  border-radius: 4px;
}
/* Keep mouse interactions clean — only show the ring for keyboard focus */
:focus:not(:focus-visible) { outline: none; }

/* Honeypot anti-spam field: invisible to people & assistive tech, present for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Fixed backgrounds repaint the whole image on every scroll frame — costly on
   touch devices. Fall back to normal scrolling on small screens (no visual loss). */
@media (max-width: 980px) {
  [style*="background-attachment: fixed"] { background-attachment: scroll !important; }
}

/* =========================================================
   LIVING IMAGERY — subtle motion so photos & the carousel
   never feel static. All of it is auto-disabled for users
   with prefers-reduced-motion (see the media query above).
   ========================================================= */

/* Slow "push-in" for the project photo that's currently in focus */
@keyframes proj-kenburns { from { transform: scale(1.05); } to { transform: scale(1.16); } }

#proj-track img[data-img] { transform: scale(1); will-change: transform; }
#proj-track img.proj-active-img { animation: proj-kenburns 7s ease-out both; }

/* Impact gallery: each photo breathes slowly (staggered so they're not in sync),
   and the tile gains depth on hover. Animations live on the <img>; hover styling
   lives on the tile, so the two never fight over the same transform. */
.impact-gallery > div { overflow: hidden; transition: box-shadow .45s ease, border-color .45s ease, transform .45s ease; }
.impact-gallery img { will-change: transform; }
.impact-gallery > div:nth-child(4n+1) img { animation: kenburns 19s ease-in-out infinite alternate; }
.impact-gallery > div:nth-child(4n+2) img { animation: kenburns 23s ease-in-out infinite alternate-reverse; }
.impact-gallery > div:nth-child(4n+3) img { animation: kenburns 26s ease-in-out infinite alternate; }
.impact-gallery > div:nth-child(4n+4) img { animation: kenburns 21s ease-in-out infinite alternate-reverse; }
.impact-gallery > div:hover { transform: translateY(-4px); box-shadow: 0 22px 55px rgba(0,0,0,0.55); border-color: rgba(206,32,41,0.55) !important; }
