/* ===========================================================================
   Living layer (2026-11-01). The look approved by the owner: a darker, warmer burgundy
   ground, slowly dissolving pictures, dust of gold, words that appear one by one,
   cards that rise as you scroll, and a slow piano under it all.

   Loaded after pages.css by views/layout/site.php and views/layout/auth.php, together with
   assets/js/living.js. To undo it completely: remove the two lines that load this file and
   living.js from those two layouts. Nothing else depends on it.
   =========================================================================== */

/* ---- the darker, warmer burgundy: 5% warmer, 10% darker ------------------- */
:root {
  --bg: #13070a;
  --bg-2: #0d0405;
  --bg-3: #110609;
  --surface: #1f0d12;
  --surface-2: #27131a;
  --surface-3: #311a21;
  --muted: #e7cbc4;
  --dim: #cca4a4;
  --ink-on-gold: #290509;
  --overlay: rgba(19, 7, 10, 0.72);
  --scrim: rgba(19, 7, 10, 0.86);
}

.site-header { background: rgba(19, 7, 10, 0.78); }
.site-header.is-scrolled { background: rgba(19, 7, 10, 0.92); }

/* On the pictures the header floats clear over them until the page is scrolled. */
body[data-page="home"] .site-header:not(.is-scrolled),
body[data-page="welcome"] .site-header:not(.is-scrolled),
body[data-page="auth"] .site-header:not(.is-scrolled) {
  background: linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-block-end-color: transparent;
}

/* ---- pictures that dissolve into each other ------------------------------- */
.lv-stage { position: relative; overflow: hidden; background: var(--bg); }
.lv-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.9s ease; }
.lv-slide.is-on { opacity: 1; }
.lv-slide img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 0%; transform: scale(1.03); }
.lv-slide.is-on img { animation: lv-kb 10s ease-out forwards; }
@keyframes lv-kb {
  from { transform: scale(1.03) translate3d(var(--kx0, 0), 0, 0); }
  to { transform: scale(1.15) translate3d(var(--kx1, 0), -1.5%, 0); }
}
.lv-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  block-size: 44%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 2;
}
.lv-dust { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; z-index: 3; pointer-events: none; }

