/* ============================================================
   CORNERSTONE SCHOLARSHIP, /scholarship and /fr/bourse-cornerstone
   Loaded by the layout on this page only. Mobile first: base rules
   for phones, min-width queries widen it (640px tablet, 1024px desktop).

   One orchestrated moment: the hero mark lays its six stones, the gold
   cornerstone first. Below that, cards rise in with the site's Rise
   and the scholar portraits unveil from the bottom-left corner.
   ============================================================ */
:root, [data-theme="light"] {
  --cs-gold: #C9A44C;
  --cs-gold-soft: rgba(201, 164, 76, .16);
  --cs-band: var(--sage-band);
  --cs-on-band: var(--on-sage);
  --cs-on-band-body: var(--on-sage-body);
}
[data-theme="dark"] {
  --cs-gold: #D4B25E;
  --cs-gold-soft: rgba(212, 178, 94, .14);
}

/* ---------- Hero ---------- */
.lj-cs-hero { background: var(--cs-band); color: var(--cs-on-band); padding: var(--sp-12) 0 var(--sp-10); overflow: hidden; }
.lj-cs-hero__inner { display: grid; gap: var(--sp-8); align-items: center; }
.lj-cs-hero__kicker { color: var(--cs-gold); font-size: .875rem; font-weight: 500; margin-bottom: var(--sp-3); }
.lj-cs-hero__title { font-family: var(--font-display); font-weight: 600; color: var(--cs-on-band); font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; max-width: 16ch; text-wrap: balance; }
.lj-cs-hero__line { font-family: var(--font-display); font-style: italic; color: var(--cs-gold); font-size: clamp(1.1rem, 2.4vw, 1.35rem); margin-top: var(--sp-4); }
.lj-cs-hero__lead { color: var(--cs-on-band-body); max-width: 56ch; margin-top: var(--sp-4); font-size: 1.0625rem; }

.lj-cs-mark { position: relative; width: min(132px, 40vw); aspect-ratio: 3 / 2.16; justify-self: start; }
.lj-cs-mark__stone { position: absolute; width: calc(33.333% - 6px); height: calc(33.333% - 6px); border-radius: 6px; background: var(--cs-on-band); opacity: .92; }
.lj-cs-mark__stone:nth-child(1) { left: 0;        bottom: 0; }
.lj-cs-mark__stone:nth-child(2) { left: 33.333%;  bottom: 0; }
.lj-cs-mark__stone:nth-child(3) { left: 66.666%;  bottom: 0; }
.lj-cs-mark__stone:nth-child(4) { left: 0;        bottom: 33.333%; }
.lj-cs-mark__stone:nth-child(5) { left: 33.333%;  bottom: 33.333%; }
.lj-cs-mark__stone:nth-child(6) { left: 0;        bottom: 66.666%; }
.lj-cs-mark__stone--gold { background: var(--cs-gold); opacity: 1; box-shadow: 0 10px 28px -8px var(--cs-gold); }

