/* ==========================================================================
   WW Housing Development LLC — styles.css
   Homepage-only styles. Shared components (buttons, header, nav) live in
   global.css.

   MOBILE FIRST: base rules target the smallest viewport; min-width queries
   enhance for larger screens (handbook §12).
   ========================================================================== */

/* ==========================================================================
   Hero — four crossfading photographs behind static copy
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36rem;
  padding-block: var(--space-2xl);
  overflow: hidden;
  text-align: center;
}

/* svh keeps the hero from jumping as mobile browser chrome hides on scroll */
@supports (min-height: 85svh) {
  .hero {
    min-height: 85svh;
  }
}

/* --------------------------------------------------------------------------
   Photo track
   The gradient is the empty state — it shows through until the photographs
   are added, so the hero still reads as designed with /images empty.
   -------------------------------------------------------------------------- */
.hero__media {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    140deg,
    var(--clr-primary) 0%,
    var(--clr-primary-deep) 100%
  );
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1100ms var(--ease-out);
}

.hero__slide.is-active {
  opacity: 1;
}

.hero__slide picture,
.hero__slide img {
  width: 100%;
  height: 100%;
}

.hero__slide img {
  object-fit: cover;
  transform: scale(1);
  transition: transform 8000ms linear;
}

/* Slow drift on the visible photo only */
.hero__slide.is-active img {
  transform: scale(1.07);
}

/* Navy scrim: holds text contrast over whatever photography is dropped in */
.hero__scrim {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    to bottom,
    rgba(10, 30, 50, 0.62) 0%,
    rgba(10, 30, 50, 0.72) 100%
  );
}

/* --------------------------------------------------------------------------
   Copy
   -------------------------------------------------------------------------- */
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__eyebrow {
  margin: 0;
  max-width: 30rem;
  color: var(--clr-accent-light);
  font-size: var(--fs-200);
  font-weight: var(--fw-bold);
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0;
  max-width: 22ch;
  color: var(--clr-surface);
  font-size: clamp(2rem, 7vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero__text {
  margin: 0;
  max-width: 48ch;
  color: rgba(250, 247, 242, 0.88);
  font-size: var(--fs-400);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Carousel controls
   Below the buttons on phones; pinned to the left and right edges from the
   desktop breakpoint up, as in the reference layout.
   -------------------------------------------------------------------------- */
.hero__controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.hero__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--clr-line-on-dark);
  border-radius: 50%;
  background-color: rgba(10, 30, 50, 0.45);
  color: var(--clr-surface);
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
}

.hero__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

.hero__arrow:hover,
.hero__arrow:focus-visible {
  border-color: var(--clr-accent-light);
  background-color: var(--clr-accent);
  color: var(--clr-primary);
}

/* ==========================================================================
   Larger screens — min-width only
   ========================================================================== */
@media (min-width: 48em) {
  .hero__inner {
    gap: var(--space-lg);
  }

  .hero__text {
    font-size: var(--fs-500);
  }

  .hero__actions {
    gap: var(--space-md);
  }
}

@media (min-width: 64em) {
  /* Controls leave the flow and straddle the hero */
  .hero__controls {
    position: absolute;
    inset: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .hero__arrow {
    position: absolute;
    top: 50%;
    width: 3.25rem;
    height: 3.25rem;
    transform: translateY(-50%);
    pointer-events: auto;
  }

  .hero__arrow--prev {
    left: clamp(1rem, 3vw, 3.5rem);
  }

  .hero__arrow--next {
    right: clamp(1rem, 3vw, 3.5rem);
  }
}

/* ==========================================================================
   Reduced motion — hold a single still photograph
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero__slide,
  .hero__slide img,
  .hero__slide.is-active img {
    transition: none;
    transform: none;
  }
}

/* ==========================================================================
   About — portrait with an overlapping frosted card, beside the firm's story
   Shared pieces (.section-badge, .feature, .check, .avatar-stack,
   .quote-card) live in global.css.
   ========================================================================== */
.about__inner {
  display: grid;
  gap: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   Left column — photograph
   The tint is the empty state, visible until the photograph is added.
   -------------------------------------------------------------------------- */
.about__visual {
  position: relative;
}

.about__photo {
  display: block;
  aspect-ratio: 4 / 5;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: rgba(15, 42, 68, 0.08);
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Frosted card, overlapping the photograph's bottom-right corner */
.about__card {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  width: min(15rem, 62%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid rgba(250, 247, 242, 0.22);
  border-radius: var(--radius-lg);
  background-color: rgba(10, 30, 50, 0.62);
  color: var(--clr-surface);
  text-align: center;
}

/* Lighten the fill where the backdrop can actually be blurred */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .about__card {
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    background-color: rgba(10, 30, 50, 0.38);
  }
}

.about__card .avatar-stack img {
  border-color: rgba(250, 247, 242, 0.85);
}

.about__card-text {
  margin: 0;
  font-size: var(--fs-300);
  font-weight: var(--fw-semibold);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Right column — copy
   -------------------------------------------------------------------------- */
.about__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
}

.about__title {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.about__quote {
  width: 100%;
}

.about__features {
  display: grid;
  gap: var(--space-lg);
  width: 100%;
}

.about__checks {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--clr-line);
}

/* ==========================================================================
   Larger screens — min-width only
   ========================================================================== */
@media (min-width: 48em) {
  .about__features,
  .about__checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  .about__card {
    right: var(--space-lg);
    bottom: var(--space-lg);
  }

  .quote-card__body {
    padding: var(--space-lg);
  }

  .quote-card__quote p {
    font-size: var(--fs-400);
  }
}

@media (min-width: 64em) {
  .about__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: var(--space-2xl);
    align-items: center;
  }

  .about__photo {
    aspect-ratio: 3 / 4;
  }
}

/* The "Our Process" step cards (.process and below) moved to global.css when
   the /start/ landing page started using them too. */

/* The Fee Arrangement / pricing block moved to global.css when the Fee
   Arrangement page started using it too — shared components live there
   (handbook: one home for anything more than one page renders). */

/* ==========================================================================
   Project Experience — the principals' prior work, as cards
   Uses the shared .section-header and .link-arrow from global.css.
   ========================================================================== */
.projects__list {
  display: grid;
  gap: var(--space-xl);
}

.project {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: white;
}

.project__media {
  position: relative;
  background-color: rgba(15, 42, 68, 0.1);
}

.project__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  object-fit: cover;
}

/* Category flag, seated in the bottom-left corner of the photograph */
.project__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  padding: var(--space-xs) var(--space-md);
  border-radius: 0 var(--radius-sm) 0 0;
  background-color: var(--clr-accent-light);
  color: var(--clr-primary);
  font-size: var(--fs-200);
  font-weight: var(--fw-bold);
}

.project__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
  padding: var(--space-lg);
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.project__meta li {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--clr-muted);
  font-size: var(--fs-200);
}

