/* How-to video overlay (howto.js). Standalone: safe to load on any page. */
.howto-modal {
  --howto-green: #11AD30;
  --howto-ink: #0B0B0B;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
.howto-modal::backdrop { background: rgba(11, 11, 11, .86); }
.howto-modal[open] { display: flex; align-items: center; justify-content: center; }
.howto-modal.is-fallback { z-index: 1000; background: rgba(11, 11, 11, .86); }

.howto-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 16px 24px;
  max-width: 100%;
  animation: howto-in .28s cubic-bezier(.2, .8, .2, 1);
}
.howto-title {
  margin: 0;
  max-width: 34ch;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  color: rgba(255, 255, 255, .86);
}

/* 9:16 frame sized to the viewport; .is-wide (the default, set by howto.js) switches to 16:9 */
.howto-frame {
  position: relative;
  height: min(78vh, 860px);
  aspect-ratio: 9 / 16;
  max-width: calc(100vw - 32px);
  border-radius: 28px;
  overflow: hidden;
  background: var(--howto-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .5);
}
.howto-modal.is-wide .howto-frame { height: auto; width: min(92vw, 1100px); aspect-ratio: 16 / 9; border-radius: 16px; }
.howto-frame iframe,
.howto-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--howto-ink); }
.howto-frame video { object-fit: contain; }

.howto-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: 400 28px/1 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background .15s;
}
.howto-close:hover { background: rgba(255, 255, 255, .22); }
.howto-close:focus-visible,
.howto-frame :focus-visible { outline: 3px solid var(--howto-green); outline-offset: 3px; }

/* Phones: fill the screen */
@media (max-width: 600px), (max-height: 520px) {
  .howto-inner { width: 100%; height: 100%; padding: 0; gap: 0; }
  .howto-title { position: absolute; top: 0; left: 0; right: 60px; z-index: 1; padding: 18px 16px; text-align: left; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
  .howto-frame,
  .howto-modal.is-wide .howto-frame { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .howto-close { z-index: 2; top: max(8px, env(safe-area-inset-top)); background: rgba(11, 11, 11, .55); }
}

/* Trigger styles */
[data-howto] { cursor: pointer; }
.howto-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border: 0;
  border-radius: 999px;
  background: #0B0B0B;
  color: #fff;
  font: 500 15px/1 'DM Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.howto-btn::before {
  content: '';
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: #11AD30 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.howto-btn:hover { background: #222; transform: translateY(-1px); }
.howto-btn:focus-visible { outline: 3px solid #11AD30; outline-offset: 3px; }

html.howto-lock, html.howto-lock body { overflow: hidden; }

@keyframes howto-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .howto-inner { animation: none; }
  .howto-btn, .howto-close { transition: none; }
  .howto-btn:hover { transform: none; }
}
