/* ==========================================================================
   Rewrite Your Money Story — course page
   Ported from the "Rewrite Your Money Story" design. The hero workbook is a
   still picture (the old story struck through, the new line written). The
   moving parts sit lower down: the beliefs are struck through as you reach
   them, the words sink beneath the surface, the seven strands of light rise,
   and the closing line is written by hand. Sections marked data-reveal start
   when they scroll into view (see main.js).
   ========================================================================== */

.r-page { overflow: hidden; background: linear-gradient(180deg, #0A0410 0%, #110717 14%, #0A0410 30%, #110717 48%, #0A0410 64%, #110717 82%, #1A0B26 100%); }

/* ---------- hero (static) ---------- */
.r-hero { padding: 0 0 110px; background: radial-gradient(40% 50% at 78% 52%, rgba(122, 61, 184, .32) 0%, rgba(122, 61, 184, 0) 72%), radial-gradient(34% 30% at 6% 14%, rgba(86, 48, 138, .2) 0%, rgba(86, 48, 138, 0) 70%); }
.r-hg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px 56px; padding-top: 40px; }
.r-eye { display: flex; align-items: center; gap: 16px; font-size: 11.5px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase; color: #D9C2F5; }
.r-eye::before { content: ""; width: 40px; height: 1px; background: linear-gradient(90deg, rgba(233, 213, 255, 0), #E9D5FF); }
.r-h1 { margin-top: 26px; font-family: var(--serif); font-weight: 500; font-size: clamp(54px, 6.9vw, 112px); line-height: .94; letter-spacing: -.015em; color: var(--white); }
.r-h1 em { padding-right: .06em; font-style: italic; font-weight: 400; background: linear-gradient(100deg, #B98CE8 0%, #E4C8FF 40%, #FFFFFF 52%, #C9A6F0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r-intro { margin-top: 28px; max-width: 520px; }
.r-hero .facts { margin-top: 34px; }
.r-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 40px; }

/* the workbook, shown as a still: the old story struck through, the new one written */
.bk3 { position: relative; width: 100%; max-width: 660px; margin-left: auto; aspect-ratio: 1.42; perspective: 1900px; container-type: inline-size; }
.bk3-glow { position: absolute; left: 50%; top: 52%; width: 120%; height: 120%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(201, 166, 240, .36) 0%, rgba(122, 61, 184, .18) 50%, rgba(122, 61, 184, 0) 100%); pointer-events: none; }
.bk3-in { position: absolute; inset: 4% 2%; display: flex; transform: rotateX(16deg) rotateZ(-3deg); transform-style: preserve-3d; }
.bk3-pg { position: relative; width: 50%; height: 100%; padding: 7.5cqw 5cqw 5cqw; overflow: hidden; }
.bk3-pg.l { transform-origin: 100% 50%; transform: rotateY(9deg); border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #E8DDF3 0%, #F5EFFB 55%, #EEE5F6 88%, #CDBBE0 100%); box-shadow: -2px 3px 0 #D8C9E8, -4px 6px 0 #C4AFDA, -6px 9px 0 #A88FC4, 0 40px 80px rgba(5, 2, 10, .65); }
.bk3-pg.r { transform-origin: 0 50%; transform: rotateY(-9deg); border-radius: 0 6px 6px 0; background: repeating-linear-gradient(180deg, rgba(185, 140, 232, 0) 0, rgba(185, 140, 232, 0) calc(6.2cqw - 1px), rgba(185, 140, 232, .28) calc(6.2cqw - 1px), rgba(185, 140, 232, .28) 6.2cqw) 0 15.6cqw / 100% auto no-repeat, linear-gradient(270deg, #E8DDF3 0%, #F7F2FC 55%, #F0E8F8 88%, #CDBBE0 100%); box-shadow: 2px 3px 0 #D8C9E8, 4px 6px 0 #C4AFDA, 6px 9px 0 #A88FC4, 0 40px 80px rgba(5, 2, 10, .65); }
.bk3-pg.l::after, .bk3-pg.r::after { content: ""; position: absolute; top: 0; bottom: 0; width: 22%; pointer-events: none; }
.bk3-pg.l::after { right: 0; background: linear-gradient(270deg, rgba(74, 40, 110, .22), rgba(74, 40, 110, 0)); }
.bk3-pg.r::after { left: 0; background: linear-gradient(90deg, rgba(74, 40, 110, .22), rgba(74, 40, 110, 0)); }
.bk3-k { font-size: 1.45cqw; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: #7A3DB8; }
.bk3-old { display: flex; flex-direction: column; gap: 1.5cqw; margin-top: 2.6cqw; }
.bk3-ln { font-size: 2.15cqw; line-height: 1.45; color: #9C8DAE; }
.bk3-ln span { background: linear-gradient(#9E63E0, #9E63E0) no-repeat 0 56% / 100% max(1.5px, .2cqw); -webkit-box-decoration-break: slice; box-decoration-break: slice; }
.bk3-rep { display: flex; flex-direction: column; gap: 1.1cqw; margin-top: 1.2cqw; font-size: 2.15cqw; line-height: 1.45; color: #3B2550; }
.bk3-rep p:nth-child(1) { opacity: .55; filter: blur(.3px); }
.bk3-rep p:nth-child(2) { opacity: .38; filter: blur(.7px); }
.bk3-rep p:nth-child(3) { opacity: .24; filter: blur(1.2px); }
.bk3-rep p:nth-child(4) { opacity: .14; filter: blur(1.8px); }
.bk3-rep p:nth-child(5) { opacity: .08; filter: blur(2.4px); }
.bk3-hand { margin-top: 2.4cqw; font-family: var(--script); font-size: 6.4cqw; line-height: 6.2cqw; color: #2A1240; }
.bk3-hand span { display: block; }
.bk3-new { margin-top: 2cqw; font-family: var(--serif); font-style: italic; font-size: 3cqw; line-height: 1.2; color: #5B2A92; }

/* ---------- the story you were handed (struck through as you reach it) ---------- */
.r-sg { display: grid; grid-template-columns: minmax(0, .42fr) minmax(0, 1.58fr); gap: 28px 72px; }
.r-sh { padding-top: 12px; }
.r-sh2 { display: flex; flex-direction: column; gap: 18px; max-width: 240px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 30px; line-height: 1.15; color: #D9C2F5; }
.r-sh2::before { content: ""; width: 40px; height: 1px; background: linear-gradient(90deg, #E9D5FF, rgba(233, 213, 255, 0)); }
.r-st1 { max-width: 900px; font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 3.8vw, 58px); line-height: 1.1; color: var(--white); }
.r-bel { display: flex; flex-direction: column; gap: 18px; margin-top: 44px; padding-left: 28px; border-left: 1px solid rgba(217, 194, 245, .22); }
.r-bel li { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 2.8vw, 42px); line-height: 1.2; color: #8F839F; }
.r-bel li > span { background-image: linear-gradient(90deg, #C9A6F0, #F3E8FF), linear-gradient(180deg, rgba(201, 166, 240, 0), rgba(201, 166, 240, .5), rgba(201, 166, 240, 0)); background-repeat: no-repeat; background-position: 0 55%, 0 54%; background-size: 100% 2px, 100% 12px; -webkit-box-decoration-break: slice; box-decoration-break: slice; }
.r-story.in .r-bel li > span { animation: r-strike 1s cubic-bezier(.65, 0, .35, 1) both; animation-delay: calc(var(--i) * .8s + .6s); }
.r-story.in .r-bel li { animation: r-dim .8s ease both; animation-delay: calc(var(--i) * .75s + 1.2s); }
.r-story.pre .r-bel li { color: #EFE6F7; }
.r-story.pre .r-bel li > span { background-size: 0% 2px, 0% 12px; }
.r-st2 { margin-top: 44px; max-width: 640px; }
.r-st3 { margin-top: 40px; max-width: 860px; font-family: var(--serif); font-size: clamp(28px, 2.6vw, 40px); line-height: 1.3; color: #F1ECF7; }
.r-st3 .ml { font-style: italic; color: #D9C2F5; }
.r-st3 strong { font-weight: 500; color: var(--white); text-shadow: 0 0 30px rgba(201, 166, 240, .55); }

/* ---------- your beliefs are instructions (words sink beneath the surface) ---------- */
.r-ins { background: radial-gradient(46% 40% at 84% 60%, rgba(122, 61, 184, .22) 0%, rgba(122, 61, 184, 0) 70%); }
.r-ig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px 80px; }
.r-it { display: flex; flex-direction: column; gap: 22px; }
.r-it .c-h2 { margin-bottom: 8px; }
.r-it .body { max-width: 560px; }
.r-ichg { margin-top: 12px; font-family: var(--serif); font-style: italic; font-size: clamp(28px, 2.5vw, 38px); line-height: 1.2; color: #F3E8FF; text-shadow: 0 0 30px rgba(201, 166, 240, .5); }
.sf { position: relative; height: 560px; overflow: hidden; border-radius: 4px; }
.sf-below { position: absolute; left: 0; right: 0; top: 200px; bottom: 0; background: linear-gradient(180deg, rgba(122, 61, 184, .24) 0%, rgba(26, 11, 38, .4) 40%, rgba(10, 4, 16, 0) 100%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.sf-line { position: absolute; left: 0; right: 0; top: 200px; height: 1px; background: linear-gradient(90deg, rgba(233, 213, 255, 0), rgba(233, 213, 255, .95) 30%, #FFFFFF 50%, rgba(233, 213, 255, .95) 70%, rgba(233, 213, 255, 0)); box-shadow: 0 0 18px 2px rgba(201, 166, 240, .7); }
.sf-la { position: absolute; left: 0; top: 18px; }
.sf-lb { position: absolute; right: 0; top: 218px; text-align: right; }
.sf-la, .sf-lb { font-size: 10.5px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; color: var(--lilac); }
.sf-w { position: absolute; top: 96px; left: var(--x); font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; white-space: nowrap; color: #FFFFFF; opacity: 0; animation: r-sink 12.5s cubic-bezier(.45, 0, .55, 1) infinite; animation-delay: var(--d); }
.sf-sed { position: absolute; font-family: var(--serif); font-style: italic; white-space: nowrap; color: #9E63E0; }

/* ---------- what this is, and what it isn't ---------- */
.r-isg { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: 36px 80px; }
.r-is1 { font-family: var(--serif); font-size: clamp(28px, 2.7vw, 40px); line-height: 1.25; color: var(--white); }
.r-is2 { margin-top: 26px; max-width: 620px; }
.r-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.r-chip { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(217, 194, 245, .16); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #7F7391; }
.r-chip::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 1px; background: var(--lilac); }
.r-chip.on { border-color: rgba(233, 213, 255, .7); background: rgba(245, 238, 252, .08); color: var(--white); box-shadow: 0 0 24px rgba(158, 99, 224, .35); }
.r-chip.on::after { display: none; }
.r-is3 { margin-top: 30px; font-family: var(--serif); font-style: italic; font-size: clamp(26px, 2.3vw, 34px); line-height: 1.3; color: #F3E8FF; }

/* ---------- your seven days (strands rise as you reach them) ---------- */
.r-dy { background: radial-gradient(60% 40% at 50% 64%, rgba(122, 61, 184, .22) 0%, rgba(122, 61, 184, 0) 72%); }
.r-arc { display: flex; align-items: center; gap: 16px; min-width: 320px; font-size: 10.5px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; }
.r-arc .a { color: #7F7391; }
.r-arc .b { color: #F1E4FF; }
.r-arc .ln { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217, 194, 245, .12), rgba(241, 228, 255, .85)); }
.r-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: clamp(12px, 1.8vw, 30px); row-gap: 0; margin-top: 64px; }
.r-gh { position: relative; grid-row: 1; display: flex; flex-direction: column; gap: 10px; padding: 0 0 26px; }
.r-gh::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(233, 213, 255, .7), rgba(217, 194, 245, .14)); }
.r-gk { font-size: 10.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--lilac); }
.r-gn { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 2.7vw, 42px); line-height: 1; color: var(--white); }
.r-gd { max-width: 440px; font-size: 15px; line-height: 1.55; color: var(--text); }
.r-d { grid-row: 2; display: flex; flex-direction: column; cursor: default; }
.r-dc { position: relative; height: 300px; }
.r-haze { position: absolute; left: 50%; bottom: 0; width: 72%; max-width: 96px; height: var(--h); transform: translateX(-50%); border-radius: 999px 999px 0 0; background: linear-gradient(0deg, rgba(122, 61, 184, 0) 0%, rgba(158, 99, 224, .12) 55%, rgba(201, 166, 240, .22) 100%); filter: blur(10px); opacity: .75; transition: opacity .5s ease; }
.r-bar { position: absolute; left: 50%; bottom: 0; width: 3px; height: var(--h); margin-left: -1.5px; border-radius: 3px; background: linear-gradient(0deg, rgba(122, 61, 184, 0) 0%, var(--c) 100%); transform-origin: 50% 100%; transition: transform 1.5s cubic-bezier(.2, .7, .2, 1), filter .4s ease; transition-delay: calc(var(--i) * .13s), 0s; }
.r-bead { position: absolute; left: 50%; bottom: calc(var(--h) - 6px); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 16px 4px rgba(201, 166, 240, .75); animation: r-glint 6s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); transition: bottom 1.5s cubic-bezier(.2, .7, .2, 1), opacity .6s ease; transition-delay: calc(var(--i) * .13s); }
.r-d:hover .r-bar { filter: brightness(1.5) drop-shadow(0 0 10px rgba(233, 213, 255, .85)); }
.r-d:hover .r-haze { opacity: 1; }
.r-dt { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid rgba(217, 194, 245, .14); transition: border-color .5s; }
.r-d:hover .r-dt { border-top-color: rgba(233, 213, 255, .7); }
.r-dk { font-size: 10.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--lilac); }
.r-dn { font-family: var(--serif); font-size: clamp(22px, 1.9vw, 29px); line-height: 1; color: var(--white); }
.r-dl { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.r-tag { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: #C9A6F0; }
.r-tag svg { flex: none; width: 11px; height: 11px; }
.r-dy.pre .r-bar { transform: scaleY(0); transition: none; }
.r-dy.pre .r-bead { bottom: -6px; opacity: 0; transition: none; }
.r-dy.pre .r-haze { opacity: 0; transition: none; }

/* ---------- what you'll receive ---------- */
.r-rcg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 56px; }
.r-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 28px; border: 1px solid rgba(217, 194, 245, .16); background: linear-gradient(180deg, rgba(26, 11, 38, .75) 0%, rgba(17, 7, 23, .6) 100%); }
.r-ill { position: relative; height: 250px; border-bottom: 1px solid rgba(217, 194, 245, .1); background: radial-gradient(60% 70% at 50% 60%, rgba(122, 61, 184, .24) 0%, rgba(122, 61, 184, 0) 75%); }
.r-ill svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-ct { padding: 30px 34px 36px; font-size: 17px; line-height: 1.7; color: #EDE7F4; }
.r-ct b { display: block; margin-bottom: 8px; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.1; color: var(--white); }
.r-scrib { stroke-dasharray: 100; stroke-dashoffset: 100; animation: r-scrib 7s ease-in-out infinite; }
.r-wv { stroke-dasharray: 9 91; animation: r-comet 4.5s linear infinite; }
.r-wl { position: absolute; left: 34px; font-size: 10px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--lilac); }
.r-keep { margin-top: 44px; text-align: center; font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.2vw, 32px); color: #EDE3F7; }

/* ---------- closing: the line is written by hand ---------- */
.r-cl { position: relative; padding: 140px 0 150px; text-align: center; background: radial-gradient(50% 50% at 50% 62%, rgba(122, 61, 184, .32) 0%, rgba(122, 61, 184, 0) 72%); }
.r-cl::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 110px; background: linear-gradient(180deg, rgba(233, 213, 255, 0), rgba(233, 213, 255, .6)); }
.r-cli { display: flex; flex-direction: column; align-items: center; max-width: 980px; margin: 0 auto; }
.r-c1 { max-width: 900px; font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 3.8vw, 58px); line-height: 1.12; color: var(--white); text-wrap: balance; }
.r-pen { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 30px; font-family: var(--script); font-size: clamp(46px, 5.6vw, 84px); line-height: 1.25; color: var(--white); text-shadow: 0 0 34px rgba(201, 166, 240, .6); }
.r-pl { position: relative; display: block; width: max-content; max-width: 100%; }
.r-pi { display: block; clip-path: inset(-40% -8% -40% -6%); }
.r-pn { position: absolute; top: 60%; left: 100%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 14px 5px rgba(201, 166, 240, .9), 0 0 40px 12px rgba(158, 99, 224, .5); opacity: 0; }
.r-cl.in .l1 .r-pi { animation: r-pen 2s cubic-bezier(.45, 0, .2, 1) .3s both; }
.r-cl.in .l1 .r-pn { animation: r-pnib 2s cubic-bezier(.45, 0, .2, 1) .3s both; }
.r-cl.in .l2 .r-pi { animation: r-pen 1.9s cubic-bezier(.45, 0, .2, 1) 2.35s both; }
.r-cl.in .l2 .r-pn { animation: r-pnib 1.9s cubic-bezier(.45, 0, .2, 1) 2.35s both; }
.r-cl.pre .r-pi { clip-path: inset(-40% 100% -40% -6%); }
.r-c3 { margin-top: 34px; font-family: var(--serif); font-style: italic; font-size: clamp(26px, 2.4vw, 36px); color: var(--lilac-3); }
.r-cl .btn { margin-top: 46px; }

@keyframes r-strike { from { background-size: 0% 2px, 0% 12px; } to { background-size: 100% 2px, 100% 12px; } }
@keyframes r-dim { from { color: #EFE6F7; } to { color: #8F839F; } }
@keyframes r-sink { 0% { opacity: 0; transform: translateY(0); filter: blur(0); color: #FFFFFF; } 7% { opacity: 1; } 30% { opacity: 1; transform: translateY(0); filter: blur(0); color: #FFFFFF; } 48% { opacity: 1; transform: translateY(130px); filter: blur(0); color: #E4C8FF; } 72% { opacity: .6; transform: translateY(250px); filter: blur(2.5px); color: #B98CE8; } 100% { opacity: 0; transform: translateY(380px); filter: blur(6px); color: #7A3DB8; } }
@keyframes r-glint { 0%, 100% { transform: scale(1); } 6% { transform: scale(1.7); } 14% { transform: scale(1); } }
@keyframes r-scrib { 0%, 12% { stroke-dashoffset: 100; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes r-comet { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes r-pen { from { clip-path: inset(-40% 100% -40% -6%); } to { clip-path: inset(-40% -8% -40% -6%); } }
@keyframes r-pnib { 0% { left: 0; opacity: 1; } 90% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .r-hero { padding-bottom: 80px; }
  .r-hg { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .r-h1 { font-size: clamp(48px, 13vw, 64px); }
  .bk3 { margin: 12px auto 0; }
  .r-cta { align-items: stretch; }
  .r-cta .btn { white-space: normal; text-align: center; }
  .r-cta .course-small { text-align: center; }
  .r-sg, .r-ig, .r-isg { grid-template-columns: minmax(0, 1fr); }
  .r-bel { padding-left: 18px; }
  .sf { height: 470px; }
  .sf-w { font-size: 24px; }
  .r-days { display: flex; flex-direction: column; margin-top: 44px; }
  .r-days > * { order: var(--o); }
  .r-gh { padding: 34px 0 18px; }
  .r-gh:first-child { padding-top: 0; }
  .r-d { flex-direction: row; gap: 18px; padding: 14px 0; }
  .r-dc { flex: none; width: 28px; height: 120px; }
  .r-haze { width: 28px; }
  .r-dt { justify-content: center; padding-top: 0; border-top: 0; }
  .r-rcg { grid-template-columns: minmax(0, 1fr); }
  .r-ill { height: 200px; }
  .r-ct { padding: 24px 24px 28px; }
  .r-cl { padding: 120px 0 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .r-bel li > span, .r-bel li, .sf-w, .r-bead, .r-scrib, .r-wv, .r-pi, .r-pn { animation: none !important; }
  .r-bel li > span { background-size: 100% 2px, 100% 10px; }
  .sf-w { opacity: .9; }
  .r-scrib { stroke-dashoffset: 0; }
  .r-pi { clip-path: none !important; }
  .r-bar, .r-bead, .r-haze { transition: none; }
}
