/**
 * Coastline DC — Hero Section
 * TASK-001 — Production hero (homepage)
 */

/* ─── Hero shell ─── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100svh;
  height: 100vh;
  min-height: 100svh;
  min-height: 100vh;
  color: var(--color-text-inverse);
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

.hero__picture,
.hero__image {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  object-position: 68% center;
}

@media (max-width: 47.99rem) {
  .hero__image {
    object-fit: cover;
    object-position: center 42%;
  }
}

.hero__media .media-placeholder {
  background:
    linear-gradient(
      145deg,
      var(--primitive-navy-950) 0%,
      var(--primitive-navy-800) 30%,
      var(--primitive-ocean-900) 55%,
      var(--primitive-navy-900) 85%,
      var(--primitive-navy-950) 100%
    );
  color: rgb(255 255 255 / 0.38);
}

.hero__media .media-placeholder span {
  max-width: 18rem;
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-spacing-wide);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      rgb(6 13 24 / 0.92) 0%,
      rgb(10 22 40 / 0.55) 42%,
      rgb(10 22 40 / 0.25) 70%,
      rgb(10 22 40 / 0.35) 100%
    );
}

.hero__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    transparent 0%,
    rgb(6 13 24 / 0.45) 100%
  );
}

/* ─── Layout ─── */

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.hero__content {
  align-self: end;
  width: 100%;
  padding-block: var(--space-6) var(--space-5);
  min-height: 0;
}

@media (min-width: 48rem) {
  .hero__content {
    padding-block: var(--space-10) var(--space-6);
  }
}

@media (max-height: 44rem) {
  .hero__eyebrow {
    display: none;
  }

  .hero__subheadline {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
  }

  .hero__headline {
    font-size: clamp(2rem, 8vw, 2.75rem);
  }
}

/* ─── Typography ─── */

.hero__eyebrow {
  margin-bottom: var(--space-5);
  font-family: var(--font-family-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--primitive-gold-400);
}

.hero__headline {
  margin-bottom: var(--space-5);
  font-family: var(--font-family-display);
  font-size: clamp(2.25rem, 5.5vw + 0.5rem, 4.75rem);
  font-weight: var(--font-weight-regular);
  line-height: 1.02;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-inverse);
  max-width: 11ch;
}

@media (min-width: 48rem) {
  .hero__headline {
    margin-bottom: var(--space-6);
    max-width: 14ch;
  }
}

.hero__subheadline {
  margin-bottom: var(--space-8);
  font-size: clamp(var(--font-size-base), 1.25vw + 0.65rem, var(--font-size-lg));
  line-height: var(--line-height-relaxed);
  color: var(--primitive-sand-200);
  max-width: 40rem;
}

/* ─── CTAs ─── */

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero .btn--primary {
  background-color: var(--color-text-inverse);
  color: var(--primitive-navy-900);
  border-color: var(--color-text-inverse);
}

.hero .btn--primary:hover {
  background-color: var(--primitive-sand-100);
  border-color: var(--primitive-sand-100);
}

.hero .btn--secondary {
  background-color: transparent;
  border-color: rgb(255 255 255 / 0.42);
  color: var(--color-text-inverse);
}

.hero .btn--secondary:hover {
  background-color: rgb(255 255 255 / 0.08);
  border-color: var(--color-text-inverse);
}

/* ─── Bottom bar: trust badges + scroll ─── */

.hero__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  flex-shrink: 0;
  padding-block: var(--space-5) var(--space-8);
  border-top: 1px solid rgb(255 255 255 / 0.12);
  background: linear-gradient(to top, rgb(6 13 24 / 0.65), rgb(6 13 24 / 0.2));
}

@media (min-width: 48rem) {
  .hero__bar {
    padding-block: var(--space-6) var(--space-10);
  }
}

.hero__badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .hero__badges {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4) var(--space-8);
  }
}

.hero__badge {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  color: var(--primitive-sand-200);
}

.hero__badge-icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15em;
  color: var(--primitive-gold-400);
}

.hero__badge-text {
  font-weight: var(--font-weight-medium);
}

.hero__badge-text span {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--primitive-sand-300);
}

.hero__badge--compact .hero__badge-text span {
  display: none;
}

