/* Mythos Studio — Home. Classes are prefixed hm-. */

.hm { min-height: 100%; padding-bottom: 80px; }

/* ---------- hero ---------- */
.hm-hero { position: relative; height: clamp(440px, 66vh, 700px); overflow: hidden; isolation: isolate; background: var(--abyss); }
.hm-slides, .hm-slide { position: absolute; inset: 0; }
.hm-slide { opacity: 0; transition: opacity 1.8s ease; transform-origin: var(--kb-o, 50% 50%); will-change: opacity, transform; }
.hm-slide.show { opacity: 1; }
.hm-slide.kb { animation: hm-kenburns 15s linear both; }
.hm-slide-img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(1.06) brightness(.8); }
@keyframes hm-kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.16) translate(var(--kb-x, 0), var(--kb-y, 0)); }
}
@media (prefers-reduced-motion: reduce) { .hm-slide.kb { animation: none; transform: scale(1.04); } }

.hm-hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 5, 9, .62) 0%, rgba(2, 5, 9, .08) 24%, rgba(2, 5, 9, .12) 52%, rgba(2, 5, 9, .9) 86%, var(--bg) 100%),
    radial-gradient(ellipse 62% 48% at 50% 46%, rgba(2, 5, 9, .42), transparent 72%),
    linear-gradient(90deg, rgba(2, 5, 9, .55), transparent 22%, transparent 78%, rgba(2, 5, 9, .55));
}
.hm-hero-grain { z-index: 1; opacity: .07; }
.hm-hero .sh-ambient { z-index: 0; }

.hm-hero-top { position: absolute; z-index: 2; top: 22px; left: 34px; right: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hm-hero-top .eyebrow { color: rgba(231, 237, 233, .72); }
/* The mode badge sits at the hero's right edge and the hero clips overflow: open its tooltip below, right-aligned, wrapped. */
.hm-mode { cursor: help; }
.hm-mode[data-tip]:hover::after, .hm-mode[data-tip]:focus-visible::after {
  top: calc(100% + 8px); bottom: auto; left: auto; right: 0; transform: none;
  width: max-content; max-width: min(280px, calc(100vw - 32px)); white-space: normal; line-height: 1.4; text-align: left;
}

.hm-hero-title {
  position: absolute; z-index: 2; left: 0; right: 0; top: 45%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 24px; text-align: center;
  animation: hm-title-in 1.4s var(--ease) both;
}
.hm-hero-eyebrow { color: var(--bronze); letter-spacing: .32em; }
.hm-hero-title h1 {
  font: 500 clamp(38px, 6.4vw, 88px)/1.02 var(--display); letter-spacing: .12em; margin-right: -.12em;
  color: var(--pearl);
  background: linear-gradient(180deg, #ffffff 10%, #dfe8e4 55%, #b9c9c4 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 30px rgba(0, 0, 0, .55));
}
.hm-hero-sub { display: flex; align-items: center; gap: 16px; font: 500 clamp(10.5px, 1.05vw, 14px)/1.2 var(--display); letter-spacing: .42em; text-transform: uppercase; color: var(--bronze-hi); }
.hm-hero-sub span { margin-right: -.42em; }
.hm-hero-sub i { width: clamp(24px, 5vw, 64px); height: 1px; background: linear-gradient(90deg, transparent, var(--bronze)); }
.hm-hero-sub i:last-child { background: linear-gradient(90deg, var(--bronze), transparent); }
.hm-hero-tag { margin-top: 4px; font: italic clamp(17px, 1.7vw, 24px)/1.3 var(--serif); color: rgba(231, 237, 233, .84); text-shadow: 0 2px 20px rgba(0, 0, 0, .8); }
@keyframes hm-title-in { from { opacity: 0; transform: translateY(calc(-50% + 14px)); filter: blur(6px); } to { opacity: 1; transform: translateY(-50%); filter: none; } }

.hm-caption {
  position: absolute; z-index: 3; right: 34px; bottom: 132px; max-width: 300px; overflow: hidden;
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 8px; border-radius: 99px;
  border: 1px solid rgba(159, 211, 224, .2); background: rgba(2, 5, 9, .5); backdrop-filter: blur(10px);
  color: rgba(231, 237, 233, .85); font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.hm-caption:hover { border-color: rgba(201, 160, 99, .55); color: var(--bronze-hi); }
.hm-caption .icon { color: var(--bronze); }
.hm-caption-bar { position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px; background: rgba(159, 211, 224, .1); }
.hm-caption-bar i { display: block; height: 100%; width: 100%; transform-origin: left; background: var(--bronze); animation: hm-progress 8s linear both; }
@keyframes hm-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- hero prompt bar ---------- */
.hm-composer { position: relative; z-index: 5; max-width: 1120px; margin: -112px auto 0; padding: 0 34px; animation: rise .6s .15s var(--ease) both; }
.hm-composer-fail { display: flex; gap: 14px; align-items: center; padding: 18px 20px; color: var(--warn); }
.hm-composer-fail b { color: var(--pearl); }

/* ---------- body ---------- */
.hm-body { max-width: 1680px; margin: 0 auto; padding: 36px 34px 0; min-width: 0; }
.hm-section { min-width: 0; }
.hm-section + .hm-section { margin-top: 48px; }
.hm-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.hm-head .eyebrow { color: var(--bronze); }
.hm-head h2 { font-size: 18px; }
.hm-more { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hm-more:hover { color: var(--ink); }

/* ---------- numbers ---------- */
.hm-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.hm-kpi {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 116px; padding: 16px 18px 16px; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--line); color: var(--ink);
  background: linear-gradient(180deg, rgba(15, 33, 53, .55), rgba(6, 16, 27, .65));
  transition: border-color var(--t), transform var(--t), background var(--t);
}
a.hm-kpi:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-2px); background: linear-gradient(180deg, rgba(20, 54, 80, .5), rgba(6, 16, 27, .7)); }
.hm-kpi.skeleton { border: 0; background: linear-gradient(100deg, rgba(159, 211, 224, .05) 30%, rgba(159, 211, 224, .11) 50%, rgba(159, 211, 224, .05) 70%); background-size: 300% 100%; }
.hm-kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--faint); }
a.hm-kpi:hover .hm-kpi-top .icon { color: var(--bronze); }
.hm-kpi-num { font: 500 31px/1.1 var(--display); letter-spacing: .02em; color: var(--pearl); }
.hm-kpi-sub { font-size: 12px; color: var(--muted); }
.hm-kpi-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(159, 211, 224, .06); }
.hm-kpi-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--verdigris), var(--ok)); }
.hm-live { display: inline-flex; align-items: center; gap: 7px; color: var(--shaft); }
.hm-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--shaft); animation: sh-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(159, 211, 224, .15); }