/* name of the topic under the picture, and the little bar that shows where you are */
.lv-cap {
  position: absolute;
  inset-inline: 16px;
  inset-block-end: 34px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: var(--gold-2);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.lv-cap.is-in { opacity: 1; transform: none; }
.lv-cap::before, .lv-cap::after { content: ""; inline-size: 28px; block-size: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.lv-cap::after { transform: scaleX(-1); }
.lv-prog { position: absolute; inset-inline: 16px; inset-block-end: 12px; z-index: 5; display: flex; gap: 6px; }
.lv-seg { flex: 1; block-size: 18px; display: flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.lv-seg i { display: block; inline-size: 100%; block-size: 3px; background: rgba(244, 221, 154, 0.28); border-radius: 2px; position: relative; overflow: hidden; }
.lv-seg i::after { content: ""; position: absolute; inset: 0; background: var(--gold-2); transform-origin: right center; transform: scaleX(0); }
[dir="ltr"] .lv-seg i::after { transform-origin: left center; }
.lv-seg.is-done i::after { transform: scaleX(1); }
.lv-seg.is-on i::after { animation: lv-fill var(--lv-every, 5.6s) linear forwards; }
@keyframes lv-fill { to { transform: scaleX(1); } }

/* ---- the top of the home page and of the welcome page ---------------------- */
.lv-hero { position: relative; overflow: hidden; margin-block-start: calc(var(--header-h) * -1); }
.lv-hero .lv-stage { aspect-ratio: 1 / 1.04; }
.lv-copy { position: relative; z-index: 6; margin-block-start: -18px; padding: 0 var(--gutter) var(--sp-8); display: flex; flex-direction: column; align-items: center; text-align: center; }
.lv-copy .eyebrow { margin: 0 0 8px; }
.lv-copy .eyebrow::before { display: none; }
.lv-copy h1 { margin: 4px 0 12px; font-size: clamp(2.2rem, 9.4vw, 3.3rem); line-height: 1.18; color: var(--ink); text-wrap: balance; }
.lv-copy h1 em { display: block; color: var(--gold-2); font-style: normal; }
.lv-copy .lv-lead { margin: 0 auto 22px; max-width: 34rem; color: var(--muted); font-size: 1.02rem; line-height: 1.85; }
.lv-copy .lv-lead--gold { color: var(--gold-2); font-size: clamp(1.08rem, 3.8vw, 1.28rem); line-height: 1.8; }
.lv-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; inline-size: 100%; }
.lv-actions .btn { min-block-size: 58px; padding-inline: 30px; font-size: 1.08rem; font-weight: 600; }
.lv-actions.is-one .btn { inline-size: min(100%, 22rem); }

/* welcome extras */
.lv-seal { position: relative; z-index: 6; inline-size: 170px; block-size: 170px; margin: -118px auto 10px; }
.lv-seal img { position: relative; display: block; inline-size: 100%; block-size: 100%; filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.65)); }
.lv-seal::before { content: ""; position: absolute; inset: -34px; border-radius: 50%; background: radial-gradient(circle, rgba(223, 180, 73, 0.4), transparent 68%); animation: lv-halo 4.8s ease-in-out infinite; }
@keyframes lv-halo { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
.lv-seal::after { content: ""; position: absolute; inset: 3%; border-radius: 50%; z-index: 2; background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 214, 0.7) 50%, transparent 62%); background-size: 260% 100%; background-position: 130% 0; mix-blend-mode: soft-light; animation: lv-sweep 7s ease-in-out infinite 1.5s; pointer-events: none; }
@keyframes lv-sweep { 0% { background-position: 130% 0; } 45%, 100% { background-position: -60% 0; } }
.lv-hero--welcome .lv-copy { margin-block-start: 0; padding-block-start: 0; }
.lv-hero--welcome .lv-stage { aspect-ratio: 1 / 0.92; }
.lv-late { opacity: 0; animation: lv-fadeup 1s ease forwards; }
@keyframes lv-fadeup { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lv-cta { position: relative; overflow: hidden; }
.lv-cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); transform: translateX(120%); animation: lv-shine 5.5s ease-in-out infinite 3s; pointer-events: none; }
[dir="rtl"] .lv-cta::after { animation-name: lv-shine; }
@keyframes lv-shine { 0% { transform: translateX(120%); } 30%, 100% { transform: translateX(-120%); } }
.lv-note { display: flex; gap: 12px; align-items: flex-start; max-inline-size: 30rem; margin: 22px auto 0; text-align: start; color: var(--muted); font-size: 0.98rem; line-height: 1.8; }
.lv-note svg { flex: none; inline-size: 24px; block-size: 24px; margin-block-start: 0.3em; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lv-login { margin: 14px 0 0; color: var(--muted); font-size: 1.05rem; }
.lv-login a { color: var(--gold); text-decoration: underline; text-underline-offset: 0.25em; }

/* numbers */
.lv-stats { display: flex; justify-content: center; gap: clamp(36px, 12vw, 84px); padding: 30px 16px 34px; }
.lv-stat { text-align: center; }
.lv-stat b { display: block; font-family: var(--font-serif); font-size: 2.8rem; font-weight: 500; line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.lv-stat span { color: var(--muted); font-size: 0.98rem; }

/* ---- "coming soon" cards with a picture ------------------------------------ */
.lv-sc { overflow: hidden; transition: border-color 0.5s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.6s; }
.lv-sc:hover, .lv-sc:active { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); }
.lv-sc .course-cover { overflow: hidden; }
.lv-sc .course-cover img { transform: scale(1.02); }
.lv-sc.lv-in .course-cover img { animation: lv-scz 16s ease-out forwards; }
@keyframes lv-scz { from { transform: scale(1.02); } to { transform: scale(1.13); } }
.lv-sc .course-body { text-align: center; }
.lv-sc h3 { color: var(--gold-2); }
.lv-sc-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-block-end: 22px; }
.lv-sc-head h2 { margin: 0; color: var(--gold-2); font-size: clamp(1.7rem, 6.6vw, 2.4rem); }
.lv-sc-head svg { inline-size: 26px; block-size: 26px; fill: none; stroke: var(--gold-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: lv-bob 1.6s ease-in-out infinite; }
@keyframes lv-bob { 0%, 100% { transform: translateY(-3px); opacity: 0.7; } 50% { transform: translateY(5px); opacity: 1; } }
.lv-welcome-points { padding-block: var(--sp-8) var(--sp-6); }
.lv-welcome-closing { text-align: center; padding: 8px 16px 44px; }
.lv-welcome-closing .btn { min-block-size: 58px; padding-inline: 30px; font-size: 1.08rem; font-weight: 600; }

/* ---- sign-in pages: a slow strip of pictures above the form ----------------- */
.lv-auth-stage { aspect-ratio: 16 / 10; margin-block-start: calc(var(--header-h) * -1); margin-block-end: -46px; }
body[data-page="auth"] .site-main { position: relative; z-index: 2; }
body[data-page="auth"] .card, body[data-page="auth"] .auth-card .card-pad { background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)); border-color: var(--line-strong); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body[data-page="auth"] .form-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(223, 180, 73, 0.16); outline: 0; }
body[data-page="auth"] .btn-gold { position: relative; overflow: hidden; }
body[data-page="auth"] .btn-gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%); transform: translateX(120%); animation: lv-shine 6s ease-in-out infinite 3.5s; pointer-events: none; }

