/* Biblical Foundations: five columns, one portico.  Design: docs/DESIGN.md.  Every colour below is a token from section 6 of the design.
   State classes on <html>: js, is-on (a lesson was started), is-playing (follows the player), is-whole (all five full), is-still (reduced motion).
   Values the script writes: --p on each .pl (0..1, heard / length), --whole on <html> (0..1). Nothing is requested from YouTube before the press. */
:root {
  --ivory: #f2ede3; --ivory-deep: #e6dfd1; --stone: #cfc6b4; --ink: #23221f; --umber: #4f4331; --bronze: #5f3e04; --bronze-deep: #3f2a03;
  --graphite: #2b2e33; --gold: #c8922e; --gold-hi: #f0c866;
  --serif: 'Spectral', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --cap: 'Marcellus', 'Trajan Pro', 'Palatino Linotype', Georgia, serif;
  /* the Share component reads these names */
  --primary: var(--bronze); --secondary: var(--ivory-deep); --bg-color: var(--ivory); --text-color: var(--ink); --border-radius: 6px; --border-radius-sm: 4px;
  --fw: max(300px, min(880px, calc(100vw - 24px), calc((100svh - 250px) * 1.26)));   /* the video's width; the portico is as wide */
  --pk: .13;                                                                              /* a pillar's width as a share of --fw */
  --pw: clamp(46px, calc(var(--fw) * var(--pk)), 124px);
  --hang: 28px; --lh: 26px;
  --whole: 0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: linear-gradient(180deg, var(--ivory) 0, var(--ivory) 70svh, var(--ivory-deep) 100%); color: var(--ink); font: 400 1.075rem/1.65 var(--serif); overflow-x: hidden; }
