/* dAIvinci Studio · Lift: styles for the three ways of answering the wrong scroll (ways.js). */

/* ------------------------------------------------------------ one line in the machine's voice, shown for a while */
.say { position: fixed; z-index: 5; left: 50%; bottom: 6.5vh; margin: 0; padding: 0 20px; width: max-content; max-width: 92vw; text-align: center;
  font: italic 500 clamp(20px, 1.9vw, 26px)/1.2 var(--serif); color: var(--linen); text-wrap: balance;
  opacity: 0; transform: translate(-50%, 10px); transition: opacity .45s, transform .6s var(--out), color .5s; pointer-events: none; }
.say.on { opacity: 1; transform: translate(-50%, 0); }
.say b { display: inline-block; font-weight: 500; font-style: normal; animation: rise 1.6s var(--out) infinite; }
.day .say { color: var(--iron); }
.say b.dn { animation-name: fall; }                          /* on a touch screen the way up is to pull the page down */
@keyframes fall { 0% { transform: translateY(-7px); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }
.no-js .say { display: none; }
@media (max-width: 899px) {
  .say { bottom: auto; top: 70px; font-size: 20px; }
  .say::before { content: ""; position: absolute; inset: -14px -6px -18px; z-index: -1; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
    -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
  .say.low { top: auto; bottom: 10px; font-size: 19px; }      /* in the air the machine flies low: the line goes under it */
  /* a tall card may lie under it now: its ground is feathered on every side */
  .say.low::before { inset: -16px -26px -10px; background: rgba(13, 15, 44, .5);
    -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent); mask-image: radial-gradient(closest-side, #000 58%, transparent); }
  .day .say.low::before { background: rgba(224, 238, 248, .55); }
  /* with a card's text right under it (the page says so: .over), the ground is a band across the foot of the screen */
  .say.low.over::before { inset: -20px -50vw -10px; background: rgba(13, 15, 44, .8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    -webkit-mask-image: linear-gradient(transparent, #000 44%); mask-image: linear-gradient(transparent, #000 44%); }
  .day .say.low.over::before { background: rgba(216, 233, 246, .84); }
  .say.low.hush { opacity: 0; }                                /* they are reading on inside a tall card: its last lines are not talked over */
}

.dial, .lanterns, .motes { position: fixed; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* ------------------------------------------------------------ 1 · wind it */
.wind-tag { position: fixed; z-index: 4; left: 0; top: 0; white-space: nowrap; color: var(--linen); opacity: 0; pointer-events: none;
  will-change: transform, opacity; }
.wind-tag.full { color: #EE9A7B; animation: beat .7s ease-in-out infinite alternate; }
.day .wind-tag { color: var(--iron); }                        /* wound again in the morning */
.day .wind-tag.full { color: #A8452A; }
@keyframes beat { to { letter-spacing: .11em; } }
.way-wind .hero-r { transition: opacity .3s; }
.winding .hero-r { opacity: 0; }

/* after the launch, first light: where the sunrise is, marked on the gauge */
.gauge .sun { position: absolute; left: -3px; bottom: calc(var(--at, .48) * 100%); width: 7px; height: 7px; margin-bottom: -3.5px; border-radius: 50%;
  background: #F6CFA2; box-shadow: 0 0 9px 3px rgba(246, 207, 162, .5); opacity: 0; transition: opacity .9s; }
/* its name runs up the gauge, so that it never lies over a card passing on the right */
.gauge .sun .m { position: absolute; right: 9px; bottom: 13px; writing-mode: vertical-rl; transform: rotate(180deg); color: #F6CFA2; white-space: nowrap; }
.lit .gauge .sun { opacity: 1; }
.lit.day .gauge .sun { opacity: 0; }
@media (max-width: 899px) { .gauge .sun .m { display: none; } }

/* ------------------------------------------------------------ 2 · nothing falls down */
.way-rise .hero h1 .w { display: inline-block; white-space: nowrap; }
.way-rise .hero h1 .ch { display: inline-block; position: relative; }
/* only once they stir do the letters become layers of their own: at rest they sit exactly where uncut text sits */
.stirring .hero h1 .ch, .risen .hero h1 .ch { will-change: transform;
  transform: translateY(calc(var(--g, 0) * var(--l, 8) * -1px)) rotate(calc(var(--g, 0) * var(--r, 0) * 1deg)); }
.way-rise .hero h1 .ch i { display: inline-block; font-style: normal; }
.risen .hero h1 .ch i { animation: afloat 4.2s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes afloat { from { transform: translateY(-3px) rotate(-.7deg); } to { transform: translateY(3px) rotate(.7deg); } }
.way-rise .hero-l .lede span { transition: transform .5s cubic-bezier(.5, 0, .9, .5), opacity .42s; }
.way-rise .hero-l .lede.out span { transform: translateY(-58px); opacity: 0; }
.way-rise .hero-l .lede.out span + span { transition-delay: .08s; }
.way-rise .hero-l .lede.in span { animation: rise-in .85s var(--out) both; }
.way-rise .hero-l .lede.in span + span { animation-delay: .16s; }
@keyframes rise-in { from { transform: translateY(26px); opacity: 0; } }
.risen .mark { opacity: 1; }

/* ------------------------------------------------------------ 3 · the whole sky */
.chart { position: fixed; z-index: 4; left: 0; top: 0; width: 100%; height: 100%; visibility: hidden; opacity: 0; pointer-events: none; color: var(--linen); }
.charting .chart { visibility: visible; pointer-events: auto; }
.charting main { pointer-events: none; }
.way-chart .gauge { transition: color .5s, opacity .4s; }
.charting .gauge { opacity: 0; }
.chart-cap { position: absolute; right: calc(50% + var(--col, 80px) + 64px); top: 57%; width: min(340px, 28vw); text-align: right; }
.chart-cap em { display: block; font: italic 500 clamp(27px, 2.7vw, 40px)/1.06 var(--serif); letter-spacing: -.005em; margin-bottom: 14px; text-wrap: balance; }
.chart-cap .m { display: block; opacity: .78; text-wrap: balance; }
.chart-line { position: absolute; left: 50%; width: 1px; margin-left: -.5px; top: 9vh; bottom: 13vh; background-size: 1px 12px; animation: climb .9s linear infinite; }
.chart-line.night { background-image: linear-gradient(to top, rgba(237, 232, 220, .8) 3px, transparent 3px);
  -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 50%); mask-image: linear-gradient(to top, #000 42%, transparent 50%); }
.chart-line.day { background-image: linear-gradient(to top, rgba(20, 22, 28, .7) 3px, transparent 3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 50%); mask-image: linear-gradient(to bottom, #000 42%, transparent 50%); }
@keyframes climb { to { background-position: 0 -12px; } }
.wp { position: absolute; left: 0; top: 0; display: block; padding: 6px 0 6px 32px; color: var(--linen); text-decoration: none; white-space: nowrap; will-change: transform; }
.wp::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; height: 1px; background: currentColor; opacity: .6; transition: width .25s var(--out); }
.wp .m { display: block; opacity: .76; }
.wp b { display: block; font: 500 clamp(21px, 1.9vw, 27px)/1.12 var(--serif); letter-spacing: -.005em; }
.wp small { display: block; font: italic 500 16px/1.25 var(--serif); opacity: .8; }
.wp.day { color: var(--iron); }
.wp.plain b { font-style: italic; font-weight: 400; opacity: .85; }
.wp.left { padding: 6px 32px 6px 0; text-align: right; }
.wp.left::before { left: auto; right: 0; }
a.wp:hover::before, a.wp:focus-visible::before { width: 28px; opacity: 1; }
a.wp:hover b, a.wp:focus-visible b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.wp.here b { font-style: italic; }
.wp.here.blip::after { animation: blip .7s var(--out); }
@keyframes blip { 30% { transform: rotate(45deg) scale(2.1); } }
.wp.here::before { top: 88%; }
.wp.here::after { content: ""; position: absolute; left: 18px; top: 88%; width: 9px; height: 9px; margin-top: -4.5px; background: var(--chalk-lit); transform: rotate(45deg); }
@media (max-width: 899px) {
  .chart-cap { right: calc(50% + var(--col, 20px) + 18px); top: 60%; width: calc(50% - var(--col, 20px) - 34px); }
  .chart-cap em { font-size: 24px; }
  .wp { padding-left: 22px; }
  .wp.left { padding: 6px 22px 6px 0; }
  .wp::before { width: 14px; }
  .wp.here::after { left: 10px; }
  .wp small { display: none; }
  .wp b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .say b, .wind-tag.full, .chart-line, .risen .hero h1 .ch i { animation: none; }
}
