/* The home page's bands in the pattern of magicschool.ai (src/marquee.js; measured in
   .design-refs/reference/magicschool/DISSECTION-faces-features.md, section 5):

   Band 1, .fc-band   feature cards after the hero, two rows running left, a card turning into an
                      educator under a fine pointer, an educator's tile after every second card on touch.
   Band 3, .fw-band   the wall of educators: one row of squares on a navy band.
   Band 2, .ws-card   the three workspace cards in #platform: the product, an educator on hover or focus.

   The rows. Each holds its set twice and runs from 0 to -50 percent, so it starts over without a seam.
   A set is --mq-n items of --mq-pitch pixels, so the duration is that width over 50 px a second, here,
   with no measuring. The rows run from the first paint, with no fade-in. Pointing at the rows (a fine
   pointer only, so a tap never leaves them stuck) or moving the keyboard into the band holds them
   meanwhile; the pause button holds them until it is pressed again, and a press of play wins over the
   holds until the pointer and the focus have left (data-paused and data-run, set by site.js). Under
   reduced motion nothing runs: the copy is dropped and each row becomes a scroller that snaps from
   card to card and reaches every one. Only transform moves; the edges fade through a mask. */

.mq-band{position:relative;overflow-x:clip}
.mq-rows{
  --mq-fade:100px;
  overflow:hidden;
  /* the edges fade out; a mask reads only alpha */
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 var(--mq-fade),#000 calc(100% - var(--mq-fade)),transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 var(--mq-fade),#000 calc(100% - var(--mq-fade)),transparent 100%);
}
.mq-row{display:flex;width:max-content}
.mq-set{display:flex;flex:0 0 auto;margin:0;padding:0;list-style:none}
.mq-item{flex:0 0 auto;box-sizing:border-box;width:calc(var(--mq-pitch) * 1px);margin:0;position:relative}

@media (prefers-reduced-motion:no-preference){
  .mq-row{animation:mq-run calc(var(--mq-n) * var(--mq-pitch) * 1s / 50) linear infinite;will-change:transform}
  .mq-band[data-paused] .mq-row{animation-play-state:paused}
  .mq-band:not([data-run]):has(:focus-visible) .mq-row{animation-play-state:paused}
}
@media (prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine){
  .mq-band:not([data-run]) .mq-rows:hover .mq-row{animation-play-state:paused}
}
@keyframes mq-run{to{transform:translateX(-50%)}}

@media (prefers-reduced-motion:reduce){
  .mq-row{width:auto;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;padding-inline:var(--mq-fade);scroll-padding-inline:var(--mq-fade);scrollbar-width:thin;scrollbar-color:var(--mist) transparent}
  .mq-row:focus-visible{outline-offset:-3px}
  .mq-set[aria-hidden]{display:none}
  /* the card or the square snaps to the edge, never the slot our mark sits in */
  .fc,.fw-tile{scroll-snap-align:start}
  .mq-toggle{display:none !important}
}

/* the pause control, shown by site.js: bottom left of the band, where a player keeps its play button
   (the spec's bottom right is where the site's assistant, Ellie, sits on every screen) */