a { color: var(--bronze); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--bronze-deep); }
:focus-visible { outline: 3px solid var(--bronze); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ---- keys: the Global Menu key and the Share key ---- */
.keys { position: fixed; z-index: 5; top: max(10px, env(safe-area-inset-top, 0px)); left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.keys > * { pointer-events: auto; }
.key { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem .95rem; border-radius: 4px; border: 1px solid rgba(95, 62, 4, .55); background: rgba(242, 237, 227, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--bronze); font: 400 .95rem/1 var(--cap); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 0 rgba(95, 62, 4, .18); }
.key:hover { background: #fff8e6; }
.key .glyph { font-size: 1rem; color: var(--bronze); }
.keys .share { --share-accent: #5f3e04; --share-on-accent: #f2ede3; --share-panel-bg: #f2ede3; --share-panel-fg: #23221f; --share-line: rgba(95, 62, 4, .35); --share-field-bg: #e6dfd1; --share-btn-bg: rgba(242, 237, 227, .88); --share-btn-fg: #5f3e04; --share-radius: 6px; --share-radius-sm: 4px; --share-shadow: 0 24px 70px rgba(35, 34, 31, .35); }

/* ---- the stage ---- */
.stage { position: relative; padding: 14px 12px 8px; overflow: hidden; }
.light { position: absolute; inset: -20% -10% auto -10%; height: 130%; pointer-events: none; background: linear-gradient(112deg, transparent 18%, rgba(255, 244, 214, .0) 22%, rgba(255, 244, 214, .75) 36%, rgba(255, 238, 196, .35) 46%, transparent 58%); mix-blend-mode: soft-light; animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-4%); } to { transform: translateX(6%); } }
.flank { position: absolute; top: -40px; bottom: 0; width: clamp(80px, 9.5vw, 150px); display: none; background: url(shaft.jpg) 0 0 / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: .5; pointer-events: none; -webkit-mask: linear-gradient(180deg, transparent 0, #000 24%, #000 76%, transparent 100%); mask: linear-gradient(180deg, transparent 0, #000 24%, #000 76%, transparent 100%); }
.flank.l { left: calc(50% - var(--fw) / 2 - clamp(110px, 14vw, 230px)); }
.flank.r { right: calc(50% - var(--fw) / 2 - clamp(110px, 14vw, 230px)); }
@media (min-width: 1100px) { .flank { display: block; } }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.masthead { position: relative; z-index: 2; text-align: center; padding: 20px 0 8px; }
.title { margin: 0; font: 400 clamp(1.7rem, 4vw, 2.9rem)/1.05 var(--cap); letter-spacing: .075em; text-transform: uppercase; color: var(--bronze); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title { background: linear-gradient(100deg, #7a5208 0%, #b9831f 22%, #e3b24a 40%, #b9831f 56%, #6e4806 100%) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: sheen 2.6s ease-out .5s 1 both; }
  .title.sheen { animation: sheen 2.6s ease-out 1 both; }
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.by { margin: .3rem 0 0; font: italic 400 clamp(1rem, 1.8vw, 1.25rem)/1.3 var(--serif); color: var(--umber); letter-spacing: .02em; }

/* ---- the video frame (centered, R27) ---- */
.frame { position: relative; z-index: 2; width: var(--fw); margin: 6px auto 0; padding: 7px; background: var(--graphite); border-radius: 3px; box-shadow: 0 0 0 1px #6a4a12, 0 0 0 3px var(--ivory), 0 0 0 4px rgba(95, 62, 4, .45), 0 26px 44px -22px rgba(63, 48, 20, .6); }
.screen { position: relative; aspect-ratio: 16 / 9; background: #0e0f11; overflow: hidden; }
.poster, .slot, .slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.poster { object-fit: cover; }
.begin { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; background: linear-gradient(180deg, rgba(14, 15, 17, 0) 55%, rgba(14, 15, 17, .28)); }
.play { width: clamp(54px, 9vw, 78px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 28, 31, .78); border: 2px solid var(--gold-hi); box-shadow: 0 6px 22px rgba(0, 0, 0, .45); transition: transform .25s; }
.tri { display: block; width: 0; height: 0; margin-left: 12%; border-left: clamp(16px, 2.6vw, 24px) solid var(--gold-hi); border-top: clamp(10px, 1.6vw, 15px) solid transparent; border-bottom: clamp(10px, 1.6vw, 15px) solid transparent; }
.begin:hover .play, .begin:focus-visible .play { transform: scale(1.07); }
.begin:focus-visible { outline-offset: -5px; outline-color: var(--gold-hi); }
html.is-on .begin, html.is-on .poster { display: none; }
.resume { position: absolute; z-index: 2; left: 12px; bottom: 10px; margin: 0; padding: .3rem .7rem; border-radius: 3px; background: rgba(27, 28, 31, .82); color: var(--gold-hi); font: 400 .8rem/1.2 var(--cap); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.resume[hidden] { display: none; }
html.is-on .resume { display: none; }

/* ---- the portico: five pillars, the lintel above them ---- */
.portico { position: relative; width: var(--fw); margin: calc(var(--hang) + 8px) auto 0; padding-top: var(--lh); }   /* no z-index: a stacking context here would keep the stone's multiply from reaching the wall */
.lintel { position: absolute; z-index: 1; left: 1%; right: 1%; top: 0; height: calc(var(--lh) + 8px); display: grid; place-items: center; background: url(lintel.jpg) 0 0 / 100% 100% no-repeat; mix-blend-mode: multiply; pointer-events: none; transform: translateY(calc((1 - var(--whole)) * var(--hang) * -1)); transition: transform 1.1s cubic-bezier(.3, .8, .25, 1); }
.lintel b { font: 400 clamp(.56rem, 1.55vw, .8rem)/1 var(--cap); letter-spacing: .16em; text-transform: uppercase; color: var(--bronze-deep); white-space: nowrap; text-shadow: 0 0 0 transparent; transition: text-shadow 1.2s, color 1.2s; }
.lintel::after { content: ''; position: absolute; left: 4%; right: 4%; bottom: -10px; height: 10px; background: radial-gradient(60% 100% at 50% 0, rgba(63, 48, 20, .38), transparent 70%); opacity: calc(1 - var(--whole)); pointer-events: none; }
html.is-whole .lintel b { text-shadow: 0 0 10px rgba(240, 200, 102, .95), 0 0 1px rgba(255, 244, 214, 1); }
html:not(.js) .lintel { transform: none; }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.pl { margin: 0; padding: 0; --p: 0; }
.pillar { display: flex; flex-direction: column; align-items: center; min-height: 44px; padding: 2px 0 4px; color: var(--ink); text-decoration: none; position: relative; }
.stack { position: relative; display: block; width: var(--pw); margin: 0 auto; }
/* the pillar is built from the ground up: foot, shaft, capital, each piece clipped open on its own (the clip sits on the blending element itself, so the multiply still reaches the wall) */
.piece { position: relative; display: block; mix-blend-mode: multiply; animation: rise .62s cubic-bezier(.2, .75, .2, 1) backwards; animation-delay: calc(var(--i) * 95ms + var(--d, 0ms)); }
.pc-foot { --d: 120ms; } .pc-shaft { --d: 460ms; } .pc-cap { --d: 800ms; }
@keyframes rise { from { clip-path: inset(100% 0 0 0); } }
.piece img { width: 100%; height: 100%; }
.pc-cap { width: 100%; aspect-ratio: 360 / 199; transition: transform .3s; }
.pc-shaft { width: 49.4%; height: calc(var(--pw) * .62); margin: -1px auto -1px; }
.pc-foot { width: 100%; aspect-ratio: 360 / 209; }
.pc-shaft img { object-fit: fill; }
.gilt { position: absolute; inset: 0; background: linear-gradient(90deg, #e8b53f 0%, #ffe08a 36%, #f4c862 60%, #d79a2c 100%); mix-blend-mode: multiply; transition: clip-path .7s ease-out; pointer-events: none; }
.pc-cap .gilt { -webkit-mask: url(cap-mask.png) 0 0 / 100% 100% no-repeat; mask: url(cap-mask.png) 0 0 / 100% 100% no-repeat; clip-path: inset(calc((1 - clamp(0, calc((var(--p) - .92) / .08), 1)) * 100%) 0 0 0); }
.pc-shaft .gilt { clip-path: inset(calc((1 - clamp(0, calc((var(--p) - .08) / .84), 1)) * 100%) 0 0 0); }
.pc-foot .gilt { -webkit-mask: url(foot-mask.png) 0 0 / 100% 100% no-repeat; mask: url(foot-mask.png) 0 0 / 100% 100% no-repeat; clip-path: inset(calc((1 - clamp(0, calc(var(--p) / .08), 1)) * 100%) 0 0 0); }
.joint { position: absolute; left: -5%; right: -5%; bottom: calc(var(--at) * 100%); height: 1px; background: rgba(63, 42, 10, .24); transition: background .6s, box-shadow .6s; }
.joint.lit { background: #fff1c2; box-shadow: 0 0 3px 1px rgba(240, 200, 102, .9); }
.joint.seat { animation: seat .6s ease-out 1; }
@keyframes seat { 30% { transform: translateY(1px); box-shadow: 0 0 8px 3px rgba(255, 224, 140, 1); } }
.no { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 400 clamp(.55rem, 1.1vw, .8rem)/1 var(--cap); color: var(--bronze-deep); letter-spacing: .02em; text-shadow: 0 0 3px rgba(255, 250, 236, .85); mix-blend-mode: normal; }
.label { display: block; text-align: center; margin-top: 2px; line-height: 1.15; }
.nm { display: block; font: 400 clamp(.6rem, 1.45vw, .8rem)/1.15 var(--cap); letter-spacing: .08em; text-transform: uppercase; color: var(--umber); hyphens: manual; }
.tm { display: block; font: italic 400 clamp(.62rem, 1.25vw, .78rem)/1.2 var(--serif); color: var(--umber); margin-top: 1px; }
.pillar[aria-current="true"] .nm { color: var(--bronze); }
.pillar[aria-current="true"] .label::after { content: ''; display: block; width: 26px; height: 2px; margin: 4px auto 0; background: var(--gold); border-radius: 1px; }
.pillar[aria-current="true"] .stack::after { content: ''; position: absolute; left: -12%; right: -12%; bottom: -3%; height: 24%; background: radial-gradient(50% 60% at 50% 70%, rgba(240, 200, 102, .75), transparent 72%); z-index: -1; pointer-events: none; }
@media (hover: hover) {
  .pillar:hover .pc-cap { transform: translateY(-2px); }
  .pillar:hover .nm { color: var(--bronze); }
  .pillar .pc-cap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) -140% 0 / 140% 100% no-repeat; -webkit-mask: url(cap-mask.png) 0 0 / 100% 100% no-repeat; mask: url(cap-mask.png) 0 0 / 100% 100% no-repeat; pointer-events: none; }
  .pillar:hover .pc-cap::after { animation: glint .9s ease-out 1; }
  @keyframes glint { to { background-position: 140% 0; } }
}
.steps { position: absolute; left: -2%; right: -2%; bottom: 0; height: 0; pointer-events: none; }

/* ---- below the fold ---- */
.board { background: linear-gradient(180deg, transparent, var(--ivory-deep) 14%, var(--ivory-deep)); padding: 34px 0 42px; border-top: 1px solid rgba(95, 62, 4, .18); }
.wrap { width: min(1040px, 100% - 40px); margin: 0 auto; }
.lede { margin: 0 auto 30px; max-width: 34ch; text-align: center; font: italic 400 clamp(1.15rem, 2.4vw, 1.5rem)/1.45 var(--serif); color: var(--umber); }
.lesson { margin: 0 0 12px; }
.lh { margin-bottom: 14px; }
.kick { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0; font: 600 .82rem/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--umber); }
.rn { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .4rem; border: 1px solid var(--bronze); border-radius: 2px; color: var(--bronze); font-size: .95rem; letter-spacing: .04em; }
.lh h2 { margin: .45rem 0 0; font: 400 clamp(1.8rem, 4vw, 2.7rem)/1.1 var(--cap); letter-spacing: .05em; text-transform: uppercase; color: var(--bronze); }
.lbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.words p { margin: 0 0 1em; max-width: 62ch; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.72; }
.words .watch { font-size: .98rem; }
.chapters { background: rgba(255, 252, 244, .6); border: 1px solid rgba(95, 62, 4, .28); border-radius: 3px; padding: 14px 16px 12px; box-shadow: inset 0 1px 0 #fff; }
.chapters h3 { margin: 0 0 .5rem; font: 400 .85rem/1.2 var(--cap); letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }
.toc { list-style: none; margin: 0; padding: 0; column-width: 290px; column-gap: 40px; }
.toc li { margin: 0; position: relative; break-inside: avoid; }
.toc a { display: flex; align-items: baseline; gap: .55rem; min-height: 44px; padding: .45rem .3rem .45rem 1.1rem; color: var(--ink); text-decoration: none; position: relative; line-height: 1.3; }
.toc a::before { content: ''; position: absolute; left: .15rem; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; transform: rotate(45deg); border: 1px solid var(--bronze); background: transparent; transition: background .5s; }
.toc li.heard a::before { background: var(--gold); }
.toc li.now a { font-weight: 600; color: var(--bronze-deep); }
.toc li.now a::before { box-shadow: 0 0 0 3px rgba(240, 200, 102, .6); }
.toc a:hover .ct { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; }
.dots { flex: 1 1 auto; min-width: 12px; border-bottom: 1px dotted rgba(79, 67, 49, .5); transform: translateY(-.28em); }
.toc .tm { margin: 0; font-style: normal; font-variant-numeric: tabular-nums; color: var(--umber); font-size: .9rem; white-space: nowrap; }
.src { margin: .5rem 0 0; font-size: .85rem; color: var(--umber); font-style: italic; }
.take { margin: 42px 0 0; padding-top: 26px; border-top: 1px solid rgba(95, 62, 4, .22); }
.take h2 { margin: 0 0 14px; font: 400 1.25rem/1.2 var(--cap); letter-spacing: .12em; text-transform: uppercase; color: var(--bronze); }
.tablets { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.tablets a { display: inline-flex; align-items: center; min-height: 56px; padding: .6rem 1.5rem; background: linear-gradient(180deg, #fffaf0, #ece4d3); border: 1px solid rgba(95, 62, 4, .5); border-radius: 3px; box-shadow: 0 2px 0 rgba(95, 62, 4, .25), inset 0 1px 0 #fff; color: var(--bronze); font: 400 1.02rem/1.2 var(--cap); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.tablets a:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(95, 62, 4, .22), inset 0 1px 0 #fff; }
.note { margin: 0; max-width: 62ch; color: var(--umber); font-style: italic; font-size: .98rem; }
.foot { margin-top: 40px; text-align: center; }
.rule { display: block; height: 10px; margin: 0 auto 14px; max-width: 360px; background: linear-gradient(90deg, transparent, rgba(95, 62, 4, .5), transparent) center / 100% 1px no-repeat; position: relative; }
.rule i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); background: var(--gold); }
.links { margin: 0; font-size: .98rem; }
.links a { display: inline-block; padding: 12px 8px; }
.links span { color: var(--umber); }

/* ---- his rule: body paragraphs are fully justified (hyphenated, from 701 px up) ---- */
@media (min-width: 701px) { .words p, .note { text-align: justify; -webkit-hyphens: auto; hyphens: auto; } .words .watch { text-align: left; } }

/* ---- the lessons are all shown without JavaScript; with it only the chosen one ---- */
.lesson[hidden] { display: none; }

/* ---- narrower screens ---- */
@media (max-width: 639px) {
  :root { --pk: .164; --hang: 22px; --lh: 24px; }
  .masthead { padding-top: 58px; }
  .stage { padding-left: 8px; padding-right: 8px; }
  .frame { padding: 5px; }
  .key .kl { font-size: .85rem; }
  .lintel b { letter-spacing: .09em; }
  .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
  .links span { display: none; }
}

/* ---- reduced motion: the same end states at once ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html.is-still .light { animation: none; }
html.is-still .piece, html.is-still .title, html.is-still .lintel, html.is-still .gilt, html.is-still .joint { animation: none; transition: none; }
@media print { .keys, .dust, .light, .portico, .frame { display: none; } body { background: #fff; } .lesson[hidden] { display: block; } }
