.home-button-showreel {
  border: 1px solid rgba(151, 136, 255, .58);
  color: #f7f5f0;
  background: linear-gradient(110deg, rgba(109, 92, 255, .20), rgba(255, 103, 60, .16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  cursor: pointer;
}

.home-button-showreel:hover,
.home-button-showreel:focus-visible {
  border-color: rgba(185, 174, 255, .92);
  background: linear-gradient(110deg, rgba(109, 92, 255, .32), rgba(255, 103, 60, .24));
}

html:has(body.portfolio-home),
body.portfolio-home {
  overflow-x: clip;
  overflow-y: visible;
}

.portfolio-home main { overflow: visible; }

.portfolio-home .home-hero {
  min-height: calc(100svh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-showreel-stage {
  position: sticky;
  z-index: 1;
  top: 72px;
  scroll-margin-top: 72px;
  width: 100%;
  height: calc(100svh - 72px);
  min-height: 620px;
  overflow: hidden;
  color: #fff;
  background: #050609;
  isolation: isolate;
}

.home-showreel-inline-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050609;
}

.home-showreel-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 5, 8, .34) 0%, transparent 20%, transparent 68%, rgba(4, 5, 8, .82) 100%),
    linear-gradient(90deg, rgba(4, 5, 8, .28), transparent 24%, transparent 76%, rgba(4, 5, 8, .28));
  pointer-events: none;
}

.home-showreel-chrome {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: clamp(24px, 3vw, 46px);
  pointer-events: none;
}

.home-showreel-heading {
  position: absolute;
  top: clamp(24px, 3vw, 46px);
  left: clamp(24px, 3vw, 46px);
  max-width: 480px;
}

.home-showreel-heading p {
  margin: 0 0 9px;
  color: rgba(255, 255, 255, .55);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .19em;
}

.home-showreel-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 650;
  letter-spacing: -.035em;
}

.home-showreel-status {
  position: absolute;
  top: clamp(24px, 3vw, 46px);
  right: clamp(24px, 3vw, 46px);
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, .58);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.home-showreel-status span { display: inline-flex; align-items: center; gap: 8px; }
.home-showreel-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58d79b;
  box-shadow: 0 0 0 4px rgba(88, 215, 155, .12);
}

.home-showreel-controls {
  position: absolute;
  right: clamp(24px, 3vw, 46px);
  bottom: clamp(28px, 3.4vw, 54px);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.home-showreel-controls button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  color: rgba(255, 255, 255, .86);
  background: rgba(5, 6, 9, .5);
  box-shadow: none;
  font-size: 10px;
  font-weight: 680;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.home-showreel-controls button:hover,
.home-showreel-controls button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .58);
  background: rgba(45, 91, 209, .68);
}

.home-showreel-controls button:last-child { padding-inline: 16px; }
.home-showreel-controls button:last-child span { display: inline-block; margin-left: 6px; }

.home-showreel-scroll {
  position: absolute;
  left: clamp(24px, 3vw, 46px);
  bottom: clamp(28px, 3.4vw, 54px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .62) !important;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: auto;
}

.home-showreel-scroll i {
  position: relative;
  width: 34px;
  height: 1px;
  overflow: visible;
  background: rgba(255, 255, 255, .42);
}

.home-showreel-scroll i::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-right: 1px solid rgba(255, 255, 255, .62);
  border-bottom: 1px solid rgba(255, 255, 255, .62);
  transform: rotate(45deg);
}

.home-content-layer {
  position: relative;
  z-index: 2;
  margin-top: -3svh;
  padding-top: 3svh;
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  background: var(--atelier-paper, #f7f5f0);
  box-shadow: 0 -28px 80px rgba(0, 0, 0, .18);
}

.portfolio-home .home-footer {
  position: relative;
  z-index: 5;
}

.showreel-dialog {
  width: min(1320px, calc(100vw - 48px));
  max-width: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  background: #0a0b0e;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .58);
}

.showreel-dialog::backdrop {
  background: rgba(4, 5, 7, .78);
  backdrop-filter: blur(14px);
}

.showreel-dialog[open] {
  position: fixed;
  z-index: 10000;
  inset: 50% auto auto 50%;
  max-height: calc(100vh - 24px);
  margin: 0;
  transform: translate(-50%, -50%);
}

@supports not selector(dialog::backdrop) {
  .showreel-dialog[open] {
    box-shadow: 0 0 0 100vmax rgba(4, 5, 7, .78), 0 40px 120px rgba(0, 0, 0, .58);
  }
}

.showreel-dialog-shell { padding: 20px; }

.showreel-dialog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 18px;
}

.showreel-dialog-heading small {
  color: rgba(255, 255, 255, .48);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.showreel-dialog-heading h2 {
  margin: 7px 0 0;
  color: #fff;
  font-size: 18px;
  letter-spacing: -.02em;
}

.showreel-dialog-heading button {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, .24);
  color: rgba(255, 255, 255, .82);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.showreel-video {
  width: 100%;
  max-height: calc(100vh - 180px);
  display: block;
  aspect-ratio: 16 / 9;
  background: #050609;
}

.showreel-dialog-note {
  margin: 14px 2px 0;
  color: rgba(255, 255, 255, .45);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

body.showreel-open { overflow: hidden; }

@media (max-width: 900px) {
  .home-showreel-heading { max-width: min(60vw, 420px); }
  .home-showreel-controls { max-width: 62vw; flex-wrap: wrap; justify-content: flex-end; }
  .showreel-dialog { width: calc(100vw - 20px); }
  .showreel-dialog-shell { padding: 10px; }
  .showreel-dialog-heading { padding: 4px 2px 12px; }
  .showreel-dialog-heading h2 { font-size: 14px; }
  .showreel-dialog-note { line-height: 1.5; }
}

@media (max-width: 768px) {
  .portfolio-home .home-hero { min-height: calc(100svh - 90px); }
  .home-showreel-stage {
    top: 90px;
    scroll-margin-top: 90px;
    height: calc(100svh - 90px);
    min-height: 520px;
  }
  .home-showreel-shade {
    background: linear-gradient(180deg, rgba(4, 5, 8, .56), transparent 31%, transparent 56%, rgba(4, 5, 8, .9) 100%);
  }
  .home-showreel-heading {
    top: 22px;
    right: 20px;
    left: 20px;
    max-width: none;
  }
  .home-showreel-heading h2 { max-width: 300px; font-size: 21px; line-height: 1.18; }
  .home-showreel-status { top: 24px; right: 20px; }
  .home-showreel-status span:first-child { display: none; }
  .home-showreel-controls {
    right: 20px;
    bottom: 24px;
    max-width: calc(100% - 40px);
  }
  .home-showreel-controls button { min-height: 36px; padding-inline: 11px; }
  .home-showreel-scroll { left: 20px; bottom: 79px; }
  .home-content-layer {
    margin-top: -2svh;
    padding-top: 2svh;
    border-radius: 22px 22px 0 0;
  }
}

@media (max-width: 480px) {
  .home-showreel-controls button:first-child { display: none; }
  .home-showreel-controls button:last-child { background: rgba(45, 91, 209, .72); }
  .home-showreel-scroll { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-showreel-controls button { transition: none; }
}
