.masthead {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 0;
  background: #000;
}

.masthead-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: #000;
}

/* === Proportional Border Rectangle & Content === */
.masthead-border-wrap {
  position: relative;
  width: 82vw;
  aspect-ratio: 2 / 1;
  margin-left: 5vw;      /* Adjust as needed: more pushes border to the right */
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 2;
  font-size: 2vw;
}

/* Border rectangle design */
.masthead-border-rectangle {
  position: absolute;
  inset: 0;
  border-top: 1.5px solid rgba(255,255,255,0.7);
  border-right: 1.5px solid rgba(255,255,255,0.7);
  border-bottom: 1.5px solid rgba(255,255,255,0.7);
  z-index: 2;
  pointer-events: none;
}
.masthead-border-rectangle::before,
.masthead-border-rectangle::after {
  content: '';
  position: absolute;
  left: 0;
  width: 0;
  border-left: 1.5px solid rgba(255,255,255,0.7);
}
.masthead-border-rectangle::before { top: 0; height: 12%; }
.masthead-border-rectangle::after  { bottom: 0; height: 12%; }

/* === Hero Content === */
.masthead-hero-content {
  position: relative;
  z-index: 3;
  max-width: 92vw;
  margin-left: -4vw;
  margin-top: 14vw;
  color: #fff;
  font-family: 'Playfair Display', serif;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.masthead-hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6em; 
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.12;
  text-transform: uppercase;
  margin-bottom: 0.45em;
  color: #fff;
}

.nowrap { white-space: nowrap; }

.masthead-hero-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6em; 
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0.85;
  margin-top: 1em;
  margin-bottom: 2em;
  text-align: left;
}

/* === Scroll Down Indicator === */
.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 13vh;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 6;
  cursor: pointer;
}

.scroll-text {
  font-family: 'Playfair Display', serif;
  font-size: 0.7em;
  letter-spacing: 0.25em;
  color: #fff;
  margin-bottom: 6px;
  opacity: 0.9;
  transition: color 0.16s linear;
}

/* --- Stack the arrows perfectly below the text --- */
.arrow-stack {
  position: relative;
  width: 20px;
  height: 20px;
  display: block;
}

/* Both arrows occupy the same space inside the stack */
.scroll-arrow {
  position: absolute;
  left: 0; top: 0;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.22));
  transition: opacity 0.16s linear;
  pointer-events: none;
}

/* Initial state: white arrow visible, orange arrow hidden */
.arrow-white  { opacity: 1; }
.arrow-orange { opacity: 0; }

/* On hover: white arrow fades out, orange arrow fades in; text turns orange */
.scroll-indicator:hover .scroll-text {
  color: #ee7828;
}
.scroll-indicator:hover .arrow-white  { opacity: 0; }
.scroll-indicator:hover .arrow-orange { opacity: 1; }

.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.2);
  z-index: 2;
}

@media (max-width: 700px) {
  .masthead-border-wrap {
    width: 80vw;             /* Shrinks right away at 699px */
    aspect-ratio: 2 / 1.6;
    font-size: 2.4vw;
    margin: 0 auto;
    min-width: 240px;
  }
  .masthead-hero-content {
    max-width: 92vw;
    margin-left: -4vw;
    margin-top: 25vw;
  }
  .masthead-hero-content h1 {
    font-size: 1.6em;                /* text now always scales from the .masthead-border-wrap font-size */
    letter-spacing: 0.07em;
    line-height: 1.14;
  }
  .masthead-hero-sub {
    font-size: 0.9em;
  }
  .scroll-indicator {
    bottom: 5vh;
  }
  .scroll-arrow {
    width: 18px;
  }
  .masthead .custom-btn {
    font-size: 0.9em;
    padding: 0.34em 1em;
  }
}

@media (max-width: 400px) {
  .masthead-border-wrap {
    width: 70vw;
    aspect-ratio: .9 / 1.1;
    font-size: 4vw;
    min-width: 120px;
    margin: 0 auto;
  }
  .masthead-hero-content {
    max-width: 96vw;
    margin-left: -6vw;
    margin-top: 34vw;
  }
  .masthead-hero-content h1 {
    font-size: 1em;  /* Inherits from .masthead-border-wrap font-size */
    letter-spacing: 0.07em;
    line-height: 1.14;
  }
  .masthead-hero-sub {
    font-size: 0.7em;
  }
  .scroll-arrow {
    width: 5vw;
    max-width: 24px;
    min-width: 10px;
  }
  .masthead .custom-btn {
    font-size: 0.75em;
    padding: 0.25em 0.5em;
  }
}

/* Responsive button, if you use one */
.masthead .custom-btn {
  font-size: 1.1em;
  padding: 0.6em 2em;
}

/* ========= Sticky header + STABLE viewport height below desktop ========= */
/* Make your header/search bar sticky so it reserves space; masthead uses 100svh (no resize on scroll) */
@media (max-width: 1024px) {
  /* Change these selectors to match your header/search container */
  .site-header,
  .search-bar {
    position: sticky;
    top: 0;
    z-index: 1000; /* above masthead video */
  }

  .masthead {
    min-height: 100svh; /* stable viewport height; prevents jump during scroll */
    padding-top: 0;
  }
}

/* Fallback if 100svh isn't supported */
@supports not (height: 100svh) {
  @media (max-width: 1024px) {
    .masthead { min-height: 100vh; }
  }
}

/* Desktop stays as before */
@media (min-width: 1025px) {
  .masthead {
    min-height: 100vh;
    padding-top: 0;
  }
}
