/*!
 * Skhillz Learning System - photography and product-visual language
 *
 * The brief: photos must feel alive, education-forward, and built into the page
 * rather than dropped on it. Every page should compose differently, but from
 * one vocabulary.
 *
 * Nine compositions, meant to be mixed so no two sections feel alike:
 *
 *   .mz-bleed        photo runs off one edge of the viewport, text holds the
 *                    other side. Best for a hero.
 *   .mz-overlap      two photos at different scales, the smaller overlapping
 *                    the larger, text beside them.
 *   .mz-scrim        full-bleed photo with a navy gradient over it, text on top.
 *   .mz-duotone      portrait pushed to navy/aqua duotone, for a quieter band.
 *   .mz-rail         photo with a stat rail welded to its edge, not floating
 *                    near it.
 *   .mz-mosaic       asymmetric grid, one dominant photo and two supporting.
 *   .mz-nodes        circular portraits joined by connecting lines. This is the
 *                    logo's own meaning made literal: the mark's connected
 *                    nodes stand for learners, educators and families.
 *   .mz-inset        photo as section background, content cards floating above.
 *   .mz-frame        photo with a product-UI card overlapping its corner.
 *
 * Product screens are built in HTML and CSS under .ui-, never shipped as
 * images. They stay sharp at any size, weigh nothing, can be read by a screen
 * reader, restyle with the palette, and can genuinely overlap a photograph.
 *
 * Every photo slot is a <figure> with a fixed aspect-ratio so the layout does
 * not move while images load, and every slot is listed with its exact pixel
 * size in docs/PHOTO_BRIEF.md.
 */

/* ---- Shared figure behavior ------------------------------------------- */
.mz figure, figure.mz-fig { margin: 0; position: relative; }
.mz img, .mz-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.mz-fig {
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #E8F0FF, #DFF8FF);
  box-shadow: 0 26px 60px rgba(7, 31, 85, .18);
}
.mz-fig.r-2-1   { aspect-ratio: 2 / 1; }
.mz-fig.r-3-2   { aspect-ratio: 3 / 2; }
.mz-fig.r-4-3   { aspect-ratio: 4 / 3; }
.mz-fig.r-1-1   { aspect-ratio: 1 / 1; }
.mz-fig.r-3-4   { aspect-ratio: 3 / 4; }
.mz-fig.r-4-5   { aspect-ratio: 4 / 5; }
.mz-fig.r-16-9  { aspect-ratio: 16 / 9; }

/* A slot with no photograph yet still reads as designed, and says what it
   wants. It is not a gray box and it is not a broken image. */
.mz-fig[data-slot]::after {
  content: attr(data-slot);
  position: absolute;
  inset: auto 14px 14px 14px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4A6596;
  background: rgba(255, 255, 255, .82);
  border: 1px dashed #A9C4EE;
  border-radius: 10px;
  padding: 7px 10px;
  pointer-events: none;
}
/* Must carry [data-slot] too. The rule that draws the label is
   .mz-fig[data-slot]::after, and a bare .mz-fig:has(img)::after loses to it
   on specificity, so the label sat on top of the photograph. Nothing
   exercised this until the first real photo went in. */
.mz-fig[data-slot]:has(img)::after { content: none; }

/* ---- 1. Bleed ----------------------------------------------------------- */
.mz-bleed { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center; }
.mz-bleed.right .mz-media { margin-right: calc(50% - 50vw + var(--sbw, 0px) / 2); }
.mz-bleed.left  { direction: rtl; }
.mz-bleed.left > * { direction: ltr; }
.mz-bleed.left .mz-media { margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2); }
.mz-bleed .mz-media .mz-fig { border-radius: 28px; }
.mz-bleed.right .mz-media .mz-fig { border-radius: 28px 0 0 28px; }
.mz-bleed.left  .mz-media .mz-fig { border-radius: 0 28px 28px 0; }

/* ---- 2. Overlap --------------------------------------------------------- */
.mz-overlap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 54px; align-items: center; }
.mz-overlap .mz-stack { position: relative; padding-bottom: 76px; padding-left: 62px; }
.mz-overlap .mz-stack .mz-a { border-radius: 26px; }
.mz-overlap .mz-stack .mz-b {
  position: absolute; left: 0; bottom: 0; width: 47%;
  border-radius: 20px; border: 7px solid #fff;
  box-shadow: 0 22px 46px rgba(7, 31, 85, .24);
}

/* ---- 3. Scrim ----------------------------------------------------------- */
.mz-scrim { position: relative; overflow: hidden; }
.mz-scrim > img, .mz-scrim > picture img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.mz-scrim::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(105deg, rgba(7, 31, 85, .94) 0%, rgba(7, 31, 85, .78) 42%, rgba(7, 31, 85, .30) 100%);
}
.mz-scrim > .inner, .mz-scrim > .container, .mz-scrim > .wrap, .mz-scrim > .mz-on { position: relative; z-index: 2; }
.mz-scrim.empty { background: linear-gradient(105deg, #071F55, #14356F); }

/* ---- 4. Duotone --------------------------------------------------------- */
.mz-duotone { position: relative; border-radius: 26px; overflow: hidden; background: var(--navy); }
.mz-duotone img { filter: grayscale(1) contrast(1.06); opacity: .62; mix-blend-mode: luminosity; }
.mz-duotone::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(23, 108, 235, .55), rgba(77, 216, 255, .28));
  mix-blend-mode: screen; pointer-events: none;
}

