/* round 4: the written letter family (/written/, /trial/, /written-old-broken/). Everything is scoped to .r4w,
   the wrapper r4_written.py adds only on those three pages. Layout and looks only; every word stays. */

/* ---------- reading progress bar (CSS scroll timeline; hidden where unsupported) ---------- */
.r4w-progress{display:none}
@supports (animation-timeline: scroll()){
  .r4w-progress{display:block;position:fixed;left:0;top:0;width:100%;height:5px;z-index:9999;pointer-events:none;
    background:linear-gradient(90deg,#ffd200,#f0a020);transform-origin:0 50%;transform:scaleX(0);
    animation:r4w-read linear both;animation-timeline:scroll(root)}
  @keyframes r4w-read{to{transform:scaleX(1)}}
}

/* ---------- base reading layout ---------- */
.fam-letter .r4w .r4w-band{padding:76px 0}
.fam-letter .r4w .r4w-band .wrap{max-width:800px}
.fam-letter .r4w .r4w-band--offer .wrap{max-width:880px}
.fam-letter .r4w .band--cream{background:#fbf5ea}
.fam-letter .r4w .band--cream+.band--cream{border-top:1px solid #efe4d2}
.fam-letter .r4w p,.fam-letter .r4w li{font-size:18px;line-height:1.72}
.fam-letter .r4w :is(.prose,.center,.box--line)>p:not([class]){color:#2a2a2a}
.fam-letter .r4w .prose>p{margin:0 0 1.05em}
@media(max-width:600px){
  .fam-letter .r4w .r4w-band{padding:48px 0}
  .fam-letter .r4w p,.fam-letter .r4w li{font-size:17px}
}

/* chapter openers: the first heading of each band is a big editorial heading with a red tab above it */
.fam-letter .r4w .r4w-band>.wrap>.box--line:first-child{border-top:0;margin-top:0;padding-top:0}
.fam-letter .r4w .r4w-band>.wrap>.box--line:first-child>:is(h1,h2):first-child,
.fam-letter .r4w .r4w-band>.wrap>h3:first-child,
.fam-letter .r4w .r4w-band>.wrap>.center:first-child>h2.t-h2:first-child{
  font:800 clamp(28px,3.3vw,42px)/1.16 var(--f-head);color:#1d1d1d;letter-spacing:-.01em;text-align:left;margin:0 0 .7em;max-width:30ch}
.fam-letter .r4w .r4w-band>.wrap>.box--line:first-child>:is(h1,h2):first-child::before,
.fam-letter .r4w .r4w-band>.wrap>h3:first-child::before,
.fam-letter .r4w .r4w-band>.wrap>.center:first-child>h2.t-h2:first-child::before{
  content:"";display:block;width:56px;height:6px;border-radius:6px;background:var(--red);margin:0 0 22px}
.fam-letter .r4w .r4w-band--offer>.wrap>.center:first-child>h2.t-h2:first-child,
.fam-letter .r4w .r4w-band--offer>.wrap>h2.t-h2:first-child{text-align:center;margin-left:auto;margin-right:auto}
.fam-letter .r4w .r4w-band--offer>.wrap>.center:first-child>h2.t-h2:first-child::before,
.fam-letter .r4w .r4w-band--offer>.wrap>h2.t-h2:first-child::before{margin-left:auto;margin-right:auto}
.fam-letter .r4w .box--line{border-top:0}

/* in-letter headings */
.fam-letter .r4w .t-h4{font-size:clamp(21px,2.1vw,25px);line-height:1.32;color:#1d1d1d}
.fam-letter .r4w .quote-big{font-size:clamp(25px,3vw,34px);line-height:1.3;margin:.9em auto .7em;max-width:24em}

/* emphasis lines: no more stacked tinted boxes; bold text with a soft highlighter stroke */
.fam-letter .r4w .prose>p.em-line{background:none;border:0;border-radius:0;padding:0;margin:1.2em 0;color:#1d1d1d;font-size:19px}
.fam-letter .r4w .prose>p.em-line b{background:linear-gradient(transparent 60%,rgba(255,210,0,.42) 60%);box-decoration-break:clone;-webkit-box-decoration-break:clone;padding:0 2px}

/* pull quotes: bigger, quieter, centred between two short rules */
.fam-letter .r4w .pullquote{border:0;padding:46px 6% 38px;margin:2.2em 0;text-align:center;position:relative}
.fam-letter .r4w .pullquote::before{top:0;background:none!important;font-size:72px;line-height:1;color:var(--red)}
.fam-letter .r4w .pullquote::after{content:"";position:absolute;left:50%;bottom:0;width:120px;height:3px;border-radius:3px;background:var(--red);transform:translateX(-50%)}
.fam-letter .r4w .pullquote>div,.fam-letter .r4w .pullquote>.t-h3{font:italic 400 clamp(23px,2.6vw,30px)/1.4 var(--f-quote);color:#1d1d1d}

/* ---------- hero ---------- */
.fam-letter .r4w .r4w-hero{background:radial-gradient(120% 140% at 85% 10%,#9b1a20 0%,#6e0d12 45%,#3e0609 100%);color:#fff;padding:84px 0 92px;overflow:hidden}
.fam-letter .r4w .r4w-hero::after{content:"";position:absolute;inset:auto 0 0 0;height:6px;background:linear-gradient(90deg,#ffd200,#f0a020)}
.fam-letter .r4w .r4w-hero__in{max-width:1180px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:64px;align-items:center}
.fam-letter .r4w .r4w-hero__txt{text-align:left}
.fam-letter .r4w .r4w-hero__txt>:first-child{font:700 clamp(17px,1.5vw,20px)/1.45 var(--f-head);color:#ffd36b;text-align:left;margin:0 0 22px;padding-left:64px;position:relative;max-width:34em}
.fam-letter .r4w .r4w-hero__txt>:first-child::before{content:"";position:absolute;left:0;top:.7em;width:46px;height:3px;background:#ffd36b;border-radius:3px}
.fam-letter .r4w .r4w-hero__txt>:is(h1,h2,h3,p,.prose):not(:first-child){color:#fff;text-align:left}
.fam-letter .r4w .r4w-hero__txt .quote-big{color:#fff;font-size:clamp(32px,3.7vw,52px);line-height:1.18;margin:0 0 26px;max-width:none;text-align:left}
.fam-letter .r4w .r4w-hero__txt .quote-big+.quote-big{font-size:clamp(21px,2vw,27px);line-height:1.4;color:#ffe2b0;border-left:4px solid #ffd36b;padding-left:20px;margin:0}
.fam-letter .r4w .r4w-hero__txt .prose p{color:#f6e6e6;font-size:20px;text-align:left}
.fam-letter .r4w .r4w-hero__txt .prose strong{color:#fff}
.fam-letter .r4w .r4w-hero__txt :is(h2,h3):not(:first-child){color:#fff;font-size:clamp(24px,2.4vw,32px);line-height:1.25;margin:.2em 0}
.fam-letter .r4w .r4w-hero__txt .t-h3:not(:first-child){color:#ffe2b0;font-size:clamp(20px,1.9vw,24px)}
.fam-letter .r4w .r4w-hero__txt h1:first-child{font:800 clamp(34px,4vw,54px)/1.1 var(--f-head);color:#fff;padding-left:0}
.fam-letter .r4w .r4w-hero__txt h1:first-child::before{display:none}
.fam-letter .r4w .r4w-hero__fig{margin:0;position:relative;justify-self:end;width:100%;max-width:440px}
.fam-letter .r4w .r4w-hero__fig::before{content:"";position:absolute;inset:22px -22px -22px 22px;border:3px solid #ffd36b;border-radius:26px;opacity:.85}
.fam-letter .r4w .r4w-hero__fig img{position:relative;display:block;width:100%;height:auto;aspect-ratio:4/4.4;object-fit:cover;border-radius:24px;border:8px solid #fff;box-shadow:0 30px 60px rgba(0,0,0,.45)}
@media(max-width:900px){
  .fam-letter .r4w .r4w-hero{padding:48px 0 60px}
  .fam-letter .r4w .r4w-hero__in{grid-template-columns:1fr;gap:40px}
  .fam-letter .r4w .r4w-hero__fig{justify-self:center;max-width:min(330px,82%)}
  .fam-letter .r4w .r4w-hero__fig::before{inset:14px -14px -14px 14px}
  .fam-letter .r4w .r4w-hero__txt>:first-child{padding-left:0;padding-top:18px}
  .fam-letter .r4w .r4w-hero__txt>:first-child::before{top:0}
  .fam-letter .r4w .r4w-hero__txt .prose p{font-size:18px}
}

/* ---------- article pictures: full column width, rounded, with depth (were 400px, left-aligned) ---------- */
.fam-letter .r4w .r4w-band p:has(>img[width="400"]){margin:2em 0}
.fam-letter .r4w .r4w-band img[width="400"]{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;object-position:50% 40%;
  border-radius:20px;box-shadow:0 22px 48px rgba(40,10,10,.18)}
@media(min-width:1000px){
  .fam-letter .r4w .r4w-band p:has(>img[width="400"]){margin:2.4em -70px}
}

/* Judd: round portrait floated beside his introduction */
.fam-letter .r4w .prose>p:has(>img[src*="judd-circular"]){float:right;width:230px;margin:6px 0 18px 32px;shape-outside:circle(50%)}
.fam-letter .r4w img[src*="judd-circular"]{width:230px;height:230px;border-radius:50%;border:6px solid #fff;box-shadow:0 0 0 3px var(--red),0 18px 40px rgba(40,10,10,.2)}
.fam-letter .r4w .r4w-band>.wrap>h3:first-child+p{font:500 20px/1.5 var(--f-head);color:#7d0f13}
@media(max-width:600px){
  .fam-letter .r4w .prose>p:has(>img[src*="judd-circular"]){float:none;margin:8px auto 22px;width:180px}
  .fam-letter .r4w img[src*="judd-circular"]{width:180px;height:180px}
}
.fam-letter .r4w .r4w-band>.wrap::after{content:"";display:table;clear:both}

/* ---------- testimonials ---------- */
.fam-letter .r4w .r4w-testi{position:relative;background:#fff;border-radius:22px;padding:34px 34px 26px 34px;margin:2em 0;box-shadow:0 16px 40px rgba(60,20,10,.10);border:1px solid #f0e4d4}
.fam-letter .r4w .r4w-testi::before{content:"\201C";position:absolute;top:-26px;left:28px;width:56px;height:56px;border-radius:50%;background:var(--red);color:#fff;
  font:700 54px/76px var(--f-quote);text-align:center}
.fam-letter .r4w .r4w-testi>p:first-child{font:italic 400 19px/1.7 var(--f-quote);color:#2a2a2a;margin:0 0 14px;text-align:left}
.fam-letter .r4w .r4w-testi>p.r4w-testi__name{font:700 17px/1.3 var(--f-head);color:var(--red);margin:0;text-align:left}
.fam-letter .r4w .r4w-testi>p.r4w-testi__name::before,.fam-letter .r4w .r4w-testi__who .col p::before{content:"\2014\00a0"}
.fam-letter .r4w .r4w-testi__who{display:flex;align-items:center;gap:14px;margin:0}
.fam-letter .r4w .r4w-testi__who .col{flex:0 0 auto;width:auto}
.fam-letter .r4w .r4w-testi__who .fig{margin:0}
.fam-letter .r4w .r4w-testi__who img{width:64px;height:64px;border-radius:50%;object-fit:cover}
.fam-letter .r4w .r4w-testi__who .col p{font:700 17px/1.3 var(--f-head);color:var(--red);margin:0}
@media(max-width:600px){.fam-letter .r4w .r4w-testi{padding:34px 20px 20px}.fam-letter .r4w .r4w-testi>p:first-child{font-size:17px}}

/* ---------- the one dark spotlight band: the product reveal ---------- */
.fam-letter .r4w .r4w-reveal{background:radial-gradient(90% 120% at 50% 0%,#8f161c 0%,#5b0a0e 55%,#320507 100%);color:#fff;padding:88px 0 80px;text-align:center}
.fam-letter .r4w .r4w-reveal .wrap{max-width:980px}
.fam-letter .r4w .r4w-reveal :is(h1,h2,h3){color:#fff;font:800 clamp(30px,3.6vw,48px)/1.15 var(--f-head);margin:0 auto 34px;max-width:24ch}
.fam-letter .r4w .r4w-reveal :is(h2,h3)+:is(h2,h3){font-size:clamp(20px,2vw,26px);color:#ffd36b;margin-top:-18px}
.fam-letter .r4w .r4w-reveal .fig{margin:0 auto 34px;max-width:720px;background:#fff;border-radius:24px;padding:22px;box-shadow:0 30px 70px rgba(0,0,0,.4)}
.fam-letter .r4w .r4w-reveal .fig img{border-radius:12px}
.fam-letter .r4w .r4w-reveal .quote-big{color:#ffe2b0;max-width:30em;margin:0 auto}
.fam-letter .r4w .r4w-reveal+.r4w-band .box--line:first-child{padding-top:0}
@media(max-width:600px){.fam-letter .r4w .r4w-reveal{padding:56px 0}.fam-letter .r4w .r4w-reveal .fig{padding:12px;border-radius:18px}}

/* product media rows after the reveal: picture in a soft card */
.fam-letter .r4w .r4w-band .cols--media:not(.r4w-testi__who)>.col>.fig img{border-radius:16px}
.fam-letter .r4w .check{background:#fff;border-radius:16px;padding:16px 18px 6px 60px;margin:0 0 12px;box-shadow:0 6px 18px rgba(60,20,10,.06)}
.fam-letter .r4w .check .prose>p{margin:0 0 .5em}
.fam-letter .r4w .check::before{left:20px;top:19px}

/* the plain (no button) grey box in the letter: a clean card instead of the dashed cart frame */
.fam-letter .r4w .box--line .box--grey:not(:has(.btn-buy)){border:0;border-top:6px solid var(--gold);border-radius:20px;padding:26px 28px 14px;background:#fff;text-align:left;box-shadow:0 14px 36px rgba(60,20,10,.09)}

/* offer bands: warm, with the coupon boxes centred and wider */
.fam-letter .r4w .r4w-band--offer{background:linear-gradient(180deg,#fff6e6 0%,#fbefdc 100%);border-top:6px solid var(--red)}
.fam-letter .r4w .band--cream .box--line:has(.bonus-card){background:#fff}
.fam-letter .r4w .r4w-band--offer .pullquote::before{background:none}

/* r6 (review 5c-r6): the last countdown pill sits in an offer band whose text rules made "Discount Expires In:" dark on red */
.fam-letter .r4w-band .goldcoupon .center .center p,.fam-letter .r4w-band--offer .goldcoupon .center .center p{color:#fff!important}
