/* PatchProtocol landing page. The page is a piece of the game's own world: a small bot with a drill, radar dish and antenna mining ore in a lava cave. Palette and type follow the game's main menu: night navy, off-white, teal leaf, orange circuit, Inter. */
@font-face{font-family:Inter;src:url(fonts/inter-regular.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Inter;src:url(fonts/inter-medium.woff2) format("woff2");font-weight:500;font-style:normal;font-display:swap}

:root{
  --space:#0a0a10; --ink:#e6eef8; --mist:#c3d2de; --teal:#2bb5a8; --teal-light:#6fd8cc; --amber:#ff8a3d; --spark:#ffd27a;
  --pad:clamp(16px,6vw,72px);

  /* The world picture is 3200 by 3075. It is sized to cover the screen and to keep the bot a steady size:
     tall screens show a narrow slice around the bot, wide screens show more cave. */
  --ar:1.0407;
  --ww:max(100vw,min(calc(2.0*100dvh),calc(5.6*100vw)));
  --wh:calc(var(--ww)/var(--ar));
  --u:calc(var(--ww)/100);      /* 1% of the world's width */
  --bx:50vw;
}
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none;background:var(--space);color-scheme:dark}
body{position:fixed;inset:0;font:400 16px/1.4 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--ink);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}

/* the world: the bot's ground point sits --bx across and 66% down the screen, unless the picture runs out */
.world{
  position:fixed;z-index:0;width:var(--ww);height:var(--wh);
  left:clamp(calc(100vw - var(--ww)),calc(var(--bx) - var(--ww)*.4125),0px);
  top:clamp(calc(100dvh - var(--wh)),calc(66dvh - var(--wh)*.64618),0px);
  overflow:hidden;
}
.world img{position:absolute;display:block;user-select:none;-webkit-user-drag:none}
.world__ground{inset:0;width:100%;height:100%}
.world__bot{left:35.812%;top:56.553%;width:11.062%;height:auto}
.world__bot--tools{animation:drill 90ms steps(1) infinite}
.world__bot--body{animation:rattle 130ms steps(1) infinite}

/* lava light breathing over the cave floor */
.world__heat{position:absolute;inset:0;mix-blend-mode:screen;animation:heat 5s ease-in-out infinite alternate;
  background:
    radial-gradient(ellipse 26% 20% at 14% 49%,rgba(255,120,40,.5),transparent 70%),
    radial-gradient(ellipse 14% 12% at 82% 68%,rgba(255,120,40,.4),transparent 70%)}

/* where the drill bites: a flickering glow, a burst of sparks and a little grit */
.drill-glow{position:absolute;left:45.406%;top:74.984%;width:calc(var(--u)*9);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;mix-blend-mode:screen;
  background:radial-gradient(circle,rgba(255,226,150,.85) 0%,rgba(255,150,60,.45) 30%,transparent 70%);animation:flicker 160ms steps(1) infinite}
.sparks{position:absolute;left:45.406%;top:74.984%;width:0;height:0}
.sparks i{position:absolute;left:0;top:0;width:calc(var(--u)*.55);height:calc(var(--u)*.55);margin:calc(var(--u)*-.275);border-radius:50%;background:var(--spark);box-shadow:0 0 calc(var(--u)*.9) calc(var(--u)*.25) rgba(255,150,50,.85);opacity:0;animation:spark 800ms cubic-bezier(.2,.7,.4,1) infinite}
.sparks i:nth-child(1){--dx:-5;--dy:-4;animation-delay:0ms}
.sparks i:nth-child(2){--dx:4;--dy:-6;animation-delay:110ms}
.sparks i:nth-child(3){--dx:-7;--dy:-1;animation-delay:230ms}
.sparks i:nth-child(4){--dx:6;--dy:-3;animation-delay:340ms}
.sparks i:nth-child(5){--dx:-3;--dy:-8;animation-delay:450ms}
.sparks i:nth-child(6){--dx:2;--dy:-9;animation-delay:560ms}
.sparks i:nth-child(7){--dx:8;--dy:-2;animation-delay:670ms}
.sparks i:nth-child(8){--dx:-6;--dy:-6;animation-delay:760ms}
.sparks i:nth-child(9){--dx:5;--dy:-7;animation-delay:830ms}

