/* /media. Tokens and the nav live in site.css. .os-container is 1180 outer / 1124
   content, with 20px gutters under 640px and 28px from 640px up.
   Direction A from 768px: featured 16:9, then a card grid.
   Under 768px the grids become Direction B's snap-scrolling 9:16 reel. */

html.media-page { scroll-padding-top: 84px; }
html.media-page, html.media-page body { max-width: 100%; overflow-x: clip; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sm-hide { display: none; }
@media (min-width: 768px) { .sm-hide { display: inline; } }

.os-container { --g: 20px; }
@media (min-width: 640px) { .os-container { --g: 28px; } }

.m-head { padding-top: calc(68px + 28px); padding-bottom: 8px; }
.m-crumb { margin: 0 0 18px; font-size: 14.5px; color: var(--ink-2); }
.m-crumb ol { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.m-crumb li + li::before { content: "/"; margin: 0 8px; color: var(--ink-2); }
.m-crumb a { color: var(--violet-2); font-weight: 600; }
.m-h1 { font-size: clamp(2.1rem, 5.4vw, 3.8rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; text-wrap: balance; margin: 6px 0 0; }
.m-intro { max-width: 62ch; }
.m-intro p { margin: 14px 0 0; }
.m-intro a, .m-desc a, .m-fine a { color: var(--violet-2); font-weight: 600; }
.m-head-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (max-width: 767px) { .m-head-actions .os-btn { flex: 1 1 100%; } }

.m-sec { padding-top: 52px; }
.m-h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 680; line-height: 1.15; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.m-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.m-kicker { margin: 0 0 6px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-2); }
.m-desc { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; overflow-wrap: anywhere; }
.m-card-title, .m-feat-title, .m-player-title, .m-h1, .m-h2 { overflow-wrap: anywhere; }
.m-fine { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.m-fp { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.m-tag { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.45); color: #fff; background: rgba(255, 255, 255, 0.08); }
.m-tag-pro { color: #fff; background: #3c2d86; border-color: transparent; margin-left: 6px; }

.m-stage { position: relative; overflow: hidden; border-radius: 24px; border: 1px solid var(--line-strong); background: #05070f; box-shadow: var(--shadow-window); aspect-ratio: 16 / 9; }
.m-stage video, .m-stage-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.m-feat { padding-top: 8px; }
.m-feat-a { padding-bottom: 8px; }
.m-feat-video { aspect-ratio: 16 / 9; }
.m-feat-cap { padding-top: 18px; }
.m-feat-title { font-size: clamp(1.35rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.m-feat-desc { max-width: 70ch; }
@media (min-width: 768px) { .m-stage { border-radius: 28px; } }
@media (max-width: 767px) {
  .m-feat-video { aspect-ratio: 9 / 16; max-height: 70svh; width: min(100%, calc(70svh * 9 / 16)); margin-inline: auto; }
}
.m-feat-play { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; }
.m-feat-play[hidden] { display: none; }
.m-feat-play:focus-visible { outline: 2px solid var(--violet); outline-offset: -6px; }
.m-feat-play .m-play { position: static; width: 76px; height: 76px; background: var(--accent-solid); border-color: rgba(255, 255, 255, 0.35); }
.m-feat-play .m-play svg { width: 28px; height: 28px; }

.m-grid, .m-grid-1, .m-reel { list-style: none; margin: 0; padding: 0; }
.m-card { position: relative; display: grid; gap: 12px; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 10px; transition: background-color 0.2s ease, border-color 0.2s ease; }
.m-card:hover { background: var(--card-hover); border-color: rgba(168, 152, 255, 0.32); }
.m-thumb { position: relative; overflow: hidden; border-radius: 14px; background: #0b0f1f; aspect-ratio: 16 / 9; }
.m-pic, .m-pic img { display: block; width: 100%; height: 100%; }
.m-pic img { object-fit: cover; background: #0b0f1f; }
.m-play { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgba(8, 10, 22, 0.82); border: 1px solid rgba(255, 255, 255, 0.55); }
.m-play svg { width: 18px; height: 18px; margin-left: 2px; }
.m-dur { position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 2px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: #fff; background: rgba(5, 7, 15, 0.88); }
.m-card-title { margin: 0; font-size: 16.5px; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; text-wrap: balance; }
.m-card .m-body { padding: 0 6px 8px; }
.m-open { all: unset; cursor: pointer; display: inline; color: var(--ink); }
.m-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 5; pointer-events: auto; }
.m-open:focus-visible { outline: none; }
.m-open:focus-visible::after { outline: 2px solid var(--violet); outline-offset: 3px; }
.m-card:hover .m-open { color: #fff; }

.m-card-link { position: relative; display: grid; align-content: center; gap: 6px; padding: 18px 20px; background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.38); border-radius: 20px; list-style: none; }
.m-card-link:hover { border-color: rgba(196, 185, 255, 0.7); background: var(--card-hover); }
.m-card-link a { color: var(--ink); font-weight: 650; font-size: 17px; letter-spacing: -0.015em; text-decoration: none; }
.m-card-link a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.m-card-link a:focus-visible { outline: none; }
.m-card-link:focus-within { outline: 2px solid var(--violet); outline-offset: 3px; }
.m-arrow { color: var(--violet-2); }
.is-wide { grid-column: 1 / -1; }
.m-card-cta { align-content: center; justify-items: start; background: linear-gradient(160deg, rgba(109, 90, 240, 0.22), rgba(255, 255, 255, 0.04)); border-color: rgba(168, 152, 255, 0.45); }
.m-card-cta .m-body { display: grid; gap: 4px; justify-items: start; padding: 18px 14px; }
.m-card-cta img { border-radius: 12px; margin-bottom: 8px; }
.m-card-cta .os-btn { position: relative; z-index: 4; margin-top: 12px; }

@media (min-width: 768px) {
  .m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .m-grid-1 { display: grid; gap: 18px; }
  .m-card-link:not(.is-wide) { aspect-ratio: 16 / 9; align-self: start; }
  .m-card-link.is-wide { min-height: 96px; }
}
@media (min-width: 960px) {
  .m-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .m-demo { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: center; padding: 14px; }
  .m-demo .m-body { padding: 8px 18px 8px 8px; }
  .m-demo .m-card-title { font-size: 26px; }
}

/* Phone reel: one horizontal snap strip per section, in place of stacked rows. */
@media (max-width: 767px) {
  .m-grid, .m-grid-1 {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--g));
    padding: 4px var(--g) 16px;
    scroll-padding-inline: var(--g);
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .m-grid > li, .m-grid-1 > li {
    position: relative;
    flex: 0 0 78vw;
    max-width: 78vw;
    aspect-ratio: 9 / 16;
    scroll-snap-align: start;
    border-radius: 20px;
    overflow: hidden;
  }
  /* The caption must not be positioned, or the stretched button only covers
     the title. Thumb and caption share one grid cell; the button's ::after
     is positioned against the card, so the poster and play icon are taps too. */
  .m-grid > .m-card:not(.m-card-cta), .m-grid-1 > .m-card:not(.m-card-cta) {
    display: grid;
    grid-template: 1fr / 1fr;
    padding: 0;
    border-color: var(--line-strong);
  }
  .m-grid > .m-card:not(.m-card-cta) .m-thumb, .m-grid-1 > .m-card:not(.m-card-cta) .m-thumb {
    grid-area: 1 / 1;
    position: relative;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
  }
  .m-grid > .m-card:not(.m-card-cta) .m-play, .m-grid-1 > .m-card:not(.m-card-cta) .m-play { left: 12px; top: 12px; bottom: auto; }
  .m-grid > .m-card:not(.m-card-cta) .m-dur, .m-grid-1 > .m-card:not(.m-card-cta) .m-dur { top: 12px; right: 12px; bottom: auto; }
  .m-grid > .m-card:not(.m-card-cta) .m-body, .m-grid-1 > .m-card:not(.m-card-cta) .m-body {
    grid-area: 1 / 1;
    align-self: end;
    position: static;
    z-index: auto;
    padding: 56px 14px 14px;
    background: linear-gradient(180deg, rgba(5, 7, 15, 0) 0%, rgba(5, 7, 15, 0.92) 42%, rgba(5, 7, 15, 0.97) 100%);
    pointer-events: none;
  }
  .m-grid .m-open, .m-grid-1 .m-open { pointer-events: auto; }
  .m-grid .m-desc, .m-grid-1 .m-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-size: 13px;
    color: #f4f3fb;
  }
  .m-grid .m-card-title, .m-grid-1 .m-card-title { font-size: 15.5px; color: #fff; }
  .m-grid .m-fp, .m-grid .m-older, .m-grid-1 .m-fp, .m-grid-1 .m-older {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .m-grid > .m-card:focus-within, .m-grid-1 > .m-card:focus-within, .m-grid > .m-card-link:focus-within {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
  }
  .m-grid .m-open:focus-visible::after, .m-grid-1 .m-open:focus-visible::after { outline: none; }
  .m-card-link, .m-card-cta {
    align-content: end;
    background: linear-gradient(165deg, rgba(60, 45, 134, 0.95), rgba(11, 15, 31, 0.96));
    border-style: solid;
    padding: 16px;
  }
  .m-card-link a, .m-card-cta .m-card-title { color: #fff; }
}

.m-cta-wrap { padding-top: 64px; padding-bottom: 28px; }
.m-cta { display: grid; gap: 20px; align-items: center; padding: 28px 22px; }
.m-cta img { border-radius: 16px; box-shadow: 0 0 40px -6px rgba(124, 92, 255, 0.6); }
.m-cta-title { margin: 0 0 6px; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.m-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 767px) { .m-cta-actions .os-btn { flex: 1 1 100%; } }
@media (min-width: 900px) { .m-cta { grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; padding: 32px 36px; } }

.m-player { padding: 0; margin: auto; border: 1px solid var(--line-strong); border-radius: 24px; background: #0b0f1f; color: var(--ink); width: min(1040px, calc(100vw - 32px)); max-height: calc(100svh - 24px); overflow: auto; box-shadow: 0 60px 140px -30px #000; }
.m-player::backdrop { background: rgba(3, 4, 10, 0.82); }
.m-player-in { padding: 14px 18px 22px; }
.m-player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.m-player-title { margin: 0; font-size: clamp(1.05rem, 2.2vw, 1.35rem); font-weight: 680; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.m-close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); cursor: pointer; }
.m-close:hover { background: rgba(255, 255, 255, 0.14); }
.m-close svg { width: 20px; height: 20px; }
.m-stage-box { position: relative; background: #000; border-radius: 16px; overflow: hidden; margin-inline: auto; aspect-ratio: 16 / 9; width: min(100%, calc((100svh - 230px) * 16 / 9)); border: 1px solid var(--line); }
.m-stage-box[data-cut="9x16"] { aspect-ratio: 9 / 16; width: min(100%, calc((100svh - 250px) * 9 / 16)); max-height: 80vh; }
.m-player-desc { margin: 14px auto 0; max-width: 68ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; text-align: center; }
.m-player-fp { display: flex; justify-content: center; text-align: center; }
.m-player-fp .m-fp { max-width: 68ch; }
.m-player-note { text-align: center; }
.m-player-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
#pl-links { display: contents; }
@media (max-width: 767px) {
  .m-player { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .m-player-in { padding: 10px 14px 18px; }
  .m-player-actions .os-btn { flex: 1 1 auto; }
}

.os-nav-links a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.07); }
.os-footer a[aria-current="page"] { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html.media-page { scroll-behavior: auto; }
  .m-card, .m-card-link, .m-play, .os-btn { transition: none !important; }
  .os-btn-primary:hover { transform: none; }
  .m-grid, .m-grid-1 { scroll-behavior: auto; }
}
@media (prefers-contrast: more) {
  .m-desc, .m-crumb, .m-fine, .m-fp, .m-player-desc { color: #fff; }
  .m-card, .m-card-link, .m-stage { border-color: rgba(255, 255, 255, 0.72); }
}
@media (forced-colors: active) {
  .m-play, .m-dur, .m-tag { border: 1px solid CanvasText; }
  .m-open:focus-visible::after, .m-card:focus-within { outline-color: Highlight; }
}
