/* ==========================================================================
   Marshal motifs, product intros, hero backdrops and the scroll-told story.
   Pairs with js/marshal-motifs.js + js/marshal-story.js (product pages) and
   js/marshal-journey.js (marshal.co.ls portals).
   ========================================================================== */
.mo { --m: var(--p, var(--accent)); --mi: var(--pi, var(--accent-ink)); position: relative; color: var(--text); font-family: var(--sans); }

/* ---- Timetable (Schools) ---- */
.mo-tt { width: min(820px, 88vw); }
.mo-tt__head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.mo-tt__clock { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 7vw, 84px); line-height: .8; letter-spacing: -.04em; color: var(--m); font-variant-numeric: tabular-nums; }
.mo-tt__term { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.mo-tt__grid { display: grid; grid-template-columns: 30px repeat(5, minmax(0, 1fr)); gap: 6px; }
.mo-tt__day, .mo-tt__period { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); align-self: center; }
.mo-tt__day { padding: 0 0 4px 4px; }
.mo-tt__cell { position: relative; height: clamp(30px, 5.4vh, 54px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; align-items: end; padding: 6px 8px; }
.mo-tt__cell i { position: absolute; inset: 0; background: var(--m); transform-origin: 50% 100%; }
.mo-tt__cell b { position: relative; font-weight: 500; font-size: clamp(9px, 1vw, 12px); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-tt__cell.is-lit b { color: var(--mi); }

/* ---- Pipeline (CRM) ---- */
.mo-pl { width: min(920px, 92vw); }
.mo-pl__total { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.mo-pl__total span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.mo-pl__total b { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 6vw, 76px); line-height: .85; letter-spacing: -.04em; color: var(--m); font-variant-numeric: tabular-nums; }
.mo-pl__board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mo-pl__col { min-height: clamp(220px, 34vh, 300px); padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--text) 3%, transparent); }
.mo-pl__head { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); padding: 2px 2px 8px; border-bottom: 1px solid var(--line); }
.mo-pl__head em { font-style: normal; color: var(--text); }
.mo-pl__ghost { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.mo-pl__ghost b { font-weight: 500; font-size: 12px; color: var(--text-dim); }
.mo-pl__ghost i { display: block; height: 4px; width: 60%; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.mo-pl__card {
    position: absolute; left: 0; top: 0; z-index: 2;
    width: calc((100% - 30px) / 4 - 16px);
    display: grid; gap: 4px; padding: 12px; border-radius: 12px;
    background: color-mix(in srgb, var(--m) calc(var(--won, 0) * 100%), var(--mo-card, #f1efe8));
    color: #111; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7);
}
.mo-pl__card span { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-pl__card b { font-size: clamp(12px, 1.3vw, 15px); font-weight: 600; line-height: 1.15; }
.mo-pl__card em { font-style: normal; font-family: var(--display); font-weight: 700; font-size: clamp(16px, 1.8vw, 22px); letter-spacing: -.02em; }
.mo-pl__dot { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: #111; transform: scale(0); }
@media (max-width: 600px) { .mo-pl__ghost b { display: none; } .mo-pl__card { padding: 9px; } .mo-pl__card span { display: none; } }

/* ---- Receipt (Business Suite) ---- */
.mo-rc { width: 300px; display: grid; justify-items: center; }
.mo-rc__slot { width: 330px; height: 16px; border-radius: 9px; background: #262926; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .7); position: relative; z-index: 2; }
.mo-rc__paper {
    width: 276px; margin-top: -8px; padding: 26px 20px 30px;
    background: #f6f3ea; color: #191919; font-size: 11.5px; line-height: 1.6;
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}
.mo-rc__lines p { margin: 0; }
.mo-rc__brand { text-align: center; font-family: var(--display); font-weight: 750; font-size: 22px; line-height: 1; letter-spacing: -.02em; margin-bottom: 6px !important; }
.mo-rc__brand span { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.mo-rc__meta { text-align: center; font-size: 10px; letter-spacing: .06em; opacity: .65; margin: 4px 0 10px !important; }
.mo-rc__row { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.mo-rc__rule { border-top: 1.5px dashed #999; margin: 8px 0 !important; }
.mo-rc__total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-weight: 750; font-size: 22px; letter-spacing: -.02em; }
.mo-rc__total b { font-variant-numeric: tabular-nums; }
.mo-rc__bars { display: flex; gap: 2px; height: 34px; margin: 12px 0 2px !important; justify-content: center; }
.mo-rc__bars i { display: block; background: #191919; }
.mo-rc__stamp {
    position: absolute; right: -54px; top: 46%; z-index: 3;
    padding: 8px 12px; border: 3px solid var(--m); border-radius: 10px;
    color: var(--m); background: color-mix(in srgb, var(--ink) 82%, transparent);
    font-size: 11px; line-height: 1.25; letter-spacing: .1em; text-transform: uppercase; text-align: center;
    transform: rotate(-12deg);
}
.mo-rc__stamp b { font-size: 15px; }

/* ---- Contours (Fields) ---- */
.mo-ct { width: min(920px, 94vw); }
.mo-ct__svg { display: block; width: 100%; height: auto; overflow: visible; }
.mo-ct__line { fill: none; stroke: color-mix(in srgb, var(--text) 32%, transparent); stroke-width: 1.2; }
.mo-ct__line.is-major { stroke: var(--m); stroke-opacity: .75; stroke-width: 1.7; }
.mo-ct__plot { fill: color-mix(in srgb, var(--m) 24%, transparent); stroke: var(--m); stroke-width: 1.5; }
.mo-ct__pin path { fill: var(--m); }
.mo-ct__hole { fill: var(--ink); }
.mo-ct__ping { fill: none; stroke: var(--m); stroke-width: 2; }
.mo-ct__coords { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 10px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.mo-ct__coords span:last-child { color: var(--m); }

/* ---- Intro: motif plays on a dark curtain ---- */
.curtain__caption { display: block; margin-top: 6px; font-style: normal; color: var(--accent); }
.curtain__caption:empty { display: none; }
.js .curtain.curtain--story { background: var(--ink); color: var(--text); }
.curtain--story .curtain__count { display: none; }
.curtain__motif { position: absolute; inset: 0 0 70px; display: grid; place-items: center; }

/* ---- Hero backdrop: the intro motif stays behind the headline ---- */
.hero__fx {
    position: absolute; z-index: 0; pointer-events: none;
    right: -2vw; top: clamp(120px, 14vw, 170px);
    width: min(54vw, 860px); display: grid; justify-items: end;
    opacity: .2;
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
    mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.hero__fx .mo { width: 100%; }
.hero--receipt .hero__fx { width: auto; right: 4vw; top: clamp(110px, 9vw, 140px); opacity: .42; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); transform: rotate(5deg); }
.hero--receipt .hero__fx .mo { width: 300px; }
.hero .hero__inner { z-index: 1; }
@media (max-width: 860px) {
    .hero__fx { width: 110vw; right: -30vw; opacity: .14; }
    .hero--receipt .hero__fx { right: -60px; opacity: .3; }
}

/* ---- Story: stacked by default, pinned and scroll-told with motion ---- */
.story { position: relative; background: var(--ink); padding: clamp(80px, 10vw, 140px) 0; }
.story__eyebrow { margin-bottom: 40px; }
.story__beats { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(60px, 8vw, 110px); }
.story__beat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: 1fr auto 1fr; grid-template-areas: ". shot" "text shot" ". shot"; column-gap: 5vw; align-items: center; }
.story__text { grid-area: text; }
.story__shot { grid-area: shot; }
.story__when { display: flex; gap: 14px; align-items: center; margin: 0 0 18px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.story__when span { color: var(--accent); }
.story__line { margin: 0; font-family: var(--display); font-weight: 650; font-variation-settings: "wdth" 88; font-size: clamp(2rem, 4.4vw, 4.6rem); line-height: 1; letter-spacing: -.035em; max-width: 15ch; }
.story__shot { margin: 0; }
.story__shot .frame img { display: block; width: 100%; max-height: 64svh; object-fit: cover; object-position: top left; }
.story__shot.is-phone { display: grid; justify-items: center; }
.story__shot.is-phone .phone__device { width: min(290px, 70%); }
.story__rail { display: none; }

.story.is-live { padding: 0; }
.story.is-live .story__pin { height: 100svh; display: flex; align-items: center; }
.story.is-live .story__inner { position: relative; width: 100%; height: 100%; }
.story.is-live .story__eyebrow { position: absolute; top: clamp(100px, 13vh, 130px); left: var(--gutter); margin: 0; }
.story.is-live .story__beats { position: absolute; inset: 0 var(--gutter); display: block; }
.story.is-live .story__beat { position: absolute; inset: 0; padding-top: clamp(60px, 8vh, 90px); }
.story.is-live .story__rail { display: flex; gap: 8px; position: absolute; left: var(--gutter); bottom: clamp(30px, 6vh, 56px); }
.story__rail i { display: block; width: clamp(28px, 4vw, 56px); height: 2px; background: var(--line); overflow: hidden; }
.story__rail b { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.story.is-live .story__line .word { display: inline-block; }
@media (max-width: 860px) {
    .story__beat { grid-template-columns: 1fr; grid-template-rows: auto auto; grid-template-areas: "text" "shot"; row-gap: 24px; }
    .story.is-live .story__beat { align-content: center; padding-top: 70px; }
    .story.is-live .story__shot .frame img { max-height: 34svh; }
    .story.is-live .story__shot.is-phone .phone__device { width: min(200px, 48vw); }
    .story__line { font-size: clamp(1.9rem, 8vw, 2.8rem); }
}
.story.is-live .story__shot.is-phone .phone__device { height: min(60svh, 560px); width: auto; }
@media (max-width: 860px) { .story.is-live .story__shot.is-phone .phone__device { height: 36svh; width: auto; } }
