/* ============================================
   VARIABLES
   ============================================ */
:root {
  --color-ink: #111827;
  --color-ink-50: rgba(17, 24, 39, 0.5);
  --color-bg: #ffffff;
  --font-sans: "Manrope", system-ui, -apple-system, sans-serif;

  --text-display: clamp(2.25rem, 4.5vw, 3.5rem);   /* 56px */
  --text-heading: clamp(1.5rem, 2.5vw, 2rem);      /* 32px */
  --text-subheading: clamp(1.25rem, 2vw, 1.75rem); /* 28px */
  --text-lead: clamp(1.0625rem, 1.5vw, 1.25rem);   /* 20px */
  --text-base: 1rem;

  --space-gutter: clamp(1.25rem, 10.3vw, 9.25rem); /* 148px at 1440 */
  --space-edge: 2rem;                               /* 32px */
  /* One shared content column: 1144px wide at 1440 (edges at x=148),
     collapsing to edge gutters on smaller screens. */
  --container: min(1144px, calc(100% - 2 * var(--space-edge)));
  --space-section: clamp(5rem, 12vw, 10rem);

  --radius: 16px;
  --radius-sm: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-base: 600ms;

  --header-height: 90px;
}

/* ============================================
   RESET
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2 {
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================
   COMPONENTS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--color-ink);
  color: #fff;
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.btn:active {
  transform: translateY(0);
}

/* ============================================
   SECTIONS — Header
   ============================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-edge);
  color: #fff;
  transition: color 400ms var(--ease-out);
}

.site-header.is-dark {
  color: var(--color-ink);
}

.site-header__logo,
.site-header__menu {
  display: inline-flex;
  color: inherit;
}

.site-header__menu svg {
  transition: transform var(--duration-fast) var(--ease-out);
}

.site-header__menu:hover svg {
  transform: rotate(90deg);
}

.site-header__menu[aria-expanded="true"] svg {
  transform: rotate(45deg); /* plus becomes a close */
}

/* While the menu is open the header sits over the dark overlay,
   so it's always white regardless of scroll position. */
.site-header.is-menu-open {
  color: #fff;
}

/* ============================================
   SECTIONS — Nav menu overlay
   ============================================ */
.nav-menu {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(1, 7, 20, 0.6);
  -webkit-backdrop-filter: blur(6.8px);
  backdrop-filter: blur(6.8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms var(--ease-out), visibility 0s linear 500ms;
}

.nav-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms var(--ease-out);
}

.nav-menu__links {
  list-style: none;
  margin: 0;
  padding: 328px 0 0 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-menu__link {
  display: inline-block;
  font-size: clamp(2rem, 3.3vw, 3rem); /* 48px */
  line-height: 1.1;
  color: #fff;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.nav-menu.is-open .nav-menu__link {
  opacity: 1;
  transform: translateY(0);
}

.nav-menu.is-open li:nth-child(1) .nav-menu__link { transition-delay: 60ms; }
.nav-menu.is-open li:nth-child(2) .nav-menu__link { transition-delay: 130ms; }
.nav-menu.is-open li:nth-child(3) .nav-menu__link { transition-delay: 200ms; }
.nav-menu.is-open li:nth-child(4) .nav-menu__link { transition-delay: 270ms; }

.nav-menu__link:hover {
  opacity: 0.7;
}

/* ============================================
   SECTIONS — Hero
   ============================================ */
.hero {
  position: relative;
  height: 968px;
  max-height: 130vh;
  overflow: hidden;
  background: linear-gradient(180deg, #c1ddee 0%, #e0eff8 13%, #edf4f7 42%, #f4efed 82%, #f7f3f1 88%, #ffffff 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  width: var(--container);
  margin-inline: auto;
  padding-top: 189px;
  will-change: transform;
}

.hero__title {
  font-size: var(--text-display);
  max-width: 817px;
}

.hero__image {
  position: absolute;
  z-index: 2;
  top: 29px;
  left: 50%;
  translate: -50% 0;
  /* Fixed at the design size and centered — wide screens don't scale it,
     the hero's overflow just crops the sides. */
  width: 1606px;
  pointer-events: none;
  will-change: transform;
}

.hero__image img {
  width: 100%;
  /* hero-house.png carries its own transparent top (sky zone), so the
     headline reads at rest and the opaque region covers it on scroll. */
}

/* ============================================
   SECTIONS — Social proof
   ============================================ */
.proof {
  padding-top: 8px;
  text-align: center;
}

.proof__title {
  font-size: var(--text-display);
  max-width: 560px;
  margin: 0 auto;
}

.proof__logos {
  margin-top: 100px;
  overflow: hidden;
}

.marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 47px;
  width: max-content;
  padding-right: 47px; /* keeps the loop seam evenly spaced */
  animation: marquee-scroll 32s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.proof__logo {
  flex-shrink: 0;
  opacity: 0.2;
}

.proof__logo--strong {
  opacity: 0.3;
}

.proof__dashboard {
  max-width: 910px;
  margin: 88px auto 0;
  padding: 0 var(--space-edge);
}

.proof__dashboard img {
  width: 100%;
  border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
}

/* ============================================
   SECTIONS — Templates
   ============================================ */
.templates {
  padding-top: 80px;
}

.templates__intro {
  display: flex;
  justify-content: space-between;
  gap: clamp(32px, 6vw, 96px);
  width: var(--container);
  margin-inline: auto;
}

.templates__heading {
  font-size: var(--text-heading);
  line-height: 1.2;
  max-width: 422px;
  flex: 1;
}

.templates__copy {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--color-ink-50);
  max-width: 422px;
  flex: 1;
}

.carousel {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 20px;
  width: var(--container);
  margin: 64px auto 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel__slide {
  flex: 0 0 min(677px, 82%);
  aspect-ratio: 677 / 351;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 350ms var(--ease-out);
}

.carousel__slide.is-switching img {
  opacity: 0;
}

/* Clickable side slides get a hover tint */
.carousel__slide--prev::after,
.carousel__slide--next::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.carousel__slide--prev:hover::after,
.carousel__slide--next:hover::after {
  opacity: 0.18;
}

.carousel__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 16%, rgba(255, 255, 255, 0) 84%, #fff 100%);
}

/* ============================================
   SECTIONS — Features
   ============================================ */
.features {
  padding-top: var(--space-section);
  text-align: center;
}

.features__title {
  font-size: var(--text-display);
  max-width: 777px;
  margin: 0 auto;
}

.features__panel {
  display: flex;
  align-items: center;
  gap: clamp(40px, 4.9vw, 70px);
  width: var(--container);
  margin: 110px auto 0;
  text-align: left;
}

.features__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.feature {
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
  padding-bottom: 24px;
}

.feature__toggle {
  display: block;
  width: 100%;
  text-align: left;
}

.feature__name {
  font-size: var(--text-subheading);
  line-height: 1.2;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.feature:not(.is-active) .feature__toggle:hover .feature__name {
  opacity: 0.6;
}

.feature__desc {
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-ink-50);
  margin-top: 16px;
  display: none;
}

.feature.is-active .feature__desc {
  display: block;
  animation: fade-slide-in 400ms var(--ease-out);
}

.features__media {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
}

.features__media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity 300ms var(--ease-out);
}

