/* ==========================================================================
   PROJECT HERO SCENES — the drawings for the Ongoing and Upcoming project
   pages, in the same language as the villa in css/projects-page.css (whose
   .el-* rules, timings and keyframes these reuse): gold pencil lines first,
   the building inked up from the ground, the trees growing, the lights
   coming on — then small motions that keep the night alive.

   .pfe--uh  Ongoing: United Height by night — fins, balcony boxes, the
             spine of light, the slatted lobby, a wet forecourt mirroring it.
   .pfe--up  Upcoming: the next address — a tower crane, the frame rising
             three floors, the rest of the tower still a gold blueprint
             that a scan line reads, behind the BeamPark hoarding.
   ========================================================================== */

.pfe--tall {
  /* as tall as the screen allows, never pushing the hero past it */
  width: min(100%, calc(66svh * 840 / 640), calc((100svh - 300px) * 840 / 640));
  aspect-ratio: 840 / 640;
}
@media (max-width: 959px) { .pfe--tall { width: 100vw; } }

/* timed reveals: --t is when, --fd / --dd how long */
.js:not(.page-in) .pfe .el-fx { opacity: 0; }
.page-in .pfe .el-fx { animation: el-fade var(--fd, .8s) ease-out var(--t, 2s) both; }
.page-in .pfe .el-dr { animation: el-draw var(--dd, 1.4s) cubic-bezier(.6, 0, .3, 1) var(--t, 1s) both; }

