/* ============================================================
   Curriculum: scroll-driven stacking cards (ScrollStack port)
   Vanilla port of the React Bits <ScrollStack/> for the .NET
   Razor site: no React, no second Lenis. scroll-stack.js drives
   the pin/scale/blur transforms off window scroll (the shared
   window.__ssLenis feeds window.scrollY). This file is only the
   card visual + layout; the motion is applied inline by the JS.
   Each card = one MBA semester: details on the LEFT, a video
   placeholder on the RIGHT (client supplies the video later).
   Reuses global tokens (--accent/--ink/--muted/--line/--ease).
   ============================================================ */

.ss-stack {
  position: relative;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* the flow that provides the scroll distance for the stack */
.ss-stack-inner { position: relative; }

/* ---- card ---- */
.sk-card {
  position: relative;
  will-change: transform, filter;
  transform-origin: center top;
  margin-bottom: var(--ss-gap, 42px);
}
.sk-card:last-of-type { margin-bottom: 0; }

.ss-card-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(22px, calc(2.6 * var(--fv, 1vw)), 40px);
  align-items: stretch;
  /* equal height for every card so a card on top of the stack fully covers
     the one beneath it: scroll-stack.js sets --ss-h to the tallest card's
     natural height, so nothing is ever cut off. Unset = natural height. */
  height: var(--ss-h, auto);
  padding: clamp(24px, calc(2.4 * var(--fv, 1vw)), 40px);
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -34px rgba(19, 24, 41, .34);
  overflow: hidden;
}

/* thin accent rail across the top of each card */
.ss-card-inner::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #8e1d16);
}