.mq-toggle{position:absolute;left:16px;bottom:16px;z-index:3;display:grid;place-items:center;width:32px;height:32px;padding:0;border-radius:50%;border:1px solid var(--rule);background:var(--white);color:var(--navy);box-shadow:var(--shadow-sm);cursor:pointer;transition:border-color .2s,color .2s}
.mq-toggle[hidden]{display:none}
.mq-toggle:hover{border-color:var(--emerald);color:var(--emerald-ink)}
.mq-toggle svg{grid-area:1 / 1;width:16px;height:16px}
.mq-toggle .i-pause{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.mq-toggle .i-play{fill:currentColor;display:none}
.mq-toggle[aria-pressed='true'] .i-pause{display:none}
.mq-toggle[aria-pressed='true'] .i-play{display:block}

/* ---------- Band 1: the feature cards ---------- */

.fc-band{
  --mq-pitch:419;--mq-n:12;
  --fc-w:335px;--fc-h:105px;--fc-slot:84px;--fc-mark:24px;
  background:var(--tint);padding-block:60px;
}
.fc-band .mq-rows{display:grid;row-gap:40px}
.fc-sprite{position:absolute;width:0;height:0;overflow:hidden}

/* each row in its product's colours: Margin in emerald, Marlo and the platform in navy */
.fc-row-a{--fc-line:#B9EAD6;--fc-wash:var(--emerald-wash);--fc-ink:var(--emerald-ink)}
.fc-row-b{--fc-line:var(--mist);--fc-wash:var(--tint);--fc-ink:var(--navy)}

/* an item is its card and the slot beside it for our mark: after the card on row 1, before it on
   row 2, so the second row starts a mark later than the first */
.fc-item{display:flex;align-items:center}
.fc-row-a .fc-item{padding-right:var(--fc-slot)}
.fc-row-b .fc-item{padding-left:var(--fc-slot)}
.fc-item::after{
  content:'';position:absolute;top:50%;width:var(--fc-mark);height:var(--fc-mark);margin-top:calc(var(--fc-mark) / -2);
  background:var(--emerald);opacity:.85;
  -webkit-mask:url(/assets/mark.svg) center / contain no-repeat;mask:url(/assets/mark.svg) center / contain no-repeat;
}
.fc-item:nth-child(even)::after{background:var(--navy)}
.fc-row-a .fc-item::after{right:calc((var(--fc-slot) - var(--fc-mark)) / 2)}
.fc-row-b .fc-item::after{left:calc((var(--fc-slot) - var(--fc-mark)) / 2)}

/* the card: live text, a white face with a soft emerald glow round it and the row's wash inside its
   edge; the inner glow sits on top, so it frames the photo as well */
.fc{position:relative;flex:0 0 auto;box-sizing:border-box;width:var(--fc-w);height:var(--fc-h);border-radius:var(--r-md);background:var(--white);border:1px solid var(--fc-line);box-shadow:0 0 20px rgba(23,185,120,.14);overflow:hidden}
.fc::after{content:'';position:absolute;inset:0;z-index:2;border-radius:inherit;box-shadow:inset 0 0 18px var(--fc-wash);pointer-events:none}
.fc-body{display:grid;grid-template-columns:56px minmax(0,1fr);column-gap:16px;align-items:center;height:100%;box-sizing:border-box;padding:20px 24px 20px 20px}
.fc-ico{display:grid;place-items:center;width:56px;height:56px;border-radius:12px;background:var(--fc-wash);color:var(--fc-ink)}
.fc-ico svg{width:28px;height:28px;display:block}
.fc-text{display:grid;row-gap:2px;min-width:0}
.fc-title{display:block;font-family:var(--font-display);font-weight:600;font-size:16px;line-height:20px;letter-spacing:-.005em;color:var(--fc-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fc-title .soon{margin-left:4px;vertical-align:2px}
.fc-line{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;font-family:var(--font-text);font-weight:400;font-size:14px;line-height:20px;color:var(--slate);text-wrap:pretty}

/* the educators: inside each card under a fine pointer, as tiles of their own on a touch screen */
.fc-face,.fc-tile{display:none}
.fc-tile-img{display:block;width:100%;height:100%;object-fit:cover}

@media (hover:hover) and (pointer:fine){
  .fc-face{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none;transition:opacity .3s ease}
  .fc-body{transition:opacity .3s ease}
  .fc:hover .fc-face{opacity:1}
  .fc:hover .fc-body{opacity:0}
}
@media not all and (hover:hover) and (pointer:fine){
  .fc-band{--mq-n:18}
  .fc-tile{display:flex}
}

@media (max-width:1023px){
  .fc-band{padding-block:48px 56px}
  .fc-band .mq-rows{--mq-fade:48px;row-gap:32px}
}
@media (max-width:639px){
  .fc-band{--mq-pitch:336;--fc-w:280px;--fc-h:96px;--fc-slot:56px;--fc-mark:20px;padding-block:32px 56px}
  .fc-band .mq-rows{--mq-fade:24px;row-gap:24px}
  .fc-body{grid-template-columns:40px minmax(0,1fr);column-gap:12px;padding:14px 16px 14px 14px}
  .fc-ico{width:40px;height:40px;border-radius:10px}
  .fc-ico svg{width:22px;height:22px}
  .fc-title{font-size:15px;line-height:19px}
  .fc-line{font-size:13px;line-height:18px}
}

/* ---------- Band 3: the wall of educators ---------- */

.fw-band{--mq-pitch:304;--mq-n:18;background:linear-gradient(var(--navy-deep),var(--navy));color:#fff;padding-block:60px}
.fw-head{text-align:center}
.fw-head h2{color:#fff;margin:0 auto}
.fw-head .lede{color:var(--mist);margin:16px auto 0;max-width:none}
.fw-band .mq-rows{margin-top:16px}
/* room above and below the squares for the marks that hang over the gaps */
.fw-row{padding-block:40px}
.fw-item{padding-right:24px}
.fw-tile{position:relative;display:block;width:280px;height:280px;border-radius:16px;overflow:hidden;background:var(--navy-deep)}
.fw-tile img{display:block;width:100%;height:100%;object-fit:cover}
.fw-tile::after{content:'';position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 28px rgba(23,185,120,.35);pointer-events:none}
.fw-shot .fw-tile{background:var(--white)}
/* our mark above and below each gap, its centre 13 px outside the row of squares */
.fw-item::before,.fw-item::after{
  content:'';position:absolute;left:276px;width:32px;height:32px;
  background:var(--emerald);opacity:.9;
  -webkit-mask:url(/assets/mark.svg) center / contain no-repeat;mask:url(/assets/mark.svg) center / contain no-repeat;
}
.fw-item::before{top:-29px}
.fw-item::after{bottom:-29px}
.fw-item:nth-child(even)::before,.fw-item:nth-child(even)::after{background:var(--white);opacity:.75}
.fw-band .mq-toggle{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.3);color:#fff;box-shadow:none}
.fw-band .mq-toggle:hover{border-color:var(--emerald-bright);color:var(--emerald-bright)}

@media (max-width:1023px){.fw-band .mq-rows{--mq-fade:48px}}
@media (max-width:639px){
  .fw-band{padding-block:48px 56px}
  .fw-band .mq-rows{--mq-fade:24px}
}

/* ---------- Band 2: the workspace cards (#platform) ---------- */

.ws-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:40px}
.ws-grid .ws-card{display:flex;flex-direction:column;padding:24px;border-radius:var(--r-md);border:1px solid var(--rule);box-shadow:none;transition:box-shadow .26s ease}
.ws-grid .ws-card.link:hover{transform:none;border-color:var(--rule)}
.ws-media{position:relative;display:grid;aspect-ratio:341 / 196;margin-bottom:20px;border-radius:8px;overflow:hidden;background:var(--tint)}
.ws-media img{grid-area:1 / 1;display:block;width:100%;height:100%;object-fit:cover}
.ws-shot,.ws-face{transition:opacity .3s ease}
.ws-face{opacity:0}
.ws-card .cue{margin-bottom:8px}
.ws-card h3{font-size:20px;line-height:24px;margin-bottom:8px}
.ws-card p{font-size:15.5px;margin:0 0 18px}
.ws-card .thread-link{align-self:flex-start;margin-top:auto}
.ws-card .arrow{display:inline-block}

/* the glow: magicschool's link card, in our emerald; the keyboard gets it and the swap too */
.ws-grid .ws-card:focus-visible{border-radius:var(--r-md);box-shadow:0 0 20px rgba(23,185,120,.45)}
.ws-card:focus-visible .thread-link::after{width:100%}
.ws-card:focus-visible .thread-link .arrow{transform:translateX(4px)}
@media (hover:hover) and (pointer:fine){
  .ws-grid .ws-card.link:hover{box-shadow:0 0 20px rgba(23,185,120,.45)}
  .ws-card:hover .ws-face,.ws-card:focus-visible .ws-face{opacity:1}
  .ws-card:hover .ws-shot,.ws-card:focus-visible .ws-shot{opacity:0}
}
/* a touch screen keeps the product */
@media not all and (hover:hover) and (pointer:fine){.ws-media .ws-face{display:none}}

@media (max-width:780px){.ws-grid{grid-template-columns:1fr;gap:16px}}
/* a tablet: the picture beside the words, so it is never stretched past its pixels */
@media (min-width:560px) and (max-width:780px){
  .ws-grid .ws-card{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1fr);grid-template-rows:auto auto auto 1fr;column-gap:24px;align-items:start}
  .ws-media{grid-column:1;grid-row:1 / span 4;margin-bottom:0}
  .ws-card>:not(.ws-media){grid-column:2}
  .ws-card .thread-link{align-self:end;justify-self:start}
}
