/* Liras Consulting · motion layer
   1) Brand intro (home, once per session)
   2) Lyres rising behind the hero
   3) Hero entrance once the intro is released */

:root { --intro-duration: 4600ms; --lyre-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 861'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M176.5 859.9C158.9 857.2 136.7 850.6 121.3 843.5C74.1 821.5 29.2 769.0 10.0 713.4C5.1 699.3 3.5 689.9 1.5 665.7C-1.2 632.3 -0.4 610.9 4.5 587.5C16.4 529.9 21.8 509.0 34.0 473.5C36.7 465.8 43.1 446.2 48.3 429.9C60.4 392.2 68.4 371.1 83.2 338.5C86.0 332.4 89.5 324.6 91.0 321.0C94.3 313.2 104.5 293.6 107.2 289.8C114.3 279.6 134.8 232.1 142.4 208.0C147.6 191.5 147.3 189.7 139.0 185.5C136.2 184.0 132.4 183.6 119.5 183.3C97.4 182.7 92.0 180.7 95.5 173.9C98.5 168.1 100.4 167.6 120.4 167.5C136.1 167.4 139.4 167.0 145.2 165.2C154.4 162.1 155.9 160.7 157.5 153.0C159.4 143.9 161.3 115.1 160.5 108.8C157.2 83.1 144.8 56.1 133.7 50.3C129.6 48.2 115.5 47.4 109.4 48.9C102.1 50.8 91.0 61.4 81.4 76.0C79.9 78.2 78.3 80.0 77.8 80.0C77.3 80.0 73.8 77.0 70.1 73.2C66.3 69.5 62.0 65.5 60.6 64.3C55.5 59.9 57.7 43.4 65.5 28.0C70.1 19.0 79.0 11.6 94.3 4.0C103.1 -0.3 107.0 -0.7 117.1 1.9C137.2 7.0 153.8 15.6 163.0 25.6C168.2 31.1 176.0 41.3 176.0 42.4C176.0 42.8 177.3 45.0 178.9 47.3C185.4 56.9 191.2 71.9 195.9 91.2C200.2 109.0 201.3 119.3 200.6 133.9C199.5 152.9 199.5 153.0 201.2 154.6C203.9 157.4 210.1 158.0 236.0 158.0C318.0 158.0 460.1 153.1 465.9 150.1C467.0 149.5 468.3 147.1 468.9 144.3C470.5 137.5 470.7 136.4 471.5 128.5C474.3 99.6 484.7 70.0 499.1 49.9C521.5 18.4 559.0 4.7 586.0 18.1C598.0 24.2 606.4 39.3 608.4 58.9C609.2 66.3 608.6 67.8 604.2 68.6C599.5 69.4 594.1 72.2 591.6 74.9C588.8 78.0 587.9 77.7 578.6 70.6C561.0 57.1 553.4 56.1 536.7 64.8C518.8 74.1 508.8 95.1 505.9 130.1C504.6 144.8 505.7 153.4 509.1 156.2C511.7 158.4 513.2 158.4 519.7 156.5C528.5 153.9 531.6 148.1 529.1 139.2C526.8 131.4 532.0 127.6 540.1 131.1C559.4 139.4 565.6 178.0 550.5 194.8C541.2 205.1 531.0 203.4 531.0 191.7C531.0 187.5 528.5 180.3 526.3 177.8C524.1 175.4 519.9 175.5 516.6 178.1C512.7 181.2 513.1 186.6 518.1 199.2C523.8 213.7 538.2 242.6 545.0 253.4C553.7 267.2 561.5 280.1 563.6 284.0C564.6 285.9 566.0 288.2 566.6 289.0C568.9 292.1 594.3 336.7 601.3 350.0C603.4 354.1 606.0 358.9 607.0 360.5C609.4 364.6 621.7 391.8 624.5 399.4C626.8 405.6 645.9 449.9 654.5 469.0C719.0 611.9 714.3 734.3 641.9 802.4C627.1 816.3 593.0 839.6 583.7 842.1C581.5 842.7 577.2 844.3 574.1 845.7C556.2 853.8 539.7 857.3 510.0 859.5C483.3 861.4 460.8 861.4 450.5 859.5C417.8 853.3 385.2 832.5 362.8 803.8C359.4 799.3 354.5 793.4 352.1 790.8L347.7 785.9L343.8 789.7C341.6 791.8 337.3 796.9 334.3 801.0C311.1 832.1 273.6 852.6 227.7 859.4C215.9 861.2 186.8 861.4 176.5 859.9ZM496.5 789.0C526.9 786.2 550.7 774.3 576.1 749.0C592.6 732.6 597.9 725.2 608.1 704.7C623.0 674.3 624.9 666.3 624.9 632.4C624.9 599.0 623.2 580.4 618.3 562.0C611.1 534.6 593.3 486.4 582.7 465.5C581.1 462.2 575.1 446.0 569.4 429.5C562.7 409.8 556.2 393.0 550.5 380.5C545.7 370.1 540.3 358.1 538.5 354.0C536.7 349.9 532.1 340.0 528.2 332.0C509.5 293.0 508.0 289.8 496.7 262.0C491.0 248.0 480.3 215.1 478.5 206.0C475.2 189.4 470.6 185.4 455.3 186.2C439.1 187.0 439.5 185.3 440.4 244.5C440.7 268.7 441.3 309.6 441.6 335.5C442.2 385.2 443.1 405.7 445.4 418.0C446.1 422.1 448.1 433.1 449.8 442.5L452.9 459.5L454.0 517.5C455.7 609.3 456.8 623.0 462.7 623.0C467.4 623.0 481.1 638.4 486.0 649.1C490.7 659.6 487.8 663.5 474.2 664.5C463.5 665.3 459.0 666.8 457.1 670.2C455.7 672.7 455.8 673.4 459.8 681.7C467.4 698.0 467.4 707.5 459.4 723.8C456.5 729.8 454.9 731.7 450.7 734.5C443.7 739.2 436.1 741.6 425.9 742.5C416.7 743.3 412.5 744.9 411.5 747.9C409.7 753.6 426.5 773.5 438.5 779.7C450.2 785.8 463.8 788.9 483.5 789.8C485.1 789.9 491.0 789.5 496.5 789.0ZM235.8 780.4C248.9 777.7 260.2 771.7 270.8 761.6C278.5 754.3 274.9 748.0 261.7 745.9C249.9 744.1 235.3 734.2 230.4 724.8C224.9 714.2 224.9 700.8 230.4 687.5C235.6 674.6 235.3 673.2 227.2 671.0C222.0 669.7 214.0 662.7 214.0 659.6C214.0 652.7 224.4 637.8 234.4 630.5C246.7 621.4 246.4 623.8 245.7 529.0C245.2 457.7 246.1 415.9 248.4 402.0C250.0 392.7 246.3 203.4 244.4 194.6C243.3 190.1 239.3 189.0 222.9 189.0C202.5 189.0 196.9 190.2 192.5 195.3C190.5 197.6 188.8 200.9 188.5 202.9C186.5 215.8 177.7 245.1 165.5 279.5C151.4 319.3 132.1 378.1 127.2 396.0C126.0 400.1 122.4 415.2 119.1 429.5C112.7 456.8 112.1 459.3 104.6 486.5C88.6 543.9 82.9 580.4 83.2 623.5C83.4 659.1 85.1 670.7 93.1 690.0C103.4 714.7 115.0 731.3 133.8 748.2C154.2 766.6 162.7 772.0 181.3 778.1C193.7 782.1 221.6 783.3 235.8 780.4ZM292.7 625.0C297.2 623.3 297.4 622.1 297.4 579.5C297.5 530.1 296.1 337.2 295.5 314.5C295.3 304.6 294.8 285.0 294.5 271.0C293.8 241.0 291.4 201.1 290.0 195.9C288.5 190.6 284.0 188.6 272.9 188.6C262.7 188.6 259.4 190.1 258.5 195.4C257.4 200.9 257.4 231.6 258.5 309.0C259.7 397.7 259.7 398.5 258.5 419.5C257.4 438.2 257.2 565.3 258.3 587.5C259.5 613.3 261.7 623.0 267.0 625.8C270.0 627.4 287.8 626.8 292.7 625.0ZM339.3 624.7C341.7 623.2 341.7 622.9 342.3 600.8C343.0 575.8 341.7 443.9 340.7 442.3C340.0 441.2 338.4 375.2 337.0 284.5C336.4 249.3 335.7 217.3 335.5 213.5C334.6 199.8 333.7 193.0 332.6 191.4C330.1 188.1 308.9 187.7 305.7 190.9C304.8 191.8 304.5 197.9 304.5 212.8C304.5 261.9 307.1 469.7 308.0 493.0C308.6 507.0 309.5 532.0 310.0 548.5C311.5 595.4 312.3 609.1 314.1 618.8C314.7 621.6 315.2 624.0 315.3 624.0C315.4 624.0 317.3 624.7 319.5 625.5C324.5 627.4 335.9 626.9 339.3 624.7ZM389.1 623.4C391.7 621.9 392.8 620.4 393.6 616.9C396.5 605.2 395.8 467.7 392.7 442.0C391.8 435.1 390.6 425.4 390.0 420.5C388.6 409.3 388.2 398.9 387.0 347.0C384.8 250.2 382.1 189.7 380.0 187.6C379.4 187.0 375.1 186.3 370.5 186.1C359.9 185.7 353.0 187.8 349.8 192.3C346.0 197.6 346.0 194.3 349.0 367.0C349.6 400.8 350.5 432.3 351.0 437.0C351.5 441.7 352.4 461.0 353.0 480.0C354.8 542.9 358.1 605.2 360.6 620.7C361.2 625.0 364.4 626.0 376.1 625.6C383.5 625.4 386.6 624.8 389.1 623.4ZM434.2 622.8C436.9 622.0 438.6 620.8 439.3 619.1C440.1 617.3 440.4 593.2 440.4 537.0L440.4 457.5L435.7 430.5L430.9 403.5L430.0 341.5C429.5 307.4 428.6 268.9 428.0 256.0C427.5 243.1 426.8 226.4 426.5 219.0C425.8 202.9 425.1 192.1 424.4 189.9C423.8 187.6 417.4 186.0 409.3 186.0C400.6 186.0 396.2 187.5 394.9 190.7C393.3 195.0 393.9 243.9 396.6 313.5C396.9 322.3 397.5 347.1 398.0 368.5C398.5 393.9 399.4 411.3 400.4 418.5C401.2 424.6 402.9 436.2 404.1 444.5C406.1 458.6 406.2 464.1 406.5 533.5C406.8 602.7 407.2 617.0 408.9 619.8C411.2 623.6 425.9 625.3 434.2 622.8Z'/%3E%3C/svg%3E"); }

/* ───────── 1. INTRO ───────── */
.liras-intro { display: none; }
html[data-intro-pending] { overflow: hidden; }
html[data-intro-pending] .liras-intro {
  position: fixed; inset: 0; z-index: 10001;
  display: grid; place-items: center; padding: 2rem;
  background: var(--navy); color: var(--white);
  animation: liras-depart var(--intro-duration) linear both;
}
.liras-intro-identity { width: min(40rem, calc(100vw - 4rem)); display: flex; flex-direction: column; align-items: center; }
.liras-intro-stage { position: relative; display: inline-block; padding: 0 1.95em 0 0.2em; font-size: clamp(1.15rem, 4.6vw, 3.4rem); }
.liras-intro-wordmark {
  display: block; white-space: nowrap;
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; text-transform: uppercase;
  font-size: 1em; line-height: 1;
  margin-right: -0.3em; /* compensate trailing tracking */
}
.liras-intro-sweep { position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; right: 1.95em; pointer-events: none; }
/* a veil in the page colour travels with the lyre and uncovers the name exactly behind it */
.liras-intro-sweep::before { content: ''; position: absolute; top: -0.2em; bottom: -0.2em; left: 0; width: calc(200% + 6em); background: var(--navy); }
.liras-intro-sweep span { z-index: 1; opacity: 0; }
.liras-intro-sweep span {
  position: absolute; left: 0; top: 50%;
  height: 2.07em; aspect-ratio: 700 / 861;
  transform: translate(-50%, -54%);
  background: var(--white);
  -webkit-mask: var(--lyre-mark) center / contain no-repeat; mask: var(--lyre-mark) center / contain no-repeat;
}
.liras-intro-rule { display: none; } /* no rule in the intro */
.liras-intro-caption {
  margin-top: 1.6rem; text-align: center;
  font-family: var(--ff-mono); font-size: clamp(0.58rem, 1.15vw, 0.72rem);
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--silver-dim);
  opacity: 0;
}
.liras-intro-skip {
  position: absolute; right: max(1.5rem, env(safe-area-inset-right)); bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 1.4rem; min-height: 44px; padding: 0.65rem 1.1rem;
  font-family: var(--ff-mono); font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--silver-dim); background: transparent; border: 1px solid var(--border-gold); border-radius: 0; cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.liras-intro-skip:hover, .liras-intro-skip:focus-visible { background: var(--white); color: var(--navy); }
