/* =========================================================
   BEACH POOL DETAIL PAGE — bp.css
   Supplements main.css. All overrides are scoped.
   ========================================================= */

/* ── HERO ────────────────────────────────────────────────── */
.bp-hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  isolation: isolate;
  display: flex;
  align-items: center;
}

.bp-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url('../../assets/img/project-beach-sunset.jpg') center 40% / cover no-repeat;
  background-image: -webkit-image-set(url('../../assets/img/project-beach-sunset.webp') type('image/webp') 1x, url('../../assets/img/project-beach-sunset.jpg') type('image/jpeg') 1x);
  background-image: image-set(url('../../assets/img/project-beach-sunset.webp') type('image/webp') 1x, url('../../assets/img/project-beach-sunset.jpg') type('image/jpeg') 1x);
  background-size: cover; background-position: center 40%; background-repeat: no-repeat;
  transform: scale(1.04);
  animation: heroBgZoom 22s ease-in-out infinite alternate;
}

@keyframes heroBgZoom {
  from { transform: scale(1.04); }
  to   { transform: scale(1.09); }
}

.bp-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(120deg, rgba(14,17,22,0.75) 0%, rgba(14,17,22,0.40) 50%, rgba(14,17,22,0.20) 100%),
    linear-gradient(to bottom, rgba(14,17,22,0.1) 0%, rgba(14,17,22,0.55) 100%);
}

.bp-hero-content {
  position: relative;
  z-index: 10;
  padding: 0 clamp(28px, 8vw, 110px);
  max-width: 820px;
  padding-top: 80px; /* account for fixed header */
}

.bp-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 28px;
  opacity: 0;
  animation: heroFadeUp 1.1s var(--ease) 0.2s forwards;
}
.bp-hero-breadcrumb a { color: inherit; transition: color .3s; }
.bp-hero-breadcrumb a:hover { color: rgba(255,255,255,0.8); }

.bp-hero-title {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: clamp(60px, 8vw, 120px);
  line-height: 0.93;
  font-weight: 200;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 24px;
  opacity: 0;
  animation: heroFadeUp 1.3s var(--ease) 0.38s forwards;
}

.bp-hero-lead {
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.75;
  color: rgba(255,255,255,0.68);
  max-width: 540px;
  margin-bottom: 32px;
  opacity: 0;
  animation: heroFadeUp 1.2s var(--ease) 0.6s forwards;
}

.bp-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 1.1s var(--ease) 0.8s forwards;
}

.bp-hero-tag {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.bp-hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.45);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0;
  animation: heroFadeUp 1.1s var(--ease) 1s forwards;
  transition: opacity .3s;
}
.bp-hero-scroll:hover { opacity: 0.75; }

/* ── SPECS BAR ────────────────────────────────────────────── */
.bp-specs-bar {
  display: flex;
  gap: 0;
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bp-specs-bar::-webkit-scrollbar { display: none; }

.bp-spec {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 24px clamp(16px, 2.5vw, 36px);
  border-right: 1px solid rgba(255,255,255,0.06);
  min-width: 160px;
}
.bp-spec:last-child { border-right: 0; }

.bp-spec-k {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  font-weight: 600;
}

.bp-spec-v {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.82);
  white-space: nowrap;
}

/* ── SYSTEM SECTION ────────────────────────────────────────── */
.bp-system {
  background: var(--ink);
  color: var(--paper);
  padding-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(80px, 12vw, 160px);
}

.bp-system .section-head {
  max-width: 640px;
  margin-bottom: clamp(48px, 6vw, 80px);
}

.bp-system-stage {
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

/* ── CONTROLS ────────────────────────────────────────────── */
.bp-controls {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-ctrl-group {
  margin-bottom: 8px;
}

.bp-ctrl-group-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 8px;
  padding-left: 4px;
}

.bp-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 100px;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.38);
  border: 1px solid transparent;
  background: transparent;
  transition:
    color .35s var(--ease),
    background .35s var(--ease),
    border-color .35s var(--ease),
    box-shadow .35s var(--ease);
  cursor: pointer;
}
.bp-ctrl-btn:hover { color: rgba(255,255,255,0.65); }

.bp-ctrl-btn.is-active {
  color: var(--paper);
  background: rgba(123,199,243,0.08);
  border-color: rgba(123,199,243,0.30);
  box-shadow: 0 0 22px -6px rgba(123,199,243,0.3);
}

/* LED button gets gold active state */
.bp-ctrl-btn--led.is-active {
  background: rgba(228,194,122,0.1);
  border-color: rgba(228,194,122,0.38);
  box-shadow: 0 0 28px -6px rgba(228,194,122,0.45);
  color: var(--gold);
}

.bp-ctrl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
  width: 18px;
}

.bp-ctrl-name { flex: 1; font-weight: 500; font-size: 12.5px; }

.bp-ctrl-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.22);
  transition: color .35s var(--ease);
}
.bp-ctrl-btn.is-active .bp-ctrl-badge { color: rgba(123,199,243,0.8); }
.bp-ctrl-btn--led.is-active .bp-ctrl-badge { color: var(--gold); }

/* ── READOUT PANEL ────────────────────────────────────────── */
.bp-readout {
  margin-top: 16px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
}

.bp-readout-title {
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--paper);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: opacity .4s var(--ease);
}

