*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #3a4a3e;
}

/* ── Video layer ── */
.video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Sage overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/*
  On portrait mobile, preserveAspectRatio="xMidYMid slice" shows only
  ~400 of the 1600 horizontal user units, clipping the 640-wide figure.
  Scale 6 (384px wide) fits comfortably within that visible range.
*/
.cowgirl-mobile  { display: none; }

@media (max-width: 767px) {
  .cowgirl-desktop { display: none; }
  .cowgirl-mobile  { display: block; }
}

/* ── Content layer ── */
.content {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.5rem 2.75rem;
}

/*
  max-width: min-content constrains the container to the largest
  child min-content size. .name (nowrap) contributes its full text
  width; .intro contributes only its longest single word — so the
  container is sized to the name, and .intro wraps within that.
*/
.text-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%; /* mobile: intro flows the full content width */
}

@media (min-width: 768px) {
  .text-block {
    width: auto;
    max-width: min-content; /* constrain intro to name width on iPad+ */
  }
}

.name {
  font-family: "Playwrite US Trad", cursive;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  color: #f0ebe0;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
  /* Script fonts have tall ascenders that extend above the em-square;
     padding-top keeps them inside the clip-path region during animation. */
  padding-top: 0.4em;
}

.intro {
  padding-left: 12px;
  padding-top: 12px;
  font-family: "Coustard", serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1rem;
  color: #f0ebe0;
  overflow-wrap: break-word;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: "Coustard", serif;
  font-size: 0.65rem;
  color: #b6c4b9;
  line-height: 1.4;
  align-self: flex-end;
  text-align: right;
}

.footer a {
  color: inherit;
  text-decoration: none;
  pointer-events: all;
}

.footer a:hover {
  text-decoration: underline;
}

/*
  Animations only run when the user has not requested reduced motion.
  Elements are visible by default (no opacity: 0) so they always show
  regardless of motion preference.
*/
@media (prefers-reduced-motion: no-preference) {
  .name {
    opacity: 0;
    animation: reveal-up 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
  }

  .intro {
    opacity: 0;
    animation: reveal-up 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
  }

  .footer {
    opacity: 0;
    animation: reveal-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.1s;
  }

  @keyframes reveal-up {
    from {
      clip-path: inset(100% 0 0 0);
      opacity: 0;
    }
    to {
      clip-path: inset(0% 0 0 0);
      opacity: 1;
    }
  }
}

/* Hide the video for users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .video-bg {
    display: none;
  }
}