.project__meta svg {
  width: 0.9375rem;
  height: 0.9375rem;
  flex: none;
  color: var(--clr-accent);
}

.project__title {
  margin: 0;
  font-size: var(--fs-500);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  text-wrap: balance;
}

.project__text {
  margin: 0;
  color: var(--clr-muted);
  font-size: var(--fs-300);
  line-height: 1.6;
}

/* Keeps every card's link on the same baseline */
.project__link {
  margin-top: auto;
  padding-top: var(--space-md);
}

/* ==========================================================================
   Project Experience — larger screens
   ========================================================================== */
@media (min-width: 64em) {
  /* Two columns: four projects sit as an even 2 × 2 */
  .projects__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  .project {
    max-width: none;
    margin-inline: 0;
  }
}

/* ==========================================================================
   Pathways marquee — a continuously scrolling band between About and Process

   The track holds the item list twice. Each item carries its own trailing
   padding rather than the track using `gap`, so both halves are exactly the
   same width and translateX(-50%) loops seamlessly.
   ========================================================================== */
.marquee {
  padding-block: var(--space-lg);
  background-color: var(--clr-primary);
}

.marquee__viewport {
  position: relative;
  overflow: hidden;
  /* Items dissolve at both edges instead of clipping hard */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 6%,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 6%,
    #000 94%,
    transparent 100%
  );
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 48s linear infinite;
}

/* Hovering or tabbing into the strip holds it still */
.marquee__viewport:hover .marquee__track,
.marquee__viewport:focus-within .marquee__track {
  animation-play-state: paused;
}

/* Set by js/script.js from the pause control */
.marquee.is-paused .marquee__track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.marquee__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: none;
  /* Trailing space lives on the item, not as a track gap — see note above */
  padding-right: clamp(2rem, 5vw, 3.5rem);
  color: var(--clr-surface);
  font-size: var(--fs-300);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.marquee__item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--clr-accent-light);
}

/* --------------------------------------------------------------------------
   Pause control
   Hover-pause alone leaves out keyboard and touch visitors, and WCAG 2.2.2
   wants a real mechanism for anything that moves for more than five seconds.
   -------------------------------------------------------------------------- */
.marquee__inner {
  position: relative;
}

.marquee__toggle {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--clr-line-on-dark);
  border-radius: 50%;
  background-color: var(--clr-primary);
  color: var(--clr-surface);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
}

.marquee__toggle svg {
  width: 0.875rem;
  height: 0.875rem;
}

.marquee__toggle:hover,
.marquee__toggle:focus-visible {
  border-color: var(--clr-accent-light);
  background-color: var(--clr-accent-light);
  color: var(--clr-primary);
}

/* Swap the glyph from the button's own state — no DOM rebuilding */
.marquee__toggle .marquee__icon-play {
  display: none;
}

.marquee__toggle[aria-pressed="true"] .marquee__icon-play {
  display: block;
}

.marquee__toggle[aria-pressed="true"] .marquee__icon-pause {
  display: none;
}

/* ==========================================================================
   Marquee — reduced motion
   Nothing moves on its own; the strip becomes a row the visitor scrolls.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .marquee__viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .marquee__track {
    animation: none;
    transform: none;
  }

  /* The second copy exists only to make the loop seamless */
  .marquee__track [aria-hidden="true"] {
    display: none;
  }

  .marquee__toggle {
    display: none;
  }
}

