/* ==========================================================================
   Estate Lens Media — custom styles (layered on top of Tailwind utilities)
   ========================================================================== */

:root {
  --ink-950: #070c11;
  --ink-900: #0c141c;
  --ink-800: #131f29;
  --ink-700: #1b2c38;
  --hairline: rgba(244, 246, 245, 0.09);
  --teal-400: #7fc8cf;
  --teal-500: #5fb4bd;
  --teal-600: #4a95a0;
  --brass-400: #c9a86a;
  --paper-100: #f4f6f5;
  --paper-300: #c7d1d3;
  --paper-500: #8fa0a4;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--ink-900);
  color: var(--paper-100);
  font-family: 'Manrope', system-ui, sans-serif;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--teal-500);
  color: var(--ink-950);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
#site-nav {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 400ms ease, border-color 400ms ease, backdrop-filter 400ms ease, padding 300ms ease;
}
#site-nav.nav-solid {
  background: rgba(7, 12, 17, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-menu.open {
  max-height: 32rem;
}

.burger-line {
  transition: transform 260ms ease, opacity 200ms ease;
}
#burger-btn[aria-expanded="true"] .burger-line-1 {
  transform: translateY(7px) rotate(45deg);
}
#burger-btn[aria-expanded="true"] .burger-line-2 {
  opacity: 0;
}
#burger-btn[aria-expanded="true"] .burger-line-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero-media {
  animation: heroDrift 26s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero-gradient {
  background:
    linear-gradient(to top, var(--ink-950) 0%, rgba(7,12,17,0.55) 42%, rgba(7,12,17,0.25) 65%, rgba(7,12,17,0.55) 100%),
    linear-gradient(to right, rgba(7,12,17,0.55) 0%, rgba(7,12,17,0.05) 35%, rgba(7,12,17,0.05) 65%, rgba(7,12,17,0.55) 100%);
}

/* Aperture ring — the brand's signature decorative motif, echoed from the logo mark */
.aperture-ring {
  position: absolute;
  border-radius: 9999px;
  border: 1px solid rgba(127, 200, 207, 0.18);
  pointer-events: none;
}
.aperture-ring::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 9999px;
  border: 1px solid rgba(127, 200, 207, 0.12);
}

.scroll-cue {
  animation: cueBob 2.4s ease-in-out infinite;
}
@keyframes cueBob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ---------------------------------------------------------------------
   Reveal-on-scroll
   --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------
   Eyebrow / section labels — uses the aperture glyph instead of numbering
   --------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-400);
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--teal-500);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Before / After comparison slider (vanilla JS, pointer events)
   --------------------------------------------------------------------- */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--ink-800);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}
.ba-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.ba-slider .ba-over {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* width is set by JS via inline style (clip amount) */
}
.ba-slider .ba-over img {
  width: var(--ba-img-width, 100%);
  max-width: none;
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(244, 246, 245, 0.85);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.ba-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: var(--ink-950);
  border: 2px solid var(--teal-400);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  transition: transform 200ms ease;
}
.ba-slider:hover .ba-handle-grip,
.ba-slider:focus-within .ba-handle-grip {
  transform: translate(-50%, -50%) scale(1.08);
}
.ba-tag {
  position: absolute;
  top: 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: rgba(7, 12, 17, 0.68);
  backdrop-filter: blur(6px);
  color: var(--paper-100);
  border: 1px solid var(--hairline);
  pointer-events: none;
}
.ba-tag-before { left: 0.85rem; }
.ba-tag-after { right: 0.85rem; }

.ba-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem;
  border: 1.5px dashed rgba(127, 200, 207, 0.3);
  background: linear-gradient(135deg, var(--ink-800), var(--ink-900));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.5rem;
}

/* ---------------------------------------------------------------------
   Package toggle
   --------------------------------------------------------------------- */
.pkg-toggle-track {
  position: relative;
  display: inline-flex;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  padding: 0.3rem;
}
.pkg-toggle-thumb {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0.3rem;
  width: calc(50% - 0.3rem);
  background: var(--teal-500);
  border-radius: 9999px;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.pkg-toggle-track[data-active="commercial"] .pkg-toggle-thumb {
  transform: translateX(100%);
}
.pkg-toggle-btn {
  position: relative;
  z-index: 1;
  padding: 0.6rem 1.6rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  color: var(--paper-300);
  transition: color 250ms ease;
}
.pkg-toggle-track[data-active="residential"] .pkg-toggle-btn[data-value="residential"],
.pkg-toggle-track[data-active="commercial"] .pkg-toggle-btn[data-value="commercial"] {
  color: var(--ink-950);
}

.pkg-panel {
  display: none;
}
.pkg-panel.active {
  display: grid;
}

.pkg-card-signature {
  border-image: linear-gradient(135deg, var(--teal-500), var(--brass-400)) 1;
}

/* ---------------------------------------------------------------------
   FAQ accordion
   --------------------------------------------------------------------- */
.faq-item {
  border-bottom: 1px solid var(--hairline);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 380ms cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.open .faq-answer {
  max-height: 20rem;
}
.faq-icon {
  transition: transform 300ms ease;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* ---------------------------------------------------------------------
   Showreel lite-embed facade
   --------------------------------------------------------------------- */
.play-button {
  transition: transform 260ms ease, background-color 260ms ease;
}
.showreel-facade:hover .play-button {
  transform: scale(1.08);
  background-color: var(--teal-500);
}

/* ---------------------------------------------------------------------
   Form elements
   --------------------------------------------------------------------- */
.field-input {
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  color: var(--paper-100);
  transition: border-color 220ms ease, background-color 220ms ease;
}
.field-input::placeholder {
  color: var(--paper-500);
}
.field-input:focus {
  border-color: var(--teal-500);
  background: var(--ink-700);
}

/* Simple utility for background image spans in raster type headers, if needed */
.text-balance {
  text-wrap: balance;
}

/* Card lift */
.lift-card {
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), border-color 320ms ease, box-shadow 320ms ease;
}
.lift-card:hover {
  transform: translateY(-6px);
  border-color: rgba(127, 200, 207, 0.35);
  box-shadow: 0 20px 45px -18px rgba(0,0,0,0.6);
}

/* ---------------------------------------------------------------------
   Companies-we've-worked-with logo marquee
   --------------------------------------------------------------------- */
.logo-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.logo-track {
  display: flex;
  width: max-content;
  animation: logoScroll 60s linear infinite;
  will-change: transform;
}
.logo-marquee:hover .logo-track,
.logo-marquee:focus-within .logo-track {
  animation-play-state: paused;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 1rem;
  margin: 0;
  list-style: none;
  flex-shrink: 0;
}
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 208px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 0.75rem;
  border: 1px solid var(--hairline);
}
.logo-tile img {
  width: auto;
  height: auto;
  max-width: 150px;
  max-height: 54px;
  object-fit: contain;
}
@keyframes logoScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-marquee { -webkit-mask-image: none; mask-image: none; }
  .logo-track { animation: none; display: block; width: auto; padding: 0 1.25rem; }
  .logo-group { flex-wrap: wrap; justify-content: center; padding-right: 0; flex-shrink: 1; }
  .logo-group[aria-hidden="true"] { display: none; }
}
