/* Homepage launch hero: fixed copy over three rotating backdrops (assets/js/home-hero.js). */
.launch-hero { position: relative; z-index: 2; background: #050911; border-bottom: 1px solid var(--line-soft, #14283d); }
.lh-stage { position: relative; display: flex; align-items: center; min-height: clamp(560px, 46vw, 820px); overflow: hidden; }
.lh-backdrop { position: absolute; inset: 0; container-type: size; overflow: hidden; }
.lh-scene { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.lh-scene.is-on { opacity: 1; }

/* Scene 1: the agreement. The frame anchors Knox's signature at 62% across, 52% down,
   in the open window between the copy column (ends by ~45%) and the book (starts at ~75%). */
.lh-agreement { --w: max(106cqw, 205cqh); position: absolute; width: var(--w); aspect-ratio: 1600 / 901; left: calc(62cqw - var(--w) * .634); top: calc(52cqh - var(--w) * .3184); transform-origin: 63.4% 56.6%; filter: brightness(.6) saturate(.85); }
.lh-agreement > img { display: block; width: 100%; height: 100%; }
.lh-agreement > .lh-ink { position: absolute; left: 48.75%; top: 46.62%; width: 29.375%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 220% 100%; mask-size: 220% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0 0; mask-position: 0 0; }
.launch-hero.lh-js .lh-agreement > .lh-ink { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.launch-hero.lh-js .lh-scene--agreement.run .lh-agreement { animation: lh-push 12s cubic-bezier(.2,.6,.3,1) forwards; }
.launch-hero.lh-js .lh-scene--agreement.run .lh-ink { animation: lh-sign 2.4s cubic-bezier(.5,.1,.45,.95) 1.4s forwards; }
.lh-cool { position: absolute; inset: 0; background: #0b3563; mix-blend-mode: color; opacity: .22; }

/* Scene 2: Flint, panning slowly */
.lh-flint { position: absolute; top: 0; left: 0; width: 112%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.5) contrast(1.15); }
.lh-scene--flint.run .lh-flint { animation: lh-pan 12s linear forwards; }
.lh-tint { position: absolute; inset: 0; background: #0c4a86; mix-blend-mode: color; opacity: .6; }

/* Scene 3: a wall of terms with a moving light. The light's position is set on the lit layer only
   and registered as non-inheriting, so moving it repaints one mask instead of restyling every paragraph. */
@property --mx { syntax: '<length-percentage>'; inherits: false; initial-value: 62%; }
@property --my { syntax: '<length-percentage>'; inherits: false; initial-value: 45%; }
.lh-fp { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.2cqw; padding: 0 3cqw; font: 400 clamp(9px, .74cqw, 12px)/1.5 Georgia, 'Times New Roman', serif; text-align: justify; hyphens: auto; pointer-events: none; }
.lh-fp-col { overflow: hidden; }
.lh-fp-col > div { animation: lh-fp-scroll 90s linear infinite; }
.lh-fp-col:nth-child(2) > div { animation-duration: 104s; }
.lh-fp-col:nth-child(3) > div { animation-duration: 82s; }
.lh-fp-col:nth-child(4) > div { animation-duration: 97s; }
.lh-fp p { margin: 0 0 .7em; }
.lh-fp--dim { color: rgba(154,182,207,.2); }
.lh-fp--dim mark { background: none; color: inherit; }
.lh-fp--lit { color: rgba(228,242,255,.95);
  -webkit-mask-image: radial-gradient(circle min(13rem, 22cqw) at var(--mx, 62%) var(--my, 45%), #000 25%, transparent 100%);
  mask-image: radial-gradient(circle min(13rem, 22cqw) at var(--mx, 62%) var(--my, 45%), #000 25%, transparent 100%); }
.lh-fp--lit mark { padding: 0 .15em; background: rgba(245,225,38,.92); color: #050911; }

/* Constant shade over every scene keeps the copy legible */
.lh-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,9,17,.96) 0%, rgba(5,9,17,.92) 40%, rgba(5,9,17,.5) 50%, rgba(5,9,17,.06) 60%, rgba(5,9,17,.06) 72%, rgba(5,9,17,.3) 100%),
    linear-gradient(0deg, rgba(5,9,17,.9) 0%, transparent 22%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(79,200,255,.03) 2px 3px); }

/* Layout: copy | open window for the signature | book */
.lh-inner { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: minmax(0, min(40vw, 36rem)) 1fr minmax(0, min(22vw, 22.5rem)); align-items: center; padding: 72px 3vw 112px 5vw; }
.lh-copy { --indent: calc(clamp(2.1rem, 3.6vw, 3.4rem) * .86); grid-column: 1; font-family: 'Libre Caslon Text', Georgia, 'Times New Roman', serif; color: #f1f4f6; }
.lh-label { display: inline-block; margin: 0 0 1.6rem; padding-bottom: .7rem; border-bottom: 1px solid rgba(233,241,247,.4); font-size: .72rem; line-height: 1; letter-spacing: .24em; text-transform: uppercase; color: #a9bfd0; }
.lh-title { margin: 0; font-weight: 400; font-size: clamp(2.1rem, 3.6vw, 3.4rem); line-height: 1.16; text-shadow: 0 .3rem 2rem rgba(0,0,0,.55); }
.lh-row { position: relative; display: block; padding-left: var(--indent); }
.lh-n { position: absolute; left: 0; top: .55em; font-size: .36em; letter-spacing: .06em; color: #8fa9bf; }
.lh-keep { white-space: nowrap; }
.lh-fineprint { max-width: 36rem; margin: 1.6rem 0 0 var(--indent); padding-top: .85rem; border-top: 1px solid rgba(233,241,247,.16); font-size: clamp(12px, .82vw, 13.5px); line-height: 1.62; text-align: justify; hyphens: auto; color: rgba(214,228,240,.62); }
.lh-fineprint-head { display: block; margin-bottom: .45rem; font-size: max(12px, .9em); letter-spacing: .2em; text-transform: uppercase; color: #8fa9bf; }
.lh-fineprint b { font-weight: 700; color: rgba(232,240,246,.8); }
.lh-mark { color: #eef3f6; padding-bottom: .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'><path d='M0 5 Q 12 2.4 25 4.6 T 50 4.1 T 75 4.8 T 100 3.9' fill='none' stroke='%23e3343c' stroke-width='1.7' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>");
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% .5em; }
.launch-hero.lh-js .lh-mark { background-size: 0% .5em; }
.launch-hero.lh-js .lh-copy.is-reading .lh-mark { animation: lh-pen .9s cubic-bezier(.5,.1,.4,1) var(--d, 1.4s) forwards; }
.lh-meta { margin: 1.4rem 0 0 var(--indent); font-size: .95rem; line-height: 1.6; color: #8fa9bf; }
.lh-meta em { color: #e9f1f7; }
.lh-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin: 1.6rem 0 0 var(--indent); }
.lh-btn { display: inline-block; padding: 1rem 2rem; background: #f1f1ee; color: #121417; font-weight: 700; font-size: .85rem; line-height: 1; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.lh-btn:hover { background: #fff; color: #121417; }
.lh-link { color: #b5e8fa; font-size: 1rem; text-decoration: underline; text-underline-offset: .35em; text-decoration-thickness: 1px; }
.lh-link:hover { color: #fff; }
.launch-hero :focus-visible { outline: 2px solid #b5e8fa; outline-offset: 4px; }

/* Book: float > tilt > image, with the glint clipped to the book's own shape */
.lh-book { grid-column: 3; perspective: 1400px; }
.lh-book-float { animation: lh-float 6s ease-in-out infinite; }
.lh-book-tilt { position: relative; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); transition: transform .6s cubic-bezier(.16,1,.3,1); }
.lh-book-tilt img { display: block; width: 100%; height: auto; filter: drop-shadow(0 26px 34px rgba(0,0,0,.75)) drop-shadow(0 0 50px rgba(79,200,255,.16)); }
.lh-glare-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: url(/assets/books/terms-conditions-paperback.webp); mask-image: url(/assets/books/terms-conditions-paperback.webp);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.lh-glare { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.3) 50%, transparent 62%); transform: translateX(-130%); mix-blend-mode: screen; animation: lh-glare 8s ease-in-out infinite; }

/* Camera-feed labels and Pause */
.lh-controls { position: absolute; z-index: 3; left: 5vw; right: 3vw; bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.lh-feeds { display: flex; flex-wrap: wrap; gap: 8px; pointer-events: auto; }
.lh-feed, .lh-pause { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(30,58,84,.9); background: rgba(5,9,17,.72); color: #6f8faa; font: 500 .68rem/1 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.lh-feed:hover, .lh-pause:hover { color: #dceeff; }
.lh-feed i { width: 7px; height: 7px; border-radius: 50%; background: #2b4057; }
.lh-feed.is-on { color: #dceeff; border-color: #2c5878; }
.lh-feed.is-on i { background: #ff4d57; box-shadow: 0 0 10px #ff4d57; animation: lh-rec 1.2s steps(2) infinite; }
.lh-feed b { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: #4fc8ff; }
.lh-feed.is-on b { animation: lh-progress 10s linear forwards; }
.lh-feed-short { display: none; }
.lh-time { font: 500 .68rem/1 'JetBrains Mono', monospace; letter-spacing: .14em; color: rgba(220,238,255,.55); }

/* Paused (button, off-screen, hidden tab): freeze every animation in place */
.launch-hero.is-paused *, .launch-hero.is-paused *::before, .launch-hero.is-paused *::after { animation-play-state: paused !important; }

/* Reduced motion: one still, signed scene with the pen marks drawn */
.launch-hero.is-static *, .launch-hero.is-static *::before, .launch-hero.is-static *::after { animation: none !important; transition: none !important; }
.launch-hero.is-static .lh-agreement > .lh-ink { -webkit-mask-position: 0 0 !important; mask-position: 0 0 !important; }
.launch-hero.is-static .lh-mark { background-size: 100% .5em !important; }
.launch-hero.is-static .lh-glare-clip, .launch-hero.is-static .lh-pause, .launch-hero.is-static .lh-time { display: none; }
@media (prefers-reduced-motion: reduce) {
  .launch-hero *, .launch-hero *::before, .launch-hero *::after { animation: none !important; transition: none !important; }
  .launch-hero .lh-agreement > .lh-ink { -webkit-mask-position: 0 0 !important; mask-position: 0 0 !important; }
  .launch-hero .lh-mark { background-size: 100% .5em !important; }
  .launch-hero .lh-glare-clip { display: none; }
}

/* Phones and narrow tablets: book on top, text below, darker shade */
@media (max-width: 899px) {
  .lh-stage { min-height: 0; }
  .lh-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 40px 20px 96px; }
  .lh-book { grid-column: 1; grid-row: 1; width: min(52vw, 240px); margin: 0 auto; }
  .lh-copy { grid-column: 1; grid-row: 2; }
  .lh-shade { background: rgba(5,9,17,.8); }
  .lh-fp { grid-template-columns: repeat(2, 1fr); }
  .lh-fp-col:nth-child(n+3) { display: none; }
  .lh-feed-long { display: none; }
  .lh-feed-short { display: inline; }
  .lh-controls { left: 20px; right: 20px; bottom: 18px; }
  .lh-time { display: none; }
}

@keyframes lh-push { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes lh-sign { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes lh-pan { from { transform: translateX(0) scale(1.04); } to { transform: translateX(-8%) scale(1.1); } }
@keyframes lh-fp-scroll { to { transform: translateY(-50%); } }
@keyframes lh-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes lh-glare { 0%, 62% { transform: translateX(-130%); } 84%, 100% { transform: translateX(130%); } }
@keyframes lh-progress { to { width: 100%; } }
@keyframes lh-rec { 50% { opacity: .35; } }
@keyframes lh-pen { to { background-size: 100% .5em; } }