/* ---- inner pages: a slow picture behind the title ---------------------------- */
.lv-banner { position: absolute; inset: 0 0 auto 0; block-size: 380px; overflow: hidden; z-index: 0; pointer-events: none; }
.lv-banner .lv-slide img { filter: brightness(0.5) saturate(0.9); }
.lv-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(19, 7, 10, 0.1), var(--bg) 96%); z-index: 2; }
body.lv-has-banner main { position: relative; }
body.lv-has-banner main > *:not(.lv-banner) { position: relative; z-index: 1; }

/* ---- things rise into view while you scroll ---------------------------------- */
.lv-rv { opacity: 0; transform: translateY(22px); transition: opacity 0.95s ease var(--lv-d, 0ms), transform 0.95s ease var(--lv-d, 0ms); }
.lv-rv.lv-in { opacity: 1; transform: none; }
.lv-w { display: inline-block; opacity: 0; animation: lv-wi 0.9s ease forwards; animation-delay: calc(var(--i) * 0.09s + 0.25s); white-space: pre; }
@keyframes lv-wi { from { opacity: 0; filter: blur(8px); transform: translateY(10px); } to { opacity: 1; filter: blur(0); transform: none; } }
.card, .course-card, .plan-card { transition: border-color 0.5s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.6s; }

/* ---- the music button --------------------------------------------------------- */
.lv-snd { inline-size: 44px; block-size: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.28); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: color 0.4s, border-color 0.4s; flex: none; }
.lv-snd svg { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lv-snd .lv-on { display: none; }
.lv-snd.is-on .lv-on { display: block; }
.lv-snd.is-on .lv-off { display: none; }
.lv-snd.is-on { color: var(--gold-2); border-color: var(--gold); animation: lv-sndp 3.2s ease-in-out infinite; }
@keyframes lv-sndp { 0%, 100% { box-shadow: 0 0 0 0 rgba(223, 180, 73, 0.35); } 50% { box-shadow: 0 0 0 9px rgba(223, 180, 73, 0); } }
/* no music on pages that play a lesson video */
body[data-page="watch"] .lv-snd, body[data-page="lesson"] .lv-snd { display: none; }

/* ---- wide screens: the picture on one side, the words on the other ----------- */
@media (min-width: 900px) {
  .lv-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-block-size: 780px; }
  .lv-hero .lv-stage { aspect-ratio: auto; block-size: 100%; min-block-size: 780px; -webkit-mask-image: linear-gradient(to left, #000 58%, transparent 100%); mask-image: linear-gradient(to left, #000 58%, transparent 100%); }
  [dir="ltr"] .lv-hero .lv-stage { -webkit-mask-image: linear-gradient(to right, #000 58%, transparent 100%); mask-image: linear-gradient(to right, #000 58%, transparent 100%); }
  .lv-hero .lv-stage::after { display: none; }
  .lv-copy { margin-block-start: 0; padding: 110px 56px 70px; justify-content: center; }
  .lv-copy h1 { font-size: clamp(2.6rem, 4vw, 3.7rem); }
  .lv-cap { inset-block-end: 44px; }
  .lv-prog { inset-block-end: 20px; inset-inline: 48px 96px; }
  .lv-seal { margin: 0 auto 12px; }
  .lv-hero--welcome { min-block-size: 860px; }
  .lv-hero--welcome .lv-stage { min-block-size: 860px; }
  .lv-hero--welcome .lv-copy { padding: 150px 56px 80px; }
  .lv-auth-stage { aspect-ratio: 16 / 5; margin-block-end: -70px; }
  .lv-banner { block-size: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-slide, .lv-cap, .lv-rv { transition-duration: 0.001ms !important; }
  .lv-slide.is-on img, .lv-seal::before, .lv-seal::after, .lv-cta::after, .lv-snd.is-on, .lv-sc.lv-in .course-cover img, .lv-sc-head svg, body[data-page="auth"] .btn-gold::after { animation: none !important; }
  .lv-w, .lv-late { animation-duration: 0.001ms !important; animation-delay: 0s !important; }
}
