/* MC Experience: a compact magazine that turns its pages */
.experience .section-heading { margin-bottom: 30px; }
.magazine { position: relative; outline: none; }
.magazine-stage { display: grid; height: clamp(450px, 31vw, 540px); perspective: 1800px; touch-action: pan-y; }
.magazine-page { grid-area: 1 / 1; display: grid; grid-template-columns: 58% 42%; min-height: 0; background: var(--site-bg); backface-visibility: hidden; will-change: transform, opacity; }

.magazine-photo { position: relative; display: block; overflow: hidden; min-height: 0; }
.magazine-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.001); transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.magazine-photo:hover img, .magazine-photo:focus-visible img { transform: scale(1.035); }
.magazine-photo::after { content: ''; position: absolute; inset: 0 -1px 0 0; pointer-events: none; background: linear-gradient(90deg, transparent 42%, rgb(var(--site-bg-rgb) / 35%) 66%, rgb(var(--site-bg-rgb) / 82%) 88%, var(--site-bg) 100%); }
/* the spine: a hairline between photograph and text, fading at both ends */
.magazine-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 76px 56px; min-width: 0; }
.magazine-copy::before { content: ''; position: absolute; left: 0; top: 14%; bottom: 14%; width: 1px; background: linear-gradient(180deg, transparent, #ffffff26 30%, #ffffff26 70%, transparent); }
.magazine-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .75rem; letter-spacing: .17em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 20px; }
.magazine-kicker .red-rule { margin: 0; width: 26px; }
.magazine-kicker span { white-space: nowrap; }
.magazine-date { color: var(--text-muted); }
.magazine-date::before { content: '· '; }
.magazine-copy h3 { font-size: clamp(2.2rem, 2.9vw, 3rem); line-height: 1.02; margin-bottom: 20px; max-width: 470px; overflow-wrap: anywhere; }
.magazine-text { color: var(--text-muted); font-size: .9688rem; line-height: 1.75; max-width: 430px; margin-bottom: 28px; }
.magazine-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; font-size: .75rem; font-weight: 500; letter-spacing: .17em; padding-block: 8px; border-bottom: 1px solid #d9232e; transition: color .2s, gap .3s; }
.magazine-cta svg { width: 16px; height: 16px; }
.magazine-cta:hover { color: #f05b62; gap: 16px; }

.magazine-nav { position: absolute; right: 0; bottom: 18px; left: calc(58% + 56px); display: flex; align-items: center; gap: 8px; z-index: 2; }
.magazine-count { margin: 0 auto 0 0; font-size: .75rem; letter-spacing: .16em; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.magazine-count b { font-weight: 500; color: #fff; }
.magazine-arrow { width: 42px; height: 42px; display: grid; place-items: center; background: none; border: 1px solid #ffffff2e; transition: border-color .2s, background .2s, color .2s; }
.magazine-arrow svg { width: 18px; height: 18px; }
.magazine-arrow:hover { border-color: #fff; background: #fff; color: #111; }
.magazine-archive { margin-top: 30px; }
.magazine-archive .text-link { font-size: .75rem; letter-spacing: .17em; text-transform: uppercase; }

/* a soft band of light that sweeps across the leaving page, like paper catching the light as it turns */
.magazine-page.is-leaving { pointer-events: none; z-index: 1; }
.magazine-page.is-leaving::after { content: ''; grid-area: 1 / 1 / 2 / 3; pointer-events: none; background: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 0%) 35%, rgb(0 0 0 / 38%) 100%); opacity: 0; animation: magazine-shade .62s cubic-bezier(.6, .05, .25, 1) forwards; }
.magazine-page.is-leaving.turn-back::after { background: linear-gradient(270deg, transparent 0%, rgb(0 0 0 / 0%) 35%, rgb(0 0 0 / 38%) 100%); }
@keyframes magazine-shade { to { opacity: 1; } }

@media (max-width: 1000px) {
  .magazine-stage { height: 450px; }
  .magazine-page { grid-template-columns: 55% 45%; }
  .magazine-copy { padding: 30px 0 90px 34px; }
  .magazine-nav { left: calc(55% + 34px); }
  .magazine-copy h3 { font-size: 2.2rem; }
  /* on narrower pages the date drops under the category, aligned with it */
  .magazine-date { flex-basis: 100%; padding-left: 38px; }
  .magazine-date::before { content: none; }
  .magazine-text { font-size: .9375rem; }
}
@media (max-width: 700px) {
  .magazine-stage { height: auto; perspective: 1200px; }
  .magazine-page { grid-template-columns: 1fr; }
  .magazine-photo { aspect-ratio: 3 / 2; }
  .magazine-photo::after { inset: 0 0 -1px; background: linear-gradient(0deg, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 40%) 22%, transparent 48%); }
  .magazine-copy { padding: 6px 0 4px; }
  .magazine-copy::before { display: none; }
  .magazine-kicker { margin-bottom: 14px; }
  .magazine-copy h3 { font-size: 2.2rem; margin-bottom: 14px; min-height: 2.04em; }
  .magazine-text { margin-bottom: 22px; min-height: 8.75em; }
  .magazine-nav { position: static; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
  .magazine-archive { margin-top: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .magazine-photo img { transition: none; }
  .magazine-page.is-leaving::after { animation: none; }
}