/* ---- left: semester details ---- */
.ss-card-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ss-card-badge {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(175, 37, 28, .09); color: var(--accent);
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.ss-card-badge b {
  font-family: 'Oswald', 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 14px; letter-spacing: 0;
  white-space: nowrap;
}
.ss-card-badge { flex-wrap: wrap; row-gap: 4px; }
.ss-card-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.ss-card-title {
  font-size: clamp(26px, calc(2.9 * var(--fv, 1vw)), 40px);
  font-weight: 600; line-height: 1.04; letter-spacing: -.02em;
  color: var(--ink); margin: 18px 0 0;
}
.ss-card-title em {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-style: italic; font-weight: 500; color: var(--accent);
}
.ss-card-note {
  font-size: clamp(14.5px, calc(1.2 * var(--fv, 1vw)), 16.5px); line-height: 1.55;
  color: var(--muted); margin: 12px 0 0; max-width: 46ch;
}

.ss-card-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 16px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.ss-card-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* module chips, 2-col; fills the card's remaining height and scrolls if long */
.ss-modlist {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start;
  overflow: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.ss-modlist::-webkit-scrollbar { width: 6px; }
.ss-modlist::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.ss-mod {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: 11px;
  background: var(--offwhite); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; line-height: 1.32; color: var(--ink);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.ss-mod:hover { border-color: rgba(175, 37, 28, .34); transform: translateY(-2px); }
.ss-mod-dot { flex: none; width: 18px; height: 18px; border-radius: 6px; margin-top: 1px;
  background: rgba(175, 37, 28, .1); color: var(--accent);
  display: flex; align-items: center; justify-content: center; }
.ss-mod-dot svg { width: 12px; height: 12px; }
/* a full-width chip for specialisation / internship rows */
.ss-mod.is-span { grid-column: 1 / -1; background: #fff; }

/* module chip internals, the text sits in its own span so a "choose one"
   tag can ride along on the same line without breaking the icon alignment */
.ss-mod-t { min-width: 0; }
.ss-mod-tag {
  display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 999px;
  background: rgba(175, 37, 28, .1); color: var(--accent);
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  vertical-align: 1px;
}
.ss-mod.is-choice { background: #fff; border-style: dashed; }

/* the forking semester, the two finishing routes, side by side, using the
   whole card (the structure panel is hidden here: the choice is the content) */
.ss-card-inner.is-fork { grid-template-columns: 1fr; }
.is-fork .ss-card-right { display: none; }
.ss-forks {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, calc(2 * var(--fv, 1vw)), 28px);
}
.ss-fork {
  display: flex; flex-direction: column; min-height: 0;
  padding: clamp(14px, calc(1.4 * var(--fv, 1vw)), 20px); border-radius: 16px;
  background: var(--offwhite); border: 1px solid var(--line);
}
.ss-fork:first-child { border-top: 3px solid var(--accent); }
.ss-fork:last-child { border-top: 3px solid var(--ink); }
.ss-fork-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ss-fork-head b {
  font-size: clamp(16px, calc(1.5 * var(--fv, 1vw)), 19px); font-weight: 600; letter-spacing: -.01em; color: var(--ink);
}
.ss-fork-n {
  flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.ss-fork-note { margin: 6px 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ss-modlist.is-one { grid-template-columns: 1fr; }
.ss-modlist.is-one .ss-mod { background: #fff; }
.ss-modlist.is-one .ss-mod.is-span { grid-column: auto; }

/* a labelled group inside the module list, used by the final semester,
   where the two finishing routes each get their own set of modules */
.ss-modgroup {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--line);
}
.ss-modgroup:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ss-modgroup b {
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.ss-modgroup span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* ---- right: structure panel (semester-aware cards) ---- */
.sk-brief { align-items: stretch; justify-content: flex-start; }
.sk-brief-in {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  padding: clamp(20px, calc(2 * var(--fv, 1vw)), 30px); width: 100%;
}
.sk-brief-year {
  align-self: flex-start; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.sk-brief-sem {
  display: block; margin: 16px 0 0;
  font-size: clamp(20px, calc(2 * var(--fv, 1vw)), 27px); font-weight: 600; letter-spacing: -.02em;
  line-height: 1.1; color: #fff;
}
/* the whole degree in one rail: filled to here, rings mark the exit points */
.sk-brief-rail { display: flex; align-items: center; gap: 6px; margin: 18px 0 0; }
.sk-rail-s {
  flex: 1; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transition: background-color .4s var(--ease);
}
.sk-rail-s.is-done { background: rgba(255, 255, 255, .62); }
.sk-rail-s.is-stop { position: relative; }
.sk-rail-s.is-stop::after {
  content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #14151a; border: 2px solid rgba(255, 255, 255, .45);
}
.sk-rail-s.is-done.is-stop::after { background: var(--accent); border-color: var(--accent); }

/* the four exit points, shown on every card so the shape of the degree is
   readable from wherever the reader joins the stack */
.sk-ladder { margin-top: auto; padding-top: 18px; }
.sk-ladder-k {
  display: block; margin-bottom: 10px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, .45);
}
.sk-ladder-r {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  margin-bottom: 6px;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.sk-ladder-r:last-of-type { margin-bottom: 0; }
.sk-ladder-n {
  flex: none; min-width: 58px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.sk-ladder-r b {
  font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: rgba(255, 255, 255, .62);
}
.sk-ladder-r.is-done { border-color: rgba(255, 255, 255, .2); }
.sk-ladder-r.is-done .sk-ladder-n { color: rgba(255, 255, 255, .6); }
.sk-ladder-r.is-done b { color: #fff; }
.sk-ladder-r.is-now { background: rgba(175, 37, 28, .2); border-color: rgba(175, 37, 28, .55); }
.sk-ladder-now {
  margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.sk-ladder-note {
  margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .66);
}

/* legend + sourcing line under the stack */
.ss-stack-legend {
  margin: clamp(26px, calc(3 * var(--fv, 1vw)), 40px) 0 0;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
}
.ss-stack-note {
  margin: 8px 0 0; max-width: 86ch;
  font-size: 12.5px; line-height: 1.6; color: var(--muted); opacity: .85;
}

/* ---- right: video placeholder ---- */
.ss-card-right { min-width: 0; display: flex; }
.sk-video {
  position: relative; flex: 1; border-radius: 18px; overflow: hidden;
  background: radial-gradient(130% 120% at 100% 0%, #23252f 0%, #14151a 55%, #0d0e12 100%);
  min-height: 240px;
  display: flex; align-items: center; justify-content: center;
}
.sk-video video,
.sk-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* faint grid texture so the empty state doesn't read as broken */
.sk-video::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 34px 34px;
}
.ss-video-ph { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, .78); padding: 24px; }
.ss-video-play {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; backdrop-filter: blur(2px);
  transition: transform .4s var(--ease), background-color .4s var(--ease);
}
.ss-card-inner:hover .ss-video-play { transform: scale(1.08); background: var(--accent); border-color: transparent; }
.ss-video-play svg { width: 24px; height: 24px; margin-left: 3px; }
.ss-video-ph b { display: block; font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.ss-video-ph span { display: block; font-size: 12.5px; margin-top: 5px; color: rgba(255, 255, 255, .55); letter-spacing: .02em; }
/* watermark semester numeral on the video */
.ss-video-wm {
  position: absolute; right: 14px; bottom: 4px; z-index: 1;
  font-family: 'Oswald', 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: clamp(4.5rem, calc(8 * var(--fv, 1vw)), 7rem); line-height: .8;
  color: rgba(255, 255, 255, .06); pointer-events: none; user-select: none;
}

/* ---- right: a captioned photograph per semester (the MBA) ---- */
.sk-shot { margin: 0; align-items: flex-end; justify-content: flex-start; }
.sk-shot::before { display: none; }
.sk-shot img { transition: transform .9s var(--ease); }
.ss-card-inner:hover .sk-shot img { transform: scale(1.03); }
/* a scrim under the caption so it reads over any photograph */
.sk-shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13, 14, 18, 0) 38%, rgba(13, 14, 18, .82) 100%);
}
.sk-shot-cap {
  position: relative; z-index: 2;
  padding: clamp(18px, calc(2 * var(--fv, 1vw)), 28px); padding-right: clamp(80px, calc(9 * var(--fv, 1vw)), 130px);
}
.sk-shot-k {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.sk-shot-cap b {
  display: block; margin-top: 12px;
  font-size: clamp(19px, calc(1.9 * var(--fv, 1vw)), 26px); font-weight: 600; line-height: 1.18; letter-spacing: -.02em;
  color: #fff;
}
.sk-shot .ss-video-wm { z-index: 2; color: rgba(255, 255, 255, .16); }

/* end sentinel, bottom spacer (desktop only): holds the fully-assembled
   stack on screen a beat longer, then lets it clear before the next section
   so cards never overlap the following content. Zeroed on mobile (no stacking). */
.ss-stack-end { height: 0; width: 100%; }
.ss-stack.is-stacking .ss-stack-end { height: 46vh; }

/* ---- responsive: stack the two columns on narrow screens ---- */
@media (max-width: 860px) {
  .ss-card-inner {
    grid-template-columns: 1fr;
    height: auto;            /* natural height, cards flow, no stacking */
    gap: 20px;
  }
  /* video first, then details, keeps the "video" promise visible on mobile */
  .ss-card-right { order: -1; }
  .sk-video { aspect-ratio: 16 / 9; min-height: 0; }
  /* the structure panel is text, not a frame: let it take the height it needs */
  .sk-brief { aspect-ratio: auto; }
  .sk-ladder { margin-top: 20px; }
  .ss-modlist { flex: none; max-height: none; overflow: visible; }
  .ss-stack-end { height: 0; }
}
@media (max-width: 760px) {
  .ss-forks { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ss-modlist { grid-template-columns: 1fr; }
  .ss-card-inner { border-radius: 20px; padding: 20px; }
}

/* ---- motion off / reduced-motion: plain stacked flow, no transforms.
   (scroll-stack.js also bails out early in both cases and never sets a
   transform; this is the CSS backstop.) ---- */
@media (prefers-reduced-motion: reduce) {
  .sk-card { transform: none !important; filter: none !important; }
  .ss-mod { transition: none; }
}