/* ---------- continue production ---------- */
.hm-production { display: grid; gap: 16px; }
.hm-ep { display: grid; grid-template-columns: minmax(300px, 38%) minmax(0, 1fr); overflow: hidden; border-radius: var(--r-xl); }
.hm-ep.hm-ep-plain { grid-template-columns: 1fr; }
.hm-ep-skel { height: 320px; }
.hm-ep-cover { position: relative; display: block; min-height: 320px; border-radius: 0; color: var(--pearl); }
.hm-ep-cover > img { position: absolute; inset: 0; }
.hm-ep-cover.backdrop > img { filter: saturate(.55) brightness(.6) sepia(.18); }
.hm-ep-cover:hover > img { transform: scale(1.03); }
.hm-ep-cover:hover { color: var(--pearl); }
.hm-ep-ph { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 30% 20%, rgba(159, 211, 224, .14), transparent 60%), linear-gradient(160deg, var(--tide-2), var(--abyss)); }
.hm-ep-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 5, 9, .1) 30%, rgba(2, 5, 9, .88)), linear-gradient(90deg, transparent 65%, rgba(6, 16, 27, .55)); }
.hm-ep-cover-text { position: absolute; left: 24px; right: 24px; bottom: 22px; display: flex; flex-direction: column; gap: 6px; }
.hm-ep-cover-text .eyebrow { color: rgba(231, 237, 233, .65); }
.hm-ep-num { font: 500 12.5px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--bronze-hi); }
.hm-ep-name { font: 500 clamp(24px, 2.3vw, 34px)/1.08 var(--display); letter-spacing: .06em; color: var(--pearl); text-shadow: 0 2px 20px rgba(0, 0, 0, .6); }
.hm-ep-cover-note { position: absolute; top: 14px; left: 14px; padding: 4px 9px; border-radius: 99px; background: rgba(2, 5, 9, .65); border: 1px solid var(--line); font: 500 9.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); backdrop-filter: blur(6px); }

