/* Masthead: slim sticky bar (sized in px so it looks identical on compact app pages) (logo, navigation, play button) above a video hero. */
:root {
  --masthead-h: 72px;
  --masthead-bg: #111416;
  --masthead-line: rgba(232, 237, 240, .1);
}
html { scroll-padding-top: calc(var(--masthead-h) + 16px); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 11.2px 16px;
  border-radius: 4px;
  background: #fff;
  color: #111416;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: #111416; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--masthead-h);
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(10, 12, 14, .72), rgba(10, 12, 14, 0));
  transition: background-color .25s ease, border-color .25s ease;
}
.masthead.betterstate-nav-scrolled,
.masthead:has(.masthead__drawer:not(.hidden)) {
  background: var(--masthead-bg);
  border-bottom-color: var(--masthead-line);
}

.masthead__bar {
  display: flex;
  align-items: center;
  gap: 40px;
  box-sizing: border-box;
  width: min(100%, 1408px);
  height: 100%;
  margin-inline: auto;
  padding-inline: 16px;
}

.masthead__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
}
.masthead__brand img {
  display: block;
  width: auto;
  height: 41.6px;
  max-width: none;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  margin-right: auto;
}
.masthead__link {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 14.4px;
  color: rgba(238, 238, 239, .72);
  font-size: 15.2px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s ease;
}
.masthead__link::after {
  content: '';
  position: absolute;
  left: 14.4px;
  right: 14.4px;
  bottom: -1px;
  height: 2px;
  background: #d0283f;
  transform: scaleX(0);
  transition: transform .25s ease;
}
.masthead__link:hover,
.masthead__link.is-active { color: #fff; text-decoration: none; }
.masthead__link.is-active::after { transform: scaleX(1); }

.masthead__tools {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.masthead__tool {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(238, 238, 239, .72);
  font-size: 15.2px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.masthead__tool:hover { color: #fff; text-decoration: none; }

.masthead__user {
  display: flex;
  align-items: center;
  gap: 9.6px;
  color: rgba(238, 238, 239, .85);
  font-size: 15.2px;
  font-weight: 500;
  text-decoration: none;
}
.masthead__user:hover { color: #fff; text-decoration: none; }
.masthead__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.masthead__user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.masthead__logout { display: flex; margin: 0; }
.masthead__icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--masthead-line);
  border-radius: 4px;
  background: transparent;
  color: rgba(238, 238, 239, .72);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.masthead__icon-btn:hover { color: #ee9aaa; border-color: #a8172e50; background: #a8172e20; }
.masthead__icon-btn:focus-visible { outline: 2px solid #d17c8c; outline-offset: 3px; }
.masthead__icon-btn svg { width: 16px; height: 16px; }

.masthead__burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
.masthead__burger span,
.masthead__burger span::before,
.masthead__burger span::after {
  position: absolute;
  left: 50%;
  width: 22.4px;
  height: 2px;
  margin-left: -11.2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.masthead__burger span { top: 50%; margin-top: -1px; }
.masthead__burger span::before,
.masthead__burger span::after { content: ''; left: 0; margin-left: 0; }
.masthead__burger span::before { transform: translateY(-7px); }
.masthead__burger span::after { transform: translateY(7px); }
.masthead__burger[aria-expanded='true'] span { background: transparent; }
.masthead__burger[aria-expanded='true'] span::before { background: #fff; transform: rotate(45deg); }
.masthead__burger[aria-expanded='true'] span::after { background: #fff; transform: rotate(-45deg); }

.masthead__drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--masthead-h));
  overflow-y: auto;
  padding: 8px 20px 24px;
  border-bottom: 1px solid var(--masthead-line);
  background: var(--masthead-bg);
}
.masthead__drawer-nav { display: flex; flex-direction: column; }
.masthead__drawer-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--masthead-line);
  color: #d9dfe3;
  font-size: 16.8px;
  font-weight: 500;
  text-decoration: none;
}
.masthead__drawer-link.is-active { color: #fff; box-shadow: inset 3px 0 0 #d0283f; padding-left: 13.6px; }
.masthead__drawer-actions {
  display: grid;
  gap: 9.6px;
  margin-top: 20px;
}
.masthead__drawer-actions form { margin: 0; }
.masthead__drawer-actions :is(.btn-play, .btn-ghost) { width: 100%; }

/* Hero: full-bleed footage. The masthead overlaps it, so it starts at the page top. */
.hero {
  position: relative;
  isolation: isolate;
  margin-top: calc(-1 * var(--masthead-h));
  overflow: hidden;
  background: #111416;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
}

.hero--home {
  display: flex;
  align-items: flex-end;
  min-height: min(832px, 88svh);
}
.hero--home .hero__media::after {
  background:
    linear-gradient(180deg, rgba(10, 12, 14, .35) 0%, rgba(17, 20, 22, 0) 25%, rgba(17, 20, 22, 0) 60%, #111416 100%),
    linear-gradient(90deg, rgba(10, 12, 14, .88) 0%, rgba(10, 12, 14, .6) 38%, rgba(10, 12, 14, .1) 75%);
}
.hero__inner {
  box-sizing: border-box;
  width: min(100%, 1408px);
  margin-inline: auto;
  padding: calc(var(--masthead-h) + 48px) 16px 88px;
}
.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 9.6px;
  margin: 0 0 24px;
  color: rgba(238, 238, 239, .8);
  font-size: 15.2px;
  font-variant-numeric: tabular-nums;
}
.hero__status strong { color: #fff; font-weight: 600; }
.hero__status-dot {
  width: 8.8px;
  height: 8.8px;
  border-radius: 50%;
  background: #8b6d73;
}
.hero__status.is-online .hero__status-dot {
  background: #4fc27a;
  box-shadow: 0 0 0 0 rgba(79, 194, 122, .5);
  animation: hero-live 2.4s ease-out infinite;
}
@keyframes hero-live {
  0% { box-shadow: 0 0 0 0 rgba(79, 194, 122, .45); }
  70%, 100% { box-shadow: 0 0 0 8.8px rgba(79, 194, 122, 0); }
}
.hero__title {
  max-width: 14ch;
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.hero__lead {
  max-width: 544px;
  margin: 24px 0 0;
  color: rgba(238, 238, 239, .82);
  font-size: 18px;
  line-height: 1.65;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.hero__more {
  display: inline-block;
  margin-top: 24px;
  color: rgba(238, 238, 239, .7);
  font-size: 15.2px;
  text-decoration: underline;
  text-decoration-color: rgba(238, 238, 239, .3);
  text-underline-offset: .3em;
}
.hero__more:hover { color: #fff; text-decoration-color: #d0283f; }

/* Inner pages: a short band of footage behind the masthead and page title. */
.hero--page { height: 240px; }
.hero--page .hero__media::after {
  background: linear-gradient(180deg, rgba(10, 12, 14, .55) 0%, rgba(17, 20, 22, .82) 55%, #111416 100%);
}
.hero--page + .diego-host + main { position: relative; margin-top: -104px; }
.hero--page + .diego-host + main.updates-shell { padding-top: 0; }

@media (max-width: 1100px) {
  .masthead__bar { gap: 24px; }
  .masthead__link { padding-inline: 9.6px; }
  .masthead__link::after { left: 9.6px; right: 9.6px; }
  .masthead__tool, .masthead__user-name { display: none; }
}
@media (max-width: 900px) {
  :root { --masthead-h: 64px; }
  .masthead__bar { padding-inline: 16px; }
  .masthead__brand img { height: 35.2px; }
  .masthead__nav, .masthead__tools { display: none; }
  .masthead__burger { display: block; }
  .hero--home { min-height: min(704px, 92svh); }
  .hero--home .hero__media::after {
    background: linear-gradient(180deg, rgba(10, 12, 14, .55) 0%, rgba(10, 12, 14, .45) 35%, rgba(10, 12, 14, .85) 70%, #111416 100%);
  }
  .hero__inner { padding: calc(var(--masthead-h) + 32px) 20px 48px; }
  .hero__lead { font-size: 16px; }
  .hero__actions :is(.btn-play, .btn-ghost) { flex: 1 1 192px; }
  .hero--page { height: 160px; }
  .hero--page + .diego-host + main { margin-top: -64px; }
}
@media (min-width: 901px) {
  .masthead__drawer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__status.is-online .hero__status-dot { animation: none; }
  .masthead__link::after, .masthead__burger span, .masthead__burger span::before, .masthead__burger span::after { transition: none; }
}

/* Scrollbar matches the dark surfaces. */
html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track { background: #111416; }
html::-webkit-scrollbar-thumb { background: #3a4146; border: 3px solid #111416; border-radius: 999px; }
html::-webkit-scrollbar-thumb:hover { background: #79303d; }
html::-webkit-scrollbar-corner { background: #111416; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: #3a4146 #111416; }
}
@media (forced-colors: active) {
  html { scrollbar-color: auto; }
}

/* Diego: support helper peeking up from the bottom-right edge. Idle his face is visible,
   a tease lifts him to the shoulders and a click opens his speech bubble. */
.diego-host .diego { --diego-w: 136px; right: 24px; bottom: 0; }
.diego-host .diego__figure {
  transform: translate3d(0, 42%, 0);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
}
.diego-host .diego.is-tease .diego__figure { transform: translate3d(0, 22%, 0); }
.diego-host .diego.is-talk .diego__figure { transform: translate3d(0, 6%, 0); }
.diego-host .diego:not(.is-tease):not(.is-talk) .diego__figure:hover { transform: translate3d(0, 34%, 0); }
.diego-host .diego__img { mix-blend-mode: normal; }
/* Out of the way while the mobile menu is open. */
body:has(.masthead__drawer:not(.hidden)) .diego-host .diego {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 520px) {
  .diego-host .diego { --diego-w: 108px; right: 12px; }
}
.diego-host .diego__bubble {
  border-radius: 8px;
  background: #191d20;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.diego-host .diego__bubble::before,
.diego-host .diego__bubble::after { display: none; }
.diego-host .diego__name { color: #e8a3ae; letter-spacing: .08em; }
.diego-host .diego__cta {
  justify-content: flex-start;
  width: auto;
  padding: 9.6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #eea1ad;
  box-shadow: none;
}
.diego-host .diego__cta:hover { color: #fff; filter: none; transform: none; }
@media (max-width: 767px) {
  .diego-host .diego__text { font-size: 14.4px; line-height: 1.6; }
  .diego-host .diego__cta { min-height: 44px; align-items: center; }
}

/* Scroll depth (set by home-motion.js): copy drifts up and fades, footage lags behind. */
.hero--home .hero__inner {
  transform: translate3d(0, var(--hero-copy-y, 0px), 0);
  opacity: var(--hero-copy-opacity, 1);
}
.hero--home .hero__video { transform: translate3d(0, var(--hero-video-y, 0px), 0); }