html[dir="rtl"] .liras-intro-skip { right: auto; left: max(1.5rem, env(safe-area-inset-left)); }

html[data-intro-pending] .liras-intro-sweep { animation: liras-sweep var(--intro-duration) cubic-bezier(.65, 0, .35, 1) both; }
html[data-intro-pending] .liras-intro-sweep span { animation: liras-lyre-in var(--intro-duration) linear both, liras-pluck calc(var(--intro-duration) * 0.56) ease-in-out calc(var(--intro-duration) * 0.12) both; }
html[data-intro-pending] .liras-intro-caption { animation: liras-caption var(--intro-duration) ease both; }

@keyframes liras-lyre-in { 0% { opacity: 0; } 10%, 100% { opacity: 1; } }
@keyframes liras-sweep {
  /* eases in, glides across and settles softly beside the name.
     Fallback if the script cannot measure: the lyre's left edge stops 0.25em after the text */
  0%, 12% { transform: translateX(0); }
  68%, 100% { transform: translateX(var(--lyre-rest, calc(100% + 1.09em))); }
}
/* the lyre sways like a plucked string while it travels */
@keyframes liras-pluck {
  0%   { rotate: -7deg; }
  30%  { rotate: 5deg; }
  60%  { rotate: -3deg; }
  100% { rotate: 0deg; }
}
@keyframes liras-caption { 0%, 48% { opacity: 0; transform: translateY(0.4rem); } 68%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes liras-depart { 0%, 82% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* the wordmark is always Latin: keep its tracking in every language */
html .liras-intro .liras-intro-wordmark { letter-spacing: 0.3em !important; }

/* ───────── 2. RISING LYRES ───────── */
.lyre-field {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 82%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 82%, transparent 100%);
}
.lyre-float {
  position: absolute; bottom: 0; width: var(--size); aspect-ratio: 700 / 861;
  opacity: var(--op);
  animation: lyre-rise var(--dur) linear var(--delay) infinite;
  will-change: transform;
}
.lyre-float i {
  position: absolute; inset: 0; display: block;
  background: var(--tone, #000);
  -webkit-mask: var(--lyre-mark) center / contain no-repeat; mask: var(--lyre-mark) center / contain no-repeat;
  animation: lyre-sway var(--sway) ease-in-out var(--delay) infinite alternate;
  transform-origin: 50% 80%;
}
.lyre-float.is-soft i { --tone: #8B8580; }
@keyframes lyre-rise { 0% { transform: translate(-50%, 25vh); } 100% { transform: translate(-50%, -125vh); } }
@keyframes lyre-sway {
  0%   { transform: translateX(calc(var(--drift) * -1)) rotate(calc(var(--tilt) * -1)); }
  100% { transform: translateX(var(--drift)) rotate(var(--tilt)); }
}
@media (max-width: 768px) {
  .lyre-float { opacity: calc(var(--op) * 0.45); }
  .lyre-float:nth-child(n+19) { display: none; }
  .lyre-field {
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), transparent 18%, transparent 70%, rgba(0,0,0,.7));
            mask-image: linear-gradient(90deg, rgba(0,0,0,.35), transparent 18%, transparent 70%, rgba(0,0,0,.7));
  }
}

/* ───────── 3. HERO ENTRANCE ───────── */
html.liras-motion .page-home #hero .hero-inner > * { animation: liras-hero-in 3.4s cubic-bezier(.22, .61, .36, 1) both; }
html.liras-motion .page-home #hero .hero-inner > .hero-rule { animation-name: liras-hero-rule; transform-origin: left; }
html[dir="rtl"].liras-motion .page-home #hero .hero-inner > .hero-rule { transform-origin: right; }
html.liras-motion .page-home #hero .hero-inner > :nth-child(2) { animation-delay: 800ms; }
html.liras-motion .page-home #hero .hero-inner > :nth-child(3) { animation-delay: 1600ms; }
html.liras-motion .page-home .lyre-field { animation: liras-fade 4.5s ease both; }
html[data-intro-pending] .page-home #hero .hero-inner > *,
html[data-intro-pending] .page-home .lyre-field { animation: none !important; opacity: 0; }
@keyframes liras-hero-in { from { opacity: 0; transform: translateY(1.1rem); } to { opacity: 1; transform: none; } }
@keyframes liras-hero-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes liras-fade { from { opacity: 0; } to { opacity: 1; } }

/* ───────── 4. INTERIOR PAGES: SOFT TEXT ENTRANCE ───────── */
/* hide until the script has tagged the blocks; failsafe shows them anyway */
html.liras-motion:not(.lr-ready) body:not(.page-home) > :is(section, main) { opacity: 0; animation: liras-fade 0.6s ease 2.5s forwards; }
html.liras-motion.lr-ready body:not(.page-home) .hero-banner { animation: liras-appear 3.2s ease both; }
@keyframes liras-appear { from { opacity: 0; } }
html.liras-motion .lr-reveal { opacity: 0; transform: translateY(1.1rem); }
html.liras-motion .lr-reveal.is-in { animation: liras-hero-in 2.2s cubic-bezier(.22, .61, .36, 1) var(--lr-delay, 0ms) both; }

/* Casos: the grid lines were drawn by a black grid background showing through the 1px gaps,
   so it showed while the cards faded in. Draw the lines on the cards instead. */
.casos-grid { background: transparent; }
.casos-grid > .caso-card { box-shadow: 0 0 0 1px var(--border); }

/* Casos: the cards arrive a little faster than the rest of the interior text */
html.liras-motion .casos-grid > .lr-reveal.is-in { animation-duration: 1.6s; animation-delay: calc(var(--lr-delay, 0ms) * 0.75); }

/* ───────── REDUCED MOTION ───────── */
@media (prefers-reduced-motion: reduce) {
  html[data-intro-pending] .liras-intro { display: none; }
  .lyre-float { bottom: var(--rest-y); transform: translateX(-50%); animation: none !important; }
  .lyre-float i { animation: none !important; }
  html.liras-motion .page-home #hero .hero-inner > *, html.liras-motion .page-home .lyre-field { animation: none !important; }
  html.liras-motion .lr-reveal { opacity: 1; transform: none; animation: none !important; }
}