@keyframes lj-cs-lay {
  0%   { opacity: 0; transform: translateY(-46px) rotate(-4deg); }
  70%  { opacity: 1; transform: translateY(3px) rotate(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes lj-cs-glow {
  0%, 100% { box-shadow: 0 10px 28px -8px var(--cs-gold); }
  50%      { box-shadow: 0 10px 40px -4px var(--cs-gold); }
}
.lj-cs-mark__stone { animation: lj-cs-lay .7s var(--ease-out) both; }
.lj-cs-mark__stone:nth-child(1) { animation: lj-cs-lay .8s var(--ease-out) .15s both, lj-cs-glow 4s ease-in-out 1.8s infinite; }
.lj-cs-mark__stone:nth-child(2) { animation-delay: .45s; }
.lj-cs-mark__stone:nth-child(3) { animation-delay: .6s; }
.lj-cs-mark__stone:nth-child(4) { animation-delay: .75s; }
.lj-cs-mark__stone:nth-child(5) { animation-delay: .9s; }
.lj-cs-mark__stone:nth-child(6) { animation-delay: 1.05s; }

.lj-cs-facts { display: grid; gap: var(--sp-4); margin-top: var(--sp-10); padding-top: var(--sp-6); border-top: 1px solid rgba(247, 245, 239, .16); }
.lj-cs-facts li { display: flex; flex-direction: column; gap: var(--sp-1); }
.lj-cs-facts strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--cs-on-band); font-variant-numeric: tabular-nums; }
.lj-cs-facts span { color: var(--cs-on-band-body); font-size: .9375rem; }

/* ---------- Scholars ---------- */
.lj-cs-class__head { margin-bottom: var(--sp-8); }
.lj-cs-class__lead { max-width: 60ch; margin-top: var(--sp-3); }
.lj-cs-scholars { display: grid; gap: var(--sp-8); }
.lj-cs-scholar { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--r-xl); overflow: hidden; }
.lj-cs-scholar:hover { box-shadow: var(--shadow-md); }
.lj-cs-scholar { transition: box-shadow var(--t-base); }
.lj-cs-scholar__photo { position: relative; margin: 0; aspect-ratio: 4 / 5; background: var(--sage-soft); overflow: hidden; }
/* Studio portraits on white: multiply lays them on the sage ground. */
.lj-cs-scholar__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; mix-blend-mode: multiply; }
.lj-cs-scholar__photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34%; background: linear-gradient(to top, rgba(36, 48, 30, .5), transparent); pointer-events: none; }
.lj-cs-scholar__badge { position: absolute; left: var(--sp-4); bottom: var(--sp-4); z-index: 1; display: inline-flex; align-items: center; gap: var(--sp-2); padding: 6px 12px 6px 8px; border-radius: var(--r-full); background: var(--cs-band); color: var(--cs-on-band); font-size: .8125rem; font-weight: 600; }
.lj-cs-scholar__stone { width: 14px; height: 11px; border-radius: 3px; background: var(--cs-gold); }
.lj-cs-scholar__body { padding: var(--sp-6); border-top: 3px solid var(--cs-gold); }
.lj-cs-scholar__name { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 1.75rem); color: var(--heading); letter-spacing: -.01em; }
.lj-cs-scholar__facts { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.lj-cs-scholar__facts dt { font-size: .8125rem; color: var(--text-tertiary); }
.lj-cs-scholar__facts dd { color: var(--text-primary); font-weight: 500; }

/* Portrait unveil: the photo opens from the gold corner as the card rises. */
.has-rise .lj-cs-scholar[data-rise] .lj-cs-scholar__photo img { clip-path: inset(100% 100% 0 0 round 0 var(--r-xl) 0 0); transform: scale(1.08); }
.has-rise .lj-cs-scholar[data-rise].is-up .lj-cs-scholar__photo img { clip-path: inset(0 0 0 0); transform: none; transition: clip-path 1.1s var(--ease-out) calc(var(--rise-delay, 0ms) + 150ms), transform 1.6s var(--ease-out) calc(var(--rise-delay, 0ms) + 150ms); }

/* ---------- Story ---------- */
.lj-cs-story { display: grid; gap: var(--sp-8); align-items: center; }
.lj-cs-story__text p { max-width: 62ch; margin-top: var(--sp-4); }
.lj-cs-story__quote { margin: 0; padding: var(--sp-8) var(--sp-6); border-left: 4px solid var(--cs-gold); background: var(--sage-wash); border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.lj-cs-story__quote p { font-family: var(--font-display); font-style: italic; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.35; color: var(--heading); }

/* ---------- Covers and eligibility ---------- */
.lj-cs-panels { display: grid; gap: var(--sp-6); }
.lj-cs-panel { padding: var(--sp-8) var(--sp-6); background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--r-xl); }
.lj-cs-panel__title { font-size: clamp(1.25rem, 2.6vw, 1.5rem); color: var(--heading); margin-bottom: var(--sp-5); }
.lj-cs-panel__sub { font-size: 1rem; color: var(--heading); margin-top: var(--sp-6); }
.lj-cs-panel__note { font-size: .9375rem; margin-top: var(--sp-4); }
.lj-cs-list { display: grid; gap: var(--sp-3); }
.lj-cs-list li { position: relative; padding-left: 26px; color: var(--text-primary); line-height: 1.5; }
.lj-cs-list li::before { content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 10px; border-radius: 3px; background: var(--sage); }
.lj-cs-list li:first-child::before { background: var(--cs-gold); }

/* ---------- Calendar ---------- */
.lj-cs-steps { display: grid; gap: var(--sp-4); counter-reset: none; }
.lj-cs-step { position: relative; padding: var(--sp-6) var(--sp-6) var(--sp-6) 76px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); }
.lj-cs-step__n { position: absolute; left: var(--sp-6); top: var(--sp-6); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--cs-band); color: var(--cs-on-band); font-family: var(--font-display); font-weight: 600; }
.lj-cs-step:first-child .lj-cs-step__n { background: var(--cs-gold); color: var(--cs-band); }
.lj-cs-step__title { font-size: 1.0625rem; color: var(--heading); }
.lj-cs-step p { margin-top: var(--sp-1); font-size: .9375rem; }