/* embers lifting off the lava */
.embers{position:absolute;inset:0}
.embers i{position:absolute;width:calc(var(--u)*.22);height:calc(var(--u)*.22);border-radius:50%;background:#ffb25a;box-shadow:0 0 calc(var(--u)*.5) rgba(255,130,40,.9);opacity:0;animation:ember 7s linear infinite}
.embers i:nth-child(1){left:3%;top:44%;animation-delay:0s}
.embers i:nth-child(2){left:8%;top:50%;animation-delay:1.3s;animation-duration:8s}
.embers i:nth-child(3){left:13%;top:47%;animation-delay:2.9s}
.embers i:nth-child(4){left:18%;top:52%;animation-delay:4.1s;animation-duration:9s}
.embers i:nth-child(5){left:22%;top:46%;animation-delay:.6s}
.embers i:nth-child(6){left:5%;top:55%;animation-delay:3.4s;animation-duration:8s}
.embers i:nth-child(7){left:10%;top:40%;animation-delay:5.2s}
.embers i:nth-child(8){left:15%;top:56%;animation-delay:.9s;animation-duration:8s}
.embers i:nth-child(9){left:80%;top:64%;animation-delay:2.2s}
.embers i:nth-child(10){left:83%;top:68%;animation-delay:3.7s;animation-duration:9s}
.embers i:nth-child(11){left:85%;top:62%;animation-delay:5.6s}
.embers i:nth-child(12){left:81%;top:71%;animation-delay:4.8s}
.embers i:nth-child(13){left:20%;top:42%;animation-delay:6.1s;animation-duration:8s}
.embers i:nth-child(14){left:7%;top:58%;animation-delay:1.8s;animation-duration:9s}

/* darkens the top and bottom so the wordmark and the line below it read over any ground */
.veil{position:fixed;inset:0;z-index:1;pointer-events:none;background:
  linear-gradient(180deg,rgba(6,7,14,.72) 0%,rgba(6,7,14,.45) 24%,rgba(6,7,14,0) 44%),
  linear-gradient(0deg,rgba(6,7,14,.7) 0%,rgba(6,7,14,0) 22%)}

main{position:fixed;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;text-align:center;padding:max(env(safe-area-inset-top),clamp(10px,4.5dvh,48px)) var(--pad) max(env(safe-area-inset-bottom),clamp(14px,4dvh,40px))}
/* a soft teal glow behind the wordmark, as on the game's menu */
.logo{position:relative;margin:0;line-height:0}
.logo::before{content:"";position:absolute;inset:-18% -10%;pointer-events:none;background:radial-gradient(ellipse 50% 50% at 50% 50%,rgba(74,168,154,.3) 0%,rgba(74,168,154,.1) 45%,transparent 72%)}
.logo img{position:relative;display:block;width:min(88vw,calc(clamp(60px,21dvh,250px)*2.8571));height:auto;filter:drop-shadow(0 10px 24px rgba(0,0,0,.6)) drop-shadow(0 0 2px rgba(0,0,0,.5))}
.tagline{margin:clamp(2px,.8dvh,10px) 0 0;color:var(--mist);font-style:italic;font-size:clamp(15px,2.4dvh,22px);letter-spacing:.04em;text-shadow:0 2px 8px rgba(0,0,0,.9);text-wrap:balance}
.soon{margin:auto 0 0;font-weight:500;font-size:clamp(15px,2.4dvh,21px);letter-spacing:.1em;color:var(--ink);text-shadow:0 2px 10px rgba(0,0,0,.9)}
.soon::after{content:"";display:inline-block;width:.5em;height:1.05em;margin-left:.45em;vertical-align:-.17em;background:var(--teal-light);animation:caret 1.1s steps(1) infinite}

/* the drill shudders against the rock; the body shakes less */
@keyframes drill{0%{transform:translate(0,0)}33%{transform:translate(calc(var(--u)*.06),calc(var(--u)*-.12))}66%{transform:translate(calc(var(--u)*-.05),calc(var(--u)*.06))}}
@keyframes rattle{0%{transform:translate(0,0)}50%{transform:translate(0,calc(var(--u)*.05))}}
@keyframes flicker{0%{opacity:.95}25%{opacity:.6}50%{opacity:1}75%{opacity:.7}}
@keyframes spark{0%{opacity:0;transform:translate(0,0) scale(1)}8%{opacity:1}100%{opacity:0;transform:translate(calc(var(--u)*var(--dx)*1.4),calc(var(--u)*var(--dy)*1.2 + var(--u)*5)) scale(.3)}}
@keyframes ember{0%{opacity:0;transform:translate(0,0)}10%{opacity:.9}100%{opacity:0;transform:translate(calc(var(--u)*1.5),calc(var(--u)*-14))}}
@keyframes heat{from{opacity:.65}to{opacity:1}}
@keyframes caret{0%,55%{opacity:1}56%,100%{opacity:0}}

/* short landscape screens (phones on their side): wordmark left, the cave behind */
@media (orientation:landscape) and (max-height:540px){
  main{align-items:flex-start;text-align:left}
  .logo img{width:min(44vw,calc(clamp(44px,34dvh,170px)*2.8571))}
  .soon{margin-top:auto}
  .veil{background:linear-gradient(90deg,rgba(6,7,14,.8) 0%,rgba(6,7,14,.45) 40%,rgba(6,7,14,0) 62%),linear-gradient(0deg,rgba(6,7,14,.6) 0%,rgba(6,7,14,0) 22%)}
}
@media (prefers-reduced-motion:reduce){
  .world__bot,.world__heat,.drill-glow,.soon::after{animation:none}
  .sparks,.embers{display:none}
}
