/* Almond Construction: page-specific styles.
   Scroll-driven reveal of a rendered HDB flat (ceiling slab lifts off),
   room hotspots, recent work, capabilities and the process timeline. */

.cx-hero {
  padding-top: 160px;
  padding-bottom: 96px;
}

.cx-hero h1 {
  font-size: clamp(44px, 6vw, 88px);
  font-weight: 400;
  line-height: 1;
  max-width: 18ch;
  margin-top: 32px;
}

.cx-hero .lede {
  margin-top: 36px;
}

.cx-hero-ctas {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .cx-hero {
    padding-top: 72px;
    padding-bottom: 64px;
  }
}

.house-pin {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* --- Pinned house section --- */
.house-pin {
  position: relative;
  height: 620vh;
}

@media (max-width: 760px) {
  .house-pin {
    height: 520vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .house-pin {
    height: auto;
    position: static;
  }
}

.house-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .house-sticky {
    position: static;
    height: auto;
    padding: 24px 0 56px;
  }
}

.house-caption {
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .house-caption {
    display: none;
  }
}

.house-caption.is-active {
  opacity: 1;
}

.house-stage {
  position: relative;
  width: min(92vw, 78vh, 760px);
  aspect-ratio: 1 / 1;
}

.house-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.house-slab {
  will-change: transform;
}

.hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.hotspot-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(244, 237, 227, 0.7);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(74, 28, 28, 0.18), 0 8px 22px rgba(30, 8, 8, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
}

.hotspot-dot::before {
  content: "+";
}

.hotspot-dot:hover,
.hotspot.is-open .hotspot-dot {
  background: var(--ink);
  color: var(--bg);
  transform: scale(1.08);
}

.hotspot.is-open .hotspot-dot::before {
  content: "\2212";
}

.hotspot-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 270px;
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 22px 22px 20px;
  box-shadow: 0 18px 44px rgba(30, 8, 8, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.hotspot.is-right .hotspot-panel {
  left: auto;
  right: -8px;
  transform: translateY(6px);
}

.hotspot.is-left .hotspot-panel {
  left: -8px;
  transform: translateY(6px);
}

.hotspot.is-right.is-open .hotspot-panel,
.hotspot.is-left.is-open .hotspot-panel {
  transform: translateY(0);
}

.hotspot.is-open .hotspot-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hotspot-panel h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 10px;
}

.hotspot-panel p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 10px;
}

.hotspot-panel a {
  display: inline-block;
  padding: 10px 0 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.house-legend {
  margin-top: 28px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .house-legend {
    display: none;
  }
}

/* --- Process: a calm static row of five steps --- */
.process-pin {
  padding: 128px 0 96px;
  border-top: 1px solid var(--line);
}

.process-sticky .wrap {
  width: 100%;
}

.process-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.process-card {
  border-top: 1px solid var(--line-strong);
  padding: 28px 0 0;
}

.process-card h3 {
  font-size: 26px;
}

.process-card p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.process-num {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

@media (max-width: 1000px) {
  .process-track {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .process-track {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
}

/* --- Bathroom build-up: one room, four stages, changed by scroll --- */
.build-pin {
  position: relative;
  height: 400vh;
  border-top: 1px solid var(--line);
}

.build-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.build-frame,
.build-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.build-img {
  object-fit: cover;
  object-position: 62% center;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.build-img.is-active {
  opacity: 1;
}

.build-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(61, 22, 22, 0.94) 0%, rgba(61, 22, 22, 0.7) 32%, rgba(61, 22, 22, 0.08) 62%, rgba(61, 22, 22, 0) 100%),
    linear-gradient(0deg, rgba(61, 22, 22, 0.75) 0%, rgba(61, 22, 22, 0) 40%);
}

.build-copy {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 96px;
}

.build-captions {
  position: relative;
  min-height: 210px;
  margin-top: 28px;
  max-width: 560px;
}

.build-caption {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.build-caption.is-active {
  opacity: 1;
  transform: none;
}

.build-caption span {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.build-caption h2 {
  margin-top: 14px;
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 400;
  line-height: 1.04;
}

.build-progress {
  display: flex;
  gap: 8px;
  margin-top: 32px;
}

.build-progress i {
  width: 36px;
  height: 1px;
  background: var(--line-strong);
  transition: background 0.5s ease;
}

.build-progress i.is-active {
  background: var(--ink);
}

@media (max-width: 760px) {
  .build-pin {
    height: 340vh;
  }

  .build-frame::after {
    background: linear-gradient(0deg, rgba(61, 22, 22, 0.96) 0%, rgba(61, 22, 22, 0.75) 45%, rgba(61, 22, 22, 0.1) 100%);
  }

  .build-copy {
    padding-bottom: 56px;
  }

  .build-captions {
    min-height: 170px;
  }
}

/* Reduced motion: all four stages shown together, no pinning. */
@media (prefers-reduced-motion: reduce) {
  .build-pin {
    height: auto;
    padding: 96px 0;
  }

  .build-sticky {
    position: static;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column-reverse;
  }

  .build-frame {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: var(--maxw);
    margin: 40px auto 0;
    padding: 0 32px;
    height: auto;
  }

  .build-frame::after {
    display: none;
  }

  .build-img {
    position: static;
    opacity: 1;
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .build-copy {
    padding-bottom: 0;
  }

  .build-captions {
    min-height: 0;
  }

  .build-caption {
    position: static;
    opacity: 1;
    transform: none;
    margin-bottom: 18px;
  }

  .build-caption h2 {
    font-size: 30px;
  }

  .build-progress {
    display: none;
  }
}

.hotspot.is-open {
  z-index: 10;
}

@media (max-width: 600px) {
  .hotspot-panel {
    width: min(250px, 72vw);
  }

  .hotspot-panel a {
    padding: 12px 0 4px;
  }
}