.features__media img.is-switching {
  opacity: 0;
}

/* ============================================
   SECTIONS — Video showcase
   ============================================ */
.showcase {
  padding-top: var(--space-section);
}

.showcase__frame {
  position: relative;
  width: var(--container);
  margin: 0 auto;
}

.showcase__frame video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.showcase__mute {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.showcase__mute:hover {
  background: rgba(17, 24, 39, 0.8);
  transform: scale(1.06);
}

.showcase__mute .icon-sound-off,
.showcase__mute[aria-pressed="true"] .icon-sound-on {
  display: none;
}

.showcase__mute[aria-pressed="true"] .icon-sound-off {
  display: block;
}

/* ============================================
   SECTIONS — FAQ
   ============================================ */
.faq {
  padding-top: var(--space-section);
}

.faq__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(32px, 6vw, 96px);
  width: var(--container);
  margin: 0 auto;
}

.faq__title {
  font-size: var(--text-display);
}

.faq__copy {
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--color-ink-50);
  max-width: 286px;
}

.faq__list {
  width: var(--container);
  margin: 64px auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.faq-item {
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
  padding-bottom: 24px;
}

.faq-item__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  text-align: left;
}

.faq-item__question {
  font-size: var(--text-subheading);
  line-height: 1.2;
}

.faq-item__icon {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(17, 24, 39, 0.2);
  border-radius: 50%;
  transition: transform 300ms var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  translate: -50% -50%;
}

.faq-item__icon::after {
  rotate: 90deg;
  transition: rotate 300ms var(--ease-out);
}

.faq-item__toggle:hover .faq-item__icon {
  background: rgba(17, 24, 39, 0.05);
}

.faq-item__toggle[aria-expanded="true"] .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 400ms var(--ease-out);
}

.faq-item__answer > p {
  overflow: hidden;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-ink-50);
  max-width: 780px;
}

.faq-item__toggle[aria-expanded="true"] + .faq-item__answer {
  grid-template-rows: 1fr;
}

.faq-item__toggle[aria-expanded="true"] + .faq-item__answer > p {
  padding-top: 16px;
}

/* ============================================
   SECTIONS — CTA + Footer
   ============================================ */
.cta {
  position: relative;
  margin-top: var(--space-section);
  min-height: 823px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cta__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 64%, rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
}

.cta__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  max-width: 678px;
  margin-left: calc(41.67% + 14px);
  padding: 84px var(--space-edge) 0 0;
}

.cta__title {
  font-size: var(--text-display);
}

.footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px var(--space-edge);
  color: #fff;
}

.footer__links {
  display: flex;
  gap: 35px;
  font-weight: 600;
}

.footer__links a {
  transition: opacity var(--duration-fast) var(--ease-out);
}

.footer__links a:hover {
  opacity: 0.7;
}

.footer__logo {
  display: inline-flex;
}

.footer__copyright {
  font-size: var(--text-base);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .hero {
    height: auto;
    min-height: 640px;
    padding-bottom: 44vw;
  }

  .hero__content {
    padding-top: 150px;
  }

  .hero__image {
    top: auto;
    bottom: -6vw;
    width: max(120%, 640px);
  }

  .features__panel {
    flex-direction: column;
    align-items: stretch;
    margin-top: 72px;
  }

  .features__media img {
    aspect-ratio: 1120 / 796;
    min-height: 0;
  }

  .cta__content {
    margin-left: 0;
    padding: 84px var(--space-edge) 64px;
  }
}

@media (max-width: 768px) {
  :root {
    --space-edge: 1.25rem;
  }

  .templates__intro,
  .faq__intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .faq__copy {
    max-width: 100%;
  }

  .carousel__slide {
    flex-basis: 82%;
  }

  .proof__logo {
    max-height: 44px;
    width: auto;
  }

  .marquee__track {
    gap: 28px;
    padding-right: 28px;
    animation-duration: 22s;
  }

  .faq-item__question {
    font-size: 1.25rem;
  }

  .faq-item__icon {
    width: 32px;
    height: 32px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .nav-menu__links {
    padding: 180px 0 0 var(--space-edge);
  }

  .cta {
    min-height: 640px;
  }

  .showcase__mute {
    right: 12px;
    bottom: 12px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