/* each scene's own paints (its gradients and stipple live in its SVG) */
.pfe--uh .el-lit { fill: url(#uh-warm); }
.pfe--uh .el-st { fill: url(#uh-st); }
.pfe--uh .el-ao { fill: url(#uh-ao); }
.pfe--up .el-lit { fill: url(#up-work); }
.pfe--up .el-st { fill: url(#up-st); }
.pfe--up .el-ao { fill: url(#up-ao); }
.pfe--tall .el-mull { stroke-width: 1.3; }
.pfe--tall .el-ink { stroke-width: .7; }
.pfe--tall .el-cons { stroke-width: .8; }

/* lights: each window fades on in turn (climbing the floors); the glow
   breathes per group, and a few windows switch off and on again */
.page-in .pfe--tall .el-lit { animation: el-fade .6s ease-out calc(3.1s + var(--w, 0s)) both; }
.page-in .pfe--tall .el-litgrp { animation: el-glow 6s ease-in-out 5.6s infinite alternate; }
.page-in .pfe--tall .el-litgrp--b { animation-delay: 7.4s; }
.page-in .pfe--tall .el-lit.el-live {
  animation: el-fade .6s ease-out calc(3.1s + var(--w, 0s)) both,
             el-live var(--lv, 18s) ease-in-out calc(8s + var(--w, 0s) * 6) infinite;
}
@keyframes el-live { 0%, 60% { opacity: 1; } 64%, 82% { opacity: .06; } 86%, 100% { opacity: 1; } }

/* --- Ongoing: United Height --------------------------------------------------------- */
.el-tree--roof .el-tl3 { stroke-width: 1.1; }
.el-tree--roof .el-tl4 { stroke-width: .8; }
.el-tree--roof .el-tl5 { stroke-width: .6; }
.el-tree--roof .el-tl6,
.el-tree--roof .el-tl7 { stroke-width: .42; }

.el-rail { fill: rgb(248 245 239 / .07); stroke: rgb(248 245 239 / .4); stroke-width: .7; }
.el-rail-post { fill: none; stroke: rgb(248 245 239 / .22); stroke-width: .6; }
.el-green { fill: #36553f; stroke: rgb(243 210 140 / .5); stroke-width: .6; }
.el-hedge { fill: #142419; stroke: rgb(208 173 103 / .3); stroke-width: .8; }
.el-slat { fill: none; stroke: #102036; stroke-width: 1.2; }
.el-sign { fill: #12233a; }
.el-sign-edge { fill: none; stroke: rgb(208 173 103 / .55); stroke-width: .8; }
.el-sign-t { fill: #f3dfae; font: 600 9px var(--font-body); letter-spacing: .14em; text-anchor: middle; }
.el-logo { fill: var(--c-gold); }
.el-logo-arc { fill: none; stroke: var(--c-gold); stroke-width: 1; }
.el-bollard { fill: #2a3b4f; }
.el-car-body { fill: #e6dfd0; }
.el-car-win { fill: #0d1c2e; }
.el-car-line { fill: none; stroke: #8f9aa6; stroke-width: .6; }
.el-car-wheel { fill: #0a1422; stroke: #9aa7b4; stroke-width: 1.2; }
.el-ripple { fill: none; stroke: rgb(248 245 239 / .16); stroke-width: .8; stroke-linecap: round; }
.el-curb { fill: none; stroke: rgb(248 245 239 / .2); stroke-width: .9; }
.el-reflw .el-litr rect { fill: url(#uh-warmr); }
.el-reflw { opacity: .36; }
.page-in .el-ripples { animation: el-fade .8s ease-out 4.4s both, el-ripple 5s ease-in-out 5.2s infinite alternate; }
@keyframes el-ripple { to { transform: translateX(7px); } }

/* the LED edges of the fins and the canopy draw on with the lights */
.el-led { fill: none; stroke: #f6dfa6; stroke-width: 1.1; stroke-linecap: round; }
.el-led--glow { stroke: #f3c97a; stroke-width: 6; stroke-opacity: .16; }
.page-in .el-led { animation: el-draw 1.6s cubic-bezier(.6, 0, .3, 1) var(--t, 3s) both; }

/* --- Upcoming: the next address ------------------------------------------------------ */
.el-crane { fill: none; stroke: #e6dcc6; stroke-opacity: .75; stroke-width: .9; stroke-linejoin: round; }
.el-crane--tie { stroke-width: .55; stroke-opacity: .45; }
.el-crane-cw { fill: #22354b; stroke: rgb(230 220 198 / .6); stroke-width: .8; }
.el-pole { fill: none; stroke: #2a3b4f; stroke-width: 2.4; }
.el-scaf { fill: none; stroke: #d9cfba; stroke-opacity: .5; stroke-width: .8; }
.el-scaf--plank { stroke: #c9b48a; stroke-opacity: .7; stroke-width: 2.2; }
.el-ply { fill: #b99d6c; fill-opacity: .9; }
.el-prop { fill: none; stroke: #c9b48a; stroke-opacity: .75; stroke-width: .9; }
.el-rebar { fill: none; stroke: #d0ad67; stroke-opacity: .85; stroke-width: .8; }
.el-brick { fill: url(#up-brick); fill-opacity: .9; }
.el-cord { fill: none; stroke: #8f8a7e; stroke-width: .6; }
.el-cage { fill: #1a2c40; stroke: rgb(208 173 103 / .6); stroke-width: .8; }
.el-hook { fill: none; stroke: #d9cfba; stroke-width: .9; }
.el-cable { fill: none; stroke: #d9cfba; stroke-width: .7; vector-effect: non-scaling-stroke; }
.el-beam { fill: #6f8194; stroke: #c9d2db; stroke-width: .5; }
.el-beam-l { fill: none; stroke: #2a3b4f; stroke-width: 1.2; }
.el-hoard { fill: #0f2238; stroke: rgb(208 173 103 / .35); stroke-width: .8; }
.el-hoard-j { fill: none; stroke: rgb(208 173 103 / .2); stroke-width: .7; }
.el-hoard-rail { fill: var(--c-gold); fill-opacity: .75; }
.el-banner-t { fill: #0b1a2c; font: 700 10.4px var(--font-body); letter-spacing: .24em; text-anchor: middle; }

/* the blueprint above the frame: drawn up the tower, its dashes creeping */
.el-ghost { fill: none; stroke: #e4c787; stroke-opacity: .8; stroke-width: 1; stroke-dasharray: 6 4; }
.el-ghost--fine { stroke-width: .6; stroke-opacity: .42; stroke-dasharray: 2 3; }
.el-ghost--box { stroke-width: .8; stroke-opacity: .6; stroke-dasharray: 3 2; }
.el-ghost-fill { fill: #d0ad67; fill-opacity: .05; }
.js:not(.page-in) .el-ghostwrap { clip-path: inset(100% -60px 0 -60px); }
.page-in .el-ghostwrap { animation: el-wipe 2.6s cubic-bezier(.65, 0, .35, 1) 2.4s both; }
.page-in .el-ghost { animation: el-march 3s linear 5s infinite; }
@keyframes el-march { to { stroke-dashoffset: -20; } }
.page-in .el-ghost-fill { animation: el-breathe 4s ease-in-out 5s infinite alternate; }
.el-scan__line { fill: none; stroke: #f6dfa6; stroke-width: .9; }
.page-in .el-scan__move { animation: el-scan 7s ease-in-out 5s infinite alternate; }
@keyframes el-scan { to { transform: translateY(-264px); } }

/* the crane at work: the trolley runs out, the hook lowers a beam onto the
   deck, lets it go and comes back; the hook swings a little all the while */
.el-cable { transform-box: fill-box; transform-origin: 50% 0; }
.el-sway { transform-box: view-box; transform-origin: 610px 194px; }
.page-in .el-trolley  { animation: el-trolley 16s cubic-bezier(.45, 0, .55, 1) 4.8s infinite; }
.page-in .el-cable    { animation: el-cable 16s cubic-bezier(.45, 0, .55, 1) 4.8s infinite; }
.page-in .el-hookdrop { animation: el-hookdrop 16s cubic-bezier(.45, 0, .55, 1) 4.8s infinite; }
.page-in .el-load     { animation: el-load 16s linear 4.8s infinite; }
.page-in .el-sway     { animation: el-hooksway 3.4s ease-in-out 4.8s infinite alternate; }
@keyframes el-trolley  { 0%, 4% { transform: translateX(0); } 26%, 74% { transform: translateX(-150px); } 96%, 100% { transform: translateX(0); } }
@keyframes el-cable    { 0%, 28% { transform: scaleY(1); } 46%, 58% { transform: scaleY(2.073); } 74%, 100% { transform: scaleY(1); } }
@keyframes el-hookdrop { 0%, 28% { transform: translateY(0); } 46%, 58% { transform: translateY(118px); } 74%, 100% { transform: translateY(0); } }
@keyframes el-load     { 0%, 57% { opacity: 1; } 60%, 93% { opacity: 0; } 97%, 100% { opacity: 1; } }
@keyframes el-hooksway { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

/* the hoist cage rides its mast */
.page-in .el-hoist { animation: el-hoist 11s ease-in-out 4.2s infinite alternate; }
@keyframes el-hoist { 0%, 8% { transform: translateY(0); } 92%, 100% { transform: translateY(-180px); } }

/* welding sparks, the hoarding's lamps, the floodlights */
.el-spark { opacity: 0; transform-box: fill-box; transform-origin: center; }
.el-spark-l { fill: none; stroke: #fff2cf; stroke-width: .8; stroke-linecap: round; }
.page-in .el-spark { animation: el-spark 3.4s ease-out var(--t, 5s) infinite; }
@keyframes el-spark {
  0%   { opacity: 1; transform: scale(.5); }
  7%   { opacity: 1; transform: scale(1.1); }
  13%  { opacity: 0; transform: scale(1.3); }
  17%  { opacity: .9; transform: scale(.6); }
  24%  { opacity: 0; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.2); }
}
.page-in .el-blink { animation: el-blink 1.8s steps(1) var(--t, 4s) infinite; }
.js:not(.page-in) .el-blink { opacity: 0; }
@keyframes el-blink { 0% { opacity: 1; } 50% { opacity: .12; } }
.page-in .el-cone { animation: el-fade var(--fd, 1.4s) ease-out var(--t, 3.4s) both, el-breathe 5s ease-in-out 6s infinite alternate; }

/* --- motion reduced: everything is simply there ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js:not(.page-in) .pfe :is(.el-fx, .el-blink) { opacity: 1; }
  .js:not(.page-in) .el-ghostwrap { clip-path: none; }
  .el-spark { display: none; }
}