/* ---- 5. Rail ------------------------------------------------------------ */
.mz-rail { position: relative; }
.mz-rail .mz-stats {
  position: absolute; right: -26px; bottom: 26px;
  display: grid; gap: 1px; background: var(--line);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 44px rgba(7, 31, 85, .22);
}
.mz-rail .mz-stats div { background: #fff; padding: 14px 20px; min-width: 132px; }
.mz-rail .mz-stats b { display: block; font-size: 1.32rem; color: var(--navy); line-height: 1.1; }
.mz-rail .mz-stats span { font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* ---- 6. Mosaic ---------------------------------------------------------- */
.mz-mosaic { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-rows: repeat(2, 1fr); gap: 16px; }
.mz-mosaic > *:first-child { grid-row: 1 / 3; }

/* ---- 7. Nodes ----------------------------------------------------------- */
.mz-nodes { position: relative; display: flex; justify-content: center; align-items: center; gap: 0; flex-wrap: wrap; }
.mz-nodes .mz-node {
  width: clamp(104px, 13vw, 168px); aspect-ratio: 1; border-radius: 50%;
  overflow: hidden; border: 6px solid #fff;
  box-shadow: 0 16px 34px rgba(7, 31, 85, .22);
  position: relative; z-index: 2; margin-inline: -14px;
  background: linear-gradient(135deg, #E8F0FF, #DFF8FF);
}
.mz-nodes .mz-node:nth-child(even) { transform: translateY(-24px); }
.mz-nodes .mz-node:nth-child(3n)   { width: clamp(124px, 15vw, 196px); }
.mz-nodes::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 3px; z-index: 1;
  background: linear-gradient(90deg, transparent, var(--aqua), var(--blue), var(--aqua), transparent);
  border-radius: 4px;
}

/* ---- 8. Inset ----------------------------------------------------------- */
.mz-inset { position: relative; overflow: hidden; }
.mz-inset > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mz-inset::before { content: ""; position: absolute; inset: 0; background: rgba(245, 247, 250, .90); }
.mz-inset > .inner, .mz-inset > .container, .mz-inset > .wrap { position: relative; z-index: 2; }

/* ---- 9. Frame ----------------------------------------------------------- */
.mz-frame { position: relative; }
.mz-frame .mz-ui {
  position: absolute; right: -34px; bottom: -34px; width: min(60%, 360px); z-index: 3;
}

/* =========================================================================
 * Product screens, built rather than photographed
 * ===================================================================== */
.ui-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 22px 48px rgba(7, 31, 85, .20); padding: 16px 18px;
  font-size: .82rem; color: var(--ink); text-align: left;
}
.ui-card h4 { margin: 0 0 3px; font-size: .92rem; color: var(--navy); }
.ui-card .ui-sub { margin: 0 0 12px; font-size: .74rem; color: var(--muted); }
.ui-row { display: grid; grid-template-columns: 62px 1fr 42px; gap: 10px; align-items: center; margin: 9px 0; }
.ui-row b { font-size: .76rem; color: var(--navy); font-weight: 800; }
.ui-bar { height: 9px; border-radius: 999px; background: #E8EEF8; overflow: hidden; }
.ui-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--aqua)); }
.ui-pct { font-size: .72rem; font-weight: 900; color: var(--blue); text-align: right; }

.ui-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 10px; }
.ui-grid i { aspect-ratio: 1; border-radius: 4px; background: #E8EEF8; display: block; }
.ui-grid i.l3 { background: var(--teal); }
.ui-grid i.l2 { background: var(--aqua); }
.ui-grid i.l1 { background: #BBD5F8; }

.ui-ring { --p: 72; width: 84px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #E8EEF8 0); }
.ui-ring span { width: 66px; aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-weight: 900; color: var(--navy); font-size: .96rem; }

.ui-chip {
  display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: .76rem; font-weight: 800; color: var(--navy);
  box-shadow: 0 12px 26px rgba(7, 31, 85, .16);
}
.ui-chip::before { content: ""; width: 9px; aspect-ratio: 1; border-radius: 50%; background: var(--teal); }

.ui-phone {
  border-radius: 26px; border: 8px solid #0B1E45; background: #fff;
  box-shadow: 0 26px 54px rgba(7, 31, 85, .30); overflow: hidden; padding: 14px 12px;
}

/* =========================================================================
 * Responsive
 * ===================================================================== */
@media (max-width: 980px) {
  .mz-bleed, .mz-overlap { grid-template-columns: 1fr; gap: 30px; }
  .mz-bleed.left { direction: ltr; }
  .mz-bleed.right .mz-media, .mz-bleed.left .mz-media { margin-inline: 0; }
  .mz-bleed .mz-media .mz-fig,
  .mz-bleed.right .mz-media .mz-fig,
  .mz-bleed.left .mz-media .mz-fig { border-radius: 22px; }
  .mz-overlap .mz-stack { padding-left: 0; padding-bottom: 54px; }
  .mz-overlap .mz-stack .mz-b { width: 54%; }
  .mz-rail .mz-stats { right: 12px; bottom: 12px; }
  .mz-mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .mz-mosaic > *:first-child { grid-row: auto; grid-column: 1 / -1; }
  .mz-frame .mz-ui { right: 0; bottom: -22px; width: min(72%, 320px); }
}
@media (max-width: 620px) {
  .mz-nodes .mz-node { width: clamp(76px, 22vw, 108px); margin-inline: -9px; }
  .mz-nodes .mz-node:nth-child(3n) { width: clamp(88px, 25vw, 124px); }
  .mz-mosaic { grid-template-columns: 1fr; }
  .mz-rail .mz-stats { position: static; margin-top: 14px; grid-auto-flow: column; }
}
@media (prefers-reduced-motion: reduce) {
  .mz-nodes .mz-node:nth-child(even) { transform: none; }
}