.hm-ep-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 22px 24px 22px; }
.hm-ep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hm-ep-head .eyebrow { color: var(--bronze); }
.hm-ep-title { font: 500 20px/1.25 var(--display); letter-spacing: .06em; }
.hm-ep-pct { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.hm-ep-pct b { font: 500 30px/1 var(--display); color: var(--bronze-hi); }
.hm-ep-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 12.5px; }
.hm-ep-facts span { display: inline-flex; align-items: center; gap: 6px; }
.hm-ep-facts .icon { color: var(--faint); }
.hm-status-bar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(159, 211, 224, .06); }
.hm-status-bar i { display: block; flex: 0 1 0; min-width: 3px; transition: flex-grow .6s var(--ease); }
.hm-status-bar .s-approved { background: var(--ok); }
.hm-status-bar .s-review { background: var(--warn); }
.hm-status-bar .s-progress { background: var(--shaft); }
.hm-status-bar .s-todo { background: #263a48; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: var(--muted); }
.hm-legend span { display: inline-flex; align-items: center; gap: 7px; }
.hm-legend b { color: var(--ink); font-weight: 500; }

.hm-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.hm-blocks-head { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 10px 8px 4px; color: var(--faint); font-size: 9.5px; }
.hm-blk { display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px 42px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; color: var(--muted); font-size: 12.5px; transition: background var(--t), color var(--t); }
.hm-blk:hover { background: rgba(159, 211, 224, .06); color: var(--ink); }
.hm-blk-letter { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font: 600 11px/1 var(--display); color: var(--bronze-hi); border: 1px solid rgba(201, 160, 99, .35); background: var(--bronze-dim); }
.hm-blk-bar { height: 4px; border-radius: 4px; overflow: hidden; background: rgba(159, 211, 224, .08); }
.hm-blk-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.hm-blk-count { font: 11px var(--mono); color: var(--faint); text-align: right; }

.hm-ep-foot { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.hm-ep-foot > .btn { align-self: center; }
.hm-next {
  flex: 1 1 280px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label icon" "main icon"; align-items: center; column-gap: 12px; row-gap: 3px;
  padding: 10px 14px; border-radius: var(--r); border: 1px solid rgba(201, 160, 99, .3); color: var(--ink);
  background: linear-gradient(90deg, rgba(201, 160, 99, .13), rgba(201, 160, 99, .02));
  transition: border-color var(--t), background var(--t);
}
.hm-next:hover { color: var(--ink); border-color: rgba(201, 160, 99, .6); background: linear-gradient(90deg, rgba(201, 160, 99, .2), rgba(201, 160, 99, .04)); }
.hm-next > .icon { grid-area: icon; color: var(--bronze); transition: transform var(--t); }
.hm-next:hover > .icon { transform: translateX(3px); }
.hm-next-label { grid-area: label; color: var(--bronze); font-size: 9.5px; }
.hm-next-main { grid-area: main; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.hm-next-main b { font: 500 13px var(--mono); flex: none; }
.hm-next-main span { color: var(--muted); font-size: 12.5px; }
.hm-next.done { display: flex; gap: 10px; border-color: rgba(143, 224, 181, .3); background: rgba(143, 224, 181, .06); color: var(--ok); }

/* ---------- cast ---------- */
.hm-cast-chips { margin-bottom: 14px; }
.hm-cast-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 170px; gap: 14px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; outline: none;
}
.hm-cast-empty { grid-column: 1 / -1; width: 100%; }
.hm-cast-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; scroll-snap-align: start; animation: rise .45s var(--ease) both; }
.hm-cast-pic { aspect-ratio: 3 / 4; border-radius: 13px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color var(--t), box-shadow var(--t); }
.hm-cast-pic > img { object-position: 90% 24%; }
.hm-cast-pic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, transparent 62%, rgba(2, 5, 9, .55)); pointer-events: none; }
.hm-cast-card:hover .hm-cast-pic { border-color: rgba(201, 160, 99, .5); box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 160, 99, .15); }
.hm-cast-card:hover .hm-cast-pic > img { transform: scale(1.05); }
.hm-cast-card:focus-visible { outline: none; }
.hm-cast-card:focus-visible .hm-cast-pic { outline: 2px solid var(--bronze); outline-offset: 2px; }
.hm-cast-versions { position: absolute; z-index: 1; top: 8px; right: 8px; }
.hm-cast-name { font-weight: 600; font-size: 13px; padding: 0 2px; }
.hm-cast-meta { margin-top: -5px; padding: 0 2px; font: 500 9.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .hm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .hm-ep { grid-template-columns: 1fr; }
  .hm-ep-cover { min-height: 220px; }
}
@media (max-width: 760px) {
  .hm-hero { height: 400px; }
  .hm-hero-top { left: 16px; right: 16px; top: 16px; }
  .hm-hero-title { top: 42%; }
  .hm-hero-sub { letter-spacing: .26em; }
  .hm-caption { display: none; }
  .hm-composer { margin-top: -72px; padding: 0 12px; }
  .hm-body { padding: 26px 16px 0; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hm-kpi { min-height: 100px; padding: 14px; }
  .hm-kpi-num { font-size: 25px; }
  .hm-ep-body { padding: 18px 16px; }
  .hm-blocks { grid-template-columns: 1fr; }
  .hm-cast-track { grid-auto-columns: 138px; gap: 10px; }
  .hm-section .section-head { flex-wrap: wrap; }
}