.bp-readout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.bp-readout-grid > div:last-child {
  grid-column: span 2;
}
.bp-readout-grid dt {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 4px;
}
.bp-readout-grid dd {
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--paper);
  transition: opacity .4s var(--ease);
}

/* ── SVG CANVAS ────────────────────────────────────────────── */
.bp-canvas {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.015) 0%, rgba(255,255,255,0) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  /* warm LED overlay will appear here */
}

.bp-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── SVG LAYER TRANSITIONS ────────────────────────────────── */
.bp-layer {
  transition: opacity 0.75s var(--ease);
}

/* ── PIPE FLOW ANIMATION ──────────────────────────────────── */
.flow-pipe {
  stroke-dasharray: 11 9;
}

.bp-svg.pipes-active .flow-pipe {
  animation: flowMarch 0.65s linear infinite;
}

@keyframes flowMarch {
  to { stroke-dashoffset: -20; }
}

/* ── SLOT SKIMMER ANIMATION ───────────────────────────────── */
.skimmer-flow {
  animation: none;
}

.bp-svg.skimmer-active .skimmer-flow {
  animation: skimmerBob 2.5s ease-in-out infinite;
}

@keyframes skimmerBob {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50%       { transform: translateY(-2px); opacity: 1; }
}

/* ── LED ANIMATION ────────────────────────────────────────── */
.led-strip {
  transition: opacity .6s ease;
}

.bp-svg.led-active .led-strip {
  animation: ledDash 1.4s linear infinite;
}

@keyframes ledDash {
  to { stroke-dashoffset: -12; }
}

.led-node {
  transition: opacity .6s ease;
}

.bp-svg.led-active .led-node {
  animation: ledNodePulse 2s ease-in-out var(--d, 0s) infinite;
}

@keyframes ledNodePulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

.led-glow-fill {
  animation: none;
}

.bp-svg.led-active .led-glow-fill {
  animation: ledGlowPulse 3s ease-in-out infinite;
}

@keyframes ledGlowPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* ── CANVAS LED OVERLAY (ambient) ─────────────────────────── */
.canvas-led-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(255,168,50,0.18) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  mix-blend-mode: screen;
}

body.led-on .canvas-led-overlay {
  opacity: 1;
  animation: ambientPulse 3.5s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}

/* ── CANVAS LEGEND ────────────────────────────────────────── */
.bp-canvas-legend {
  display: flex;
  gap: 20px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.bp-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.bp-legend-item::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--c, #fff);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── GALLERY ────────────────────────────────────────────────── */
.bp-gallery {
  background: var(--paper-soft);
  padding: var(--section-y) 0;
}

.bp-gallery-grid {
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.bp-gal-hero,
.bp-gal-sm,
.bp-gal-wide {
  overflow: hidden;
  border-radius: 4px;
  position: relative;
}

.bp-gal-hero {
  grid-row: span 2;
  aspect-ratio: 3/4;
}

.bp-gal-sm {
  aspect-ratio: 4/3;
}

.bp-gal-wide {
  grid-column: span 2;
  aspect-ratio: 21/9;
}

.bp-gal-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 10s var(--ease-slow);
}

.bp-gal-hero:hover .bp-gal-img,
.bp-gal-sm:hover .bp-gal-img,
.bp-gal-wide:hover .bp-gal-img {
  transform: scale(1.04);
}

.bp-gal-hero figcaption,
.bp-gal-sm figcaption,
.bp-gal-wide figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 20px 16px;
  background: linear-gradient(transparent, rgba(14,17,22,0.55));
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* ── CTA SECTION ────────────────────────────────────────────── */
.bp-cta {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(80px, 12vw, 160px) 0;
  text-align: center;
}

.bp-cta-inner {
  padding: 0 var(--gutter);
  max-width: 720px;
  margin: 0 auto;
}

.bp-cta-inner .section-title {
  margin: 24px 0 20px;
}

.bp-cta-inner .section-lead {
  margin-bottom: 48px;
}

.bp-cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Light/dark button inversion for CTA on dark bg */
.bp-cta .btn-primary {
  background: rgba(255,255,255,0.92);
  color: var(--ink);
}
.bp-cta .btn-primary:hover { background: #fff; }
.bp-cta .btn-secondary {
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}
.bp-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.55);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .bp-system-stage {
    grid-template-columns: 1fr;
  }
  .bp-controls {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }
  .bp-ctrl-group {
    display: contents;
  }
  .bp-ctrl-group-label { display: none; }
  .bp-ctrl-btn { width: auto; }
  .bp-readout {
    width: 100%;
    margin-top: 0;
    order: 99;
  }
  .bp-gallery-grid {
    grid-template-columns: 1fr;
  }
  .bp-gal-hero { grid-row: span 1; aspect-ratio: 16/9; }
  .bp-gal-wide { grid-column: span 1; aspect-ratio: 16/9; }
}

@media (max-width: 760px) {
  .bp-specs-bar { gap: 0; }
  .bp-spec { min-width: 140px; }
  .bp-ctrl-btn { font-size: 11.5px; padding: 10px 13px; }
  .bp-cta-actions { flex-direction: column; }
  .bp-cta-actions .btn-primary,
  .bp-cta-actions .btn-secondary { width: 100%; text-align: center; justify-content: center; }
  .bp-readout-grid { grid-template-columns: 1fr 1fr; }
  .bp-readout-grid > div:last-child { grid-column: span 2; }
  .bp-canvas-legend { flex-wrap: wrap; gap: 12px; }
}
