/* ==========================================================================
   Design Page — Cascading Water Fountain Architecture
   ========================================================================== */

:root {
  --water: #96c8d8;
  --water-light: #cde6ef;
  --water-deep: #5a9ab0;
  --water-shadow: rgba(34, 33, 30, 0.16);
  --metal-outline: #2a2a2a;
}

html, body {
  overflow-x: clip;
}

.page-design {
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}

/* Header block with 160px padding top and 96px bottom */
.design-header {
  padding: 160px 48px 96px;
  position: relative;
  z-index: 10;
  max-width: var(--max-width);
  margin: 0 auto;
}

.design-header__inner {
  max-width: 680px;
  position: relative;
  z-index: 4;
}

.design-header__title {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 6.5vw, 6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 24px;
}

.design-header__intro {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.85;
}

/* Fountain Showcase Section */
.design-section {
  position: relative;
  padding: 0 48px 160px;
  max-width: 100%;
}

/* Canvas positioned across entire section behind trays */
.design-fountain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* Under trays (z-index 2) but above background */
}

/* Cascade Wrapper */
.design-wrapper {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

/* Design Rows: Section 0 Layout */
.design-row {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 64px; /* 64px between caption and next card */
}

.design-row:last-child {
  margin-bottom: 0;
}

/* Odd cards aligned left, Even cards aligned right */
.design-row--left {
  align-items: flex-start;
}

.design-row--right {
  align-items: flex-end;
}

/* Card Container with custom width Wc */
.design-card {
  position: relative;
  width: min(calc((100% + 40px) / 2), 640px);
  z-index: 2;
}

/* Tray Container */
.design-tray {
  width: 100%;
  background-color: var(--sage);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 10px;
  transform-origin: center center;
  will-change: transform;
}

/* Water Basin atop the tray - extends seamlessly flush to pour end */
.design-tray__basin {
  position: absolute;
  top: -14px;
  height: 24px;
  background: rgba(155, 170, 151, 0.85);
  border: 1.5px solid rgba(110, 125, 105, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(34, 33, 30, 0.08);
  backdrop-filter: blur(4px);
  z-index: 3;
  overflow: hidden;
}

/* Odd cards: pour end is on the RIGHT; basin reaches right edge flush */
.design-row--left .design-tray__basin {
  left: 16px;
  right: -2px;
  border-radius: 12px 0 0 12px;
  border-right: none;
}

/* Even cards: pour end is on the LEFT; basin reaches left edge flush */
.design-row--right .design-tray__basin {
  left: -2px;
  right: 16px;
  border-radius: 0 12px 12px 0;
  border-left: none;
}

.design-tray__rim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 100%);
  pointer-events: none;
}

.design-basin-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Tray Media Card */
.design-tray__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  background-color: var(--cream);
  position: relative;
}

.design-tray__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Section 3.1: Rain Bar Component seamlessly linked to basin rim */
.rain-bar {
  position: absolute;
  top: -8px; /* Level with basin rim */
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 4;
}

.rain-bar--right {
  left: 100%; /* Directly attached flush to right pour end */
  flex-direction: row;
}

.rain-bar--left {
  right: 100%; /* Directly attached flush to left pour end */
  flex-direction: row-reverse;
}

/* 8px bright --water throat seamlessly connecting basin to collar */
.rain-throat {
  width: 8px;
  height: 10px;
  background-color: var(--water);
  box-shadow: 0 0 6px rgba(150, 200, 216, 0.7);
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(90, 154, 176, 0.7);
}

.rain-bar__mount {
  display: flex;
  align-items: center;
}

/* Droop 2 degrees relative to card angle */
.rain-bar--right .rain-bar__mount {
  transform: rotate(2deg);
  transform-origin: left center;
}

.rain-bar--left .rain-bar__mount {
  flex-direction: row-reverse;
  transform: rotate(-2deg);
  transform-origin: right center;
}

.rain-bar__collar,
.rainbar-collar {
  width: 18px;
  height: 12px;
  background: linear-gradient(180deg, #f4f4f4 0%, #b9b9b9 35%, #6e6e6e 70%, #9a9a9a 100%);
  border: 1.5px solid var(--metal-outline);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(34, 33, 30, 0.2);
  flex-shrink: 0;
}

.rain-bar__rod,
.rainbar-metal {
  width: clamp(88px, 9vw, 120px);
  height: 9px;
  background: linear-gradient(180deg, #f4f4f4 0%, #b9b9b9 35%, #6e6e6e 70%, #9a9a9a 100%);
  border: 1.5px solid var(--metal-outline);
  border-radius: 4px;
  position: relative;
  box-shadow: 0 3px 6px rgba(34, 33, 30, 0.25);
}

.rainbar-metal {
  width: calc(clamp(88px, 9vw, 120px) * 1.2);
}

.rain-bar__highlight,
.rainbar-highlight {
  position: absolute;
  top: 1px;
  left: 2px;
  right: 2px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1px;
}

.rain-bar__holes,
.rainbar-holes {
  position: absolute;
  bottom: -1px;
  left: 6px;
  right: 6px;
  height: 2.4px;
  display: flex;
  justify-content: space-between;
}

/* Outer Captions under card */
.design-caption {
  width: 100%;
  max-width: min(340px, calc(100% - 120px));
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.design-caption--left {
  text-align: left;
  align-self: flex-start;
}

.design-caption--right {
  text-align: right;
  align-self: flex-end;
}

.design-caption__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.design-caption__desc {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0.8;
}

/* Collection Pool at bottom */
.fountain-pool {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 140px auto 0;
  height: 96px;
  z-index: 3;
}

.fountain-pool__coping {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  background: linear-gradient(180deg, #75726a 0%, #48453e 100%);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 6px 16px rgba(34, 33, 30, 0.15);
}

.fountain-pool__water {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  bottom: 0;
  background: linear-gradient(180deg, rgba(165, 205, 210, 0.75) 0%, rgba(110, 165, 175, 0.6) 100%);
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  box-shadow: inset 0 6px 12px rgba(34, 33, 30, 0.15);
}

.fountain-pool__surface-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.2) 100%);
  animation: poolShimmer 3s ease-in-out infinite alternate;
}

@keyframes poolShimmer {
  0% { transform: scaleX(0.9) translateX(-2%); opacity: 0.5; }
  100% { transform: scaleX(1.05) translateX(2%); opacity: 0.9; }
}

/* SECTION 7 - MOBILE (Under 900px) */
@media (max-width: 899px) {
  .design-header {
    padding: 120px 20px 64px;
  }

  .design-section {
    padding: 0 20px 100px;
  }

  .design-row {
    margin-bottom: 40px; /* 40px between caption and next card on mobile */
  }

  .design-card {
    /* C = viewport - 40, Wc = C - 84 */
    width: calc(100% - 84px) !important;
  }

  .design-caption {
    max-width: 100% !important;
  }

  .design-tray__basin {
    height: 24px;
  }

  .rain-bar--right {
    left: 100%;
  }

  .rain-bar--left {
    right: 100%;
  }

  .rain-bar__rod {
    width: 60px !important; /* B = 60px on mobile */
  }

  .rainbar-metal {
    width: 72px !important;
  }

  .rain-bar__collar,
  .rainbar-collar {
    width: 14px;
    height: 10px;
  }

  .fountain-pool {
    margin-top: 100px;
  }
}