/* ---------- Pledge ---------- */
.lj-cs-pledge { display: grid; gap: var(--sp-6); align-items: center; padding: var(--sp-8) var(--sp-6); border-radius: var(--r-xl); background: var(--cs-gold-soft); border: 1px solid var(--cs-gold-soft); }
.lj-cs-pledge__title { font-family: var(--font-display); font-weight: 600; color: var(--heading); font-size: clamp(1.4rem, 3vw, 1.9rem); }
.lj-cs-pledge p { margin-top: var(--sp-3); max-width: 64ch; }
.lj-cs-pledge__mark { position: relative; width: 84px; aspect-ratio: 3 / 2.16; }
.lj-cs-pledge__mark span { position: absolute; width: calc(33.333% - 4px); height: calc(33.333% - 4px); border-radius: 3px; background: var(--heading); }
.lj-cs-pledge__mark span:nth-child(1) { left: 0; bottom: 0; background: var(--cs-gold); opacity: 1; }
.lj-cs-pledge__mark span:nth-child(2) { left: 33.333%; bottom: 0; }
.lj-cs-pledge__mark span:nth-child(3) { left: 66.666%; bottom: 0; }
.lj-cs-pledge__mark span:nth-child(4) { left: 0; bottom: 33.333%; }
.lj-cs-pledge__mark span:nth-child(5) { left: 33.333%; bottom: 33.333%; }
.lj-cs-pledge__mark span:nth-child(6) { left: 0; bottom: 66.666%; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .lj-cs-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); }
  .lj-cs-mark { width: 200px; }
  .lj-cs-scholars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); }
  .lj-cs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lj-cs-pledge { grid-template-columns: auto 1fr; gap: var(--sp-8); padding: var(--sp-10); }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .lj-cs-hero { padding: var(--sp-16) 0 var(--sp-12); }
  .lj-cs-hero__inner { grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-12); }
  .lj-cs-mark { width: 260px; justify-self: end; }
  .lj-cs-class { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--sp-12); align-items: start; }
  .lj-cs-class__head { position: sticky; top: calc(var(--nav-h) + var(--sp-8)); margin-bottom: 0; }
  .lj-cs-scholars { gap: var(--sp-8); }
  .lj-cs-scholar:nth-child(even) { margin-top: var(--sp-12); }
  .lj-cs-story { grid-template-columns: 1.2fr 1fr; gap: var(--sp-12); }
  .lj-cs-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lj-cs-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lj-cs-step { padding: 72px var(--sp-5) var(--sp-6); }
  .lj-cs-step__n { left: var(--sp-5); }
}

@media (prefers-reduced-motion: reduce) {
  .lj-cs-mark__stone, .lj-cs-mark__stone:nth-child(1) { animation: none; }
  .has-rise .lj-cs-scholar[data-rise] .lj-cs-scholar__photo img { clip-path: none; transform: none; }
}