@media (max-width: 47.99rem) {
  .hero__badges {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .hero__badge {
    font-size: var(--font-size-xs);
    gap: var(--space-2);
  }

  .hero__badge-text span {
    display: none;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__bar {
    gap: var(--space-3);
    padding-block: var(--space-4) var(--space-5);
  }

  .hero__scroll {
    flex-direction: row;
    gap: var(--space-3);
  }

  .hero__scroll-line {
    width: 2.5rem;
    height: 1px;
    background: linear-gradient(to right, transparent, rgb(255 255 255 / 0.6));
  }
}

.hero--cinematic .hero__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.hero--cinematic .hero__content {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-block: var(--space-8) var(--space-6);
}

@media (min-width: 48rem) {
  .hero--cinematic .hero__content {
    padding-block: var(--space-12) var(--space-8);
  }
}

.hero--cinematic .hero__headline {
  max-width: 16ch;
}

/* ─── Photo hero — official Coastline construction imagery ─── */

.hero--photo {
  color: var(--color-text-inverse);
}

.hero--photo .hero__overlay {
  background: linear-gradient(
    102deg,
    rgb(0 0 0 / 0.18) 0%,
    rgb(0 0 0 / 0.14) 30%,
    rgb(0 0 0 / 0.06) 48%,
    transparent 62%
  );
}

.hero--photo .hero__overlay::after {
  display: none;
}

.hero--photo.hero--cinematic .hero__content {
  align-items: center;
  padding-block: clamp(var(--space-10), 14vh, var(--space-20));
}

.hero--photo .hero__copy {
  max-width: 38rem;
}

@media (min-width: 48rem) {
  .hero--photo .hero__copy {
    max-width: 42rem;
  }

  .hero--photo .hero__headline {
    max-width: 11ch;
    font-size: clamp(2.75rem, 4.2vw + 1rem, 5.25rem);
    letter-spacing: -0.02em;
  }
}

.hero--photo .hero__subheadline {
  max-width: 34ch;
  color: rgb(255 255 255 / 0.92);
}

.hero--photo .hero__bar {
  border-top-color: rgb(255 255 255 / 0.18);
  background: linear-gradient(to top, rgb(0 0 0 / 0.42), rgb(0 0 0 / 0.08));
}

.hero--photo .btn--primary {
  background-color: var(--color-text-inverse);
  color: var(--primitive-navy-900);
  border-color: var(--color-text-inverse);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.12);
}

.hero--photo .btn--primary:hover {
  background-color: var(--primitive-sand-100);
  border-color: var(--primitive-sand-100);
}

.hero--photo .btn--secondary {
  background-color: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.55);
  color: var(--color-text-inverse);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero--photo .btn--secondary:hover {
  background-color: rgb(255 255 255 / 0.22);
  border-color: var(--color-text-inverse);
}

.hero--cinematic .hero__bar {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding-inline: var(--space-6);
}

@media (min-width: 48rem) {
  .hero--cinematic .hero__bar {
    padding-inline: var(--space-8);
  }
}

/* ─── Scroll indicator ─── */

.hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  padding: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.55);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.hero__scroll:hover {
  color: var(--color-text-inverse);
}

.hero__scroll:focus-visible {
  outline: 2px solid var(--color-text-inverse);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0.6), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__scroll-line {
    animation: hero-scroll-line 2.2s var(--ease-editorial) infinite;
  }
}

@keyframes hero-scroll-line {
  0%, 100% {
    opacity: 0.35;
    transform: scaleY(0.85);
    transform-origin: top;
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ─── Entrance animation ─── */

@media (prefers-reduced-motion: no-preference) {
  .hero__animate {
    animation: hero-enter 1.1s var(--ease-editorial) backwards;
  }

  .hero__animate--1 { animation-delay: 0.08s; }
  .hero__animate--2 { animation-delay: 0.18s; }
  .hero__animate--3 { animation-delay: 0.28s; }
  .hero__animate--4 { animation-delay: 0.38s; }

  .hero__bar {
    animation: hero-enter 1s var(--ease-editorial) 0.5s backwards;
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__animate,
  .hero__bar {
    animation: none;
  }
}
